D parsing

Martin Nowak code at dawg.eu
Tue Nov 5 09:39:29 PST 2013


On 11/01/2013 09:59 PM, Philippe Sigaud wrote:
>
> 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.

Like many others I'm hoping for a nice general parser generator for 
quite some time.
So I'm also asking specifically about your insights on PEGs.
 From what I know they do have some memory issues due to the backtrace 
memoization (only for deep parse trees though, which aren't common in 
programming languages). Also it seems that the research community has 
some issues to formalize PEGs and what grammars they are capable to handle.
Also why is the expr grammar example so complicated?


More information about the Digitalmars-d mailing list