Compilers and Compiler Generators - An Introduction With C++

P.D. Terry ( p.terry@ru.ac.za )

Published by International Thomson Computer Press © 1997

Errata and Feedback

If you have read this book, the author would like to have your opinions, favourable or otherwise. He would also appreciate learning of other errata that you may discover. Contact him by email at the address above.

The list below was last updated on October 30, 1999. It outlines errors that crept into the first printing of the book. Those given below are deemed to be "significant" and worth marking up.  There are a number of other trivial errors in (inconsistent) hyphenation and punctuation that have been noted, but are not worth making a fuss about.

Page 17: The code section at the foot of the page should read

     L0   if 1 >= P goto L1
          if P >= 9 goto L1
          p := P + Q
          goto L0
     L1   continue
Page 22, three lines from end: "... for operating systems. With ...".

Page 75, nine lines from end:  [0-9]+ not [09]+

Page 105, line 8: "The modifications needed for driving Coco/R may be left as an interesting exercise when the reader has had more experience in parsing techniques..."

Page 181, line 14:  "... introducing REPEAT loops in one of two forms"

Page 184, Exercise 9.14: There is a missing ? at the end of the first question.

Page 200, line 6: Font is incorrect: "... the amended accept routine does not try ..."

Page 200, twelve lines from end: "... operators like ':=', '=' and '==', and also ...". (That is, the == is in the wrong font and appears as one symbol, when it should be two!)

Page 217, line 9, the word operands would be better than terms:

        Here the operators follow the pairwise operands, and there is ...

Page 218, seventeen lines from end: "... brackets the actions with '(.' and '.)', as in ...". (That is, the meta-brackets should be (. and .), and not ( and ).

Page 228, last line, an arrow goes up when it should be down:

    = identifier <Name UPARROW>    (. AddToDataBase(Name DOWNARROW, DegreeCode DOWNARROW) .)

Page 230, line 10. The period at the end of the line (part way through the production) must be deleted.

Page 234, line 10 should be broken in two:

Page 238, line 7, bad word order

        These names may then be used in the other sections ...

Page 241, line 15. There are stray spaces around the ... in the token definition. It should read

Page 248, line 11.  There is a spurious "3" before the set-membership operator.

Page 258 , eight lines from end.  There is a spurious backslash \ at the end of the line, which should, of course, read

          #include <iostream.h>

Page 304, line 8:  "... are to be found on the source diskette"

Page 344, eight lines from end.    There are > brackets where there should be < ones (this looks like the sort of error that may have occurred in other places, not all detected yet, but other errors of this sort should be very obvious to a reader who understands the notation!)  The code should read as below

Variable<dest> ":="
Expression<exp> SYNC  (. CGen->assign(dest, exp); .)
Page 345, middle of the page.  More > brackets where there should be < ones:

     (   "+" Term<E>
       | "-" Term<E>       (.CGen->negateinteger(E); .)

Page 362, middle of the page, second bullet:  "hand-crafted parser", not "hand-crafted scanner".

Page 394, line 9:  There is a missing semicolon at the end of the line

            stackaddress(int level, int offset, bool byref);

Page 449, line 22:  There is a missing caret character in the code as printed.  It should read

 for (int i = 0; i < length; i++) r.bits[i] = bits[i] ^ s.bits[i];
 
Page 452, line 2:  There is a missing caret character in the code as printed.  It should read
 { startnewline(); fprintf(lst, "%*c", charpos, '^');
 
Page 454.  There is a spurious horizontal line printed between the third and fourth lines.

Page 492.  There is a line missing after the present 10th line.  This section of code should read

          cpu.mp = mem[cpu.bp - 5];      // restore mark pointer
          cpu.pc = mem[cpu.bp - 4];      // get return address
          cpu.bp = mem[cpu.bp - 3];      // reset base pointer
          if (cpu.pc == processreturn)   // kill a concurrent process

Page 569.  The title of the (highly recommended) book by King is incorrect.  It should be C programming - a Modern Approach.