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

Discussion

A syntax directed translation for a control construct such as a while loop typically uses

  • A.only inherited attributes throughout the construct
  • B.no attributes at all
  • C.inherited attributes for labels and synthesised ones for code
  • D.only synthesised attributes throughout the construct

Answer: C

The labels for the loop head and exit must be passed into the body while the generated code flows upward. The mixture is what makes such translations L-attributed rather than S-attributed. Almost every real control construct needs both directions of flow.

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

Post your comment

Please log in or register to post a comment.