Question: 3. (20pt) Consider the following LL(1) grammar: P -+ E $$ E + atom | E|( E Es ) Es E Es (1) Compute: EPS(Es),

3. (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). 3. (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)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
