Consider the following grammar.
S -> AB | a
A -> BaB | a
a) Show that the grammar is not SLR(1).
b) Construct the LR(1) Automaton for the grammar.
c) Construct the LR parsing table for the grammar.
d) Parse the string aaaa. Show the stack, the input, and the action taken.
e) Merge the LR(1) states and convert the LR(1) Automaton to LALR(1).