Open In App

ISRO | ISRO CS 2015 | Question 29

Like Article
Like
Save
Share
Report

Which statement is true?

(A)

LALR parser is more powerful and costly as compare to other parsers

(B)

All CFG\’s are LP and not all grammars are uniquely defined

(C)

Every SLR grammar is unambiguous but not every unambiguous grammar is SLR

(D)

LR(K) is the most general back tracking shift reduce parsing method


Answer: (C)

Explanation:

1) Canonical LR is the most powerful parser as compared to other LR parsers. Order: LR(0)< SLR < LALR < CLR 
2) LP (Linear Precedence) Grammars are CFL but not vice-versa. 
3) SLR grammar cannot be ambiguous but if any unambiguous grammar has shift-reduce conflict then it cannot be parsed with a SLR parser. 
4) LR(k) has a k-look ahead which can always see ahead the input in order to avoid backtracking. So, it is a non-bacaktracking parser.

Option (C) is correct.


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 13 Nov, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads