1,314 views

4 Answers

2 votes
2 votes
No, Every unambiguous grammar need not be LR(0) grammar. But the converse is true means every LR(0) grammar is unambiguous.LR(0) grammar is a proper subset of SLR(1) grammar and both are unambiguous grammar only. So we can conclude there exist some unambiguous grammar which are SLR(1) but not LR(0).
0 votes
0 votes
No, this is not true. As, all LR(1) grammars are unambiguous, and some LR(1) grammars are not LR(0) , so this implies that some unambiguous LR(1) grammars are not LR(0).
0 votes
0 votes

@samarpita

No, this is not true...

LR parsing is not a useful technique for human languages with ambiguous grammars that depend on the interplay of words...

Human languages are better handled by ...

 

1. https://gatecse.in/lr-parsing-part-2-language-of-ll-and-lr-grammars 

 

2. https://gateoverflow.in/91352/Can-lr-1-parser-parse-any-context-free-grammar-language 

 

3. https://gateoverflow.in/105785/Ll-k-grammars 

 

4. https://web.stanford.edu/class/archive/cs/cs143/cs143.1128/handouts/090%20Top-Down%20Parsing.pdf

 

  5. https://en.wikipedia.org/wiki/LR_parser

 

 

Related questions

0 votes
0 votes
1 answer
1
aditi19 asked Mar 25, 2019
1,142 views
Can lookahead symbol be epsilon in LR(1) parsing?andpls give the LR(1) diagram for the following grammar?A->AB | aB->*AC | Cb | ∈C->+ABc | ∈
0 votes
0 votes
0 answers
2
sushmita asked Dec 31, 2018
406 views
WHAT IS A VALID ITEM FOR A VIABLE PREFIX?CAM SOMEONE EXPLAIN IN EASY WAY.
0 votes
0 votes
1 answer
4
manisha11 asked Oct 21, 2018
425 views
Can we comment/compare the number of GOTO moves inLALR and CLRCLR and SLR?