In the program proof on page 160, there is a statement that may not be clear to all, specifically,
(n + 1)* * n = 1. The justification of this statement is as follows:
Consider the following expression:
(count + 1) * (count +
1) Perform the pairwise disjointness test for the following grammar rules.
a. A aB | b | cBB
b. B aB | bA | aBb
c. C aaA | b | caB
a) FIRST(aB) = cfw_a, FIRST(b) = cfw_b, FIRST(cBB) = cfw_c Passed
b) FIRST(aB) = cfw_a, FIRST(
3) Rewrite the BNF of Example 3.4 to give + precedence over * and force + to be right associative.
<assign> <id> = <expr>
<id> A | B| C
<expr> <expr> * <term> | <term>
<term> <factor> + <term> | <factor>
<factor> ( <expr>) |