On Mon, Aug 22, 2011 at 4:07 PM, Axel Kittenberger
<axkibe@gmail.com> wrote:
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
for.
This _is_ valid lua code, suppsing "WIDGET", "TILE", "TYPE",
"ELEMENTS" etc have been declared as functions:
WIDGET mywidget
{
TITLE "My widget";
TYPE WIDGET_TYPE;
ELEMENTS
{
element1,
element2,
element3
}
}
IMPORT WIDGET mywidget
{
REFINE widget_name{
REDEFINE TITLE "Your widget";
}
}
if YOUR_WIDGET_ALLOWED then
WIDGET yourwidget
{
TITLE "Your widget";
TYPE WIDGET_TYPE;
ELEMENTS
{
element1,
element2,
element3
}
}
endif
for x= 0, 8 do
if something_true then
do_this(argument1, argument2);
end
end
supports
do
statements;
while(condition);
supports
while(condition)
statements;
end