Trịnh Quốc Lâm
New member
Consider the grammar defined by the following production rules:
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
Code:
S --> T * P
T --> U | T * U
P --> Q + P | Q
Q --> Id
U --> Id
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