Professional Documents
Culture Documents
Student Number: Name
Student Number: Name
Signature of Student:
There are 8 questions in 2 pages. Please make sure that you got all of them. Answer in the
space below each question, no extra paper shall be supplied.
1. Comment, with proper reasons, on the usability of the universal parsing methods in (1)
production compilers.
Page 1 of 2
5. Create a predictive parsing table for the grammar: A → aB | b, B → baB | ϵ. (2)
6. Augment the grammar, S → S + V | V , V → a | b and hence construct the initial set (5)
of LR(0) items and the immediate sets of items generated from the initial set.
7. For the grammar in Question 6, write down the first two lines of the SLR parsing table. (3)
8. Write down the relationship between configuration lookahead and FOLLOW(A), (1)
where A is the nonterminal the handle will be reduced to in CLR.
Page 2 of 2