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

Discussion

A synthesised attribute of a node is computed from

  • A.the attributes of every node appearing anywhere in the tree
  • B.the tokens remaining in the input at the time of evaluation
  • C.the attributes of that node's children and of the node itself
  • D.the attributes of that node's parent and left siblings only

Answer: C

Correct answer: the attributes of that node's children and of the node itself

A synthesised attribute flows upward, computed from below. That direction is what makes S-attributed definitions so convenient for bottom up parsing: by the time a production is reduced, every child has already been reduced and its attributes are available on the stack.

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

Post your comment

Please log in or register to post a comment.