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

Discussion

The dependency graph for an S-attributed definition always has edges

  • A.from child nodes upward toward their parents
  • B.from parent nodes downward toward their children
  • C.between sibling nodes at the same level of the tree
  • D.forming at least one cycle in every parse tree

Answer: A

Synthesised attributes depend only on children, so every edge points upward. A graph whose edges all point one way through a tree can never contain a cycle. This is why the S-attributed class needs no circularity test at all.

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

Post your comment

Please log in or register to post a comment.