1.

Which of the following statements is false?(a) Left as well as right most derivations can be in Unambiguous grammar(b) An LL (1) parser is a top-down parser(c) LALR is more powerful than SLR(d) Ambiguous grammar can’t be LR (k)I had been asked this question in exam.The question is from Top-Down Parsing in section Topdown Parsing of Compiler

Answer»

The correct ANSWER is (a) Left as well as right most derivations can be in Unambiguous grammar

To ELABORATE: If a grammar has more than ONE leftmost (or rightmost) derivation the grammar is AMBIGUOUS. Sometimes in unambiguous grammar the rightmost derivation and leftmost derivations may DIFFER.



Discussion

No Comment Found

Related InterviewSolutions