Despite the parsing power of LR/LALR algorithms, e.g. YACC, programmers often choose to write recursive‐descent parsers by hand to obtain increased flexibility, better error handling, and ease of debugging. We introduce ANTLR, a public‐domain parser generator that combines the flexibility of hand‐coded parsing with the convenience of a parser generator, which is a component of PCCTS. ANTLR has many features that make it easier to use than other language tools. Most important, ANTLR provides predicates which let the programmer systematically direct the parse via arbitrary expressions using semantic and syntactic context; in practice, the use of predicates eliminates the need to hand‐tweak the ANTLR output, even for difficult parsing problems. ANTLR also integrates the description of lexical and syntactic analysis, accepts LL(k) grammars for k > 1 with extended BNF notation, and can automatically generate abstract syntax trees.
[1]
Henry G. Dietz,et al.
PCCTS reference manual: version 1.00
,
1992,
SIGP.
[2]
Russell W. Quong,et al.
Adding Semantic and Syntactic Predicates To LL(k): pred-LL(k)
,
1994,
CC.
[3]
Daniel J. Rosenkrantz,et al.
Attributed Translations
,
1974,
J. Comput. Syst. Sci..
[4]
Terence Parr,et al.
The Use of Predicates In LL(k) And LR(k) Parser Generators (Technical Summary)
,
1993
.
[5]
Donald E. Knuth,et al.
On the Translation of Languages from Left to Right
,
1965,
Inf. Control..
[6]
Bjarne Stroustrup,et al.
The Annotated C++ Reference Manual
,
1990
.
[7]
Charles N. Fischer,et al.
Crafting a Compiler with C
,
1991
.
[8]
Murray Hill,et al.
Yacc: Yet Another Compiler-Compiler
,
1978
.