[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua AST and Parsing a "C" Like language
- From: Gopalakrishnan Subramani <gopalakrishnan.subramani@...>
- Date: Mon, 22 Aug 2011 16:48:32 -0600
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.
On Mon, Aug 22, 2011 at 4:07 PM, Axel Kittenberger <firstname.lastname@example.org>
I'm with what steve said, in that case, I think in your case its much
simpler. Why write a parser at all? Just use Lua to parse a
programmable configfile for you! Thats what Lua originally was made
This _is_ valid lua code, suppsing "WIDGET", "TILE", "TYPE",
"ELEMENTS" etc have been declared as functions:
if YOUR_WIDGET_ALLOWED then
TITLE "My widget";
IMPORT WIDGET mywidget
REDEFINE TITLE "Your widget";
WIDGET yourwidgetfor x= 0, 8 do
TITLE "Your widget";
if something_true then