Thanks

1 vote

Best answer

As options are about transition $S \rightarrow a$ only I have designed diagram for that only and

new transition takes place then we'll check due to which Variable it is occurring and take its new lookahead.

At state I0, we start with augmented state so its look-ahead is $. In next transition in I0, marked S have lookahead as its follow which is S. So first of its immediately next S (.SS+) which is 'a' is lookahead .

Similarly in state I1, marked S will produce new transition with its lookahead as its follow i.e +.

In LALR(1) we combine states with same transition and different lookahead so I2 and I3 are combined. So we get option D.