Question: 5. Consider the grammar G given below E- E (augmented rule where E being the start symbol in the original (1) grammar) EE. (2) E-T

5. Consider the grammar G given below E- E (augmented rule where E being the start symbol in the original (1) grammar) EE. (2) E-T (3) T-F+T TF F- (6) Assuming (E. T. F) to be the set of non-terminals and ..x} to be the set of terminals, answer the following questions (a) Compute the FIRST O) and FOLLOW O sets for each of those non-terminals in G given SC FOLLOWED (b) Fill in the productions in statels and add all those missing labeled transitions/edges in the following SLR automaton for G. You don't have to redraw the whole automaton. Refer to edges in the automaton using the notation () assuming the edge to be directed from / to I. 1 14 TP+T 13 2 (c) Fill in the following parsing table both GOTO and ACTION entries) for the same S E T F O 1 2 3 4 $ 6 7 8 5. Consider the grammar G given below. E' E (augmented rule where E being the start symbol in the original (1) grammar) EE*T (2) ET 1F+T TF FX Assuming {E, T, F) to be the set of non-terminals and {+, *, x} to be the set of terminals, answer the following questions. (a) Compute the FIRST () and FOLLOW() sets for each of those non-terminals in G given $ FOLLOW(E). (b) Fill in the productions in state Is and add all those missing labeled transitions/edges in the following SLR automaton for G. You don't have to redraw the whole automaton. Refer to edges in the automaton using the notation (I. I), assuming the edge to be directed from Ito 1;. 1. 1 16 EET T+F+T TF It E+ET EE EET EET ET TF+T TF Accept 1 15 T-F+T TLF. + T-F 14 ET I. I F- (e) Fill in the following parsing table (both GOTO and ACTION entries) for the same. + * X $ E T F 0 1 2 3 4 5 6 7 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
