Errata for The Definitive ANTLR 4 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 P1.0, released 5 months 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.
| Paper | Description | Found in | Fixed in | |
|---|---|---|---|---|
| 6-7 |
#50953: After creating the Hello.g4 sample grammar, then generating and compiling the Java, running grun leads to an error on Windows: "Can't load Hel...more...
|
P1.0
04-Mar-13 |
||
| 10 |
#51237: Diagram at the bottom of the page:
Not a typo per se, but the tokens in the diagram are not in the gray boxes which can be confusing at fir...more...
|
P1.0
05-Apr-13 |
||
| 21 |
#50914: The footnote contains a broken link. Searching mefeedia.com for "terence parr" or "jvm" both find nothing.--Roger House |
P1.0
28-Feb-13 |
||
| 30 |
#50920: Running Translate on {99, 3, 451} as shown in the book works slick. But try {{1}} and Translate blows up with a NullPointerException in Short...more...
|
P1.0
01-Mar-13 |
||
| 34 |
#50712: "OK. Let's take grammar Expr out for a joy ride. Download it [...]"
It's a book with paper, not pdf nor epub!
Download the source code for...more...
|
P1.0
04-Feb-13 |
||
| 36 |
#50419: You run TestRig with an input file (not the keyboard) for the first time on this page. You might want to mention that the input goes in t.expr.--David Woolbright |
B4.0
28-Dec-12 |
||
| 47 |
#50408: A line of Java code "tokens.getText(ctx.type());"... there does not appear to be a TokenStream.getText(Token) method in the current version of v4.--Rick Mann |
B4.0
24-Dec-12 |
||
| 49 |
#52026: locals [int i = 1;] <- semicolon is error--Alexander Egorov |
P1.0
18-Jun-13 |
||
| 60 |
#51281: In grammar fragment for Java, "superclassSpec" should be "extendsClause", defined as:- extendsClause : 'extends' Identifier ;
|
P1.0
11-Apr-13 |
||
| 60 |
#50787: In the Java pseudo-grammar here is typo in this code:
superclassSpec : 'super' identifier ;
The 'super' keyword is not allowed to use in t...more...
|
P1.0
12-Feb-13 |
||
| 61 |
#50964: Both stat examples are missing 'while' '(' expr ')' in the second choice.--Peter Nikol |
P1.0
06-Mar-13 |
||
| 65 |
#50963: expr: ID '(' exprList? ')' // use token ID and not rule expr to build a function call --Peter Nikol |
P1.0
06-Mar-13 |
||
| 68 |
#50438: In the 3rd example the comments suggest some matches that do not match the "expr" definition given here, or you would have to assume that 2*b ...more...
|
B4.0
05-Jan-13 |
||
| 79 | 64 |
#50776: There is an error with the rule at the end of the page:
vector : '[' INT+ ']'
In the comment beside the rule it is described as recognizin...more...
|
P1.0
08-Feb-13 |
|
| 90 |
#51139: The parse tree diagram for JSON should have "pair" nodes instead of "element" nodes.--Robert Pepersack |
P1.0
26-Mar-13 |
||
| 92 |
#51004: Number in JSON.g4 grammar is defined wrongly. First alternative is wrong.
It doesn't accept floating point numbers that contain zero after ...more...
|
P1.0
11-Mar-13 |
||
| 92 |
#50786: The first clause for NUMBER in the JSON grammar seems to have an error because it does not allow a zero directly after the point as in the fol...more...
|
P1.0
11-Feb-13 |
||
| 100 |
#51559: In the definition of the "expr" @ array choice I read "| expr '[' expr ']'. This will though allow for constructs like 3[1] to be recognized b...more...
|
P1.0
22-May-13 |
||
| 113 |
#50990: The text discusses the class PropertyFileBaseListener but instead of presenting the code for PropertyFileBaseListener, the code of the class P...more...
|
P1.0
08-Mar-13 |
||
| 117 |
#50434: This page has the wrong code fragment below the sentence "As a convenience, ANTLR also generates class PropertyFileBaseListener ...". It appea...more...
|
B4.0
04-Jan-13 |
||
| 134 |
#50831: There is a reference to JSON2XML_ST.java source which uses StringTemplate for XML translation. But in the source code itself there is referenc...more...
|
P1.0
18-Feb-13 |
||
| 137 |
#50413: Missing the word "to" in "Finally, we need annotate the root of the parse tree"--Craig Motlin |
B4.0
25-Dec-12 |
||
| 159 |
#50420: Change "in" to "and" in "counting from 0 in treating tabs as one character"--Craig Motlin |
B4.0
29-Dec-12 |
||
| 206 |
#50792: Input "exmagic/t.cym" doesn't have syntax highlighting, whereas the output has it. Not exactly dramatic, but this inconsistency looks a bit weird.
|
P1.0
13-Feb-13 |
||
| 247 |
#51162: Section 13.7 ("Maximizing Parser Speed") in the new ANTLR version 4 book says to use the code
parser.getInterpreter().setSLL(true);
to u...more...
|
P1.0
31-Mar-13 |

