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

Discussion

Multiple pass attribute evaluation is required when

  • A.the grammar happens to contain more than one start symbol
  • B.the parser is bottom up rather than top down
  • C.any semantic rule has a side effect of any kind
  • D.the definition is neither S-attributed nor L-attributed

Answer: D

Correct answer: the definition is neither S-attributed nor L-attributed

Both restricted classes can be evaluated in a single traversal. A definition outside them may have dependencies that no single left-to-right pass satisfies, so the tree must be traversed more than once, with a dependency analysis deciding what can be computed on each pass.

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

Post your comment

Please log in or register to post a comment.