Nov2017 cs Q32

0. Which of the following statements is/are TRUE?
(i) The grammar S → SS | a is ambiguous (where S is the start symbol).
(ii) The grammar S → 0S1 | 01S | e is ambiguous (the special symbol e represents the empty string and S is the start symbol).
(iii) The grammar (where S is the start symbol).
S → T/U
T → x S y ? xy ? e
U → yT
generates a language consisting of the string yxxyy.

  • Option : D
  • Explanation :
    We can generate more than 1 parse tree for a single string from the grammars. For statement (iii)
    S → U
    U → yT
    yT → yxSy
    yxSy → yxTy
    yxTy → yxxyy
    All statement are correct. So, option (D) is correct.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *