Machine-translated by Google. Questions are authored in English.
Top

Discussion

A production written as E goes to E plus T makes the plus operator

  • A.of higher precedence than the multiplication operator
  • B.left associative
  • C.right associative in the resulting parse trees
  • D.non associative so that chaining is forbidden

Answer: B

Recursion on the left produces left leaning trees, so a plus b plus c groups as (a plus b) plus c. Recursion on the right would make the operator right associative instead. Associativity is therefore a property of how the production is written.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.