Question: 2. (10 points) Based on the following evaluation rules, draw an annotated parse tree that shows how the syntax tree for a-(b+c) is constructed. mknode

2. (10 points) Based on the following evaluation rules, draw an annotated parse tree that shows how the syntax tree for a-(b+c) is constructed. mknode () is similar to what is described on page 205 of the textbook. A good way to do this is to first draw the parse tree, then annotate the leaves and propogate the annotations up the tree. One of your parse tree nodes will look like this: (C Here is the grammar: Production Evaluation Rules Eo.nptr mknode(+, E,.nptr. T.nptr) Eo.nptr mknode(-, El.nptr. T.nptr) Eo.nptrT.nptr T.nptrE.nptr T.nptrmknode(id) EoErtT E0E-T -T T(E) -id
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
