<p dir="ltr"><br>
On 15 Jun 2015 02:10, "Manfred Nowak via Digitalmars-d" <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br>
><br>
> With my favorite LALR-CompilerCompiler I analyzed the current D grammar.<br>
> After preliminary eliminating the RR-conflicts around 1800 states remained,<br>
> from which around 100 states are still contaminated with SR-conflicts.<br>
><br>
> Two possibilities:<br>
> 1) Those ambiguities are not in DMD but introduced by excerpting the<br>
> grammar from DMD<br>
> 2) Those ambiguities do exist in DMD.<br>
><br>
> Which one do you prefer? Is the grammar usable?<br>
><br>
> -manfred</p>
<p dir="ltr">The most complete grammar I'm aware of is:</p>
<p dir="ltr"><a href="https://github.com/Hackerpilot/DGrammar">https://github.com/Hackerpilot/DGrammar</a></p>
<p dir="ltr">I've done a basic LALR grammar (expressions only so far) with YACC, but it depends on a two tier lexer in order to resolve interpolating identifiers and dots before applying grammar rules.  This I've found is the best way to get over most SR errors and allow (PostExpression).ident to be accepted, among others to be accepted correctly.</p>
<p dir="ltr"><a href="https://github.com/ibuclaw/gdb/blob/dlang/gdb/d-exp.y">https://github.com/ibuclaw/gdb/blob/dlang/gdb/d-exp.y</a></p>
<p dir="ltr">Regards<br>
Iain</p>