Gate CS-2014-2 Question Paper With Solutions

Q. 27 Consider the grammar defined by the following production rules, with two
operators * and +

  S --> T * P 
    T --> U | T * U
    P --> Q + P | Q
    Q --> Id
    U --> Id

Which one of the following is TRUE?

(A) + is left associative, while * is right associative

(B) + is right associative, while * is left associative

(C) Both + and * are right associative

(D) Both + and * are left associative

Answer: (B)

Explanation:

Gate CS-2014-2 Question Paper With Solutions

Learn More:   Gate ME-2009 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here