Embedding attribute grammars and their extensions using functional zippers

Pedro Martins, João Paulo Fernandes, João Saraiva, Eric Van Wyk, Anthony Sloane

Research output: Contribution to journalArticlepeer-review


Attribute grammars are a suitable formalism to express complex software language analysis and manipulation algorithms, which rely on multiple traversals of the underlying syntax tree. Attribute grammars have been extended with mechanisms such as reference, higher-order and circular attributes. Such extensions provide a powerful modular mechanism and allow the specification of complex computations. This paper studies an elegant and simple, zipper-based embedding of attribute grammars and their extensions as first class citizens. In this setting, language specifications are defined as a set of independent, off-the-shelf components that can easily be composed into a powerful, executable language processor. Techniques to describe automatic bidirectional transformations between grammars in this setting are also described. Several real examples of language specification and processing programs have been implemented.

Original languageEnglish (US)
Pages (from-to)2-28
Number of pages27
JournalScience of Computer Programming
StatePublished - Dec 15 2016


  • Attribute grammars
  • Bidirectional transformations
  • Functional programming
  • Functional zippers

ASJC Scopus subject areas

  • Software
  • Information Systems
  • Modeling and Simulation
  • Computational Theory and Mathematics


Dive into the research topics of 'Embedding attribute grammars and their extensions using functional zippers'. Together they form a unique fingerprint.

Cite this