On 15 Jun 2015 02:10, "Manfred Nowak via Digitalmars-d" <
[email protected]> wrote:
>
> With my favorite LALR-CompilerCompiler I analyzed the current D grammar.
> After preliminary eliminating the RR-conflicts around 1800 states
remained,
> from which around 100 states are still contaminated with SR-conflicts.
>
> Two possibilities:
> 1) Those ambiguities are not in DMD but introduced by excerpting the
> grammar from DMD
> 2) Those ambiguities do exist in DMD.
>
> Which one do you prefer? Is the grammar usable?
>
> -manfred

The most complete grammar I'm aware of is:

https://github.com/Hackerpilot/DGrammar

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.

https://github.com/ibuclaw/gdb/blob/dlang/gdb/d-exp.y

Regards
Iain

Reply via email to