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

  • Authors:
  • Rodney Farrow

  • Affiliations:
  • Declarative Systems

  • Venue:
  • SIGPLAN '86 Proceedings of the 1986 SIGPLAN symposium on Compiler construction
  • Year:
  • 1986

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.