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

Discussion

A dependency graph for an annotated parse tree has an edge from attribute a to attribute b when

  • A.a is synthesised and b is inherited at the same node
  • B.a appears earlier than b in the text of the production
  • C.the rule computing b uses the value of a
  • D.a and b belong to the same node of the parse tree

Answer: C

The edges record which values must be available before which others can be computed. Any topological sort of the graph is a legal evaluation order. Drawing the graph for a small tree is the quickest way to see whether a definition is workable.

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

Post your comment

Please log in or register to post a comment.