1k views

Choose the correct alternatives (more than one may be correct ) and write the corresponding letters only:

Consider the $SLR(1)$ and $LALR (1)$  parsing tables for a context free grammar. Which of the following statement is/are true?

1. The goto part of both tables may be different.
2. The shift entries are identical in both the tables.
3. The reduce entries in the tables may be different.
4. The error entries in tables may be different

edited | 1k views

• Goto part & shift entry must be same.
• Reduce entry & error entry may b different due to conflicts.
answered by Veteran (54.7k points)
edited by
0
Seeing some examples we can say that the goto entries and shift entries are same but can give u some ,logic behind it and why is not affected by the lookahead symbols present in LALR(1) parser .
+2
in LALR(1) we merge LR(1) items states with same LR(0) items but with different lookaheads
+4
answer must be b,c,d
0
• Reduce entry & error entry may b different due to conflicts. I think reduce entries are different because of look a heads.

0
yes Reduce entries are different because of look aheads due to combining of states.

Reduce(LALR) >= Reduce(SLR)