Consider the following grammar: E → E # X | X X → T − X | X * T | T T → T + F…
Consider the following grammar:
E → E # X | X
X → T − X | X * T | T
T → T + F | F
F → (E) | id
Here, id stands for an identifier. The grammar is used to generate valid arithmetic expressions in a hypothetical language. Consider the following statements:
(i) # associates from left and has the least precedence.
(ii) − associates from left and has higher precedence than #.
(iii) + associates from left and has the highest precedence.
(iv) * associates from left and has the same precedence as −.
Which option is correct?
- A.
Only (i), (iii), and (iv) are true
- B.
Only (ii) and (iii) are true
- C.
Only (ii), (iii), and (iv) are true
- D.
All of the above
Attempted by 29 students.
Sign up free to check your answer
Sign up freeLoading lesson…

