The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+19 votes
1.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
asked in Compiler Design by Veteran (59.5k points)
edited by | 1.1k views

1 Answer

+21 votes
Best answer
  • Goto part & shift entry must be same.
  • Reduce entry & error entry may b different due to conflicts.
answered by Veteran (54.9k 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
+5
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)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

37,072 questions
44,645 answers
127,047 comments
43,699 users