1.

A context free language is called ambiguous if?(a) It has 2 or more than 2 left derivations for some terminal string ѡ є L (G)(b) It has 2 or more than 2 right derivations for some terminal string ѡ є L (G)(c) It has 2 or more than 2 left and right derivations for some terminal string ѡ є L (G)(d) None of the mentionedThis question was posed to me during an online exam.My doubt is from Right Left Linear Grammar in section Contextfree Grammar and Syntax Analysis of Compiler

Answer»

Correct answer is (c) It has 2 or more than 2 left and RIGHT derivations for some terminal string ѡ є L (G)

Easiest explanation: When two or more Left and right most DERIVATIVE occur the grammar turn ambiguous .



Discussion

No Comment Found

Related InterviewSolutions