[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LPEG for dummies
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Sat, 4 May 2013 13:26:07 +0200
On Sat, May 4, 2013 at 1:13 PM, Pierre-Yves Gérardy <firstname.lastname@example.org> wrote:
> Grammars are straightforward:
> `V(label)` is a sub-procedure call.
> the key-value pairs are respectively sub-procedure names and definition.
> Each grammar is self-contained. If a grammar has a sub grammar, the
> `V()` calls do not cross the parent-child boundaries.
> Groups are a bit more complex, and behave differently according to the
> capture that surrounds them, if any. No time now, more on this later.
> -- Pierre-Yves
I forgot: V() labels can be any Lua object.
The entry point of the grammar is the numeric 1 key. If a string is
found there instead of a pattern, it is turned into a V() call to that