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 over 1 year 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.

Key: Typo Tech. Error Suggestion Not a problem Next edition

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:  

(To find out what version you have, look at the copyright page, a few pages in from the front of the book. If it says (say) 'Second Printing', then here it'll be P2.0. If there are interim PDF releases in that printing, they'll be 2.1, 2.2, and so on.)

PDF 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
16

#52465: "TokenStream" is not coloured properly.

Please see this private gist: gist.github.com/mahata/abd583dc67ff40f46e5b--Yasunori MAHATA

P1.0
25-Aug-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
40
#76657: The EvalVisitor class is defined: public class EvalVisitor extends LabeledExprBaseVisitor<Integer> LabedExprBaseVisitor is an interface,...more...
P1.0
13-Apr-14
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 ;
--Trevor John Thompson

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
63
#52317: Antlr4 Notes Page 63, 64, 66 about the | symbol. It seems to me that in the antlr expression brackets are missing. The first example ('='...more...
P1.0
05-Aug-13
63

#52318: Please ignore #52317--Kuipers

P1.0
05-Aug-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
81

#52315: "Stepping up our processing needs a little bit," ... of foo?

P1.0
05-Aug-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
94
#52301: Reference 7 for the primary DOT language reference seems to be at h**p://www.graphviz.org/content/dot-language. Apache at www.graphviz.org re...more...
P1.0
02-Aug-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
167 167
#52381: The second paragraph from the bottom of the page should begin "The fail option takes either a string literal in single quotes or an action ......more...
P1.0
13-Aug-13
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.
--Tibor Csögör

P1.0
13-Feb-13
221
#76328: Hello, thanks for the excellent software and book. It seems that the following example from page 221 does not work ~~~ BAD_COMMENT1: '<...more...
P1.0
23-Jan-14
243
#52135: As well as changing ...setSLL(true) to ...setPredictionMode(PredictionMode.SLL) you will need to change ...setSLL(false) to ...setPred...more...
P1.0
06-Jul-13
243 243
#52180: The exception that is actually thrown by the SLL parser is org.antlr.v4.runtime.misc.ParseCancellationException. Therefore, in the if statemen...more...
P1.0
12-Jul-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
258
#52136: In the summary bullet points at the bottom of the page, make it clear that combined grammars can import combined grammars, e.g., * Combined g...more...
P1.0
06-Jul-13