Quiz 6: LR(0) Canonical Construction

Quiz Posted
(Thursdays)
Given in class
(Thursdays)
14 Feb 21 Feb
Note: Section 6.2.1 of our textbook talks about how to build the LR(0) collection of states, which the book calls the CFSM (characteristic finite-state machine). The book's treatment of lambda is a bit confusing, because the dot (·) appears to the left of lambda in a state, and never moves across it. If you have the rule
A → lambda
in your grammar, than I like to write this as
A → ·
in a state. This is consistent with having the bullet moved all the way to the right of a rule's right-hand side, at which time a reduction is indicated.
  1. Text exercise 1 on page 208. In lecture, I combien the goto and action tables. Please do the same.

    Also, the goto table for this exercise has an error: the entry for SimpleStmt and state 9 should be 5 not 6.

  2. Text exrecise 4a on page 208.
  3. Text exrecise 4b on page 209.
  4. Text exrecise 4c on page 209.
  5. Text exrecise 4d on page 209.
  6. Text exercise 3 on page 208.