Skip to Main content Skip to Navigation
Journal articles

Attribute Grammars as Recursion Schemes over Cyclic Representations of Zippers

Eric Badouel 1, * Bernard Fotsing 2 Rodrigue Tchougong 2 
* Corresponding author
1 S4 - System synthesis and supervision, scenarios
IRISA - Institut de Recherche en Informatique et Systèmes Aléatoires, Inria Rennes – Bretagne Atlantique
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
Complete list of metadata
Contributor : Estelle Nivault Connect in order to contact the contributor
Submitted on : Thursday, June 10, 2021 - 5:20:43 PM
Last modification on : Friday, February 4, 2022 - 3:20:15 AM
Long-term archiving on: : Saturday, September 11, 2021 - 7:32:19 PM


Publisher files allowed on an open archive



Eric Badouel, Bernard Fotsing, Rodrigue Tchougong. Attribute Grammars as Recursion Schemes over Cyclic Representations of Zippers. Electronic Notes in Theoretical Computer Science, Elsevier, 2011, 229 (5), pp.39-56. ⟨10.1016/j.entcs.2011.02.015⟩. ⟨hal-00748204⟩



Record views


Files downloads