1.

Which of the following is TRUE?(a) Both P and Q are true(b) P is true and Q is false(c) P is false and Q is true(d) Both P and Q are falseThe question was asked during an internship interview.I'd like to ask this question from Top-Down Parsing in portion Topdown Parsing of Compiler

Answer»

The correct ANSWER is (C) P is false and Q is true

Easiest explanation: Ambiguity can be SEEN inregular GRAMMAR

S → aA/a

A → aA/ε

In above grammar, STRING ‘a’ has two leftmost

derivations.

S → aA

S → a

S->a (using A->ε).



Discussion

No Comment Found

Related InterviewSolutions