CSc 4340 Introduction to Compilers
Fall 2009, Exam 3
Due: December 1st, 2009 (Tuesday) by Noon

For each of the grammars, construct the LALR(1) parsing table.
Show lookahead propagations as well as lookahead calculations. 
Also for each grammar state if it is SLR(1)? LR(1)? LALR(1)?

(1)

S --> AB | aBb | ε
A --> aBb | ε
B --> Cc | c
C --> B

(2) 

S --> bAb | Ac | ab
A --> a

(3)

S --> aCa | bCb | aDb | bDa
C --> c
D --> c

(4) 

S --> SS+ | SS* | a