retagged by
441 views

2 Answers

Best answer
3 votes
3 votes

@bikram sir ,

The first closure itself has a reduce move ( epsilon to X) and a shift move ( a or b) and as reduce moves are placed in the entire row for LR(0) there is a shift reduce conflict. 

Is my reasoning correct ?

selected by
1 votes
1 votes

Closure [$S' \rightarrow .S$] = 

$S' \rightarrow .S$

$S \rightarrow X$

$X \rightarrow .YX$

$X \rightarrow .$

$Y \rightarrow .aY$

$Y \rightarrow .b$

There are two SR conflicts(shift on $a, b$ & reduce on $X \rightarrow .$ in this $LR(0) $ item.

Hence it is not LR(0) grammar

Answer:

Related questions

2 votes
2 votes
2 answers
1
Bikram asked Nov 25, 2016
698 views
Consider the following grammar:$S \rightarrow L = P \mid P$$L \rightarrow ^*P \mid id$$P \rightarrow L$The above grammar is:AmbiguousSLR(1)LALR(1)None of the above
3 votes
3 votes
1 answer
2
Bikram asked Nov 25, 2016
288 views
Which grammar causes recursive-descent parser to go into infinite loop?LL(1)Left recursive grammarRight recursive grammarGrammar with left factors
3 votes
3 votes
2 answers
3
Bikram asked Nov 25, 2016
528 views
Consider the following grammar:$S \rightarrow aMd \mid bNd \mid aNe \mid bMe$$M \rightarrow c$$N \rightarrow c$The grammar above is:LR(1) but not LALR(1)LALR(1) but no...
3 votes
3 votes
1 answer
4
Bikram asked Nov 25, 2016
483 views
Consider the following grammar:$E \rightarrow E + T \mid T$$T \rightarrow T ^* F \mid F$$F \rightarrow (E) \mid id$What are the productions for E, T and F after convertin...