ANTLR grammar for D?

Brian Schott via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 20 11:20:35 PDT 2014


On Friday, 20 June 2014 at 09:22:07 UTC, Wesley Hamilton wrote:
> Thanks. Just realized that the "add grammar" button for ANTLR 
> grammar list is broken... so that could be why it's not there. 
> I'll probably still finish the grammar I'm making since I'm 75% 
> done. That's a great reference, though. I think it's missing a 
> few minor details like delimited strings, token strings, and 
> assembly keywords.

Keep in mind that assembly keywords aren't keywords outside of 
ASM blocks. You need your lexer to identify them as identifiers.

> It should help where the Language Reference pages aren't 
> accurate. For example, I think HexLetter is incorrectly defined.

If you find problems in the grammar please file an issue on 
Github or create a pull request.

If you need the AST of some D code, you'll save a lot of time by 
downloading D-Scanner and running "dscanner --ast sourcecode.d > 
sourcecode_ast.xml"


More information about the Digitalmars-d mailing list