Question: 87. (5 pts) Use the below grammar to draw parse trees and abstract syntax trees for the arithmetic expressions: a. 1 *2 (4+5) b. (2
87. (5 pts) Use the below grammar to draw parse trees and abstract syntax trees for the arithmetic expressions: a. 1 *2 (4+5) b. (2 + (3 +4) (ANSWER IS ON PAGE 247 questions 6.14 d and e, see solution manual) expr expr + term \ term term term * factor|factor factor ( expr ) \ number number number digit \ digit digit 0111213141516171819 (10 points) Consider the context free grammar G = (KRS) where Vis(SA,a,b,c), consists of the following rules: is (a,b,c) and R (a) Which of the following words are in L(G)? Circle all that are in L(G) abcba, c, bcb, abba, cc, ababcbaba (b) Show parse trees for all words that are in L(G) in part (a). (10 points) Consider the context free grammar G = (V.RS) where ris (SAB.ab,c), R consists of the following rules: is {a,b.c} and SB Bbs Bb Is this grammar ambiguous? Justify your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
