The Gateway to Computer Science Excellence
0 votes
110 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?

in Compiler Design by
edited by | 110 views

1 Answer

+1 vote

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. 

by
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
52,315 questions
60,433 answers
201,778 comments
95,257 users