
Syntax-directed Translation 157
The corresponding attribute grammar is given below:
D : T L L.in = T.type (inherited)
T : int T.type = int.int (synthesized)
T : float T.type = float.float (synthesized)
L0 : L1 , I L1 = L0.in (inherited)
L : I I.in = L.in (inherited)
I : id id.type = I.in (inherited)
5.4.5 S-Type Definitions and Grammars
For synthesized attributes, we perform bottom-up tree traversal for attribute evaluation. A syntax-
directed definition (SDD) is S-attributed if every attribute is synthesized in that traversal.
5.4.6 L-Type Definitions and Grammars
For SDDs with both inherited and synthesized attributes, we have to look ...