in Compiler Design
1,518 views
2 votes
2 votes
Consider the following grammer:-

Stmts -> Stmt | Stmts;Stmt

Stmt -> Var =E

Var ->id[E] | id

E-> id | (E)

Find the number of conflicts in LR(0)?
in Compiler Design
1.5k views

4 Comments

1 SR conflict
0
0

In the canonical collection of above grammar, we get many LR(0) items in which we get only one SR conflict and zero RR conflict.


SR-Conflicts :-
Var ->id.[E] | id.
(which has one reduce move) on seeing '[' we get one shift move. Therefore SR-Conflicts.

1
1
edited by
can anyone please show how to find LR(0) item sets?

I'm getting 3 S-R Conflicts
0
0

Ananya Jaiswal 1

LR(0) grammar is bottom up parser ..can parse left recursive grammar ....and here (one SR conflict)

0
0

Please log in or register to answer this question.

Related questions