lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

We cannot define the syntax of DD. It is defined by a standard forum group recognized in the automation  world and DD is widely used in industrial automation. Currently we refer the DD script and convert them to XML structure that suitable for our framework and do hand coding for rules and condition checking.
We have huge XML configurations like 100 MB (6000 files+) for our device configuration. Wherever we need logic, we extend in C++/C#. Now we need to move to Android and iOS/iPhone where we feel that defining a framework again to parse XML which is again lot of work in java and objective-c.

Lua can do better job here. We can define the config in Lua and logic can be embeded in Lua itself. Then we will try to push this to wherever required. Now I am looking for a way to convert the DD to Lua to save certain handcoding stuff.

As I said, 100% conversion may not be fessible at this point, but we could do our best and remaining can be done via hand-coding.



On Tue, Aug 23, 2011 at 2:53 AM, Axel Kittenberger <> wrote:
> DD is easy like Lua but actually it is partial copy from C style and little
> of Lua. I agree that function and table can make exact Lua code.
> But I don't think, we could run the same DD files as it is. There are more
> complicated, we need to bother about fucntion call, include files, refines
> etc.  We would like to convert so that we could add rich UI libraries on top
> of generated code. Also we are not confident enough to execute a DD via Lua.
> The advantages with the code generation is that, after code generation, we
> could hand code and fix the issues in the code generation. I am sure that we
> will not meet 100% of DD  to be auto-generated to Lua but we could fulfil
> using manual effort.
> When we generate code, some portion we would use the steve advise that is
> call a function with argument which eventually to be added to Lua globals or
> index and also take a table like configuration.

The basic question is, can you define the syntax of your "DD" or is it
something that is forced upon you? If it is the first, it is really
better to make it so it is simply directly Lua parseable. That does
not stop it from actually configuring a generator that generates some
code. Lua is also relative easy to sandbox, thus should not endanger