Question: 2.Consider the following grammar (1) expr ? term termtail (2) term tail add op term term tail E (3) term ? factor factor-tail (4) factor

2.Consider the following grammar (1) expr ? term termtail (2) term tail add op term term tail E (3) term ? factor factor-tail (4) factor tail-mult op factor factor tail e (5)factor ? (expr) id | literal (6) add-op ? +1. (7) mult-op ? \ / - For the input be + (I8ta4) for parsing, draw a syntax tree for this expression. The syntax tree is built from the grammar rules used for parsing. Do lexical analysis first, and then work on the tree from the result of lexical analysis. Show the derivation of this input from the grammar rules first, and then show the syntax tree. (40 pts)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
