Errata for Compiler Construction - Principles and Practice
by Kenneth C. Louden

Fourth Printing and Above

Last modified Tuesday, 28-Mar-2006 09:30:04 PST

Page 23

Figure 1.4, line 6: "if x > 0 then" should appear as "if 0 < x then".

Page 25

8th line from the bottom: "LDA    1,20(1)    load 20+R1 into R0" should appear as "LDA    1,20(1)    load 20+R1 into R1".

Page 35

4th Paragraph, line 7: "(boldface ε) by setting L(ε) = {ε}" should appear as "(boldface ε) by setting L(ε) = {ε}".

Page 45

Line 12: "We can try to write out a definition for ~(ab)using..." should appear as "We can try to write out a definition for (~(ab))* using ...".

Page 53

Last line: "Figure 2.4" should appear as "Figure 2.2".

Page 54

2nd paragraph, line 2 (middle of the page): "Section 2.2.4:" should appear as "Section 2.2.3:".

Page 59

Example 2.11, first diagram: The top-most backward transition (from state 7 to state 2) is missing its label. It should be labelled with epsilon.

Page 70

Line 9: There should be no break in the arrow labelled a from state S to state Š'a. (and the latter S should have a flat bar above it, but I couldn't find the Unicode for that).

Page 74

Example 2.19, line 1: "Example 2.1 (Section 2.3.2)" should appear as "Example 2.10 (Section 2.3.2)".

Page 76

2nd figure: The DONE state should be double-lined, since it is an accepting state.

Page 82

Line 19 (middle of the page) and 4th line from the bottom: "Section 2.2.4" should appear as "Section 2.2.3".

Page 88

3rd line below the code of Example 2.23: "Section 2.2.4" should appear as "Section 2.2.3".

3rd and 4th lines from the bottom: "This will be discussed further in Section 2.6.4" should appear as "This will be discussed further shortly".

Page 116

Footnote, line 2: "See Section 3.2.7" should appear as "See Section 3.6.3".

Page 140

Exercise 3.13, line 7: "grammar as (- 34 (* 3 42))." should appear as "grammar as (- 34 (* 3 42))."; in other words, the trailing period should not be in code font (and is not part of the expression).

Page 155

Figure 4.2, line 3: "while the top of the parsing stack ≠ $ and the next input token ≠ $ do" should appear as "while the top of the parsing stack ≠ $ do".

Figure 4.2, line 10: "and the next input token is terminal a" should appear as "and the next input token is a (terminal or $)".

Page 159

Figure 4.3: Insert at the bottom of the pseudocode, inside the i-loop but outside the j-loop, the following line: "remove, if necessary, immediate left recursion involving Ai".

Page 177

7th line from the bottom: "results in no further changes. Thus, we have computed the Follow sets" should appear as "results in Follow(stmt) = { ; , $ }, and a third pass results in no further changes. Thus, we have computed the Follow sets".

5th line from the bottom: "Follow(stmt) = { ; }" should appear as "Follow(stmt) = { ; , $ }".

Page 185

Line 6: "if not ( token in synchset ) then" should appear as "if not ( token in { (, number } ) then".

Line 7: "term ( synchset ) ;" should appear as "term ( synchset ∪ { +, - } ) ;".

Line 10: "term ( synchset ) ;" should appear as "term ( synchset ∪ { +, - } ) ;".

Line 18: "if not ( token in synchset ) then" should appear as "if not ( token in { (, number } ) then".

Page 285

Example 6.15, line 6 of the pseudocode: "temp := EvalWithBase ( right child of T );" should appear as "temp := EvalWithBase ( right child of T, base );".

Page 286

Line 2: "atttribute" should appear as "attribute".

Page 290

Definition of the L-attributed property: The equations for the inherited attributes Xi.aj must have the additional property that only inherited attributes of X0 may appear in the fij.

Lines 3 and 4 below the definition: "Given an L-attributed grammar in which the inherited attributes do not depend on the synthesized attributes, a recursive-descent parser..." should appear as "Given an L-attributed grammar, a recursive-descent parser...".

Page 310

Line 20 (middle of the page): "both an inherited atttribute symtab, ..." should appear as "both an inherited attribute symtab, ...".

Page 329

Figure 6.22: The following line is missing from the list of grammar rules, and should be added at the end of the list:
                        expexp + exp | exp or exp | exp [ exp ] | num | true | false | id

Page 331

10th line from the bottom: "typeError encounters this error type..." should appear as "type-error encounters this error type...".

Page 355

Line 9 (below Figure 7.5): "external variable x and makes a further call g(1), which sets m to 2 and y to 1, result-" should appear as "external variable x and makes a further call g(1), which sets m to 1 and y to 0, result-".

Page 359

The Calling Sequence: A sixth step needs to be added to the list of steps when a procedure is called: "6. Allocate space on the stack for local variables by appropriate adjustment of the sp."

Page 362

Ada code at the top of the page, line 3: "procedure Sum" should appear as "function Sum".

Ada code at the top of the page, line 6: "temp: Int_Array(low..high);" should appear as "i: INTEGER;".

First line below the Ada code: "(Note the local variable temp which also has unpredictable size.)" should be deleted.

Page 400

4th line from the bottom (excluding footnote): "greatest common divisor of two integers, which ..." should appear as "factorial of an integer, which ...".

Page 405

4th and 5th lines from the bottom: remove the discussion of the sbi instruction (it has already been discussed).

Page 427

Lines 5 and 10: "lod field_offset(x,j)" should appear as "ldc field_offset(x,j)".

Page 428

Line 2: "lod field_offset(*p,lchild)" should appear as "ldc field_offset(*p,lchild)".

Page 433

2nd line above Section 8.4.4: "lod FALSE" should appear as "ldc FALSE".

Page 455

3rd line from the bottom: "a given by a = d + reg[r]" should appear as "a given by a = d + reg[s]".

Page 458

Line 6: "2:   LDC  1,1,0       r1 = 1" should appear as "2:   LDC  1,1(0)      r1 = 1".

Line 7: "3:   LDC  2,1,0       r2 = 1" should appear as "3:   LDC  2,1(0)      r2 = 1".