Homework:
1. Write grammars for:
a. a n b 2n
b. ab n a :n is multiple of 3
c. a n b a n+1
d . C proc def: <type> id ( param_list )
where a param_list is 0 or more declarations of form“<type> id ;”
2 . Consider the grammar:
1,2: S — > aAbB | Bc
3,4: A — > aAa | a
5,6,7,8: B — > Bb | Ab | cC | AC
9: C — > c
a. Find the FIRST and FOLLOW sets for S, A, B, C
b. This grammar is not suitable for recursive descent. Whynot?
c. Rewrite productions 3 & 4 to eliminate the common
PayPal Gateway not configured
PayPal Gateway not configured