Consider the following einf gramar for the simple


Consider the following EINF gramar for the simple calculator language mentioned in class.

program -› statlist
statlist -› stat { stat}
stat to ident := expr I read ident I write exP,
expr -a term I ' ')Bem )
tem -a fact ( ./. I fact 1
facto '(' expr .).
ident
nm

Write a recursive descent parser in C for this langUaga. Consider the follows ° gramar G with start symbol A.
1. A -a aB
2. A -a Bb
3. B -a cc
4. Boo

a) Show that G is not LLI
b) Convert G to an LL( 1) gramar by 115.9 a caabination of comer substitution (. rule 2) and left recursion removal.
c) Construct the LL( 1) parse table for G.

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Consider the following einf gramar for the simple
Reference No:- TGS0654179

Now Priced at $40 (50% Discount)

Recommended (97%)

Rated (4.9/5)