in Compiler Design
1,255 views
1 vote
1 vote
Every unambiguous grammar is LR(0) grammar?
in Compiler Design
1.3k 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).
1 vote
1 vote

GATE CSE 1999 | Question: 1.17 - GATE Overflow

Hope this clarify the things :)

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