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

Discussion

Where does an inherited attribute of a node get its value from?

  • A.the attributes of that node's own children exclusively
  • B.the tokens that the scanner has yet to produce
  • C.the target machine on which the program will eventually run
  • D.the attributes of that node's parent and its siblings

Answer: D

Information flows downward or sideways across the tree. Inherited attributes express context, such as the type declared at the head of a declaration being passed to each name in the list. Without inherited attributes that construct cannot be handled in one pass.

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

Post your comment

Please log in or register to post a comment.