BNF grammar for D?

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 27 16:17:12 PDT 2014


On Monday, 27 October 2014 at 22:06:28 UTC, landaire wrote:
> There have been similar questions asked on this forum before 
> (most recent one in June with no result: 
> http://forum.dlang.org/thread/CAFMGiz8Fyv2A+ScQPQtEYEsFSybZNfY--nsxL5rqNoWWNA4agg@mail.gmail.com?page=1), 
> but I was curious if anyone happens to have a BNF grammar for D 
> laying around. I've searched all over and can't seem to find 
> anything.
>
> I'm trying to make a plugin for IntelliJ IDEA to support D 
> (https://github.com/landaire/intelliD is what I have now 
> utilizing DDT's lexer) but a lot of what's required to add 
> advanced features like code folding, code completion, etc. is 
> generally autogenerated by JetBrains's Grammar Kit plugin which 
> only generates that stuff from a BNF grammar.
>
> I know nothing about writing language grammars but based off 
> what I've seen it doesn't look like it'd be *too* difficult to 
> pick up, so if anyone also has suggestions for good readings 
> I'd appreciate that as well.

I've also been playing with getting a Intellij IDEA plugin up but 
it utilises DScanner. The only issue I'm having right now is for 
some reason its adding two elements to the Psi's tree instead of 
just one. Where the second has correct data but first is the 
correct type.
Not to mention getting dscanner to output the correct line 
number/index ext. Fun times.


More information about the Digitalmars-d mailing list