EBNF grammar for D?

bcs bcs at example.com
Mon Mar 12 20:02:11 PDT 2012


On 03/12/2012 03:17 AM, Alix Pexton wrote:
> On 11/03/2012 16:49, Philippe Sigaud wrote:
>> Hello,
>>
>> I'm looking for a D grammar in (E)BNF form. Did any of you write
>> something like that or do you think I can use the grammar parts on
>> dlang.org?
>>
>>
>> I remember different threads on this subject and saw the docs being
>> updated regularly on github, but my google-fu is weak today.
>>
>
> Rainer Schuetze pulled all the grammar out of the docs and fixed them up
> a while back as part of his work on Visual D. Its not in straight EBNF
> and it may not be 100% up to date, but it may be a good place to start.
>
> http://www.dsource.org/projects/visuald/wiki/GrammarComparison
>
> I hope that is of some use!
>
> A...

IIRC the grammar in the docs has tended to be out of date one in a 
while. I'd love to see the source for the grammar rules become the 
parser source (either generating the parser from a grammar, generating a 
grammar from the parser or embed the documentation of each grammar rule 
in the comments next to the code that implements it).


More information about the Digitalmars-d mailing list