Attribute Grammar

Program-Transformation.Org: The Program Transformation Wiki
Attribute grammars were introduced by DonaldKnuth in 1968 for the definition of the semantics of (programming) languages.

An attribute grammar is a specification that defines attributions of values to (abstract syntax) tree nodes.

The attribute grammar compiler takes care of scheduling computations of attributions.

Attribute grammars are mainly useful for program analysis

Glueing computations

All analysis is done on the original tree

See Also

  • Higher-order attribute grammars: attribute values can be new trees that can again be attributed

  • First-class attribute grammars: attribute propagation patterns are first-class