Similar questions 4 more →
Parsing & Syntax Analysis



Answer & solution
Answer: No relative precedence is specified or enforced by this grammar. (no official key was published)
Both + and * are produced by the same nonterminal E, and the grammar allows both i+(j*k) and (i+j)*k for the same token string. It therefore does not enforce multiplication-before-addition or addition-before-multiplication. Saying merely that the operators have equal precedence is also incomplete: the grammar does not enforce associativity, so it does not define a unique parse even under that description. External parser precedence declarations could resolve conflicts, but they are not part of the supplied grammar.