About ANTLR |
Latest version is 3.5.3
Download now! »
Why Use ANTLR?
[Here is a blog where people discuss the process of picking up ANTLR for the first time.]
I've been building parsers and translators since 1984. Naturally I built all my initial translators by hand with recursive-descent parsers. Eventually I wanted a tool that automated parser construction, but I hated yacc-like tools because they generated a table full of integers instead of human-readable code. Further, LR-based technology was much harder to understand than the intuitively obviously LL-based recursive-descent parsers. ANTLR grew out of my desire to automate exactly what I did by hand. Over the years, I've added features such as tree parsing that are also derived from actual experience building large translators.
ANTLR's popularity comes down to the fact that it satisfies the following fundamental requirements. Programmers want to use tools:
Explaining why tree parsers are useful is difficult until you have some experience building translators, nonetheless, ANTLR is one of the few language tools that lets you apply grammatical structure to trees.
ANTLR generates powerful recognizers with it semantic and syntactic predicates. Plus PCCTS/ANTLR was the first widely-used parser generator to employ k>1 lookahead. My PhD dissertation provided an efficient means of computing the necessary lookahead (k>1 was previously thought to be only of theoretical interest due to its exponential cost). Be careful of other tools that allow you to use more than one symbol of lookahead; some tools can't tell you when there are problems with your grammar when k>1.
I actively support and improve ANTLR (for over a decade now) as does the large user community. By using ANTLR, you can be certain that you are not betting your project on a "dead" tool. Many academic and industry projects use ANTLR. Do a google search for ANTLR and you'll see a few hundred thousand hits. Do a google search for "parser generator" and you're likely to see ANTLR shown first. Also note that there are over 5000 downloads a month of the ANTLR package.
There are existing grammars available for many languages. If you don't see it on this site, ask the antlr-interest list and somebody may have what you need. ANTLR modes for emacs, Eclipse, and other IDEs are also available.
ANTLR currently generates Java, C#, C++, and Python (as of 2.7.5).
ANTLR has pretty flexible and decent error handling.
ANTLR comes with complete source code unlike many other systems and has absolutely no restrictions on its use. I have placed it totally in the public domain.
For an in depth look comparing ANTLR to other parser generators, see this page by Ian Kaplan.
I'm working like crazy on a completely new version and tirelessly help people out on the mailing list and directly via email.
Finally, you should use ANTLR because I'm an all around nice guy and I'm kind to old people. ;)