1,939 views
1 votes
1 votes
1.Class of grammar that will parse using LR method is proper subset of class of grammar that will parse with predictive parser .

2. LR Parser can be constructed to recognize virtually all programming language constructs for which CFG can be written .

Please give valid justification for each point even if it is false

1 Answer

Best answer
1 votes
1 votes

Both are false.

1) LL(1)/Predictive parser accepts a subset of grammars accepted by LR parsers.

2) LR parsers can't parse ambiguous CFGs. Note that, Operator Precedence Parser is Bottom-Up/SR Parser but not LR parser and it also can't parse all ambiguous grammars.

edited by

Related questions

4 votes
4 votes
1 answer
2
Rajesh R asked Oct 23, 2017
1,885 views
$L1 = a^i b^i c^j$ such that i>=1 and j>=1$L2 = a^i b^i c^j$ such that j>=1$L3 = a^i b^i c^j$ such that i>=1 Answer is only L1. I think all 3 are CFL's.
2 votes
2 votes
0 answers
4
shekhar chauhan asked Jul 5, 2016
743 views
Among these languages which is/are Context free Language and has Context Free Grammar ? please Explain the reason a little bit .1 .LISP2 .C-Language3 .C++ Language4 .Cobo...