Strongly non-circular attribute grammars and their recursive evaluation

  • Authors:
  • Martin Jourdan

  • Affiliations:
  • INRIA, Rocquencourt-F78153 LECHESNAY Cedex, France

  • Venue:
  • SIGPLAN '84 Proceedings of the 1984 SIGPLAN symposium on Compiler construction
  • Year:
  • 1984

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper is devoted to the construction of recursive evaluators for strongly non-circular attribute grammars. This class of attribute grammars is very large and includes every practical example ; testing strong non-circularity can be done in polynomial time. To each synthesized attribute, a function is associated, which takes as parameters a derivation tree and the values of some inherited attributes, and returns the value of that attribute at the root of the tree. These functions are mutually recursive according to the structure of the full parse tree. This method implements a dynamic "evaluation by need", reducing the number of attributes computed to those necessary to get the "semantic value" of the full tree. A Lisp implementation allowing automatic efficient storage management is also presented, together with some applications. Our work is closely related to those of Kennedy and Warren, Saarinen and Katamaya, but our method is more efficient and has a better theoretical basis.