lua-users home
lua-l archive

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


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