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

Discussion

The difference between emitting code as a side effect and accumulating it in an attribute is that the attribute approach

  • A.allows the fragments to be rearranged before they are output
  • B.always uses less memory during the compilation process
  • C.makes the translation impossible to perform in one pass
  • D.removes the need for any temporaries in the generated code

Answer: A

Holding code in attributes lets a rule place its children's fragments in any order. Emitting directly is cheaper but fixes the output order to the order of the actions. Which approach suits depends on whether the code must be rearranged later.

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

Post your comment

Please log in or register to post a comment.