By Developers, For Developers
PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
---|---|---|---|---|---|
20 | TYPO | The link to the StringTemplate site is incomplete, it is missing the .org TLD. | 2009-06-04 | ||
86 | TYPO | The sibling node of fontsize should be 14 and not = | 2009-06-19 | ||
60 | TYPO | The parsers we’re working within this book should be: The parsers we’re working with in this book | 2009-06-19 | ||
63 | TYPO | A more powerful parsing strategy | 2009-06-19 | ||
63 | TYPO | This is precisely | 2009-06-19 | ||
29 | SUGGEST | “Grammar to Recursive-Descent Parser Mapping” is a distactingly bad name, especially for the first pattern. It’s a noun with a six-word adjective, and many different ways of mentally grouping those words: “(Grammar to Recursive-Descent) Parser Mapping”, or “Grammar to (Recursive-Descent Parser Mapping)”. A shorter name would be better: “Grammar drives Parser” or even “Grammar begets Parser”. Or if the current words are required, how about rearrange to: “Mapping of Grammar to Recursive-Descent Parser” | 2009-06-19 | A good idea; switched the title as you suggest. | |
32 | SUGGEST | “To avoid building parse trees…” This mistakenly suggests that somehow at this juncture our objective is to avoid building parse trees. This seems beside the point. The point seems to be more to point out that the call sequence follows the path of what amounts to a parse tree, and consequently we can attach actions to those calls to get work done, if that fits the task at hand. | 2009-06-19 | we are avoiding the construction of parse trees in this case they are a waste of money if all we care about is doing an action upon recognizing some input. I'm not talking about ASTs, I'm talking about parse trees. | |
32 | TYPO | Light gray tone on the X is too light in the PDF | 2009-06-19 | Hmm... looks distinct from the white and the dark gray on my machine; perhaps you are reading the PDF on the beach in bright sunlight? lucky dog. \n \n | |
35 | TYPO | Morse code “dashes” are printed as underscores and all run together. Maybe try M-dashes, or put spaces between the underscores? (Then the intercharacter space will need increase too.) | 2009-06-19 | good point. Changed to dashes. | |
41 | TYPO | 2nd last line: “Lexers are also called a scanner..” plural-singular mismatch | 2009-06-19 | ||
43 | SUGGEST | Implementation section P43-46. EOF_TYPE and EOF appear in a number of places. It would be helpful to provide a mention of what the point is of these two things. Are they different types? Is one a TYPE and the other a character? Why do they both seem to be part of the same series of consts? (p45). | 2009-06-19 | Ah. right. added comments to the code. | |
47 | TYPO | “The parser should attempt the alternative that can start with the current lookahead token.” | 2009-06-19 | I think it should only choose one alternative | |
48 | SUGGEST | “…here is a rule whose parsing decision is deterministic because the single lookahead token uniquely predicts which alternative to choose.” This appears to be saying “this rule is able to make a choice because it is able to make a choice”. Or is there more to it? | 2009-06-19 | Actually, it's possible for a lookahead token to predict more than one alternative. unique prediction implies deterministic. | |
49 | TYPO | “The two alternatives begin with the same ID token.” Probably means “the same token, which is ID.” | 2009-06-19 | ||
51 | SUGGEST | “Next we need…” Suggests that match() does the compare, and consume() does the consuming. However, it turns out that, counter expectations from the function name, match() does a comparison AND consumes. (The code comment does note this.) This is a crucial thing to understand in reading ANTLR-generated source code. | 2009-06-19 | ||
63 | TYPO | “they backtracking” —> the backtracking | 2009-06-19 | ||
18 | ERROR | “Homogeneous nodes represent specific children by position within a list rather than with named node fields. We call that a normalized child list.” | 2009-06-19 | change to start out: "Homogeneous nodes also have to represent..." | |
80 | ERROR | The word “normalized” is used over and over, but not defined. See also page 18 where it seems to be defined probably incorrectly. | 2009-06-19 | I tweaked my earlier description; normalized child list seems to be appropriate use of the adjective normalized. | |
75 | ERROR | Given that Parser.consume() resets the index (p) to 0 when doing an actual (rather than speculative/backtracking parse), the memoize/BacktrackingParser.java should clear entries at the same time. Token indices in list_memo wouldn’t correctly apply to parsing of subsequent input lines. (This doesn’t show up in the example, as only a single line, a single memoization of a ‘list()’ attempt occurs) | 2009-09-01 | Fixed by making consume() call clearMemo(), which subclasses impl. list_memo.clear(), for example. | |
68 | SUGGEST | “The one caveat to action gating is that there are some actions we must execute during backtracking. Tracking variable and method names is critical…” | 2009-06-19 | Actions that must always execute shouldn't have the action gate. \n \n | |
89 | TYPO | We we | 2009-06-19 | Oui, Oui, Monsieur! | |
88 | TYPO | “tale two” —> “take two” | 2009-06-19 | ||
97 | TYPO | “Although there is only a single node data type, we don’t need to use the type system of the implementation language to distinguish between node”. | 2009-06-19 | Yeah, that is a really weird sentence. Deleted the whole thing. | |
116 | TYPO | “It doesn’t worked so well” | 2009-06-19 | ||
116 | TYPO | Table text extends beyond bottom of page, cutting off everything after “ing for patterns, then, we need”. | 2009-06-19 | Yep, they will fix that during layout. | |
123 | ERROR | “This implementation has a number of advantages over an embedded walker.” … and following. | 2009-06-19 | Wow! could catch(es). | |
124 | TYPO | “ANTLR generates ” plural/singular inconsistent | 2009-06-19 | ||
129 | TYPO | “it’s a bit tricky” repeated. | 2009-06-19 | ||
15 | SUGGEST | PDF page 15, last paragraph: “This book identifies ### n common | 2009-06-19 | ||
12 | SUGGEST | Replace photo of Ter insulting Brazilians :-) | 2009-06-19 | ha! | |
16 | SUGGEST | Diagram at top of page 16: | 2009-06-19 | Well, that definition of what an interpreter does doesn't conflict with how it's implemented. In fact, we annotate the IR with symbol table information in the high level interpreter chapter. | |
16 | SUGGEST | A nit on pg 16: yacc is a “parser generator”, but produces neither | 2009-06-19 | changed any other to any similar. | |
14 | SUGGEST | Page 14, Section 1.1 “The big picture” (Big Picture) starts using | 2009-06-19 | Added parenthetical remark. | |
17 | SUGGEST | Awkward sentence: “They include a record of the rules | 2009-06-19 | ||
19 | TYPO | Plural/singular mismatch: “The semantic rules of your language | 2009-06-19 | ||
20 | TYPO | Sentence at top of page - a comma would be helpful: | 2009-06-19 | ||
20 | SUGGEST | Parenthesized phrase to complete sentence: | 2009-06-19 | probably okay as it is; not sure I've seen the parenthetical remark as a complete sentence before. | |
14 | TYPO | I’m not english so I’m not beyond making a mistake, but i think there is a litle mistake when it says : “Finally, we’ll can look…” I’m not sure we can use will + can. | 2009-06-19 | ||
51 | TYPO | “Upon error, we want to thrown exception” should be “Upon error, we want to throw an exception”. | 2009-06-19 | ||
14 | SUGGEST | Same with “phrase” (see #39366) | 2009-06-19 | ||
23 | SUGGEST | Diagram at top of page: label in “Reader” box looks like | 2009-06-19 | I regenerated with a newer version of the visual design tool and the image looks more clear. | |
28 | SUGGEST | A quick note about some of the reasons ‘cfront’ was later abandoned | 2009-06-19 | probably too much to go into; plus, I don't know all the reasons for that particular failure ;) | |
12 | SUGGEST | Associate acronym “DSL” with “Domain Specific Language(s)” | 2009-06-19 | Added to preface and intro and parsing chapters. | |
34 | TYPO | Singular/plural mismatch in second paragraph of section 2.3: | 2009-06-19 | ||
35 | SUGGEST | “Rule expr might look a little funny to you and it should.” -> | 2009-06-19 | ||
36 | TYPO | “Say we want to recognize list of names” -> | 2009-06-19 | ||
36 | SUGGEST | Second to last paragraph: | 2009-06-19 | Actually actually implements them in the same way and it might be a good idea to get the user used to the idea that they are all the same except for what they apply grammatical structure to. | |
38 | SUGGEST | Consider rewording: | 2009-06-19 | ||
38 | TYPO | In “public class G {”: < | 2009-06-19 | ||
38 | SUGGEST | Second to last sentence: This is the first use of the term “subrule”. | 2009-06-19 | added parenthetical remark. | |
40 | TYPO | (Also pg 41) | 2009-06-19 | I think this got fixed when I changed the capitalization of the chapter names. | |
48 | TYPO | Paragraph beginning with “In this case, …” | 2009-06-19 | Yeah, I argued that in the first book but they told me that font was enough to distinguish. | |
50 | TYPO | Last paragraph: “… rather than a token variable.” -> | 2009-06-19 | that's a field not type. | |
52 | TYPO | “… for which we’ll need more a powerful recognition pattern.” -> | 2009-06-19 | ||
53 | TYPO | “There lots of similar situations that occur in real grammars.” -> | 2009-06-19 | ||
55 | TYPO | “… tests the first two tokens lookahead | 2009-06-19 | Thanks for all of these typos, Wayne! | |
59 | TYPO | “… it’s easy to get lost will all of the scanning ahead | 2009-06-19 | ||
59 | SUGGEST | Second to last paragraph, last sentence: | 2009-06-19 | good catch. Added a parenthetical remark. | |
60 | TYPO | “The first alternative will fail, causing a backtracking parser to | 2009-06-19 | ||
63 | SUGGEST | “When to apply” for Pattern 4: | 2009-06-19 | that whole sentence and paragraph was messed up. Fixed. | |
63 | SUGGEST | “When to apply” for Pattern 4: | 2009-06-19 | ||
63 | SUGGEST | Last sentence on the page: It’s not really clear what “these” is referring to - just patterns | 2009-06-19 | Yeah, that was a bit weird. changed the sentence to be "Now, let's learn more about the advanced parsing strategies by jumping \ninto their pattern definitions." | |
66 | SUGGEST | “when backtracking, a parser does not report errors” | 2009-06-19 | ||
66 | SUGGEST | “Our parser can start out with a small fixed buffer size, n. Like | 2009-06-19 | added "The difference is that we need to hold more than (fixed) @eqv k tokens in a backtracking parser. " | |
67 | SUGGEST | (illustrations top of page) | 2009-06-19 | the first image shows what happens when p hits the end of the buffer. the second image shows what happens when p is in the middle. | |
68 | TYPO | (bottom of page) | 2009-06-19 | was trying to provide general information about that function, but I changed to LT(1) | |
73 | SUGGEST | (top of page) | 2009-06-19 | A rule might match nothing; the lasts token index would technically be -1 then. | |
75 | SUGGEST | (code for ‘memoize’ method) | 2009-06-19 | ||
78 | TYPO | (first code sample) | 2009-06-19 | ||
4 | SUGGEST | Chapter titles should use consistent capitalization. | 2009-06-19 | ||
79 | TYPO | (first paragraph) | 2009-06-19 | ||
81 | SUGGEST | (Section 4.1, first paragraph) | 2009-06-19 | "to the park" is a prepositional object. no problem. | |
45 | ERROR | The code (page 45) declares EOF = 0. The text (page 46) reads EOF (–1). I think the text is right. | 2009-06-19 | Changed the source code in the parsing subdirectories | |
97 | TYPO | (code comment at bottom of page) | 2009-06-19 | Yeah, a bad comment. fixed \n \n /** External visitors execute the same action for all nodes \n * with same node type while walking. */ \n \n | |
98 | TYPO | “The following toString() generates trees of the form: (since it was just pointed out that toString() only prints | 2009-06-19 | ||
100 | TYPO | “Track expression type (integer or vector) for each expr nod.” -> | 2009-06-19 | ||
100 | SUGGEST | “if ( exprType !=tINVALID ) {” | 2009-06-19 | ||
100 | SUGGEST | “(exprType==tINTEGER?”tINTEGER“:”tVECTOR“)+”>“;” | 2009-06-19 | ||
100 | SUGGEST | “public class AddNode extends ExprNode { Since “add” is a verb, this class name resembles a method name (e.g., | 2009-06-19 | ||
52 | TYPO | week -> weak In the last line of the Purpose section, “a week underlying parsing strategy” should be “a weak underlying parsing strategy”. | 2009-06-19 | ||
103 | SUGGEST | (code at top of page) Perhaps robustness isn’t a concern, given that this code is for // Parser guarantees both children are either null or non-null (assuming unary plus is a different token type, of course). | 2009-06-19 | It's hard to say how much testing to put in. The test I put in merely avoided a null pointer is a problem; I didn't worry about printing something reasonable upon error. | |
109 | TYPO | ( in body of print(AddNode n) ) | 2009-06-19 | ||
111 | TYPO | (second to last paragraph) | 2009-06-19 | ||
113 | TYPO | ( in body of print(AddNode n) ) | 2009-06-19 | ||
114 | TYPO | “There are number of nice tools …” -> | 2009-06-19 | ||
118 | SUGGEST | System.out.print(token!=null?token.toString():“ (same as comment #39509, pg 100) No spaces, ‘null’ in italic font. | 2009-06-19 | added spaces but I have no control over the font in the code formatter | |
121 | TYPO | “Here is the start of a PrintVisitor with the code for The code is actually for visiting an AssignNode, not | 2009-06-19 | ||
123 | SUGGEST | “This implementation does not need an interface at all and has a | 2009-06-19 | I think the interface is an artifact of an implementation in Java; dynamically typed languages such as Ruby and Python would not need. I believe it is still a double dispatch because we call print by generic node and it gets directed to a print with a specific argument type. | |
6 | TYPO | “… about getting a language up and running fast and we do about | 2009-07-03 | ||
101 | SUGGEST | (towards the top of page) | 2009-07-03 | ||
123 | SUGGEST | “^(‘print’ {print(”print “);} expr) {print(”\ | 2009-07-03 | ||
125 | SUGGEST | (towards the top of page) | 2009-07-03 | ||
128 | SUGGEST | “Wildcard (dot) matches a node or subtree.” | 2009-07-03 | moved back in time. Thanks. | |
130 | TYPO | (top of page) | 2009-07-03 | ||
130 | TYPO | (middle of page) | 2009-07-03 | ||
131 | SUGGEST | (output from running ‘java Test2 < u1’) | 2009-07-03 | ||
222 | TYPO | Text is incomplete; after the table the text continues with “an intermediate…” | 2009-07-03 | I think this was due to a build problem. | |
37 | SUGGEST | Extra whitespace & sentence fragment: | 2009-07-03 | Yeah, build error. sorry about that. | |
16 | SUGGEST | Still confused by the “or” in the ‘Semantic Analyzer’ box. I take Feel free to disregard if you think I’m being too literal here. (I | 2009-07-03 | Yeah, I think perhaps it's a bit too literal to worry about, the lots of us programmers are literal. Not sure how to fix anyway ;) | |
134 | TYPO | “… here’s the class that represents represents built-in types like | 2009-07-03 | ||
136 | TYPO | “To represent a scope, we’ll us an interface” -> | 2009-07-03 | ||
142 | TYPO | Just below the first paragraph, the words “flat scope” appear by themselves. | 2009-07-03 | ||
145 | TYPO | The text preceding the ‘varDeclaration’ rule refers to it by a different name (‘localDeclaration’). | 2009-07-03 | ||
145 | SUGGEST | “Upon: Variable declaration x: Though implied in the preceding description of Cymbol, it may be | 2009-07-03 | ||
148 | SUGGEST | (code example towards the bottom of page) | 2009-07-03 | Added a common to the code. | |
149 | SUGGEST | [Download symtab/monolithic/Cymbol.g] You’d have to download the code to see where the rule ‘primary’ | 2009-07-03 | Not sure I know what you mean. The label on the code snippet identifies it from the correct file and the rule appears directly in the book. You mean who references it? | |
151 | TYPO | “We’ll need to more Symbol subclasses to handle …” -> | 2009-07-03 | ||
152 | SUGGEST | “Upon/Action(s)” table: | 2009-07-03 | ||
152 | SUGGEST | “… ref float, def f, push f, ref int, def x, …” -> This is how the function scope of f is referred to in the next | 2009-07-03 | ||
152 | TYPO | “… def x, ref floatdef y, push local scope of f, …” -> | 2009-07-03 | ||
153 | TYPO | (bottom of page) | 2009-07-03 | ||
153 | SUGGEST | (bottom of page) Parenthetical complete sentences which are not internal to an The paragraph after this one (pg 154) also has a couple of cases of | 2009-07-03 | Thanks... I will try to remember this pattern fix others that I find. | |
156 | SUGGEST | (code sample at bottom of page) | 2009-07-03 | ||
157 | TYPO | (top of page) | 2009-07-03 | ||
157 | SUGGEST | (second to last line of Test output) | 2009-07-03 | yikes. you're right. Thanks for catching. fixed the toString method. | |
0 | TYPO | Reminder: In backtracking parser pattern, use speculate / backtrack term properly. | 2009-09-06 | ||
7 | TYPO | Preface: “If you’ve have done some work…” | 2009-07-03 | ||
34 | TYPO | Second sentence on the page reads “To distinguish what kind statement is coming down the road […]”. It is missing the word “of” between “kind” and “statement”. | 2009-07-03 | ||
162 | TYPO | (first paragraph) | 2009-07-03 | ||
163 | SUGGEST | (last paragraph) Suggest a parenthetical remark or footnote to point out that this | 2009-07-03 | excellent point | |
17 | SUGGEST | To the degree that the book targets non-specialists, it may be helpful to say more about what sentences mean in this context. You mentioned the term in the introduction without much clarification and it appears again here. “Sentence” and “phrase” are great shorthand if the reader knows the longhand. | 2009-07-03 | Added a parenthetical comment at the start about sentences being composed of phrases. | |
18 | TYPO | Do you mean “translators and the like” or “translators and their ilk”? “Translators and the ilk” seems wrong. | 2009-07-03 | ||
18 | TYPO | (End of page) The semicolon terminating the example statement disappears when the reader considers the tree, possibly leading to confusion. The example works fine without the confusing semicolon in the text. | 2009-07-03 | Unfortunately, it's not a valid statement without;. The primary issue is that the style of the book is quotes or anything around code examples \nIn line in the text. This causes some confusion when code samples use punctuation. | |
19 | TYPO | The phrase “To parse trees” near the end of the page threw me off (modifier attachment ambiguity). I read “parse trees” rather than “to parse.” I’d suggest “To traverse parse trees …” | 2009-07-03 | ||
23 | SUGGEST | The best way to do ANYTHING is to work backwards — to “start with the end in mind.” :-) | 2009-07-03 | ||
26 | SUGGEST | In bug finder part deux, it would be great to connect the dots for the reader back to the source file. Seeing that “#2” is duplicated doesn’t say which expression in the source is at fault. The reader may wonder how to get back to this information. (These examples are great, btw). | 2009-07-03 | I was trying to make it explicit back to the source code with the comments. plus, the source code is one line that method so the bytecodes have to refer to that one line. | |
32 | SUGGEST | It may confuse the reader to see both a relational expression (x<0) and an integer (0) classified as an expression at this point in the evolving plot of the book. | 2009-07-03 | I'm guessing that programmers will understand that expressions can be as simple as integer constants. | |
31 | SUGGEST | You draw the analogy to parts of speech in natural language. It would be helpful to include a figure like 2.1 (or the inline ones) for a short English sentence, including both the “sentence diagram” and tree structures. | 2009-07-03 | I can see that being a good idea; though, at this point, I'm quickly approaching my page count wall...unless you think it's critical, I'll probably save that quarter page. | |
33 | SUGGEST | The notion of a 2D structure appears at the top of the page without much motivation. It’s not revisited again until p.83, where it helps understanding. Maybe provide a cross reference to p.83? Not mention 2D structure on p.33? Give a little more context on p.33? | 2009-07-03 | ||
33 | SUGGEST | Related to earlier comments about sentences and phrases, section 2.2 starts off with a brief mention of what a language is. I’m imagining a one-stop section earlier in the book that informally discusses these formal terms. Maybe one of those sidebar boxes that appear so frequently in Prag Prog titles? Cross references back to this discussion as appropropriate would be helpful for newbies. | 2009-07-03 | ||
36 | TYPO | Opening of section 2.4. Lose the “clearly” | 2009-07-03 | ||
39 | SUGGEST | (Top of page). Calling a grammer “terse” seems almost pejorative. Concise? Compact? Clear? | 2009-07-03 | made it concise. | |
40 | SUGGEST | Under “Converting Rules,” the phrase “rule embedded within another rule surrounded by parens” is confusing. There needs to be an earlier definition of this syntactic convention. | 2009-07-03 | ||
42 | SUGGEST | You assume the reader is familiar with the ()?, ()*, and ()+ subrules. Is this the page that is intended to introduce those types of subrules? It would be helpful to have introduced these constructs (including parents, Kleene thingies, alternation, etc.) earlier. | 2009-07-03 | should be okay as I use and explain them in 2.4 Tokenizing sentences | |
165 | TYPO | “… but there are number of ways to implement the actions.” -> | 2009-07-03 | ||
165 | SUGGEST | “If you want, you can leave the sample implementation until Not sure I understand this. Are you saying the following is | 2009-07-03 | ||
165 | SUGGEST | “You can look at Cymbol.g in the source code directory to look at the | 2009-07-03 | ||
166 | TYPO | (bottom of page) | 2009-07-03 | ||
170 | TYPO | (first paragraph) | 2009-07-03 | ||
170 | SUGGEST | “Related patterns” Doesn’t pattern 19 build on Pattern 18 (as well as 17) ? | 2009-07-03 | ||
170 | TYPO | “Object-oriented languages like Cymbol also support forward references | 2009-07-03 | ||
171 | TYPO | “The logical place to stash information is an AST representation of | 2009-07-03 | ||
175 | TYPO | (Class declaration C) | 2009-07-03 | ||
175 | TYPO | (Method declaration f) | 2009-07-03 | ||
175 | TYPO | (bottom of page) | 2009-07-03 | ||
44 | TYPO | The sentence (mid-page) “To use this lexer pattern, we create an instance of a lexer an input string or stream reader” seems to be missing something. “… a lexer AND an input string …?” | 2009-07-03 | ||
44 | SUGGEST | (Bottom of page) Need to say what a “test rig” is. | 2009-07-03 | ||
175 | TYPO | (Variable reference x) | 2009-07-03 | ||
176 | TYPO | (fig. 7.10 caption) | 2009-07-03 | ||
178 | SUGGEST | (the two methods: ‘public Scope getParentScope()’) | 2009-07-03 | ||
179 | TYPO | (comments in ‘enterClass’ action code) | 2009-07-03 | ||
179 | TYPO | “… it doubly links the class names ID AST node with the …” -> | 2009-07-03 | ||
180 | TYPO | “These the dashed lines pointing at the int symbol … ” -> | 2009-07-03 | ||
180 | TYPO | (bottom of page) Full parse of subtrees within the pattern matching - very cool | 2009-07-03 | ||
183 | SUGGEST | (inherit.cymbol code) | 2009-07-03 | ||
184 | SUGGEST | (summary of chapters/patterns) | 2009-07-03 | Not sure I can do that easily or briefly... \n thanks for all of these comments! | |
139 | TYPO | we’ll us an interface should be we’ll use an interface | 2009-07-03 | ||
82 | TYPO | (Near top) Should read “recognizing English phrase” should read “recognizing the English phrase.” | 2009-07-03 | ||
109 | TYPO | Bogus comment opener in first public void walk() | 2009-07-03 | ||
191 | SUGGEST | (semantics/types/Types.g: @after rule) | 2009-07-27 | ||
193 | TYPO | (first paragraph) | 2009-07-27 | ||
193 | SUGGEST | “public Type arrayIndex(CymbolAST id, CymbolAST index) {” | 2009-07-27 | Because some language might do something with the index; just being general. | |
194 | SUGGEST | (Test.java) | 2009-07-27 | ||
204 | TYPO | (second paragraph) | 2009-07-27 | ||
195 | SUGGEST | (semantics/types/Test.java - showTypes method) | 2009-07-27 | ||
199 | SUGGEST | “The next section describes exactly how functions ‘resultType’ and But in the next section ‘promoteFromTo’ appears nowhere as a function, | 2009-07-27 | ||
65 | TYPO | “… calling them Parser Expression Grammars (PEGs) ‘Parsing | 2009-07-27 | ||
199 | TYPO | (first paragraph) | 2009-07-27 | ||
199 | TYPO | “… the tables make it really easy see the valid operand types and | 2009-07-27 | ||
84 | TYPO | “Computers only cares about operators and operands.” -> “Computers only care about operators and operands.” (Near the bottom of the page.) | 2009-07-27 | ||
213 | TYPO | “Let’s assume P p; and Q q.” -> | 2009-07-27 | ||
213 | TYPO | “… to the Cymbol language we’ve used throughout this chapter (we’ve | 2009-07-27 | ||
213 | TYPO | “This way, the definition and type safety tree passes don’t have to | 2009-07-27 | ||
215 | TYPO | “The following method answers whether we can copy a pointer | 2009-07-27 | ||
215 | TYPO | (semantics/oo/PointerType.java: javadoc comment for ‘canAssignTo’) | 2009-07-27 | ||
215 | SUGGEST | (code comment at bottom of page) I’m confused by the above comment. Given int *p; int *q; (C) then: so shouldn’t comment be something more like: | 2009-07-27 | Nope. I'm actually doing pointer assignment there not showing a condition. | |
218 | TYPO | (bottom of page) | 2009-07-27 | ||
219 | TYPO | “So far, we’ve learned how recognize sentences, construct AST …” -> | 2009-07-27 | ||
43 | TYPO | Lexers are also called a scanners, lexical analyzers, or tokenizers. -> Lexers are also called scanners, lexical analyzers, or tokenizers. | 2009-07-27 | ||
61 | TYPO | Memoizing allows us to skip the second parse of list. -> “Memorizing” allows us to skip the second parse of list. | 2009-07-27 | actually, it's really memoizing ;) | |
138 | TYPO | (last paragraph) “The fields in a C struct are visible …” | 2009-07-27 | ||
140 | TYPO | Second paragraph, “As we exit a scope, we pop it off the stack…” Parallel construction with “push it on the stack.” | 2009-07-27 | ||
140 | SUGGEST | In the scope stack diagram, depth = 1 is labeled on the left with “function f,” but the two stacks on the right show scope for function g. | 2009-07-27 | ||
140 | TYPO | Comment on function g refers to function f (copy-paste typo). | 2009-07-27 | ||
143 | TYPO | (paragraph 4) “see two different scopes stacks” scopes -> scope. | 2009-07-27 | ||
143 | SUGGEST | The final comment in the resolve function is misleading. By the time the recursion “tops out” (?) there is no scope above. | 2009-07-27 | ||
226 | SUGGEST | “… a sequence of instructions followed by a period (whitespace is I believe newline (‘\ struct A {x, y} | 2009-07-27 | ||
220 | SUGGEST | “High-level interpreters directly execute source code instructions or | 2009-07-27 | ||
223 | TYPO | “In the next section, we’ll figure out what kind of symbol table we | 2009-07-27 | ||
225 | SUGGEST | “The processor for Pattern 25, Tree-based interpreter, Suggest some context for the reference to Pattern 13, perhaps: "The processor for Pattern 25, Tree-based interpreter, on page 239 is | 2009-07-27 | ||
117 | TYPO | To walk the entire tree looking for patterns, then, we need … This sentence is cut off and not completed on the following page. | 2009-07-27 | That's something we have to fixed during layout. | |
251 | ERROR | (near bottom) The text says “bytecode and up to three parameters,” but the definition shows operands [1 ..n]. How about the following? op [operand1 [operand2 [operand3]]] | 2009-07-27 | Hi Tom, yeah I thought about that but I figured that was more confusing. | |
253 | TYPO | (near bottom) “access any element in the register array where is a stack” should read “…array whereas a stack” | 2009-07-27 | ||
254 | SUGGEST | For consistency, both “case BR” and “case ICONST” should have a final “break” (or neither should). | 2009-07-27 | ||
256 | ERROR | In figure 10.2, it looks like the entries in the constant pool are backwards. The disassembly has the string at location #0, but the diagram shows it at location #1. Similarly for the function info. | 2009-07-27 | Yikes! good catch! | |
257 | ERROR | In figure 10.3, the indexes into the constant pool are goofy. Why does CALL #0 point to constant pool entry #1? I must be mussing something here. | 2009-07-27 | doh! | |
264 | TYPO | (second last paragraph) “an associated obsession” ?? (last paragraph) “table” and “management” are run together. | 2009-07-27 | ||
276 | TYPO | (figure 10.7) register subscripts wrong for all three groups of ternary instructions: “rk = rj op rj” should be “rk = ri op rj” | 2009-07-27 | ||
276 | TYPO | (last paragraph) What is ‘@kw’? Also on p. 277. | 2009-07-27 | ||
278 | TYPO | (first sentence) “array then we can” -> “array that we can” | 2009-07-27 | ||
279 | SUGGEST | (figure 10.8) Individual instructions are run together. At fist glance, “fload ri , rj , nfstore ri , rj , n” looked liked there was an “fload” instruction and an “nfstore” instruction. Here and in other instruction figures, there needs to be more separation between instructions - each on separate row? Semicolons between? Couple of quads of space? | 2009-07-27 | Yep, already a hidden note to typesetter in there. \n | |
98 | ERROR | “To implement Pattern 10, Normalized Heterogeneous AST, on There is no need to copy and paste common part of the struct. Following technique can be used: struct AST struct ExprNode ExprNode* can be safely converted to AST*, because AST struct is the first member of ExprNode: AST* createAST(Token* token) AST* createExprNode(Token* token) void visitAST(AST* ast) if(ast visitAST(ast->children); // continue with children list This is widely used and I suppose the same approach was used by first C to C translator, before C compilers were created. | 2009-07-27 | Good point. tweaked my comment. | |
227 | TYPO | “Everything happens in the parser because a source-level interpreter | 2009-07-27 | ||
231 | SUGGEST | (bottom of page) Since there are no classes in Pie, it is probably best to stick | 2009-07-27 | ||
233 | TYPO | “Since there is no scope tree, we don’t interconnect these objects all.” -> | 2009-07-27 | ||
234 | TYPO | “… needs three things: the name, the formal list of parameters | 2009-07-27 | ||
237 | TYPO | “Then we assign the actual parameters to the formal parameter | 2009-07-27 | ||
238 | SUGGEST | “You can ignore the warning message from ANTLR; it’s the standard Suggest inserting a reference to the relevant section in [Par07] for | 2009-07-27 | ||
240 | TYPO | (bottom of page, top of pg 241) | 2009-07-27 | ||
244 | TYPO | “To call function we first grab the function name …” -> | 2009-07-27 | ||
246 | TYPO | “They are not too hard to build and very flexible (we can add new | 2009-07-27 | ||
247 | TYPO | “Then, we can execute those bytecodes on an efficient interpreter | 2009-07-27 | ||
247 | TYPO | “Bytecode interpreters have a number of useful characteristics | 2009-07-27 | ||
249 | TYPO | “… in a register-based interpreter (we can assume there are | 2009-07-27 | ||
249 | SUGGEST | “… works like the old HP calculators that used Reverse Polish | 2009-07-27 | ||
250 | TYPO | “… languages like Python so we’d use generic …” -> | 2009-07-27 | ||
249 | SUGGEST | Suggest quick note somewhere that semicolon ‘;’ thru EOL is a comment | 2009-07-27 | ||
254 | SUGGEST | “If the instruction has an operand (which is always right next to the Exception: the BR instruction, immediately preceding this paragraph, | 2009-07-27 | It's an optimization to avoid bumping the IP right before I set it to the branch address :) | |
257 | TYPO | (Figure 10.3) | 2009-07-27 | ||
258 | TYPO | “The stacks grow to the right and indicates the state before each | 2009-07-27 | ||
258 | TYPO | “Unfortunately, there’s a lot more going on in a general-purpose | 2009-07-27 | ||
258 | TYPO | “The next section gives you a taste of what’s involved in building in | 2009-07-27 | ||
224 | TYPO | it’s easy to confuse resolving a variable with loading it value -> it’s easy to confuse resolving a variable with loading its value | 2009-07-27 | ||
258 | SUGGEST | “Knowledge of computer architecture such as cache memory and CPU | 2009-07-27 | ||
259 | TYPO | “… squeeze every last drop of efficiency out the phone’s ARM8 CPU | 2009-07-27 | ||
259 | TYPO | “The Dalvik VM executes many fewer instructions to achieve the same | 2009-07-27 | ||
259 | TYPO | “… but you can learn more by looking at the Dalvik VM source code (you | 2009-07-27 | ||
260 | TYPO | (Pattern 27 - “When to apply”) | 2009-07-27 | ||
262 | TYPO | “We can isolate the method implementations in a subclass (this is a | 2009-07-27 | ||
262 | TYPO | “We can store characters as integers, but we have to store strings, | 2009-07-27 | ||
269 | TYPO | “… object array field, parameters first call knows how much | 2009-07-27 | ||
269 | TYPO | (Figure 10.5: Stack-based general bytecode instructions) Also, I found the use of ‘f’ for both “function” and “field” in this | 2009-07-27 | ||
269 | TYPO | (bottom of page; code comment) | 2009-07-27 | ||
271 | TYPO | (second to last paragraph) | 2009-07-27 | ||
273 | ERROR | (code for INSTR_FADD) In particular here’s the discussion on pg 255: “The float type in Java is 32 bits and could fit in code memory no | 2009-07-27 | ||
276 | TYPO | (Figure 10.7: Register-based arithmetic bytecode instructions) | 2009-07-27 | ||
276 | TYPO | “That image shows the registers for a function definition with p In that case the final r subscript in image above this should be | 2009-07-27 | ||
278 | TYPO | (code in function f()) | 2009-07-27 | ||
279 | SUGGEST | (Figure 10.8: Register-based general bytecode instructions) | 2009-07-27 | ||
280 | TYPO | (Figure 10.9: Register transfers and state of call stack at ret in g()) | 2009-07-27 | good catch! | |
281 | TYPO | (comment in code for call()) | 2009-07-27 | ||
91 | ERROR | The production for expr is expr returns [AST tr] // expr returns a subtree I believe the first argument to AddNode should be $tr. Otherwise, “1 + 2 + 3” would result in the same tree as “1 + 3”. | 2009-08-05 | good catch! | |
64 | TYPO | In ‘When to apply’ column for Pattern 4: “You don’t need to factor the parser as much to suit weaker parsing decisions” | 2009-08-05 | Well, it could be both. :) Might need to factor parser to suit LL(1) or whatever. | |
68 | SUGGEST | Application-specific parser actions can have side effects we can’t undo like “launch missiles.” | 2009-08-05 | It's a standard 'side effect' from func. lang world :) | |
84 | SUGGEST | “It turns out we need to know what kind of statement we fed in, just not what the grammar calls it. We can drop it” | 2009-08-05 | good. yep. | |
0 | SUGGEST | For the lazy reader, like me, it would be nice to have the pattern numbers prefix the relevant sections in the table of contents (e.g. as viewed in the sidebar of Preview) | 2009-09-06 | Hi. i'm pretty sure they do now. | |
20 | TYPO | Word “languages” is repeated: For non- | 2009-08-05 | ||
230 | TYPO | “to switch interpreter actions on off in the parser” should be “to switch interpreter actions on and off in the parser”. | 2009-08-05 | ||
99 | ERROR | For safety, AST.getNodeType should check for token == null | 2009-08-05 | trying to be terse ;) | |
99 | ERROR | Pedantry I know, but… AST.toString should check for null token In AST.toStringTree the condition children != null in the for loop is redundant because this was checked at the start of the method. | 2009-08-05 | added. \nremoved. | |
140 | TYPO | The comment for variable j refers to i (as the comment to function g refers to f: Í { int j; } // define variable i in another nested local scope | 2009-08-05 | ||
287 | SUGGEST | (Second to last line) “only one deep” begs for a unit; “one level deep?” | 2009-08-18 | ||
288 | TYPO | (End of first paragraph in 11.2) “ANTL-RMorph” breaks badly across lines. | 2009-08-24 | Hopefully, the editor will catch that. | |
309 | SUGGEST | (end of page) Bad page break — example table continues two pages later, following figures 11.9 and 11.10. | 2009-12-07 | layout should find this. | |
311 | SUGGEST | (first text paragraph) Although “unmolested” is great slang, it might be offensive to some readers; “unchanged” is clear and not emotionally charged. | 2009-08-18 | ||
311 | TYPO | (first paragraph after “Defining the translation rules”) “A grammar” doesn’t need the capital “A” after a colon | 2009-08-18 | ||
311 | SUGGEST | The word “tail” is kind of ambiguous. It’s used to refer to the trailer of the overall document and its a fragment rule that snags the tail of the line. I’d suggest renaming the tail() function to trailer(). This would also be consistent with the description in the third-last paragraph and makes nice parallelism with header(). | 2009-08-18 | ||
314 | ERROR | (TABLE fragment) As defined, does this allow a row to start on the same line as one that starts with two dashes? It seems like the pattern should be (‘\ | 2009-08-18 | ||
314 | SUGGEST | This is the only place in the book that uses LA() explicitly. Based on the recent antlr-interest posting regarding parsing Perl regular expressions, where the author went kind of nuts with this, is a brief caveat in order here? | 2009-08-18 | Possibly...to error on the side of terseness though, I'll leave it as is. | |
294 | SUGGEST | (first paragraph) I suspect that “using Jasmin, a Pattern 26, Bytecode Assembler” resulted from the use of Prag Prog’s “excellent proprietary DSL” as extended. But when it’s expanded in print, it reads awkwardly. Maybe “using Jasmin, which employs Pattern 26, …” or something like that. | 2009-08-18 | ||
315 | TYPO | The pattern’s purpose statement has an extra full stop. | 2009-08-18 | ||
317 | TYPO | (second last paragraph) Feels like “DSL” should be “DSLs” | 2009-08-18 | ||
118 | TYPO | Table too large to fit on page. Bad page break on previous page — too much white space. | 2009-08-18 | Yup, the typesetting pass will have to take care this. | |
286 | TYPO | (second paragraph, first sentence) | 2009-08-18 | ||
50 | SUGGEST | There is an example saying: So, let’s add some other rules that invoke optional_init: The “func_call” rule doesn’t seem to apply to anything in this page. Not sure if it should be there. | 2009-08-24 | ||
323 | TYPO | (second last paragraph) “(ST)” doesn’t need the parens. | 2009-08-24 | ||
326 | TYPO | In the example for conditional includes, it doesn’t seem like “ | 2009-08-24 | yikes! | |
327 | TYPO | (beginning of second paragraph) Insert “is” in “A template hierarchy | 2009-08-24 | ||
328 | TYPO | (end of page) “from->to” makes a bad break across pages | 2009-12-07 | layout should find this | |
333 | TYPO | (second last paragraph) “and inserts | 2009-08-24 | ||
338 | TYPO | (paragraph following operator(o), third last line) “the parser create | 2009-08-24 | ||
228 | TYPO | Sample code on the previous page does not match Figure 9.2. Figure 9.2 member ‘a’ should point to 1st StructInstance box and member ‘b’ the 2nd StructInstance | 2009-08-24 | ||
340 | TYPO | (first text paragraph) “… hide any x arguments of the same | 2009-08-24 | ||
341 | SUGGEST | (last paragraph of 12.5) “… build an object-relational database mapping.” The word “mapping” sounds strange here; although it will do mapping, what’s built is more like a “mapper” or a “mapping engine” or something. | 2009-08-24 | added tool. | |
342 | ERROR | Why isn’t the ID of the Person table set to use AUTO_INCREMENT as is the Person_roles table? | 2009-08-24 | 'cause we're going to manually set it; sometimes this is easier than asking the database for the row ID it just added. \n | |
344 | TYPO | (last sentence) “then includes subordinate tables…” rather than “then includes subordinate tables…” | 2009-08-24 | ||
345 | TYPO | (first sentence of “Java objects” box) “… figure out where how to get information …” | 2009-08-24 | ||
328 | TYPO | Second line from bottom of page: “It’ll teaches the basics…” | 2009-08-24 | ||
103 | TYPO | Missing the “TO” in: In order print out a tree using a text-based encoding… | 2009-08-24 | ||
103 | TYPO | In this part: The following toString( ) generates strings of the form: (root child1 child2 …) It seems this should be the toStringTree(), and not the toString(). | 2009-08-24 | ||
121 | SUGGEST | Can’t read the text at the end of this page. The text goes below the footer. | 2009-08-24 | ||
Cover | SUGGEST | I feel that the title of the book is misleading. The content of the book is about Language Implementation Patterns. It explains the various tricks you can use to implement DSLs. From the title I expected the content to be about designing languages. What kinds of syntaxes and structures are most effective for various purposes? When is it a good idea to include typing? What are various alternatives and tradeoffs for specifying types? What might a configuration language look like, or a custom scripting language, or some document description language? I would think that Terence would have a wealth of experience designing a variety of types of languages, and that was the experience I was hoping to consume in this book. So while the title of the book is compelling, I feel that it’s misleading as-is. I don’t know what’s involved with changing the title of a book that’s already at this stage, but I worry that this title will hit the wrong audience and miss the intended audience. | 2009-08-24 | Agreed. it's a bit misleading because we're missing that implementation adjective. Unfortunately it ends up being a terrible title so we left it as the three word title and hoped people would look at the abstract and so on. Yeah, I struggled with this, believe me. \n | |
345 | TYPO | (second paragraph of main text) template name is wrong, should be objectTables instead of objectTable | 2009-08-24 | ||
344 | ERROR | As on page 342, if AUTO_INCREMENT is desired, this ST needs to change. | 2009-08-24 | ||
349 | TYPO | (near middle of page) “The main program decides which target | 2009-08-24 | ||
350 | TYPO | (second text paragraph) “… little bit of Java code common …” doesn’t read well. Do you mean “… of common Java code …” ?? | 2009-08-24 | ||
4 | ERROR | Enforcing Static Typing Rules | 2009-08-24 | it should enforce that there are no indexes out of bounds, right? | |
317 | SUGGEST | “Syntax {«expr»}? is a semantic predicate that … ” -> | 2009-08-24 | ||
321 | SUGGEST | (top of page) | 2009-08-24 | ||
321 | ERROR | (code samples) for (Column c : columns) { for (String a : attrs) { | 2009-08-24 | yikes! you're right! | |
326 | SUGGEST | (top of page) | 2009-08-24 | ||
38 | TYPO | expr definition should read | 2009-09-06 | ||
328 | TYPO | (top of page) | 2009-09-06 | ||
328 | SUGGEST | “… and inject attributes in any order we want without fear I think there’s a pill for that problem ;^) | 2009-09-06 | lol ;) | |
331 | TYPO | “Piecing together a string buffer isn’t the most flexible solution | 2009-09-06 | ||
332 | SUGGEST | “DOT needs different tree nodes to have unique names. If we have two It would be nice if the example contained an illustration of the (VAR int x (+ 3 3)): “If we have two ‘three’ nodes in the tree …” | 2009-09-06 | good point. updated image and disc. | |
334 | TYPO | “void f(int *a, int *x) { // ‘int a[]’ becomes ‘int *a’” but “int x” should not become “int *x” | 2009-09-06 | yikes! bug in code. fixed. | |
336 | TYPO | “In this case, it sets attribute decls to the list but the grammar fragment above calls the attribute “-> file(defs={$d})” | 2009-09-06 | ||
338 | SUGGEST | (top of page) why using “%operator” here and not just “operator” ? | 2009-09-06 | %operator creates an ST instance. | |
65 | TYPO | I think there’s a missing “the” before “expression” in this: In C, expression T (6) is either a function call… | 2009-09-06 | ||
71 | SUGGEST | I’d go for “such as” and not “like” in: …side effects we can’t undo like “launch missiles.” | 2009-09-06 | ||
26 | SUGGEST | What you call a “fetch-execute-cycle” I think is more often called a “fetch-decode-execute cycle.” | 2009-09-06 | thanks | |
31 | SUGGEST | In addition to, or maybe even instead of, the venerable dragon book, these days I’d recommend the pair: Appel’s Modern Compiler Implementation in Java (also available in other language flavors) and Muchnick’s book Advanced Compiler Design and Implementation. | 2009-09-06 | ||
37 | SUGGEST | In regard to the following: “Descent” refers to its top-down nature and “recursive” That definition is itself a bit recursive. If you don’t want to assume the reader knows what that means (unclear to me) then maybe say something like, “…refers to the fact that its functions potentially call themselves” or something along those lines. | 2009-09-06 | ||
38 | ERROR | In the code example, the first comment uses the number 1, but everything else in the code refers to 0. But the text above also refers to 1. Probably a good idea to make it all consistent. | 2009-09-06 | good point. | |
53 | SUGGEST | I dunno if I’d use the word “grok.” I think I’d go for the less Heinleiny turn of phrase “fully understand.” | 2009-09-06 | ||
64 | SUGGEST | With regard to this: we have to squirrel away (memoize) the result of Since “memoize” is effectively being defined here, it’s weird that the term itself lands in parentheses. I’d say something like, “…we have to memoize — that is, squirrel away — the result…” | 2009-09-06 | ||
81 | TYPO | “For example, the GCC C compiler, adds a number of extensions beyond C.” I think that second comma is superfluous. | 2009-09-06 | ||
84 | TYPO | “That means we have to verify it syntax and | 2009-09-06 | ||
342 | SUGGEST | “The basic idea in an object-to-relational database is to map classes | 2009-09-06 | ||
342 | TYPO | “… has two roles (mgr and coder) and no vacation (there’s no entry | 2009-09-06 | ||
344 | TYPO | “… we can stuff it into the overall objectTable template via method | 2009-09-06 | ||
348 | TYPO | (second to last paragraph) | 2009-09-06 | ||
349 | SUGGEST | (top of page) Why no ellipses (as w/ ‘call’ at top of pg. 340)? ; e.g.: (Same w/ “<serializerClass()>”) | 2009-09-06 | added code comment to explain \n \n// objectTables defines no args; no need for ... parameter \n | |
349 | SUGGEST | “which target to generate according to the commandline argument | 2009-09-06 | ||
350 | TYPO | “Method filterFields() is the same as before except that computes | 2009-09-06 | ||
351 | TYPO | “Now it’s time to figure out how to create the template hierarchy for Noun vs. verb inconsistency between “serializeR” and | 2009-09-06 | ||
352 | TYPO | “The <! … !> comment is an ST comment inside the template that | 2009-09-06 | ||
353 | SUGGEST | (top of page) | 2009-09-06 | ||
356 | TYPO | “We nearing the end of our adventure.” -> | 2009-09-06 | ||
357 | TYPO | (bottom of page) | 2009-09-06 | ||
357 | SUGGEST | (chapter title) | 2009-09-06 | ||
358 | SUGGEST | (first paragraph) Searls, David B., “The language of genes”, | 2009-09-06 | ||
364 | SUGGEST | “… BOX described by Merijn de Jonge in ‘Pretty-Printing de Jonge, Merijn, | 2009-09-06 | yep, waiting for publisher to put in bib. already passed on. thanks! | |
364 | TYPO | “For example, I personal use a few versions … ” -> | 2009-09-06 | ||
108 | SUGGEST | You might want to do a search-and-replace of “StringBuffer” with “StringBuilder”. | 2009-09-21 | ||
142 | ERROR | Maybe this is splitting hairs too much, but to the extent that a method is a function, Java does allow functions within functions, when that inner function is defined inside a class. | 2009-09-12 | ||
147 | ERROR | In this: “Method resolve( ) does nothing more than look up «symbol-name» in a hash table dictionary.” A hash table would be an implementation detail. I’d just say “a dictionary.” | 2009-09-21 | ||
19 | TYPO | A minor error, but on page 12 you mention that there are 31 patterns and on page 19 you say there are 28. I just bought this eBook and am excited to read it, it’s exactly what I needed after reading your Definitive ANTLR Reference. | 2009-09-12 | thanks. yep, caught that one a bit earlier. | |
34 | TYPO | Second paragraph, third sentance partially repeats. “Fortunately, it’s not as hard as hard as it seems at first glance” Also, third paragraph, fourth sentance reads: “the most complicated applications need patterns from I, II, and II or I, II, and IV.” That third “II” should probably be “III” | 2009-10-22 | ||
71 | ERROR | Microsoft Research link in the footnote runs off the right side of the page. | 2009-12-07 | ||
86 | TYPO | The very last sentance on this page appears to be half missing. | 2009-10-22 | ||
148 | SUGGEST | The program symbol :: novel character analogy in this section isn’t really fleshed out, which makes the sentence “In a novel, we might have an elf character (the category) called Sri (the name) that becomes a soldier (the type)” seem quite out of place. Doubly so due to the sudden mention of elves. | 2009-10-22 | ||
235 | TYPO | In the parenthetical note “(assuming to language we’re interpreting has functions)” the word “to” is probably meant to be “the”. | 2009-10-22 | ||
EPUB | ERROR | EPUB-Version on iPhone (Stanza) : Chapter 4 page 1 and chapter 5, section “Identifying phase structure”, page 1 - some text is being printed on top of the regular text (“Missing …”) and makes it unreadable | 2009-12-07 | ||
100 | TYPO | $ java cp ../../antlr-3.2.jar org.antlr.Tool Graphics.g should be | 2009-10-22 | ||
120 | TYPO | Grammatical woe in “To obtained a different traversals” | 2009-10-22 | ||
128 | TYPO | “When to apply” section for Tree Pattern matcher seems to abruptly end with “To walk the entire tree look- ing for patterns, then, we need” This appears to actually be a PDF rendering problem, rather than something missing in the source text. | 2009-12-07 | ||
93 | TYPO | The = operator tells us (everthing -> everYthing) we need to know | 2009-10-22 | ||
22 | TYPO | The paragraph starting with “The most basic reader component combines” seems to be split unintendently. | 2009-12-07 | ||
352 | TYPO | as if the key where a property should be (where -> were): as if the key were a property | 2010-04-26 | ||
61 | ERROR | Line too long. Line 7 (… Some programming languages present) protrudes into the right margin. | 2009-12-07 | ||
64 | TYPO | Comma missing in: “…really a maximum not the…”; I suggest: | 2009-12-07 | ||
304 | TYPO | first line: “it’s easier use” should be “it’s easier to use” | 2009-12-07 | ||
132 | TYPO | Wrong brake in ExprN-ode | 2010-04-26 | ||
130 | TYPO | Last entry in table ends with an incomplete sentence. | 2009-12-07 | ||
17 | TYPO | “It’s no fair” (third of the way down the page) should, I think, be “It’s not fair”. unless you’re from Scotland. | 2009-12-07 | ||
221 | ERROR | public Type uminus(CymbolAST a) { The && on the second line above should presumably be a ||, or the == expressions should be changed to != and the outer ! removed. | 2010-04-26 | ||
282 | SUGGEST | In interp/stack/Interpreter.java on p282 of the text, there is the following excerpt: public void exec() throws Exception { This is just sample code, but I thought it worth mentioning because I found it confusing, and that interfered with my absorption of the text. The line “StackFrame f = new StackFrame(mainFunction, ip);” concerns me. I believe the top-level stack frame return address is being implicitly set to 0 (the default initialization value for “int ip”), or even a floating value if exec() is repeatedly called. I believe that implicit in this is the assumption that the assembler for the “main” routine (explicitly declared or starting at instruction 0) must end with “halt”, not “ret”, as ret would dereference the floating ip value in the stack frame to try to return to main’s non-existent caller. If main was implicit (starting at 0) and contains a “ret” this could be an infinite loop. I think it might be worth explicitly replacing the exec() line above with something like // return address guaranteed to be outside code_size to terminate cpu() loop on “ret” Making it MAXINT ensures a “ret” from main will still terminate as then (ip > codeSize), so the cpu() loop will terminate. Even if “ret” from main is illegal in your assembler grammar, this code won’t cause questions to be raised like “what is the value of ip at this point?”. | 2010-04-26 | ||
258 | TYPO | The link fourth link in the footnotes contains whitespace in the URL, after “.puc-”, where there should be no whitespace. | 2010-04-26 | ||
203 | TYPO | This sentence has an extra comma: | 2010-04-26 | ||
264 | TYPO | There is an extra comma that makes the sentence below incorrect. “He described the amazing gymnastics he and the VM team went through to squeeze every last drop of efficiency out of the phone’s ARM, CPU, and flash memory.” I think it should read: “He described the amazing gymnastics he and the VM team went through to squeeze every last drop of efficiency out of the phone’s ARM CPU, and flash memory.” The phone probably has a cpu with an arm instruction set, which dalvik is targetting. It does not have an ARM and a seperate CPU. This of course is my guess. A number of phones have more than one processor. | 2010-04-26 | ||
20 | TYPO | anintermediate (missing a space) | 2010-04-27 | ||
23 | TYPO | buildabstract syntax | 2010-04-27 | ||
xvi | TYPO | First paragraph after “Who Should Read This Book”. “…programming languages.” gets split up into three different lines: first “pro-”, then a newline saying only “gramming” and a new newline saying “languages.” | 2010-04-27 | ||
xviii | TYPO | Second paragraph after “Languages and Tools Used In This Book”. “…we’ll use aparser generator…” should be “…we’ll use a parser generator…” | 2010-04-27 | ||
66 | TYPO | For example, C function definitions and declarations are {. instead of {: | 2010-04-26 | ||
218 | ERROR | or instead of and, right? public Type uminus(CymbolAST a) { public Type uminus(CymbolAST a) { | 2010-04-26 | ||
27 | TYPO | line 5 of first paragraph of Bytecode Interpreter, | 2010-04-27 | ||
29 | TYPO | line 3 of the last paragraph | 2010-04-27 | ||
34 | TYPO | first line | 2010-04-27 | ||
29 | TYPO | The penultimate line | 2010-04-27 | ||
114 | SUGGEST | Just 2 lines of class HeteroAST? It would be better if the full source provided. | 2010-05-06 | ||
212 | ERROR | I was a bit wary of your implementation of getResultType (..), because it promotes arguments to a type based on the result type of the expression. This happens to work for arithmetic expressions, but not for the other two categories, because then always the result type will be boolean. if (2 == ‘2’) … Or am I missing something here? best regards, | 2011-07-12 | Great catch! thanks much. here's a diff. \n \n--- SymbolTable.java\t(revision 99039) \n+++ SymbolTable.java\t(working copy) \n@@ -106,8 +106,8 @@ \n int tb = b.evalType.getTypeIndex(); // type index of right operand \n Type result = typeTable[ta][tb]; // operation result type \n // promote left to right or right to left? \n- a.promoteToType = promoteFromTo[ta][result.getTypeIndex()]; \n- b.promoteToType = promoteFromTo[tb][result.getTypeIndex()]; \n+ a.promoteToType = promoteFromTo[ta][tb]; \n+ b.promoteToType = promoteFromTo[tb][ta]; \n return result; \n } \n // END: getResultType \n | |
14 | TYPO | epub bug: Linked sections in the PDF read as “Section 1.2”, but in the epub they read as “the section 1.2”, which is really jarring when placed after a period. (So the last paragraph on PDF page 14 from the epub format reads: The chapters within the different parts proceed in the order you’d follow to implement a language. the section A Tour of the Patterns describes how all the patterns fit together. ) This problem is all throughout this book, and made reading the epub feel like it was littered full of errors. (I mean, I knew darn well it was just a matter of fixing some processing steps, but it still | 2014-09-16 | I'll have to leave this to the publisher. | |
53 | SUGGEST | Token.java uses ListLexer.tokenNames[type] directly rather than using the ListLexer::getTokenName(int) method provided in ListLexer.java. (Perhaps the tokenNames[] should have been declared private to ask the compiler to enforce the abstraction.) | 2011-07-11 | ||
102 | TYPO | “(which we can ignore it for our purposes here)” should read “(which we can ignore for our purposes here)” (remove the ‘it’) or “(we can ignore it for our purposes here)” (remove the ‘which’). | 2011-07-11 | ||
108 | TYPO | ‘parse tree clearly identifies the parts of speech in sentence the cat runs quickly should read ’parse tree clearly identifies the parts of speech in the sentence the cat runs quickly. (Add ’the’ in front of ‘sentence’.) | 2011-07-11 | ||
130 | SUGGEST | The table showing Patterns vs When to Apply on page 130 of the PDF is useless in the epub version on the Sony PRS-505 reader. (It looks good enough in fbreader though.) Putting it in prose would have been useful. | 2011-07-11 | ||
143 | ERROR | The figures differ between the PDF and epub versions. The PDF is correct, the epub version is incorrect. (The first tree is incorrectly copied from the second tree.) | 2011-07-11 | ||
154 | TYPO | “(a tree of Scope’s)” should be “(a tree of Scopes)” | 2011-07-11 | ||
155 | SUGGEST | I laughed when I saw this: To make things more concrete, here’s an implementation preview: The ‘concrete’ bit is one comment line, one text line, and no supporting code structures such as class LocalScope::LocalScope(LocalScope parent) or something like that. It just seemed funny that a paragraph of prose resorts to 50% commented Java for ’concrete’ness but lacks the datastructures to make it happen. :) (I hope you can see the humour in it.) | 2011-07-11 | ||
157 | TYPO | In the epub version, C is incorrectly broken on my Sony PRS-505. (This also happens later in the text, too.) | 2011-07-11 | ||
159 | SUGGEST | The table of “upon”, “action(s)” on this page of the PDF renders poorly in the epub version. On the Sony PRS-505, each table cell is individually centered in its column, which makes for very difficult reading. No idea what to do to make it palatable. (In fbreader, it is more legible once you know it is a flattened table. It’d be super-confusing if I didn’t already know what it was.) | 2011-07-11 | ||
175 | TYPO | “Classes are like structs that they can inherit members” should read “Classes are like structs except they can inherit members” | 2011-07-11 | ||
221 | TYPO | SymbolTable.java includes the string “must be have struct type”, should read “must have struct type”. | 2011-07-11 | ||
239 | TYPO | “If resolves to a local variable” should read “If x resolves to a local variable”. | 2011-07-11 | ||
250 | SUGGEST | public Object exec(PieAST t) is inconsistent: half the statements use “method(t); break;” and the other half uses “return method(t);”. Since there is no code after the switch table, it’s hard to see why half would continue after the switch and half wouldn’t continue. If there’s a reason, please explain, and if there isn’t a reason, please standardize. :) | 2011-07-11 | ||
258 | SUGGEST | “works like the old HP calculators that used Reverse Polish Notation (RPN).” I object! :) You can buy brand-new HP calculators with SD card slots and USB mass storage support that run RPN. They’re still awesome. :) | 2011-07-11 | ||
324 | TYPO | “terminating <\\ul> tag.” should be "terminating tag." | 2011-07-11 | ||
329 | TYPO | “In the previous chapter, we’ll see how language patterns apply to some interesting problems.” Probably meant to say “In this chapter”. | 2011-07-11 | ||
162 | ERROR | On p. 162 it says “The sequence of actions for t.cymbol starts like this: push global scope, def int, def float, ref int, def i, ref float, def f, push f, ref int, def x, ref float, def y, push local scope of f, ref float, def i, and so on.”. On the other hand, on p. 163, it says upon start of file, actions “push a GlobalScope. def BuiltInType objects for int, float, void.” should be performed. Isn’t a “def void” missing on p. 162 then? I would guess that otherwise the “ref void” for the return type of the second method would not yield anything? | 2011-07-11 | Yep. adding | |
153 | ERROR | Some code is clearly missing. Second line from the bottom of the page initiates parsing with the rule “downup” but there is no such rule in the grammar. Also, the two patters folloing this, patters 18 and 19 have exactly the same problem. Without this rule, the code doesn’t execute and the patterns don’t work. | 2011-07-11 | Directly above, the text says "ANTLR's built-in downup() [teletype font] strategy". I'm hoping that it's clear that downup() is a built-in function not a rule. It CALLS topdown and bottomup rules. | |
42 | TYPO | In section 2.3, first paragraph, Line 5: A space is missing between the words “called” and “grammars”. | 2011-07-11 | ||
21 | TYPO | In the first sentence on the page, toward the end, you need a space between the words “the” and “semantics”. | 2011-07-11 | ||
21 | TYPO | In the first sentence on the page, toward the end, you need a space between the words “the” and “semantics”. | 2011-07-11 | ||
98 | TYPO | existing Should read | 2011-07-11 | ||
235 | TYPO | Bottom of page example says “is the core of fieldload()” but it’s fieldstore(). | 2011-07-11 | ||
83 | TYPO | Figure 4.2 last sentence: r^ … Rule r should must a single node, not a subtree | 2011-07-11 | ||
212 | ERROR | I think the code to promote nodes in getResultType() is wrong. It promotes ta to ta and tb to tb. I guess it should promote ta to tb and tb to ta. Otherwise the results will always be null. So, the could should be a.promoteToType = promoteFromTo[ta, tb]; | 2014-09-06 | ||
187 | TYPO | End of line 7 should be “to sym”. | 2014-09-06 | ||
118 | ERROR | “computing expression value result types” that should be removed right before the example because the code does not have that method. | 2014-09-06 | ||
97 | TYPO | public class AddNode extends AST should extend ExprNode | 2014-09-06 | ||
134 | TYPO | “This implementation has a number of advantages over an embedded walker.” should reference traditional visitor not embedded Walker or perhaps double dispatch visitor. | 2014-09-06 | ||
136 | TYPO | PrintVisitor.java should be IndependentPrintVisitor.java on this page and the previous. Line counts might be off by one also. | 2014-09-06 | ||
167 | TYPO | “pop arg scope” in the comment of the code for DefRef.g should probably be " pop method scope". | 2014-09-06 | ||
186 | TYPO | BuiltInType should be BuiltInTypeSymbol | 2014-09-06 | ||
230 | TYPO | “The next two chapters catalog the most common patterns for interpreting and translating programs.” should be about the next two parts about not chapters. | 2014-09-06 | ||
146 | SUGGEST | “Killing off a character means there should be no further references to it.” Possible fix: “Killing off a character means there should be no further references to it [as being alive].” What a wonderful book, though! If I had the means, I would nominate Prof Terence Parr for writing what I think is easily the book of the century on an otherwise very intimidating topic (thanks to the Dragon book). | 2014-09-06 | Thanks Nikhil! fixed. | |
296 | TYPO | at the end of the second paragraph “skip tree writing” should be “skip tree rewriting” | 2014-09-06 | ||
279 | TYPO | “the return address and space for parameters” | 2014-09-06 | ||
280 | TYPO | “only 7 out of the 26 bytes” should be 27 bytes. | 2014-09-06 | ||
304 | TYPO | Method gen(): “return Method(m.id, gen(m.bodyBlock));” should have “new” in there. | 2014-09-06 | ||
70 | TYPO | In the following two sentences describing Pattern 4, the word “parser” (but not parsing“) should be replaced with ”grammar": A more powerful parsing strategy means | 2014-09-06 | ||
212 | ERROR | The type promotion in getResultType is wrong since it currently looks up using using promoteFromTo[ta][ta] and promoteFromTo[tb][tb] which for both cases is always null. The correct promotion promotes to the result type. Like this: | 2014-09-06 | ||
236 | TYPO | “If resolves to a local variable or parameter,” should probably start with “If x resolves…” | 2014-09-06 | ||
118 | TYPO | missing space in ‘it discovers’ in the first sentence of the second paragraph. | 2014-09-06 | ||
113 | ERROR | The text describes the PropertyFileBaseListener generated by ANTLR but the example code shows the PropertyFileBaseVisitor instead. | 2014-09-06 | Wrong book. I'll move to ANTLR 4. | |
55 | 39 | ERROR | There is no a call of `consume` in the constructor of `ListParser`. Thus `lookahead` remains uninitialized and the program crashes with `NullPointerException`. | ||
55 | 40 | SUGGEST | You can forget about the previous erratum. It is not mentioned that the constructor of `Parser` class should call `consume`. It is worth adding an implementation of `Parser` constructor in the book. | ||
194 | 197 | ERROR | semantics/promote/SymbolTable.java: the printed book and pdf do show wrong code. public Type getResultType(Type[][] typeTable, CymbolAST a, CymbolAST b) { should be result.getTypeIndex(). | ||
233 | ERROR | On pattern 25, Tree-Based Interpreter I noticed something odd in the Pie.g grammar definition. Note this error is in the source code that accompanies the book. I am putting page 233 as a reference to the Implementation section in the pattern. Not sure why getEnclosingScope is called twice. All the examples work as expected so worry there. From interp/tree/Pie.g functionDefinition slist | |||
59 | ERROR | In the consume method for the BacktrackingParser: public void consume() { sync(1); // get another to replace consumed token This if statement that should clear out the lookahead and reset the token pointer to 0 will never be called since every time we consume a token we sync one past the pointer. If we want this to happen we need to add a check around the call to sync that looks like this: if(p >= lookahead.size()) { | |||
24ff | ERROR | EPUB version: Please include higher resolution bitmaps in the epub version. Some readers are better at scaling images than others (some don’t appear to scale images at all, rendering some diagrams unreadable), but in any case deliver blurred results at best. |