Log In
0 votes

PLEASE anyone can explain the states step wise 

Ans is given D

in Compiler Design 91 views

1 Answer

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.

selected by

Related questions

1 vote
1 answer
1 vote
1 answer
0 votes
1 answer
183 views asked Jan 24, 2019 in Compiler Design Shankar Kakde 183 views