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

Discussion

An S-attributed definition can be evaluated during

  • A.a separate pass after the whole tree has been discarded
  • B.the lexical analysis phase before parsing has begun
  • C.a bottom up parse, computing values at each reduction
  • D.a top down parse only, since attributes flow downward

Answer: C

Every attribute is synthesised, so the children are complete when the parent is reduced. Yacc-style value stacks implement exactly this evaluation with no extra machinery. Nothing beyond the parallel stack is needed to realise the whole definition.

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

Post your comment

Please log in or register to post a comment.