Question: (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 |

(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

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!