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

Discussion

The evaluation order that suffices for every L-attributed definition is

  • A.a breadth first traversal visiting each level in turn
  • B.a right to left traversal of each production's right side
  • C.any order at all
  • D.a depth first left to right traversal of the parse tree

Answer: D

The L condition was chosen precisely so that this one traversal always works. Inherited attributes are ready when a subtree is entered and synthesised ones when it is left. Recursive descent performs exactly this traversal without being asked to.

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

Post your comment

Please log in or register to post a comment.