Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars

R Farrow - ACM SIGPLAN Notices, 1986 - dl.acm.org
R Farrow
ACM SIGPLAN Notices, 1986dl.acm.org
In the traditional formulation of attribute grammars (AGs) circularities are not allowed, that is,
no attribute-instance in any derivation tree may be defined in terms of itself. Elsewhere in
mathematics and computing, though, circular (or recursive) definitions are commonplace,
and even essential. Given appropriate constraints, recursive definitions are well-founded,
and the least fixed-points they denote are computable. This is also the case for circular AGs.
This paper presents constraints on individual attributes and semantic functions of an AG that …
In the traditional formulation of attribute grammars (AGs) circularities are not allowed, that is, no attribute-instance in any derivation tree may be defined in terms of itself. Elsewhere in mathematics and computing, though, circular (or recursive) definitions are commonplace, and even essential. Given appropriate constraints, recursive definitions are well-founded, and the least fixed-points they denote are computable. This is also the case for circular AGs.
This paper presents constraints on individual attributes and semantic functions of an AG that are sufficient to guarantee that a circular AG specifies a well-defined translation and that circularly-defined attribute-instances can be computed via successive approximation. AGs that satisfy these constraints are called finitely recursive.
An attribute evaluation paradigm is presented that incorporates successive approximation to evaluate circular attribute-instances, along with an algorithm to automatically construct such an evaluator. The attribute evaluators so produced are static in the sense that the order of evaluation at each production-instance in the derivation-tree is determined at the time that each translator is generated.
A final algorithm is presented that tells which individual attributes and functions must satisfy the constraints.
ACM Digital Library