The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
55 views

        

WHICH OF THE FOLLOWING STATEMENTS ARE TRUE?

a) S1 & S3

b) S2 & S4

c) S2 & S3

d) None of these

Answer is option a.

can anyone tell me how option a is correct?

asked in Compiler Design by (175 points)
edited by | 55 views

1 Answer

0 votes

Okay ..

To check,  this is LR(0) or not check Conflicts.

There are two type conflict 1) SR Conflict and 2) RR conflict

A full parsing table is not needed, only the canonical collection. In the canonical collection, find all final items (and only final items), and see if:

  • There are both shift and reduce in the same item ("shift-reduce", s/r)
  • There are two reduce actions in the same item ("reduce-reduce", r/r)

If none of these is true, there are no conflicts means it is LR(0).

And If it is LR(0) then it is also SLR.

 

Here you can see there is no conflict. 

answered by Active (1.6k points)

Related questions

0 votes
0 answers
1
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
49,541 questions
54,083 answers
187,206 comments
70,992 users