BNF grammar for D?

Kingsley via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 16 15:25:00 PST 2014


On Monday, 27 October 2014 at 22:40:20 UTC, landaire wrote:
> On Monday, 27 October 2014 at 22:35:16 UTC, Jeremy Powers via 
> Digitalmars-d wrote:
>> This looks eerily familiar...
>>
>> I took a stab at an Intellij plugin a long time ago, and 
>> happened to pick
>> the same name:
>>
>> https://github.com/elendel-/intelliD
>>
>> Been meaning to pick back up again, but haven't had the 
>> chance... was
>> waiting for the Eclipse plugin code to mature, then got 
>> distracted.  Feel
>> free to take anything that looks useful.
>>
>>
>> Brian Schott (Hackerpilot) has done a lot of useful work 
>> grammar wise.  See:
>>
>> https://github.com/Hackerpilot/DGrammar
>>
>> An interesting path to take for an intellij plugin would be to 
>> use his
>> DCD/libdparse for all the heavy lifting, with the plugin just 
>> farming out
>> the work to external daemon process(es).  That would avoid 
>> having yet
>> another lexer/parser implementation to keep up to date.
>>
>
> I actually forked yours originally to get it running in IDEA 
> 14, then decided to mess with the lexer since it was causing 
> some problems and went off from there. I saw it was somewhat 
> inactive and tried contacting you, but couldn't find any of 
> your contact info anywhere! Glad to see you turned up here.

Hi guys,

I have been working on an intellij plugin which is here: 
https://github.com/kingsleyh/DLanguage

I only started learning D a couple of weeks ago and I haven't 
written an intellij plugin before - and also I'm not very 
familiar with parsing/lexing.

On my first pass - I got all the infrastructure working - e.g. 
run configurations, project creation, file creation etc. And I'm 
working on a BNF and JFlex by hand - but I realise it will take 
some time - so I have a branch which implements the DDT 
parser/lexer so I could get something working while I work on the 
bnf - however it breaks the contextual run configurations - which 
is pretty much essential for the plugin to be useful.

I'd like to get the DDT parser/lexer working but I'm not really 
sure where to go from where I am now. My DDT branch is called 
with_ddt.

If anyone has any pointers to what I need to do next that would 
be very helpful - even in terms of reading or reference material. 
I guess it all comes down to the DParserDefinition class - as my 
master branch uses a FlexAdapter which gives access to the 
context. But in the with_ddt branch its just using the DParser - 
which I think needs to have the hooks into the AST tree 
implemented or something like that.

Anyway let me know if you have any pointers or offers of help :)

--K


More information about the Digitalmars-d mailing list