Attribute Grammars as Recursion Schemes over Cyclic Representations of Zippers

Abstract : Evaluation of attributes w.r.t. an attribute grammar can be obtained by inductively computing a function expressing the dependencies of the synthesized attributes on inherited attributes. This higher-order functional approach to attribute grammars leads to a straightforward implementation using a higher-order lazy functional language like Haskell. The resulting evaluation functions are, however, not easily amenable to optimization rules. We present an alternative first-order functional interpretation of attribute grammars where the input tree is replaced with an extended cyclic tree each node of which is aware of its context viewed as an additional child tree. By the way, we demonstrate that these cyclic representations of zippers (trees with their context) are natural generalizations of doubly-linked lists to trees over an arbitrary signature.
Document type :
Journal articles
Liste complète des métadonnées

https://hal.inria.fr/hal-00650799
Contributor : Eric Badouel <>
Submitted on : Monday, December 12, 2011 - 12:01:59 PM
Last modification on : Friday, April 12, 2019 - 10:20:07 AM

Identifiers

  • HAL Id : hal-00650799, version 1

Citation

Eric Badouel, Célestin Nkuimi, Rodrigue Tchougong, Bernard Fotsing. Attribute Grammars as Recursion Schemes over Cyclic Representations of Zippers. Electronic Notes in Theoretical Computer Science, Elsevier, 2011, Proceedings of the Second Workshop on Mathematically Structured Functional Programming (MSFP 2008), 229 (5), pp.39-56. ⟨hal-00650799⟩

Share

Metrics

Record views

73