[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: Javier Guerra Giraldez <javier@...>
- Date: Thu, 28 Oct 2010 14:27:09 -0500
On Thu, Oct 28, 2010 at 2:17 PM, Silas Silva <silasdb@gmail.com> wrote:
> That is a answer I've expected to get :-) I actually have reasons
> (learning) to use old Lex & Yacc, at least in the first releases of this
> project.
yes, it was pretty obvious, just wanted an excuse to put a grin today
but, if you want to learn, just do all three:
1: parser->C structs->Lua. you'll find lots of references, work
should be straightforward
2: write to Lua structs directly within the parser. did you know that
even without the language, Lua is a nice data structure library?
3: LPEG. in most cases, the data flow in a LPEG parser works just like 2
I'd advise doing it in this order, because once 1 is running going to
2 is mostly removing code, and going to 3 is mostly syntax and some
extra code deletion.
--
Javier