In the following grammar
X :: = X ⊕ Y / Y Y :: = Z * Y / Z Z :: = id
Which of the following is true?
a. ‘⊕’ is left associative while ‘*’ is right associative
b. Both ‘⊕’ and ‘*’ are left associative
c. ‘⊕’ is right associative while ‘*’ is left associative
d. None of the above
Explanation: X :: = X ⊕ Y is left recursive grammar, so ‘⊕’ is left associative and Z * Y is right recursive grammar, so ‘*’ is right associative.
Quiz of this Question
Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.