It was completely rewritten in 4 years of research and coding (after 15 years of experience). Mostly clean up. Changes: (http://www.antlr.org/wiki/pages/viewpage.action?pageId=719) LL(k) → LL(*), does not require you to specify a lookahead depth Auto backtracking mode, improved speed of backtracking ANTLRWorks, integrated grammar development environment New syntax for grammars (BC break!) Simplified tree building Retargetable code generator, easy to build backends Improved error reporting Integration of StringTemplate engine (structured text generation)
By default generates .java files. Download JAR at http://www.antlr.org/download.html Version for Win/Linux/Mac/... (BSD licenced src) Currently (11/2010) supports: C, C#, Action/JavaScript, Java ANTLRWorks: java -jar antlrworks-1.4.jar Integrated, but you can still use the Eclipse plugins.
local options } : alternative 1 | ... | alternative n ; Example: expr : operand (PLUS operand)* ; operand : LPAR expr RPAR | NUMBER ; Optional stuff RegEx containing rulename, token, EBNF operator, code (Java) in braces EBNF operators: A|B = or A* = zero or more A+ = one or more A? = optional
of tokens → CalcParser (extends Parser) stream of tokens stream of tree nodes → CalcChecker (extends TreeParser) stream of tree nodes, checks context contstraints CalcInterpreter (extends TreeParser) stream of tree nodes, executes program
a hybrid grammar combining rules for lexer and parser together. grammar Calculator; options { k = 1; language = Java; output = AST; } tokens { PLUS = '+'; MINUS = '-'; ... }
Same grammar syntax for scanners, parsers, tree walkers. Many languages supported. Under active development, has active user community. Integrated grammar development environment. Eclipse plugins. Java → many platforms (Linux, Windows, Mac, ...).