[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LPeg - AST / Tree walker?
- From: Lode Hoste <zillode@...>
- Date: Thu, 31 Mar 2011 21:26:42 +0200
Thanks Fabien, I've checked out the gg.lua but it appears that I'd
have to use a completely different approach.
I liked PEG a lot since it's very clear and easily extendible.
2011/3/31 Fabien <email@example.com>:
> You might want to have a look at Metalua's gg.lua library
> (https://github.com/fab13n/metalua/blob/master/src/compiler/gg.lua). It's a
> parser combinator system rather than a PEG, but it focuses on AST
> production, ability to produce decent error messages on incorrect inputs
> (very important for programming languages), and dynamic extensibility (you
> probably don't care about the latter).
> The use of gg is detailed in Metalua's manual; you can also look at
> src/compiler/mlp_*.lua files for inspiration.
> On Thu, Mar 31, 2011 at 10:39 AM, Lode Hoste <firstname.lastname@example.org> wrote:
>> After watching the talk about LPeg I was inspired to use it to describe
>> the grammar of my DSL [but]
>> I can't find a good pointer on how to generate an AST or parse tree
>> with callbacks from it.