[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: C with embedded Lua or Lua-only program?
- From: Silas Silva <silasdb@...>
- Date: Fri, 3 Sep 2010 12:47:53 -0300
On Fri, Sep 03, 2010 at 06:58:48AM -0300, Luiz Henrique de Figueiredo wrote:
> > > 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.
That is great! So it is perfect to parse shell-like languages (the
example I gave is inspired in Tcl/Tk, which resembles shell a lot).
Thanks for the tip.
--
Silas Silva