Discussions

Terrence Parr has released ANTLR 3.0, a Java parser and code generator under the BSD license, featuring retargetable code generation, new mechanisms for building syntax trees, and a new mechanism for handling lookaheads - instead of having to specify the number of lookaheads, ANTLR 3.0 can look ahead at arbitrary depths.
Frank Sommers has an excellent (although short) interview with Terrence Parr on Artima.
ANTLR is a good tool to help generate domain-specific languages, since it can emit arbitrary code (Java, C#, C++, etc).
ANTLR is one of the two most popular compiler compilers (as they're known) for Java, along with JavaCC. If you've used them, which do you prefer, and why?

Congratualations Terence, Antlr 3 has been a god send for JBoss Rules allowing us to quickly build very rich grammar for our language; Antlr Works has also proven to be an invaluable tool. Hopefully Antlr 3.0 will encourage more people to write their own domain specific languages now, rather than use xml.
Mark Proctor
JBoss Rules Lead
http://markproctor.com/

I've been using antlr for a small project of mine which envolves parsing SQL. SQL is highly ambiguous, but my feeling is that antlr3 provides me with everything i need, and just let me focus with the details of the grammar. Antlrworks also makes a valuable addition to antlr tools, since it provides visualization for grammars, debugging, and syntax coloring.
In sum, a great tool, and even greater with antlrworks.

Many thanks to Terence for the excellent book on ANTLR. We are porting a fairly decent object oriented language (which is model aware) written in lex/yacc to ANTLR. The first advantage with ANTLR is the debuggability of generated parser for resolving any ambiguities/conflicts etc., The LL grammar lends itself to clear understandability as it is top down (the way humans would parse). Though we are not using ANTLR's tree building capabilities, it has been fairly easy for us to come up with parse actions to hand-build the AST. All the help needed is in the book "The Definitive ANTLR Reference". Do a quick scan and try out sample expression interpreter at http://www.antlr.org/wiki/display/ANTLR3/Expression+evaluator
Also check
http://www.antlr.org/wiki/display/ANTLR3/Quick+Starter+on+Parser+Grammars+-+No+Past+Experience+Required
Overall, I would say we are quite indebted to Terence Parr for his excellent work on LL(*) parser generator.
Thanks
Venkat

I find the antlr grammar to be much more readable and easier on the eyes, the AntlrWorks tooling makes development far more productive than editing JavaCC in a text editor. I also think that Antlr 3.0 has now become more powerful in it's parsing capabilities. I've no idea on performance comparisons and Antlr requires a small runtime dependency, which JavaCC does not.

I find the antlr grammar to be much more readable and easier on the eyes, the AntlrWorks tooling makes development far more productive than editing JavaCC in a text editor. I also think that Antlr 3.0 has now become more powerful in it's parsing capabilities. I've no idea on performance comparisons and Antlr requires a small runtime dependency, which JavaCC does not.

I wrote small interpreters both in javacc and in antlr. Antlr3 is quite superior in my opinion: to effectively use javacc I had to use a visitor AND modify some of the generated classes. In Antlr is really a piece of cake, and you absolutely do not need to modify code. You can do all you need staying in antlr.
And don't forget antlrworks!
uL

Antlr v2 was excellent at documentation which made me go up to speed with it,but v3 seems to provide the docs as the published pragmatic book (not free ) and no real documentation on the site
can anyone tell if this gonna change as i really wanna change to v3

I recently purchased the book after reading this posting and found it *well* worth my money. Not only is this book well structured, but easy to read. If you're looking to create a DSL or custom scripting language, this book is a must.
Good job on the book and excellent job on ANTLR. It's about time someone wrote a book on ANTLR or JavaCC!
Now I can't wait until we have one on Mule!
Best Regards,
Richard L. Burton III

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.