1.

The grammar G: S → SS | a | b is ambiguous. Check all and only the strings that have exactly two leftmost derivations in G.(a) bbb(b) ab(c) All of the mentioned(d) None of the mentionedThis question was addressed to me by my college director while I was bunking the class.The above asked question is from The NFA with n-moves to the DFA topic in division Finite Automata and Regular Expression of Compiler

Answer»

Correct CHOICE is (C) All of the mentioned

To elaborate: S => a. A string of length 2 has only one DERIVATION, e.g., S => SS => aS => ab.



Discussion

No Comment Found

Related InterviewSolutions