Synthesized and Inherited Attributes
In this class, We discuss Synthesized and Inherited Attributes.
For Complete YouTube Video: Click Here
The reader should have prior knowledge of attribute in Syntax directed translation. Click Here.
Synthesized Attribute:
Attribute taking value from its child attribute and itself we call synthesized attribute.
Example:
T’ – *FT1′ [T’.syn= T1′.syn]
T’.syn we call synthesized attribute. because it is taking value from its child attribute T1′.syn.
Inherited Attribute:
Attribute taking values from its parent, itself, or sibilings we call inherited attribute.
Example:
T’ – *FT1′ [T1′.inh = T.inh * F.inh]
In our example the attribute T1′.inh does not have right sibilings. But we can take from right sibilings also.