# which of the following statements are correct in context of LR parser ?

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

1 vote

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

## Related questions

1 vote
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.
$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.
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\}$