Official D Grammar

Jacob Carlborg doob at me.com
Tue Apr 2 07:28:30 PDT 2013


On 2013-04-02 15:21, Stewart Gordon wrote:

> Indeed, the published grammar needs to be thoroughly checked against
> what DMD is actually doing, and any discrepancies fixed (or filed in
> Bugzilla to be fixed in due course).  And then they need to be kept in
> sync.
>
> Has the idea of using a parser generator to build D's parsing code been
> rejected in the past, or is hand-coding just the way Walter decided to
> do it?  Is the code any more efficient than what a typical parser
> generator would generate?
>
> And all disambiguation rules (such as "if it's parseable as a
> DeclarationStatement, it's a DeclarationStatement") need to be made
> explicit as part of the grammar.  I suppose this is where using Bison or
> similar would help, as it would point out any ambiguities in the grammar
> that need rules to resolve them.

I'm wondering if it's possibly to mechanically check that what's in the 
grammar is how DMD behaves.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list