Question: 5 . ( 1 5 pt ) Consider the following grammar, G: 1 . P - > S $$ 2 . S - > if
pt Consider the following grammar, G:
P S $$
S if e then M O
S other
M if e then M else M
M other
O else T
O epsi
T if e then T
T other
apt Compute the sets firstX and followX for all nonterminals X and the sets
predictp for all production rules p
bpt Prove that G an LL grammar.
cpt We said that there is no topdown grammar for ifthen..else statements. Does G
contradict this? Prove your answer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
