LARA

Exercises 02

Exercise 1

Write an unambiguous grammar for palindromes over the alphabet {a,b}.

Exercise 2

Write an unambiguous grammar that match the strings that match regular expression a*b* and have more as than bs.

Exercise 3

Write a LL(1) grammar that accepts the same language as the following:
1. S → S; S
2. S → id := E
3. S → print (L)
4. E → id
5. E → num
6. E → E + E
7. E → (S, E)
8. L → E
9. L → L, E