Search code examples
.netlanguage-designbnfparser-generator

Any BNF IDE with test features


I'm working on a new language and while writting the grammar I'd like to be able to test the grammar for completeness, conflicts and similar. I'm not really concern about the underlaying parser generator (but one for .NET would be preferrable)

So feature list in short would be:

  • text editor build functionality
  • syntax/sematics error reporting
  • conflicts reporting
  • grammar test functionality (i.e. window for writting code in the intended grammar to verify the correctness of the grammar definition)

A CodePlex project called Irony does have something simlar to what I'm asking for but does not support writing the grammar as BNF which is required.


Solution

  • I would recommend ANTLR as a parser generator. It's very feature complete and supports C# as well as a host of other target languages.

    For IDEs, there's a plugin for Eclipse called ANTLR IDE and a standalone IDE called ANTLRWorks, both of which work well.

    Note, however, that ANTLR uses an LL(*) algorithm instead of a LR(k) algorithm. Still, it's very nice and ANTLRWorks can do most of the necessary left factoring.