1.

A context free language is called ambiguous if _________(a) It has 2 or more left derivations for some terminal string ѡ є L (G)(b) It has 2 or more right derivations for some terminal string ѡ є L (G)(c) It has 2 or more left & right derivations for some terminal string ѡ є L (G)(d) None of the mentionedI got this question during an internship interview.This interesting question is from Context Free Grammar topic in section Contextfree Grammar and Syntax Analysis of Compiler

Answer»

Right answer is (b) It has 2 or more right derivations for some terminal string ѡ є L (G)

For EXPLANATION I WOULD say: A context-free grammar (CFG) is a SET of recursive rewriting rules (or productions) USED to generate patterns of strings.



Discussion

No Comment Found

Related InterviewSolutions