Question: Consider the LL(1) grammar below: S -> A $$ A -> atom A -> ' A A -> ( A As ) As -> A
Consider the LL(1) grammar below:
S -> A $$
A -> atom
A -> ' A
A -> ( A As )
As -> A As
As -> 
S, A, and As are the non-terminals and the rest are terminals.
a) What is FOLLOW(As)? FOLLOW(A)? PREDICT(As ->
)?
b) Create a parse tree for the string (cdr '(a b c)) $$. Keywords cdr, a, b, and c are all atoms.
3) Consider a recursive descent parser running on the input from part b. When the quote token is matched which of the recursive descent routines will be active? In other words, which routines will have a frame on the run-time stack.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
