C.

LR(0) < SLR(1) < LALR(1) < LR(1)

LL(1) < LR(1) and LL(0) < LR(0)

LL(k) < LR(k)

LR(0) < SLR(1) < LALR(1) < LR(1)

LL(1) < LR(1) and LL(0) < LR(0)

LL(k) < LR(k)

The Gateway to Computer Science Excellence

+2 votes

Which of the following statements is FALSE?

- In a SLR(1) parser, it is allowable for both shift and reduce items to be in the same state

- In a SLR(1) parser, it is allowable for multiple reduce items to be in the same state

- All SLR(1) grammars are LR(0)

- All LR(0) grammars are SLR(1)

+3 votes

**In a SLR(1) parser, it is allowable for both shift and reduce items to be in the same state**

even though it leads to sr conflict but it is allow

**2.In a SLR(1) parser, it is allowable for multiple reduce items to be in the same state **

even though it leads to sr conflict but it is allow

** 3. All SLR(1) grammars are LR(0) **

this statement is wrong.Reason is

LR(0)<SLR(1)<LALR(1)<CLR(1)

--> if a grammar is LR(0) then it is also SLR(1),LALR(1),CLR(1).

--> if a grammar is SLR(1) then it is also LALR(1),CLR(1).

--> if a grammar is LALR(1) then it is also CLR(1).

**4.All LR(0) grammars are SLR(1)**

**Therefore C is Correct.**

0

+2

In SLR(1) table we place the reduce moves in FOLLOW(LHS of the production).

So if we have , $A \rightarrow \alpha. $ and $B \rightarrow \beta. $ in same state then if $FOLLOW(A) \cap FOLLOW(B) = \phi$ then there will be no R-R conflict in SLR(1) since these reduce moves will be placed n different cells.

similarly,

if we have , $A \rightarrow \alpha . C $ and $B \rightarrow \beta. $ in same state then if $FOLLOW(B) \neq \ cell \ at \ which \ shift \ move \ will \ be \ placed $ then there will be no conflict in SLR(1)

So if we have , $A \rightarrow \alpha. $ and $B \rightarrow \beta. $ in same state then if $FOLLOW(A) \cap FOLLOW(B) = \phi$ then there will be no R-R conflict in SLR(1) since these reduce moves will be placed n different cells.

similarly,

if we have , $A \rightarrow \alpha . C $ and $B \rightarrow \beta. $ in same state then if $FOLLOW(B) \neq \ cell \ at \ which \ shift \ move \ will \ be \ placed $ then there will be no conflict in SLR(1)

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,370 answers

198,506 comments

105,272 users