Back to the 2023 paper

Module 3: Semantic Analysis, Symbol Table, Run-time environment

20232m

Synthesized attributed are calculated
(i) From the values of attributes of the children of the node
(ii) From the values of attributes of the parent of the node
(iii) From the values of attributes of the siblings of the node
(iv) None of these

Worked SolutionAI Assisted

Answer: (iii) children of the node (option (i))

Explanation

Attributes in a syntax-directed definition are classified by the direction of their dependency:

  1. Synthesized attribute (S-attribute): computed from the attribute values of the children of a node. Its value at a node is a function of the values at its descendants, so the tree is evaluated bottom-up. A classic example is E.val = E1.val * T.val.

  2. Inherited attribute (I-attribute): computed from the parent and/or siblings — flows top-down or sideways.

Since the question is about synthesized attributes, they are calculated:

from the values of the attributes of the children of the node → option (i)\boxed{\text{from the values of the attributes of the children of the node → option (i)}}

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.