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
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 ambigious but if any unambigious 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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.