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

Discussion

Short circuit evaluation of a boolean expression is expressed in a translation scheme using

  • A.inherited attributes holding the true and false jump targets
  • B.synthesised attributes holding the value of the expression
  • C.a single temporary holding the result of the whole expression
  • D.no attributes at all

Answer: A

Passing the destinations down the tree lets each subexpression emit a jump directly to the right place. This avoids computing a value that would immediately be tested and discarded. The saving is substantial in code full of compound conditions.

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

Post your comment

Please log in or register to post a comment.