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

Discussion

In a translation scheme, an action placed at the end of the right side can safely compute

  • A.an inherited attribute of the first symbol on the right
  • B.an attribute of a symbol appearing in a different production
  • C.the lookahead token that the parser will read next
  • D.a synthesised attribute of the left side nonterminal

Answer: D

By the time the action runs, every symbol on the right has been processed and its attributes are available. This is precisely the placement an S-attributed definition uses throughout. Nothing else is permitted if the definition is to remain S-attributed.

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

Post your comment

Please log in or register to post a comment.