[spec] Looking for a write-up on the grammar notation

Dibyendu Majumdar d.majumdar at gmail.com
Thu May 16 18:48:15 UTC 2019


On Wednesday, 15 May 2019 at 23:57:55 UTC, Dibyendu Majumdar 
wrote:
> As part of this I would like to add something about the grammar 
> notation. Is there any write up available that describes how to 
> read the notation?
>

 From lack of response I take it there isn't anything. So would 
this be correct for the grammar describing D syntax:

1. The grammar is context-free.
2. Non-terminals are in italics.
3. The right hand side of each production gives available 
alternatives, i.e. there is an implicit OR.
4. Terminals are shown in bold, non-italic text.
5. Optional non-terminals are suffixed by an 'opt'.

Some questions:

1. Is the grammar complete?
2. Is it unambiguous?
3. Can it be directly converted to a parser?

Sorry I am not an expert in this so apologies if above is stupid.

Regards



More information about the Digitalmars-d mailing list