Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(20pt) Consider the following LL(1) grammar: P + E $$ E + atom | E|( E Es ) Es + E Es | (1) Compute:
(20pt) Consider the following LL(1) grammar: P + E $$ E + atom | E|( E Es ) Es + E Es | (1) Compute: EPS(Es), FIRST(Es), FOLLOW(E), PREDICT(Es +). (2) Give a parse tree for the string (cdr '(a b c)) $$. (3) Show the left-most derivation of (cdr '(a b c)) $$. (4) Show a trace, of a table-driven top-down parse of this same input (like the one in Fig.2.21, p.85 of textbook). The end marker $$ is seen as one symbol. Es is one non-terminal symbol. An atom is anything that is different from a list, that is, not between parentheses; examples of atom: car, cdr, a, b, C
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