Comments on the Tucker and Noonan book:
Page 101: The second paragraph states that "Clearly, the abstract statement types that come into play in this program are Loop, Block, Conditional, and Assignment." Actually, Skip comes into play as well. Why?
Page 103: The last line on this page should have the pair 〈N, 3〉 in the state listed before the last couple parentheses.
Page 104: The derivation listed on this page of the meaning of a while loop in a particular state has one line too many. The third line beginning with "=M(while" should be eliminated. (Why?) Also, the final line of this derivation is again missing the pair 〈N, 3〉. Moreover, I do not understand the first sentence after this derivation: "Of course, ... is used to transform the state that is shown on the line below it." Perhaps what was meant as "Of course ... is used to transform the state shown on that line into the one shown on the line below it."
Page 106: The concrete syntax for DoStatement does not end with a semicolon, contrary to what many programmers' intuition would suggest. Is this in agreement with the syntax of Java? How would you find out?
Page 107: In C family languages, the default
in a
switch
is not merely optional: it also can appear
anywhere within the switch
rather than only after all the
other case
s. Another important difference from the
syntax shown on this page is that each case (including the default)
can have any number of statements (zero or more), rather than always
exactly one. The paragraph after the BNF also doesn't correspond very
well with the BNF itself, in that it talks about default:
as being a CaseHead. (That paragraph also contains a typo:
"can have list" should be either "can have a list" or "can list".)
At the bottom of the page, the reference to "a series of abstract
Conditionals inside a Block" is in error. The entire
switch
would translate to a single Conditional
(with other Conditionals typically nested inside), except that
a switch
with only the default
and no other
case
would not even translate to a
Conditional.
Page 108: The third paragraph in Section 4.5.4 ends with "This validity check can be done as follows." No description of the validity checking does follow. Filling in this omission might make an interesting discussion topic.
"Specification of the semantics of break and continue are left as an exercise." That is a doozy of an exercise. It might be interesting to discuss why.