Stepwise evaluation of attribute grammars

  • Authors:
  • Arie Middelkoop;Atze Dijkstra;S. Doaitse Swierstra

  • Affiliations:
  • Universiteit Utrecht, Utrecht, The Netherlands;Universiteit Utrecht, Utrecht, The Netherlands;Universiteit Utrecht, Utrecht, The Netherlands

  • Venue:
  • Proceedings of the Eleventh Workshop on Language Descriptions, Tools and Applications
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Attribute Grammars are a powerful formalism to specify and implement the semantics of programming languages (e.g. as in a compiler), in particular when the semantics are syntax directed. Advanced type systems, however, use nondeterminism in their specifications to encode decisions that are independent of syntax. The implementation of such decisions is hard to express algorithmically using conventional attribute evaluation. This paper presents Stepwise Attribute Grammars (SAGs). In a SAG, nondeterministic choices can be expressed in a natural way in conjunction with unambiguous resolution strategies based on attribute values. SAGs preserve the functional relationships between attributes and support on-demand evaluation. Nondeterminism is encoded as a choice between the semantic results of children. Evaluation of a child can be performed in a stepwise fashion: it is paused after each step and yields a progress report with intermediate results, until the child is reduced to its semantic value. This facilitates a breadth-first exploration of choices, until choices can be resolved based on the progress reports.