Pegged, a Parsing Expression Grammar (PEG) generator in D

Philippe Sigaud philippe.sigaud at gmail.com
Sat Mar 10 23:53:43 PST 2012


On Sun, Mar 11, 2012 at 08:47, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:

> Great! I think you'd be wise to add the ";", otherwise it's impossible to
> split complex rules on more than one line. Alternatively you could have the
> complement, a line continuation thingie.

Complex rules can be multi-line, I'll put more examples of this in the docs.

Now that Pegged is bootstrapped (the grammar generator was generated
by Pegged itself), it's easy to change the grammar.

Anyway, the separating if done on the rule definitions  (Identifier <- ...)

A <- B   C
     / C
/D    # // OK, cut between D and E.
E <- New Def

You can insert line comments with '#'


More information about the Digitalmars-d-announce mailing list