By Developers, For Developers
PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
---|---|---|---|---|---|
15 | ERROR | The generated lexer grammar is not Expr.g but Expr.gl (by the way I’m using ANTLR 3.0b6 which is currently the last released version so it may be different in the previous or next version) | 2007-04-07 | ||
19 | TYPO | ‘inddicates’ instead of ‘indicates’ | 2007-04-07 | ||
21 | SUGGEST | It seems the actions are referred to by the fact that it’s the nth ACTION in the whole file. We can guess by the context that action 4 is the action after ID and then what are action 5 and 6, but even with the whole file it’s not so easy to see why you use these numbers because we have tendency to count the rules, not just the action. If you want to put those numbers on them I think you should also add those numbers in the comments of the source code. | 2007-04-07 | ||
22 | SUGGEST | After modifying the grammar, you may want to remember the reader to recompile the parse java file. By the way, when doing this I got the following error: | 2007-04-07 | ||
22 | ERROR | The command line examples say ‘java Main’ whereas it should be ‘java Test’. | 2007-04-07 | ||
176 | TYPO | “you could refactor of the rule as follows” should be “you could refactor the rule as follows” | 2007-04-07 | ||
212 | TYPO | “\\{p}?” should be “{p}?” and “\\{p}?=>” should be “{p}?=>” | 2007-04-07 | ||
212 | TYPO | It is written "by matching the first alternative of rule @ r a’‘. The ’@ r’ has no reason to be there… | 2007-04-07 | ||
214 | TYPO | “you can usually used attributes” should be “you can usually use attributes” | 2007-04-07 | ||
163 | SUGGEST | In the sentence “in a directory with the same name such as org/antlr/codegen/templates/Java or org/antlr/codegen/templates/Java”, shouldn’t the second path end with an other language name (C, Ruby…)? | 2007-04-07 | ||
229 | SUGGEST | 11.4 should be before 11.3 as it describes the backtrack option used in 11.3 and it references the nested grammar ‘above’ that’s in fact in 11.2 (7 pages before) | 2007-04-07 | ||
215 | SUGGEST | The introduction of this chapter is a hard to read, and after reading it I hardly had an idea of what is syntactic predicate. I think it’s missing some example or diagram. | 2007-04-07 | ||
11 | TYPO | The link to download the tour/basic/input files is incorrect. The book states the link media.pragprog.com/titles/tpantlr/code/tour/basic/input, but the real URL is media.pragprog.com/titles/antlr/code/tour/basic/input (antlr instead tpantlr). | 2007-04-07 | ||
12 | TYPO | The link to download the tour/basic/Expr.g file is incorrect. The book states the link media.pragprog.com/titles/tpantlr/code/tour/basic/Expr.g, but the real URL is media.pragprog.com/titles/antlr/code/tour/basic/Expr.g (antlr instead tpantlr). | 2007-04-07 | ||
45 | TYPO | Some chapter links are shown as chp. | 2007-04-07 | ||
45 | TYPO | The note in the right margin is not completely readable at the bottom | 2007-04-07 | ||
53 | TYPO | The name of the class holding the return values should be r_return instead of rule_return to be consistent with the implementation of the implementation of the rule that follows | 2007-04-07 | ||
32 | TYPO | To be consistent with the conventions given in the table on page 41, should the tree grammer not be in a file called Expr.gtp instead of Expr.g? | 2007-04-07 | ||
60 | TYPO | Should the "else if ( | 2007-04-07 | ||
17 | TYPO | In the sidebar the bolded switch has no spaces around it. | 2007-04-07 | ||
21 | TYPO | It looks like that “INTatom” should be written like “INT atom”. BTW, all links are wrong, as they have within the URL “tpantlr” instead “antlr”. | 2007-04-07 | ||
21 | ERROR | I’ve tried to test the /tour/eval/Expr.g with antlr-3.0b6 and ANTLRWorks 1.0b8. It seems, that the rule “‘(’ expr ‘)’ {$value = $expr.value;}” is incorrectly translated into “value = $expr.value;” instead into “value = $expr();” in ExprParser.java. | 2007-04-07 | ||
85 | TYPO | ‘In a general purpose language like Java, to allow f( ) to access x,’ should read ‘In a general purpose language like Java, to allow h( ) to access x,’ as f() already has access to x. | 2007-04-07 | ||
97 | TYPO | Several of the attribute descriptions are incorrect: | 2007-04-07 | ||
112 | TYPO | “The following subsections describe it illustrate the operations I found.” should probably be something like “The following subsections describe the operations I found.” | 2007-04-07 | ||
32 | TYPO | Links to code do not work. | 2007-04-07 | ||
129 | TYPO | The variableDefinitions tree grammar is missing an ‘|’ character in its definition, as in variableDefinition | 2007-04-07 | ||
116 | ERROR | ‘new CommonToken(INT, “12”)’ actually is not the right choice for creating a new arbitrary token, at least for compatibility - ANTLRWorks (1.0b8 at least) does not properly display ASTs with Tokens defined this way, one instead needs to use ‘adaptor.create(INT, “12”)’. | 2007-04-07 | ||
13 | TYPO | The sentence “Lexical rules all begin with an uppercase letter in ANTLR and | 2007-04-07 | ||
18 | ERROR | Broken link to download “tour/basic/Test.java” | 2007-04-07 | ||
24 | TYPO | The paragraph ending with “For example, ANTLR translates rule return specifications such as:” is followed by a method named “expr”, even though the grammar example has a rule for “multExpr”. | 2007-04-07 | ||
186 | TYPO | Awkward sentence: “Top-down parsers naturally associate operators left-to-right so that the | 2007-04-07 | ||
195 | TYPO | Need comma (possibly “, and”) after “class level” in “In this case, the grammar is loosely written because decl should only | 2007-04-07 | ||
38 | TYPO | Need comma after “vocabulary symbols” in "By | 2007-04-07 | ||
38 | TYPO | Need comma after “is a sentence” in “For example, a complete | 2007-04-07 | ||
39 | TYPO | First use of DSL should define the acronym (same is true of other acronyms seen throughout). Might even want to define first use in each chapter or part. | 2007-04-07 | ||
46 | TYPO | Last paragraph on page seems to end abruptly, and does not appear to continue on the next page. Perhaps there was something like “following table” at the end? | 2007-04-07 | ||
49 | TYPO | Need comma after “following page” in “Figure 3.2, on the following page summarizes the tree | 2007-04-07 | ||
135 | TYPO | The textual version of the AST has an error in the third child of the ‘for’ node, as it represents ‘i=0’ and not ‘i=i+1’. | 2007-04-07 | ||
164 | TYPO | Chapter reference not filled in properly in ‘see chp.templateschp.templates.’ | 2007-04-07 | ||
25 | SUGGEST | The arrows like <= and => are strangely pointed. “javac …” is something I type. Its arrow is like =>. | 2007-04-07 | ||
25 | ERROR | The whitespace rule should really be Also the line | 2007-04-07 | ||
25 | ERROR | Using ANTLR 3.0b6 (the latest as of 2/24/07), the command to compile and run Test should be: javac TLexer.java TParser.java Test.java instead of: javac T.java Test.java | 2007-04-07 | ||
25 | SUGGEST | The provided grammar only allows ‘\ | 2007-04-07 | ||
37 | TYPO | “Adding a stack to a state machine turns it into a pushdown machine (pushdown automata).” It should read “automaton”. “Automata” is the plural form, but there’s only one machine. | 2007-04-07 | ||
39 | TYPO | Nitpck about the footnote: it should read “to err is human …” | 2007-04-07 | ||
125 | ERROR | The exception handler in the generated Java code is But the grammar contains this Shouldn’t the generated handler be | 2007-04-07 | ||
68 | TYPO | The text "Figure 3.2, on the next page shows the parse tree for | 2007-04-07 | ||
191 | ERROR | TestCMinus.java: after the lines: // Walk resulting tree; create treenode stream first the next line is missing: nodes.setTokenStream(tokens); (Without this call, a null pointer exception occurs. ) | 2007-04-07 | ||
85 | TYPO | "… | 2007-04-07 | ||
87 | SUGGEST | “As an optimization, ANTLR collapses rules and subrules, whose alternatives are single token references without actions, into token sets as demonstrated in the following rule: I’d like to see an unoptimized version of that for comparison. | 2007-04-07 | ||
89 | SUGGEST | “T Parser or tree parser. Match token T at the current input position. In a lexer, invoke lexer rule T. Tokens always begin with a capital letter. The parts between the * is mentioned twice. I suppose, that the part at the first position is to be deleted. | 2007-04-07 | ||
101 | TYPO | “For example, in the following Python code, the if statement and the method call to g( ) our at the same…” In the above sentence, ‘our’ should be ‘are’. | 2007-04-07 | ||
101 | TYPO | Towards the bottom of the page: ‘the’ is incorrectly repeated as ‘the the’. | 2007-04-07 | ||
93 | TYPO | “Theafteraction is new and theinitaction was simply a code block in v2.” There are spaces missing for the bolded words ‘after’ and ‘init’. | 2007-04-07 | ||
96 | ERROR | It seems that the example of a StringTemplate group misses the opening <<-Brackets. | 2007-04-07 | ||
97 | ERROR | As my Java knowledge is limited, I’m not entirely sure about that one, but I believe that the catch-example with the rethrowing of the exception destroys the original stack trace. That has to be avoided. | 2007-04-07 | ||
60 | TYPO | Small grammatical error. | 2007-04-07 | ||
148 | TYPO | At the top of this page it reads “The list the follows summarizes the special symbols and expressions…”. Perhaps it should read “The following list summarises…” | 2007-04-07 | ||
25 | TYPO | The ls displays Test.java already in the directory but the instruction to download it to there does not appear until the bottom of the page. | 2007-04-07 | ||
121 | TYPO | I suspect, that instead {System.out.println(“var”$id.text“:”$t.text“;”);} the action should be {System.out.println(“var”$id.text“, ”$t.text“;”);}. | 2007-04-07 | ||
127 | SUGGEST | “Because Java allows you to define variables in-line as opposed to the start of a code block, you can define variables inside of any action. The variables will be visible for the immediately surrounding alternative, but not other alternatives and not surrounding alternatives if the action is within a subrule.” I’d appreciate some examples which show when which condition applies. | 2007-04-07 | ||
59 | ERROR | needs parser.program() instead of parser.prog() | 2007-04-07 | ||
131 | TYPO | “…lexer rules that refer to other lexer rules can access those portions of the overall token matched by the other rules and returned as implicit tokens.” Isn’t the word “be” missing in front of “returned”? | 2007-04-07 | ||
122 | TYPO | In the discussion of rule parameters, the text says that “rule declarator defines a parameter attribute called type that is available to actions as $type”, but the code immediately following has the rule declarator[String typeText] and references it as $typeText | 2007-04-07 | ||
145 | TYPO | “In the future, expect ANTLR to allow initialization code withinscopedefinitions like constructors.” The bolded scope has no spaces around it. | 2007-04-07 | ||
148 | TYPO | In the first paragraph… to methods => two methods And I wonder which is correct, in the running text, or in the code example: displayRecognitionError() => getErrorMessage() | 2007-04-07 | ||
235 | TYPO | “In v2, there was aparaphraseoption that automated this”. The bolded word “paraphrase” has no spaces around it. Possibly a dot at the end of sentence missing. | 2007-04-07 | ||
58 | TYPO | “For example, clearly, the twoswitchstatements could be collapsed into a single one.” The bolded switch has no spaces around it. | 2007-04-07 | ||
90 | SUGGEST | “Template literals are either single-line strings in double quotes, ”…“. For multi-line strings use double angle-brackets, <<…>>,as shown in the highlighted section in the following grammar.” When I read the word “either”, I expect it to be followed by “or”. Regardless how the sentences are rewritten, the current version disturbs the flow. | 2007-04-07 | ||
71 | TYPO | "The first symbol after the | 2007-04-07 | ||
264 | ERROR | The first code sample (ANTLR 1.0 / PCCTS) has a missing closing curly brace for the “if” block: expr(); The second code sample (ANTLR 3)is missing break statements after the two cases in the switch. switch (alt) { | 2007-04-07 | ||
264 | TYPO | code comment is incorrect. It reads: case 2 : // match alternative 1 but should be case 2 : // match alternative 2 | 2007-04-07 | ||
217 | TYPO | “the input to the translator is a series | 2007-04-07 | ||
235 | ERROR | The following grammer snippet generates 2 semicolons for a ‘call()’. This is due to the string template being “ expr: ID | 2007-04-07 | ||
34 | TYPO | (I even found it hard to type.) — not ). | 2007-04-07 | ||
220 | TYPO | Sidebar text is not entirely readable due its position at the bottom. | 2007-04-07 | ||
15 | TYPO | Last paragraph “an existing grammars” should be “an existing grammar” or “existing grammars”. | 2007-04-07 | ||
90 | TYPO | Templates: You will see the full syntax… | 2007-04-07 | ||
91 | SUGGEST | “The general structure of a rule looks like the following: …” The < | 2007-04-07 | ||
107 | TYPO | The right-hand side annotation should use ‘omit’ and not ‘emit’. | 2007-04-07 | ||
233 | TYPO | The rule: “expr : ID Isn’t the rewrite “-> ^(CALL ID expr* )” more exact in this form: “-> ^(CALL ID expr+ )”? | 2007-04-07 | ||
32 | TYPO | First sentence in sidebar: “recognized” should be “recognize”. | 2007-04-07 | ||
34 | TYPO | Section 2.2, line 7: “Human” should be “human”. | 2007-04-07 | ||
142 | TYPO | missing `+’ in System.out.println | 2007-04-07 | ||
61 | ERROR | Second paragraph: ANTLRWorks will not generate code in the same directory as the grammar file by default. The output path can be configured in the preferences menu and by default it’s set to /tmp/antlrworks. At least in version 1.0b9 on Mac OS X. | 2007-04-07 | ||
266 | TYPO | The sixth footnote “cyclic DFA allow states to transition to previously-visited states” should have an Uppercase first word and a dot at the end. | 2007-04-07 | ||
265 | TYPO | “Reconsider the non-LL(k)class or interface”: Before the bolded class there is no space. | 2007-04-07 | ||
71 | TYPO | In the following sentence: "The first symbol after the | 2007-04-07 | ||
268 | TYPO | The tesxt in the sidebar is missing spaces. | 2007-04-07 | ||
268 | TYPO | “Each alternative has a lookahead language and if a lookahead languages are disjoint for a decision then the decision is LL (*).” The “a” in front of “lookahead languages are disjoint” should be deleted. | 2007-07-30 | ||
302 | TYPO | The example rule “primary may have an incomplete rewrite, where the ID token is missing. | 2007-07-30 | ||
303 | TYPO | Like on page 302 the example rule is missing on the second rewrite the ID token. | 2007-07-30 | ||
310 | TYPO | Looking at the code sample “void f(int ((*p))(float)){ | 2007-07-30 | ||
312 | TYPO | “This example merely demonstratew how syntactic predicates resolve true ambiguities by imposing order on alternatives.” “demonstratew” instead “demonstrates”. | 2007-07-30 | ||
322 | ERROR | “Both INT and ID syntactically predict the second alternative of rule a.” I don’t understand how this is possible with these rules: “a : b INT can’t be identically lexically to INT, can it? Even taking into account that p1 is hoisted from rule b into rule a it would make only sense, if the sentence mentioned alternative one and not two. | 2007-07-30 | ||
130 | TYPO | "Java | 2007-07-30 | ||
340 | TYPO | "ANTLR resolves the ambiguity by forcing | 2007-07-30 | ||
70 | TYPO | second paragraph last sentence “the parser reports and error” should be “the parser reports an error” | 2007-07-30 | ||
353 | TYPO | This part of rule example contains the reference to the variable y, even so this variable is no longer defined. “:(b[y] ‘.’) => b[y] ‘.’ | 2007-07-30 | ||
104 | TYPO | first paragraph under lexical rules second sentence “lexer rules are always token names and began with” changes tense and should be “lexer rules are always token names and begin with” | 2007-07-30 | ||
106 | TYPO | second paragraph third sentence “Character positions ared indexed” should be “Character positions are indexed” | 2007-07-30 | ||
106 | TYPO | first sentence under section “Emitting More Than One Token Per Lexer Rule” “force the lexer to emit more token per rule” should be “force the lexer to emit more tokens per rule” | 2007-07-30 | ||
108 | TYPO | second sentence under section “Tree Matching Rules” “of the input stream but also encode the grammatical structure applied to that input string” should both references not be to the input stream? | 2007-07-30 | ||
116 | TYPO | section “output” second sentence “Only available for combined, parser, and parser grammars” should be “Only available for combined, lexer, and parser grammars”? | 2007-07-30 | ||
144 | TYPO | first sentence “is a gated semantic predicates” should be “is a gated semantic predicate” | 2007-07-30 | ||
163 | SUGGEST | the second last sentence of the first paragraph is awkwardly worded “Always think of subtrees as operations with operands that tell the computer precisely what to do just like with the expression AST does above”. Perhaps removing the “does” or changing the “with” to “what” would make it more easily readable? | 2007-07-30 | ||
47 | ERROR | Though the first grammar “file : .+” is in line with the definition on the previous page (“[…] the structure is simply ‘one or more characters’”), a file can indeed be empty. Actually, both example programs support this (as does the second grammar!), so strictly speaking, the above grammar should read “file : .*” and the above definition should read “[…] zero or more characters”. | 2007-07-30 | ||
105 | ERROR | Though I didn’t test it, the “if (stripCurlies) { […] }” block looks wrong—if “getText()” is supposed to return the code block with surrounding curly braces, you not only want to get rid the opening one by means of “substring(1,…)”, but you also need to correct the string length in order to drop the closing one as follows: | 2007-07-30 | ||
105 | ERROR | Sigh… the example is wrong, but so was my first correction; you can only get rid of the last curly brace by modifying the end index as follows: | 2007-07-30 | ||
12 | ERROR | Apple guidelines say that you should refer to the operating system as “Mac OS X”, not “OS X” as here. | 2007-07-30 | ||
243 | TYPO | Apple guidelines say that you should refer to the operating system as “Mac OS X”, not “OS X” as here. | 2007-07-30 | ||
111 | TYPO | Says “root note” instead of “root node”. | 2007-07-30 | ||
181 | TYPO | first sentence of the second paragraph | 2007-07-30 | ||
302 | TYPO | In paragraph two “context-tree” should be “context-free”. | 2007-07-30 | ||
251 | TYPO | In section 10.5, “reports the errors usual” should read “reports the errors as usual”. | 2007-07-30 | ||
268 | TYPO | second paragraph second sentence “language and if a lookahead languages are disjoint” should be | 2007-07-30 | ||
279 | ERROR | “which causes the unreachable alternative error” should really be “which causes the unreachable alternative warning”. | 2007-07-30 | ||
293 | TYPO | first paragraph third last sentence | 2007-07-30 | ||
294 | TYPO | first paragraph first sentence “disambiguating semantic predicates” should be “disambiguating semantic predicate” | 2007-07-30 | ||
336 | TYPO | backtrackign -> backtracking. | 2007-07-30 | ||
350 | ERROR | Using antlr-3.0b7, “java org.antlr.Tool infloop.g” prints: | 2007-07-30 | ||
80 | TYPO | tree built for “a=3;”
| 2007-07-30 | ||
22 | TYPO | third paragraph first sentence ’containing a Token | 2007-07-30 | ||
99 | TYPO | see @scope. 1) it’s a typo should be scope.. 2) I’m not sure why | 2007-07-30 | ||
250 | ERROR | rulecatch example uses RecognitionException e. | 2007-07-30 | ||
81 | SUGGEST | The simple tree based interpreter referenced in [3] has some errors. ANTLR Parser Generator Version 3.0b7 (April 12, 2007) 1989-2007 | 2007-07-30 | ||
197 | TYPO | In the source code, line 6, a tab is missing before // int i | 2007-07-30 | ||
197 | TYPO | That listing again, line 7: the third term in the for loop (i=i+1) is translated to (= i 0). Shouldn’t that be (= i (+ i 1)), or something like? The same mistake is shown in the tree structure on the following page. | 2007-07-30 | ||
35 | TYPO | 2nd bullet, end of 2nd line, “World”: should this be capitalized? | 2007-07-30 | ||
35 | SUGGEST | In the “Finite state machines” sidebar, at the end of the first para, I find the discussion of LL (*) vs. LL (k) confusing as the terms are unfamiliar at this point and I don’t think that the last sentence (“ANTLR’s LL (*) parsing…k+1 states.”) is necessary anyway. | 2007-07-30 | ||
62 | TYPO | The 2nd para after the code says “All of the FOLLOW_multExpr_in_expr160 variable and…” I don’t understand what “FOLLOW_multExpr_in_expr160” is unless it’s some internal macro that didn’t get translated properly? | 2007-07-30 | ||
48 | SUGGEST | I started to get a bit lost with my eyes glazing over once I started reading the section entitled “Categorizing Recognizers”. At this point I was eager to start applying the knowledge gained so far, but it’d be 8 pages before I get to the next chapter. Perhaps these 8 pages could be moved later? It doesn’t seem necessary to understand LL vs. LR or LL (k) in order to try out the examples in Chapter 3. | 2007-07-30 | ||
158 | TYPO | Assuming the examples are correct, several of the specified operations have typos, as follows: | 2007-07-30 | ||
91 | TYPO | Missing full stop in side comment: “Recursive rules in the lexer are useful for matching things like nested comments(. C)ontrast this…” | 2007-07-30 | ||
75 | TYPO | The last sentence of the second paragraph has a typo: “…alternative simply means don’t creat a tree …” should be “…alternative simply means don’t create a tree …” | 2007-07-30 | ||
135 | ERROR | Map symbols = new HashMap(); Should probably be: | 2007-07-30 | ||
246 | TYPO | In the right sidebar note, “In v2, there was aparaphraseoption that automated this” there are missing spaces around paraphrase. Should be “In v2, there was a paraphrase option that automated this” | 2007-07-30 | ||
246 | SUGGEST | In the PDF version of the document, and I’m guessing the print version, it seems incorrect to insert Table 10.1 right in the middle of a code listing. P.g starts on page 246, is interrupted on page 247 by Table 10.1, and then continues on 248. | 2007-07-30 | ||
155 | ERROR | In the after code for func, it prints out CScope::name, but the init code doesn’t set CScope::name. Prog and block do, but not func. | 2007-07-30 | ||
76 | TYPO | Section ‘Building ASTs with a Grammar’ | 2007-07-30 | ||
98 | TYPO | Figure 4.2 | 2007-07-30 | ||
107 | TYPO | The last sentence in the book is blocked by the dark blue bar (the one that contains the phrase: Prepared exclusively for….) | 2007-07-30 | ||
87 | TYPO | I am not sure if this is an error in the book or the website but the link in footnote 2 to www.antlr.org/v3 doesn’t seem to work. | 2007-07-30 | ||
88 | TYPO | The beginning of paragraph 3 starts with “A grammar describe”, which should be “A grammar describes”. | 2007-07-30 | ||
107 | ERROR | The last line is invisible, also on some other pages. | 2007-07-30 | ||
83 | TYPO | In many cases (page 83 is just an example) the “customization” bar at the bottom of the page covers the last line of text. | 2007-07-30 | ||
74 | TYPO | Fourth paragraph, third line “symbols or its children.” should be “symbols are its children.”. | 2007-07-30 | ||
77 | TYPO | Second paragraph (after sample code), first line says "to tokens +, | 2007-07-30 | ||
41 | ERROR | I can’t read the bottom line of page 41 “upon reaching the end of that submachine.” as it is obsured by the “Report erratum” text with a blue background. | 2007-07-30 | ||
33 | TYPO | The url referenced in footnote #6 can not be found. | 2007-07-30 | ||
100 | TYPO | The example at the top of the page left out the TRUE subrule for the IF. It also left off the indicator that stat could appear multiple times. It should probably read something like: | 2007-07-30 | ||
109 | TYPO | Last paragraph, first line should read: | 2007-07-30 | ||
111 | SUGGEST | On this page a section is started on “Tree Matching Rules” with no previous discussion of tree creation rules. A page or two on tree creation before tree matching would help things flow smoother and keep things in context. | 2007-07-30 | ||
275 | TYPO | section ‘Arithmetic Expression Grammars’ | 2007-07-30 | ||
107 | ERROR | The last line is “invisible”, also on some other pages. | 2007-07-30 | ||
305 | TYPO | “loath” should be “loathe” (the verb) in the sentence “It is because of this ambiguity and many others that language imple- | 2007-07-30 | ||
203 | ERROR | DOTTreeGenerator does not seem to exist in the CSharp runtime. | 2007-07-30 | ||
190 | TYPO | URLs in the footnote are reversed. pageId=1760 is the parse tree page. pageId=1763 is the heterogeneous tree page. | 2007-07-30 | ||
71 | TYPO | I think the first java method’s name should be multExpr() but not expr(). | 2007-07-30 | ||
278 | TYPO | The footnote isn’t entirely readable, as the last sentence is hidden by the blue bottom. | 2007-07-30 | ||
283 | TYPO | The last sentence is hidden by the blue bottom. | 2007-07-30 | ||
224 | TYPO | The upper box refers to “slist”, which isn’t used in the code samples. Either “slist” is “prog”, or more likely, “stat”. | 2007-07-30 | ||
210 | ERROR | On page 210, in the templates/generator/1pass/input.j example, the constructor invocation is incorrect. It compiles but you can’t instantiate the assembled classfile as an object, the contructor line should look like this and include the keyword “ .method public And same thing when calling on Object.super() constructor, just below: invokenonvirtual java/lang/Object/ The book example actually works since it doesn’t call for actually creating an object instance since generated test example is in a static method, but I wanted to instantiate the assembled class. | 2007-07-30 | ||
168 | TYPO | On page 181 of the PDF and page 168 of the dead-tree version, we have: variableDefinition …where “modifiers” should be changed to “modifier*” (or vice-versa). | 2008-11-12 | ||
109 | TYPO | “Lexer rules can force the lexer to emit more token” should be “Lexer rules can force the lexer to emit more than one token”. Also, you probably should move the sentence that comes before the “Emitting More Than One Token per Lexer Rule” down after the header. | 2008-11-12 | ||
77 | TYPO | In the Literals section, the “one-character string containing the single quote character” is missing the closing single quote. I.e. it is shown as ‘\\" instead of ’\\"’ | 2008-11-12 | ||
61 | TYPO | On the second line of the comments in Expr.g, there are extra spaces in the $stat.tree.toStringTree() call right before toStringTree. | 2008-11-12 | ||
67 | TYPO | After the testing the expression recognizer, the text says “ANTLR doesn’t emit any output because there are no actions and grammar”. There is definitely a grammar… this must mean "there are no actions in the grammar. | 2008-11-12 | ||
123 | TYPO | “There are two tokens in this case:” is followed by a list of three tokens with types 4, 5, and 6. One is a literal ‘+’, but isn’t that still a token? | 2008-11-12 | ||
127 | TYPO | The first sentence about the ASTLabelType option contains “all node variables pointers”, which doesn’t look right. Shouldn’t it be “all node variable pointers”? Or maybe it’s intended to be possessive: “all node variables’ pointers”. | 2008-11-12 | ||
93 | ERROR | The description of Actions says “to get the close curly character, escape it with a backslash”. But there are many examples in the book that use Java or C syntax with brace-enclosed blocks of code (within a brace-enclosed grammar action), and the } characters aren’t escaped. What is the whole story? I suspect that matching braces are ignored without escaping, but how are those inner braces found? (How does ANTLR tokenize to find the braces, when it doesn’t know the target language and so doesn’t know what’s a comment or a string literal?) This should really be explained more fully, so that users know when they really need to escape } characters… which might depend on their target language. | 2008-11-12 | ||
138 | ERROR | “Any rule invoked from the methodDefinition rule can use the boolean instance variable inMethod to test…”. I don’t think this is explained properly, because any rule, not just those invoked from methodDefinition, can test inMethod (I think). Tests in rules invoked from methodDefinition will find inMethod=true, while other tests will find it false, but they can all test it. | 2008-11-12 | ||
182 | ERROR | The rewrite rule for forStat doesn’t reference the statement list slist. It should probably do that, right? | 2008-11-12 | ||
206 | TYPO | The first paragraph of Chap 9 contains “from an internal data structures”. The cardinalities are mismatched :-) It should say “an internal data structure” or “internal data structures”. | 2008-11-12 | ||
209 | TYPO | The last paragraph of section 9.1 has a subject/verb mismatch: it should say “Isolating […] makes sense” instead of “make sense”. | 2008-11-12 | ||
247 | TYPO | The lead-in to the example says “override two methods from BaseRecognizer, displayRecognitionError( ) and getTokenErrorDisplay( )”. However, it looks like getErrorMessage( ) and getTokenErrorDisplay( ) are overridden in the example. Should “displayRecognitionError” be changed to “getErrorMessage” in the lead-in? | 2008-11-12 | ||
247 | TYPO | There is no space separating the second sentence in section 10.3 from the first sentence. It says “… grammar.For …”. | 2008-11-12 | ||
252 | TYPO | The comment in the code says “catch-clauses get replace with this action”. That should be “replaced”. | 2008-11-12 | ||
315 | TYPO | The paragraph beginning “The beauty of this solution is that a syntactic predicates handles …” contains a typo. It should say “a syntactic predicate” (singular) OR remove “a” and change “handles” to “handle”. | 2008-11-12 | ||
270 | ERROR | At the bottom of the page when explaining the big DFA that does the lookahead for the embedded subrule of interfaceDef, the text says that DFA scans until the semicolon or left curly. It is actually left paren (not curly - the paren is the start of the method’s arg list, which disambiguates), or ASSIGN or semicolon (variable def with or without init). | 2008-11-12 | ||
268 | SUGGEST | This page uses “DFA” for the plural of “DFA” several times (I count 5 times). While I realize that the plural of “automaton” is “automata” and not “automatons”, many places elsewhere in the book (including the next page) use “DFAs” for the plural of “DFA”, and I think that that reads better. Anyway, one consistent usage should be chosen. Note that the last plural “DFA” - in footnote 6 - mixes up the plural/singular verb form; it should say “allow” because the subject is plural, as in “Cyclic DFAs allow states to …”. Or it could use “A cyclic DFA allows …” of course. | 2008-11-12 | ||
320 | TYPO | The second paragraph begins with “lThis” which should just be “This”. | 2008-11-12 | ||
320 | TYPO | The third paragraph say “unless the uncovered alternatives is last”. That should be singular “alternative”. | 2008-11-12 | ||
83 | TYPO | Last sentence in Fig 4.2 reads “Rule r should must a single node, not a subtree.” Maybe it should be “should return a single node, …” ? | 2008-11-12 | ||
30 | SUGGEST | The reader is told to type an end-of-file character but the footnote explaining how to type the end-of-file character doesn’t appear till page 66 (in the PDF). Quote from page 30: “Note that you must type the | 2008-11-12 | ||
49 | TYPO | middle of page: You could say that the file has no structure or that the structure is simply “one or more characters.” Should be “zero or more characters.” The comment in the code block of the following page is correct. | 2008-11-12 | ||
215 | ERROR | The code on Page 215 (Paper) for “expr” has a return value (returns [int value]) which doesn’t seem to be necessary, maybe it’s a copy-paste error from the example on page 65 (Paper)? | 2008-11-12 | ||
62 | ERROR | The instruction to compile Test.java, ExprParser.java and ExprLexer.java fails when using the code as distributed from this site, thus: Test.java:28: cannot find symbol This is corrected by comment out the Walking Tree block in Test.java and compiling. Test.java as distributed is appropriate once tree grammar has been written and compiled. Perhaps insert appropriate Test.java code mid page 62? | 2008-11-12 | ||
55 | TYPO | In the upper half of the page, a source code sample is given. There is stated that a grammer such as: multExpr returns [int value] will lead to the Java Code: public int expr() throws … I assume this should be: public int multExpr() throws … | 2008-11-12 | ||
61 | ERROR | The tree printing code throws a NullPointerException woth an empty expression line, buttoken NEWLINE is a valid expr. prog :(stat {System.out.println($stat.tree==null?null or something similar would fix this. | 2008-11-12 | ||
267 | TYPO | “MATCh” in the first chunk of code should be “MATCH”. | 2008-11-12 | ||
33 | ERROR | The example of a program that consumes all characters: file : .+ ; throws a “Lexer is null” exception when run in the ANTLRworks interpreter. A possible alternative is to express it using a lexer line, i.e. capitalize “file”, as in: FILE : .+ ; which the interpreter does accept. | 2008-11-12 | ||
311 | TYPO | “backtracking=true” should read “backtrack=true” | 2008-11-12 | ||
349 | TYPO | “backtracking=true” (twice) should read “backtrack=true” | 2008-11-12 | ||
310 | ERROR | While this is not germane to the ANTLR point discussed there, List<List | 2008-11-12 | ||
83 | SUGGEST | The last sentence on the page is not visible due to the blue border. | 2008-11-12 | ||
44 | TYPO | Minor typo on 2nd paragraph, first line: “ambiguous sentence or phase” I think that should be “phrase”. | 2008-11-12 | ||
135 | TYPO | In the generated code for a(), the “System.out.println(”exiting“);” line should actually be “System.out.println(”after matching rule; before finally“);” per the definition of @after on the preceeding page. | 2008-11-12 | ||
10 | TYPO | All three lines of the export statement should be bold; as is, | 2008-11-12 | ||
160 | 147 | TYPO | This is a minor point, but in the paragraph discussing $ruleRef, I think the references to “$rulename” and “rulename” should be updated to “$ruleRef” instead, for consistency. | 2008-11-12 | |
333 | TYPO | In the anecdote box at the top of the page: “”" Should be “this point OF your program”. | 2008-11-12 | ||
125 | SUGGEST | “This is a good way to distinguish between local variables and fields of a class definition, for example.” I’d say it is a way, but not really a good way to do that. Just five pages earlier a better way, using a scope, is explained. Also, the @after block will be skipped if an exception is thrown so in that case inMethod will be corrupted. inMethod should be set to false in the finally block. | 2008-11-12 | ||
89 | TYPO | “When generating templates, on the other hand, rewrite rules specify the template to create and a set of argument…” should be “When generating templates, on the other hand, rewrite rules specify the template to create a set of argument…” and BTW I would advice you to rewrite that long sentence into shorter ones, makes it more readable (and less error prone :-). | 2008-11-12 | ||
60 | TYPO | “..on page 44 and augment it to build a suitable AST. As you we along..” should be “..on page 44 and augment it to build a suitable AST. As we move along..” | 2008-11-12 | ||
255 | ERROR | The example for the second alternative of the method rule is wrong. The rule args requires that there is at least one argument to a method. A correct example for the second alternative of the method rule would be: int f(int z) {…} | 2008-11-12 | ||
64 | TYPO | Expr.g not produced, ExprLexer.java is produced, using In ‘list of generated files’ | 2008-11-12 | ||
66 | TYPO | Test.java which is the first rule in the grammar. | 2008-11-12 | ||
82 | ERROR | $ java org.antlr.Tool Eval.g Running with 3.1 reports a missing file and does not create the listed files No mention of the .token file from Expr.g? Again the provided code is a mess I noted that ‘expr.g’ was well laid out. | 2008-11-12 | ||
102 | ERROR | Near top, says There appear to be no ‘highlighted executable lines’ | 2008-11-12 | ||
33 | TYPO | Minor typo. Last sentence on page: “When you have ambiguities in other non-determinisms in your grammar…”. I think this should read: “When you have ambiguities and other non-determinisms in your grammar…”? | 2008-11-12 | ||
282 | TYPO | In the end of first paragraph: “assuming type matches matches ‘int’”. I think it should be just “assuming type matches ‘int’”. | 2011-03-05 | ||
274 | TYPO | In the end of second paragraph: “can also be a statements”. I think it should be “statement” (singular) | 2011-03-05 | ||
323 | TYPO | In first paragraph: “… this means syntactic predicates let you use write grammars that ANTLR …” Maybe the sentence should be: “… this means syntactic predicates let you write grammars that ANTLR …” | 2011-03-05 | ||
334 | TYPO | Second paragraph, second paragraph after the code snippet: “It reflects a situation where you want to treat identifiers s and sx differently depending on whether they are followed by an integer” | 2011-03-05 | ||
73 | TYPO | Paragraph 3, sentence 1 - “A grammar describe …” should be “A grammar describes …”. | 2011-03-05 | ||
237 | TYPO | Paragraph 2 and 1st method name in following example code disagree. Should they both be “displayRecognitionError()” or “getErrorMessage(…)”? | 2011-03-05 | ||
312 | TYPO | Paragraph 2 (following 1st diagram): The paragraph begins with a spurious “1”. | 2011-03-05 | ||
81 | SUGGEST | In Figure 4.1, make the “.” bolder. I find I repeatedly miss it, when looking at this table. Also, the utility of this entry as a reference would be improved by refering people to the discussion beginning at the bottom of p.85 on “.*” and “.+”. | 2011-03-05 | added a forward reference to the greedy option; I'm not sure there is much we can do on making that '.' bigger. | |
43 | TYPO | Look at this sentence from that page: | 2011-03-04 | ||
56 | ERROR | The link cited in footnote 12 is no longer valid. | 2011-03-04 | ||
283 | TYPO | About half way down the page, the phrase “but where the semicolon can also be a statements:”, the last word should be singular (“statement”). | 2011-03-05 | ||
289 | TYPO | At end of page, and flowing onto the next, “choose which rule to match upon saying a single-digit such as 4.” has two problems: “saying” should be “seeing,” and the hyphen in “single-digit” shouldn’t be there. | 2011-03-05 | ||
60 | TYPO | Building ASTs with a Grammar, second paragraph, second sentence: As you we along, … | 2011-03-05 | old version | |
265 | ERROR | The example grammar on p. 264 requires at least one token A to occur. Thus, the rewrite on the facing page should be a : A a Or, using EBNF instead of tail recursion a : A+ ; | 2011-03-05 | ||
46 | ERROR | The WS rule in tour/basic/Expr.g includes ‘\ 1+2\ \ \ 4+5 the WS rule eats the newlines between 2 and 4, yielding “missing NEWLINE at u’4” | 2011-03-04 | ||
51 | TYPO | (Footnote) “rule references within alternative” needs more letters. “rule references within an alternative” or “rule references within alternatives”. | 2011-03-04 | ||
167 | TYPO | (Top of page) To be consistent with graph, should read (CLASS T(VARDEF … | 2011-03-05 | ||
167 | TYPO | (Last paragraph) The last of the three clauses in the for statement is referred to as ‘the initializer’. If this is standard Java nomenclature, OK, but I think of the first clause as the initializer and the third as a updater or re-initializer. On first reading, it seemed like this paragraph referred to the first clause, which didn’t make sense when the paragraph said that “the initializer expression is last.” | 2011-03-05 | ||
291 | TYPO | (first sentence) “matches” appears twice, once at end of line and once at beginning. | 2011-03-05 | ||
61 | ERROR | Page 60 states “To specify a tree structure, simple indicate which tokens should be considered operators (subtree roots) and which tokens should be excluded from the tree. Use the ^ and ! token references, respectively.” There is then a code example which shows: Shortly after, “We only need to add AST operators to tokens +, -, *, (, and ).” This appears to be a contradiction. The code example indicates that “(” and “)” should be excluded from the tree, yet we are told that we need to add AST operators to parentheses. Am I misreading, or is this an erratum? | 2011-03-05 | ! is an AST operator, no? it does not say we need to add them to the tree. it says AST operator. :) | |
331 | TYPO | Sentence has two verbs. Should probably be either “use” or “write” ;) | 2011-03-05 | ||
170 | TYPO | Sample code seems not to properly match type with constructor in: | 2011-03-05 | ||
75 | TYPO | Figure 3.2: newline symbol “\ | 2011-03-05 | Well, the printable character is there, but newline of course doesn't show up. As this is the actual output string, it's probably okay to leave that empty box to indicate newline. | |
10 | TYPO | export CLASSPATH=“$CLASSPATH: “foo” is extraneous garbage | 2011-03-04 | old version | |
105 | TYPO | the last part of this page acan’t be seen | 2011-03-05 | old version | |
216 | ERROR | After listing the Test rig, it would help to show it running with some test input data. Also, the ByteCode.stg listing shown on earlier pages does not include the full listing. I downloaded the code to obtain this. Perhaps a note about this would be helpful. | 2011-03-05 | I don't think that we can make these modifications in a reprint because it would mess up the typesetting for the rest of the book to add that text. sorry. | |
83 | TYPO | The description of r^ in Figure 4.2, the last sentence is like this: Rule r should must a single node, not a subtree. My question is: can ‘should must’ be use together? | 2011-03-05 | old version | |
163 | ERROR | the description of ^ in figure 7.1 is not acurate: Next nonsuffixed element’s node or subtree becomes the first child of this root node… It’s not necessay to be the FIRST child, like this case: expr : INT +^ FLOAT; the INT is the first child, not FLOAT, the tree is like this: + DOWN INT FLOAT UP | 2011-03-05 | ||
28 | TYPO | Strange ‘foo’ at end of this: the bash shell, you can do the following: | 2011-03-04 | old version | |
27 | ERROR | wrt Section 1.3, the directions are not even close to correct! Regards | 2011-03-04 | I believe this is user error; we have communicated over e-mail. | |
79 | TYPO | After “We are going to modify the new nib so that it becomes the user interface | 2011-03-05 | wrong book | |
70 | ERROR | In the comments prior to the expr rule, it says that you multiply the results of the two multExpr values when, in fact, you either add or subtract the two multExpr values based on the operator token. | 2011-03-05 | ||
106 | TYPO | In the fourth paragraph, second sentence, it looks like the second appearance of the word “alternatives” should be removed. It currently reads, “Alternatives that are not mutually ambiguous, even in the same block alternatives, do not need syntactic predicates.”. It should read, “Alternatives that are not mutually ambiguous, even in the same block, do not need syntactic predicates.” | 2011-03-05 | ||
159 | TYPO | In the second paragraph, first sentence, the word “implementation” should be plural. It shoud read, “The global dynamic scope mechanism works well for many simple symbol table implementations such as this, …”. | 2011-03-05 | ||
170 | TYPO | MyParser parser = new MParser(tokens,symtab); | |||
29 | SUGGEST | 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: error(150): grammar file T.g has no rules | |||
83 | TYPO | Figure 4.2: r^ (last sentence) Rule r should must a single node, not a subtree. | |||
153 | TYPO | 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 | |||
159 | ERROR | The link in the footnote is broken(page not found). | |||
141 | TYPO | r @init { Token myFirstToken = $start; // do me first } should this not be: | |||
301 | TYPO | Last paragraph, first sentence: | |||
62 | SUGGEST | 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 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. | |||
223 | TYPO | “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!) |