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 -> Consider the LL(1) grammar below: S -> A $$ A -> atom

S, A, and As are the non-terminals and the rest are terminals.

a) What is FOLLOW(As)? FOLLOW(A)? PREDICT(As -> A -> ' A A -> ( A As ) 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!