What is ANTLR?
ANTLR, ANother Tool for Language Recognition, was created by Terence Parr and is one of the most widely-used parsing frameworks available. ANTLR is a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages. ANTLR provides excellent support for tree construction, tree walking, translation, error recovery, and error reporting.
SyntaxEditor for WPF customers know that we also have our own LL(*) Parsing Framework that has a lot of benefits over ANTLR, but due to the general popularity of ANTLR, we are pleased to support it as well.
In the past few months, ANTLR v4 was released. There is updated tooling for Visual Studio that allows ANTLR v4 parsers to generated. The thing is that the entire infrastructure of ANTLR parsers has changed in v4, and with those breaking changes, it prevents our add-on from working.
In ANTLR v3, you could run the parser on the document text via our add-on (and in a worker thread so it doesn't block the main UI thread), and it would return the AST results of the parsing operation asynchronously when it completed.
In ANTLR v4, the parser is not the same as there is no automatic AST generation. Parse results can be examined via the use of the visitor pattern or a parse tree walker. If you wish to have your own AST, you have to roll your own and construct it using a visitor or walker. This change negates a lot of the features our add-on provided since now, you basically must hand code an IParser service to install on your language. SyntaxEditor is fully extensible for any custom parsers, so this can be added easily. It's just that whatever code you need to do to generate an AST or other parse data by walking the parse tree must now be custom written.
What Do You Want?
We are writing this blog post to see what you, our customers, would like to see from us in terms of ANTLR support. Do you still wish to have our add-on support ANTLR v3 as we move forward?
The only piece that is really useful from our ANTLR add-on when used with the newer v4 design is the ICharStream implementation that allows the parser to directly read from our text storage facility. Since it's only one class, do we just include it open source somewhere or make a separate v4 binary with it in there?
We'd love to hear your thoughts… Please comment below or email our support address!