Errata
The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted By | Date submitted | Date corrected |
---|---|---|---|---|---|
example2-3 top |
The %option line is missing yylineno: Note from the Author or Editor: |
jjberry | Aug 11, 2009 | Jul 19, 2013 | |
xv Middle of page |
Lex was designed by Mike Lesk and Eric Schmidt (the same Note from the Author or Editor: |
Anonymous | May 04, 2010 | Jul 19, 2013 | |
Other Digital Version | N/A ? |
Where others have reported error in first bison example: I have to agree. In my case I get 32767 as the answer consistently if input is valid. Changing from $1 to $2 (as everyone has suggested) fixes this. (I'd love to know why 0,1 and 32767 are the values people get.) Note from the Author or Editor: |
Martin Packer | Apr 14, 2012 | Jul 19, 2013 |
Page 2 Footnote 1 |
'deterministic finite automation' should be written as 'deterministic finite automaton' (remove 'i' from 'automation') Note from the Author or Editor: |
Joe Jamison | May 26, 2022 | ||
3.6 para 9 |
We can add these lines to the definition section to tell it how to resolve the conflicts: Note from the Author or Editor: |
Dave Pawson |
Aug 30, 2009 | Jul 19, 2013 | |
Printed | Page 10 bottom |
CFG is a Type 2 language, not a Type 3 as stated in the book Note from the Author or Editor: |
Anonymous | Jan 19, 2012 | Jul 19, 2013 |
Printed | Page 11 middle of page, in the action of the calclist rule |
The second line of the calclist rule has the following print statement: Note from the Author or Editor: |
David Liu | Dec 07, 2019 | |
Page 12 5th paragraph |
The text in the 5th paragraph of page 12 mentions a "calcset" start symbol, but what we have in the previous page is a grammar whose start symbol is named "calclist". Note from the Author or Editor: |
Fernando Carrijo | May 11, 2010 | Jul 19, 2013 | |
Printed | Page 25 last lines of example 2-2 |
The last test reads: Note from the Author or Editor: |
Anonymous | Apr 16, 2010 | Jul 19, 2013 |
Page 28 first pattern in example 2-3 |
The pattern is in error. Note from the Author or Editor: |
Kyle Ferrio | Dec 11, 2010 | Jul 19, 2013 | |
Printed | Page 28 Bottom of page (first regular expression) |
The regular expression for parsing the #include < or #include " portion of each file has a mistake - there is an extra \ . Note from the Author or Editor: |
Vuk Petrovic | Sep 30, 2016 | |
Printed | Page 29 example listing |
the manual management of yylineno is incorrect. flex will automatically increment yylineno as the input is consumed. therefore, statements such as: Note from the Author or Editor: |
Lexi Haley | Sep 10, 2019 | |
Printed | Page 30 Example 2-3 |
The end of the first comment in the popfile function is missing: Note from the Author or Editor: |
craie | Aug 07, 2010 | Jul 19, 2013 |
Printed | Page 30 Example 2-3 |
Near the end of the newfile function, the fn parameter (a character pointer which originated from yytext) is copied into both bs->filename and curfilename. Although this happened beforehand, the author even warns against this type of activity on page 36 (first paragraph). Therefore I believe it should be strdup'd instead (at least the first and then you can copy it). Otherwise, by the time you take this record off the stack, it won't be pointing to the same information. Note from the Author or Editor: |
craie | Aug 07, 2010 | Jul 19, 2013 |
Other Digital Version | 30 Error on Confirmed Errata page itself |
On the "Confirmed Errata" web page at: Note from the Author or Editor: |
Jim Theriault | Nov 25, 2015 | |
Printed | Page 30 popfile code listing |
The example code states; Note from the Author or Editor: |
Lexi Haley | Sep 10, 2019 | |
Printed | Page 34 middle of the code example |
The call of perror in the code uses argv[1]. Note from the Author or Editor: |
Anonymous | Apr 17, 2010 | Jul 19, 2013 |
Printed | Page 35 5th paragraph |
The lookup function uses strcmp (case sensitive string comparison) even though the author points out on page 33 that the yytext is not case folded in this case-insensitive example. Perhaps stricmp or strcasecmp was meant? Otherwise the symbol table will not reflect the case-insensitivity intended (and the instrumented statistics may be suspect). Note from the Author or Editor: |
craie | Aug 07, 2010 | Jul 19, 2013 |
Page 42 punctuators declaration |
At the punctuators declaration pattern: Note from the Author or Editor: |
crosvera | Jul 05, 2012 | Jul 19, 2013 | |
Printed | Page 44 last paragraph |
For example 2-5, popfile() function should not be the same as the ones earlier in chapter 2. It should be modified a little, or a segment fault will raise, when parsing more than one C source files from command line. Note from the Author or Editor: |
Hongzhi Song | May 09, 2011 | |
Page 50 para. 1 |
The reader had to be pretty alert to realize that the shift/reduce sequence is correct for the grammar including Note from the Author or Editor: |
Kyle Ferrio | Dec 12, 2010 | Jul 19, 2013 | |
Page 63 bottom quarter of page |
The following block of code correctly appears at the top of page 61 and is erroneously repeated near the bottom of page 63, both within Example 3-5 (fb3-2.h). It should appear exactly once: Note from the Author or Editor: |
Kyle Ferrio | Dec 21, 2010 | Jul 19, 2013 | |
Page 73 Body of treefree() |
The treefree() function only calls free() on child nodes for assignments (case '=':) and conditional expressions (case 'I': case 'W':). This will result in memory leaks if the child nodes are trees themselves. I think the two calls to free() should be to treefree() instead. Note from the Author or Editor: |
Mark Douglas | Jan 02, 2023 | ||
Page 77 bottom quarter (Example 3-8, fb3-2func.c) |
The call Note from the Author or Editor: |
Kyle Ferrio | Dec 21, 2010 | Jul 19, 2013 | |
Page 110 update_opts nonterminal definition |
The nonterminal update_opts is defined with reference to insert_opts; I think the intent is to be recursive, i.e., the two references to insert_opts should be replaced with update_opts. This is consistent with the MySQL documentation for UPDATE and INSERT. Note from the Author or Editor: |
Mark Douglas | Jan 02, 2023 | ||
Printed | Page 216 purecalc.l |
It's probably better practice to explicitly declare Note from the Author or Editor: |
Anonymous | Apr 13, 2010 | Jul 19, 2013 |
Page 234 First line of the "C++ Parsers" section |
current: Note from the Author or Editor: |
Paolo Lamponi | Aug 05, 2014 |