TY - JOUR
T1 - Embedding attribute grammars and their extensions using functional zippers
AU - Martins, Pedro
AU - Fernandes, João Paulo
AU - Saraiva, João
AU - Van Wyk, Eric
AU - Sloane, Anthony
N1 - Funding Information:
This author is partially supported by NSF Award #1047961.
Publisher Copyright:
© 2016 Elsevier B.V.
PY - 2016/12/15
Y1 - 2016/12/15
N2 - 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.
AB - 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.
KW - Attribute grammars
KW - Bidirectional transformations
KW - Functional programming
KW - Functional zippers
UR - http://www.scopus.com/inward/record.url?scp=84975528869&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84975528869&partnerID=8YFLogxK
U2 - 10.1016/j.scico.2016.03.005
DO - 10.1016/j.scico.2016.03.005
M3 - Article
AN - SCOPUS:84975528869
SN - 0167-6423
VL - 132
SP - 2
EP - 28
JO - Science of Computer Programming
JF - Science of Computer Programming
ER -