Consider the following SDD: T → FT₁ {F.val = T₁.val} T₂ → *AT₃ {T₂.val =…

Consider the following SDD:

T → FT₁ {F.val = T₁.val}

T₂ → *AT₃ {T₂.val = T₃.val × A.val}

Which of the following is true?

Answer: D. None of the aboveF.val = T1.val assigns an attribute of the left child (F) using the right sibling (T1) — this is an inherited attribute depending on a right sibling.…

  1. A.

    This SDD follows S-attributed definition.

  2. B.

    This SDD follows both S-attributed as well as L-attributed definition.

  3. C.

    This SDD follows L-attributed definition.

  4. D.

    None of the above

Attempted by 50 students.

Show answer & explanation

Correct answer: D

  • F.val = T1.val assigns an attribute of the left child (F) using the right sibling (T1) — this is an inherited attribute depending on a right sibling.

  • S-attributed SDDs allow only synthesized attributes (no inherited) → violated.

  • L-attributed SDDs allow inherited attributes to depend only on the parent and left siblings → violated (depends on a right sibling).

  • Therefore the SDD is neither S-attributed nor L-attributed.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…