search
Log In
1 vote
585 views
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
in Compiler Design 585 views

1 Answer

1 vote
 
Best answer

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

1 vote
0 answers
1
162 views
Which of the following statements are correct? S1: Binary search on array take less time than binary search on linked list. S2: Merge sort on array has more space complexity than merge sort on linked list. Only S1 Only S2 Both S1 and S2 Neither S1 nor S2 ** Here my doubt is, In S1 should i assume here that array is sorted. Answer given as Both S1 and S2.
asked Dec 27, 2015 in DS Sandeep Singh 162 views
4 votes
1 answer
2
861 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.
asked Oct 23, 2017 in Theory of Computation Rajesh R 861 views
1 vote
2 answers
3
433 views
In the network 200.20.11.144/27, the fourth octet (in decimal) of the last IP address of the network which can be assigned to a host is____ Which of the following languages are context free? $L_1=\{a^mb^na^nb^m \mid m,n \geq 1\}$ $L_2=\{a^mb^na^mb^m \mid m,n \geq 1\}$ $L_3=\{a^mb^n \mid m= 2n+1\}$
asked Jul 2, 2016 in Theory of Computation Sanjay Sharma 433 views
2 votes
0 answers
4
369 views
Among these languages which is/are Context free Language and has Context Free Grammar ? please Explain the reason a little bit . 1 .LISP 2 .C-Language 3 .C++ Language 4 .Cobol
asked Jul 6, 2016 in Compiler Design shekhar chauhan 369 views
...