Consider the following statements: S1: The value of a synthesized attribute at…

Consider the following statements:
S1: The value of a synthesized attribute at a node is computed from the value of the attribute at the children of that node.
S2: The value of inherited attribute at a node is computed from the value of the attribute at the children of that node. Which of the following is true?

Answer: A. S1 is trueS1: This is correct. Synthesized attributes are computed based on the values of the attributes of the children nodes in a parse tree. S2: This is incorrect.…

  1. A.

    S1 is true

  2. B.

    S2 is true

  3. C.

    S1 is false

  4. D.

    S1 and S2 are false

Attempted by 133 students.

Show answer & explanation

Correct answer: A

S1: This is correct. Synthesized attributes are computed based on the values of the attributes of the children nodes in a parse tree.

S2: This is incorrect. Inherited attributes are computed based on the values of the attributes of the parent or sibling nodes, not the children.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…