Answer to test yourself exercise 1 in Augmented Grammar handout
The productions of the parser that is structurally equivalent to the generator G1 are as follows.
- S ¬ A B C, where A.COUNT = B.COUNT = C.COUNT
- A0 ¬ a A1, where A0.COUNT := A1.COUNT + 1
- B0 ¬ b B1, where B0.COUNT := B1.COUNT + 1
- C0 ¬ c C1, where C0.COUNT := C1.COUNT + 1
- A ¬ e, where A.COUNT := 0
- B ¬ e, where B.COUNT := 0
- C ¬ e, where C.COUNT := 0