Errata for The Definitive ANTLR Reference
We try to keep our books accurate, but sometimes mistakes creep
in. This page lists the errors submitted by our astute readers.
If you've found a new error, please
submit it.
The latest version of the book is P4.0,
released about 2 years ago.
If you've bought a PDF of the book and would like to upgrade
it to this version (for free), visit your
home page.
| PDF |
Paper |
Description |
Found in |
Fixed in |
| 29 |
|
#46927: For grammar file T.g, if you're creating this manually, make sure there is a blank line at the end of the file. It seems that ending with a single-line comment without a newline does not parse correctly.
This is the error I encountered:
C:\WORK\lib\antlr\test\Introduction>java org.antlr.Tool T.g
error(10): internal error: Exception T.g:5:64: unexpected char: 'e'@org.antlr.grammar.v2.ANTLRLexer.nextToken(ANTLRLexer.java:346): unexpected stream error from parsing T.g
error(150): grammar file T.g has no rules
error(100): T.g:0:0: syntax error: assign.types: <AST>:0:0: unexpected end of subtree
error(100): T.g:0:0: syntax error: define: <AST>:0:0: unexpected end of subtree
--Eric #46927: For grammar file T.g, if you're creating this manually, make sure there is a blank line at the end of the file. It seems that ending with a si ...more...
|
P4.0
23-Apr-11
|
|
|
62 |
#49220: When running the Expr test for 'trees' the book text says:
BEGIN QUOTE
First ask ANTLR to translate Expr.g to Java code and compile as you did for the previous solution:
$ java org.antlr.Tool Expr.g
ANTLR Parser Generator Version 3.0 1989-2007
$ javac Test.java ExprParser.java ExprLexer.java
END QUOTE
These instructions are confusing because the "Test.java" file included in the book's code (tpantlr-code.tgz) is the modified Test.java rig used on page 66.
This is confusing since the new ExprParser.java and ExprLexer.java files are generated into the same directory as the Eval version of the test rig.
My suggestion is that the book should say, for the test rig on page 62, specifically something about using the Test.java test rig from the previous solution. Simply running what it given in the book ("$javac Test.java ExprParser.java ExprLexer.java") results in a compile error.--Michael D Rossetti #49220: When running the Expr test for 'trees' the book text says:
BEGIN QUOTE
First ask ANTLR to translate Expr.g to Java code and compile as y ...more...
|
P4.0
27-Apr-12
|
|
|
83 |
#47158: Figure 4.2: r^ (last sentence) Rule r should must a single node, not a subtree.
|
P4.0
02-Jun-11
|
|
| 141 |
|
#48705: r @init { Token myFirstToken = $start; // do me first }
should this not be:
...
Token myFirstToken = $r.start;--Achim Rumberger
|
P4.0
11-Feb-12
|
|
| 153 |
|
#47172: footnote 3 contains a broken link. (I can't post the link or the link to the correct page because pragprog system think I'm spamming if I do so). Please update the link or provide a working http redirect on the original link--Ruben Laguna Macias #47172: footnote 3 contains a broken link. (I can't post the link or the link to the correct page because pragprog system think I'm spamming if I do s ...more...
|
P4.0
08-Jun-11
|
|
| 159 |
|
#47242: The link in the footnote is broken(page not found).--Yun
|
P4.0
01-Jul-11
|
|
| 170 |
|
#46719: MyParser parser = new MParser(tokens,symtab);
should be
MyParser parser = new MyParser(tokens,symtab);
|
P3.0
02-Apr-11
|
|
| 223 |
|
#49710: "Generating templates behaves just like generating trees using rewrite rules.Each rule implicitly returns a template or tree, and the -> rewrite operator declares the output structure."
Specifically, the full stop following "rules" should be followed by a space.
(Also, I look forward to ANTLR4, thanks!) #49710: "Generating templates behaves just like generating trees using rewrite rules.Each rule implicitly returns a template or tree, and the -> rewri ...more...
|
P1.0
17-Aug-12
|
|
| 301 |
|
#48751: Last paragraph, first sentence:
The problem is that the looping subrule in declarator_specifiers...
should be:
The problem is that the looping subrule in declaration_specifiers...--Ulf Wolfgramm #48751: Last paragraph, first sentence:
The problem is that the looping subrule in declarator_specifiers...
should be:
The problem is that the loop ...more...
|
P4.0
17-Feb-12
|
|
| 2007 |
kWcBa |
#48550: The purchases I make are entirely based on these arctiles.--nejCsGGMnE
|
P4.0
20-Jan-12
|
|