D parsing

Philippe Sigaud philippe.sigaud at gmail.com
Fri Nov 1 13:59:49 PDT 2013


The examples directory shows different grammars, from JSON to XML to C to D.

I used it with the D grammar, but the one on the website is woefully
inadequate (some mistakes, out of date compared to the compiler and written
in a somewhat convoluted style full of left-recursion). The shortcomings
are that the generated parser is quite slow compared to other D parsers.

That comes from my coding, of course: Pegged generates a simple recursive
descent parser. I guess I could push for a better engine, but I'm waiting
for CTFE to get a bit better.

The advantages are nice, though: full parse tree, semantic actions, and so
on.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131101/0b7bd900/attachment.html>


More information about the Digitalmars-d mailing list