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

Discussion

A synthesized attributes can be :

(i) Result of attribute evaluation rules.
(ii) The one whose value at a node in a parse tree is defined in terms of its sibling or parent.
(iii) The one whose value at parent node can be determined from its children.

  • A.(i) only
  • B.(i) and (iii) only
  • C.(i) and (ii) only
  • D.(ii) and (iii) only

Answer: B

The answer is (i) and (iii) only.

A synthesized attribute is one computed by the semantic rules (attribute evaluation rules) of a production (i), and its value at a parse tree node is determined from the attribute values of that node's children (iii). Information flows upward, as in computing the value of an expression from its operands.

Statement (ii) describes an inherited attribute, whose value at a node depends on its parent and siblings. So options including (ii) are wrong.

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

Post your comment

Please log in or register to post a comment.