[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Best way to set a lua table from a parser written in C
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 28 Oct 2010 17:35:20 -0200
> I'm writting a parser in C (Lex & Yacc), to process a DSL similar to
> that:
>
> square square_name -x 20 -y 30 -height 20 -width 50
> circle circle_name -x 50 -y 60 -radius 100
Have a look at my lcl: http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lcl
It'll turn these lines into the equivalent of
square("square_name","-x","20","-y","30","-height","20","-width","50")
circle("circle_name","-x","50","-y","60","-radius","100")
except that there is not textual transformation: the evaluation is done
on the fly.