[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: C with embedded Lua or Lua-only program?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 3 Sep 2010 06:58:48 -0300
> > The DSL should be simple (similar to Tcl/Tk code):
> > button foo -text "Foo" -x 10 -y 20
> > label ...
> >
> > So, I though about using Lex & Yacc in C to parse the DSL
>
> Try my lcl: http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lcl
More especifically, cl.eval turns
button foo -text "Foo" -x 10 -y 20
into
button("foo","-text","Foo",-"x",10,"-y",20)
(internally, not textually) and executes it.
If you only want to parse that line, you can use cl.unpack.