| Also see [hints]. |
|
| (a) In words, describe the members of the language defined by this grammar. | [0-marks]
|
|
(b) Is the language regular?
If so give a regular expression that defines the same language.
|
[1-marks]
|
| (c) Give the canonical collection of LR(0) items for this grammar. Apply exactly the algorithm in the lecture notes ([Imp.VIII] p.140+) and use the grammar symbols in the order S, X, Y, a, b, c. |
[1-marks]
|
| (d) Fill in the SLR parsing table for the grammar. (You might not need all the rows.) |
[2-marks]
|
| (e) Detail how the sentence aacba would be parsed by an LR parser using the table from the previous part. For each step of the process give the input, the parser action (shift/reduce) and the stack in the table below. |
[1-marks]
|