Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started