Decorated Attribute Grammars . Attribute Evaluation Meets Strategic Programming ( Extended Technical Report )

Attribute grammars are a powerful specification formalism for tree-based computation, particularly for software language processing. Various extensions have been proposed to abstract over common patterns in attribute grammar specifications. These include various forms of copy rules to support non-local dependencies, collection attributes, and expressing dependencies that are evaluated to a fixed point. Rather than implementing extensions natively in an attribute evaluator, we propose attribute decorators that describe an abstract evaluation mechanism for attributes, making it possible to provide such extensions as part of a library of decorators. Inspired by strategic programming, decorators are specified using generic traversal operators. To demonstrate their effectiveness, we describe how to employ decorators in name, type, and flow analysis.

[1]  Ralf Lämmel,et al.  Strategic programming meets adaptive programming , 2003, AOSD '03.

[2]  John Tang Boyland,et al.  Composing tree attributions , 1994, POPL '94.

[3]  P. Klint,et al.  Efficient annotated terms , 2000 .

[4]  Eelco Visser,et al.  Meta-programming with Concrete Object Syntax , 2002, GPCE.

[5]  Fahimeh Jalili,et al.  A general linear-time evaluator for attribute grammars , 1983, SIGP.

[6]  John Tang Boyland,et al.  Remote attribute grammars , 2005, JACM.

[7]  Torbjörn Ekman,et al.  Declarative Intraprocedural Flow Analysis of Java Source Code , 2009, LDTA.

[8]  Ralf Lämmel,et al.  Typed generic traversal with term rewriting strategies , 2002, J. Log. Algebraic Methods Program..

[9]  S. Doaitse Swierstra,et al.  Higher order attribute grammars , 1989, PLDI '89.

[10]  Görel Hedin,et al.  Reference Attributed Grammars , 2000, Informatica.

[11]  Satoshi Matsuoka,et al.  ECOOP'97 — Object-Oriented Programming , 1997, Lecture Notes in Computer Science.

[12]  John Boyland,et al.  Descriptional Composition of Compiler Components , 1996 .

[13]  Torbjörn Ekman,et al.  Extending Attribute Grammars with Collection Attributes--Evaluation and Applications , 2007, Seventh IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2007).

[14]  Eric Van Wyk,et al.  Forwarding in Attribute Grammars for Modular Language Design , 2002, CC.

[15]  Eric Johnson,et al.  Adding domain-specific and general purpose language features to Java with the Java language extender , 2006, OOPSLA '06.

[16]  William M. Waite,et al.  Modularity and reusability in attribute grammars , 1994, Acta Informatica.

[17]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[18]  Donald E. Knuth,et al.  Semantics of context-free languages , 1968, Mathematical systems theory.

[19]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[20]  Torbjörn Ekman,et al.  Rewritable Reference Attributed Grammars , 2004, ECOOP.

[21]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools (2nd Edition) , 2006 .

[22]  Eelco Visser,et al.  Stratego/XT 0.17. A language and toolset for program transformation , 2008, Sci. Comput. Program..

[23]  Görel Hedin,et al.  JastAdd--an aspect-oriented compiler construction system , 2003, Sci. Comput. Program..

[24]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[25]  S. Doaitse Swierstra,et al.  First-class Attribute Grammars , 2000, Informatica.

[26]  Görel Hedin,et al.  Circular reference attributed grammars - their evaluation and applications , 2003, Sci. Comput. Program..

[27]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[28]  Charles Farnum,et al.  Pattern-based tree attribution , 1992, POPL '92.

[29]  Eric Van Wyk,et al.  Attribute Grammar-Based Language Extensions for Java , 2007, ECOOP.

[30]  Eelco Visser,et al.  Building program optimizers with rewriting strategies , 1998, ICFP '98.

[31]  PaakkiJukka Attribute grammar paradigmsa high-level methodology in language implementation , 1995 .

[32]  Eelco Visser,et al.  Generating Editors for Embedded Languages: Integrating SGLR into IMP , 2008 .

[33]  Guido Rossum,et al.  Python Reference Manual , 2000 .

[34]  Guy L. Steele,et al.  Growing a Language , 1999, High. Order Symb. Comput..

[35]  Eelco Visser,et al.  Program Transformation with Scoped Dynamic Rewrite Rules , 2006, Fundam. Informaticae.

[36]  Martin Odersky ECOOP 2004 – Object-Oriented Programming , 2004, Lecture Notes in Computer Science.

[37]  Jukka Paakki,et al.  Attribute grammar paradigms—a high-level methodology in language implementation , 1995, CSUR.

[38]  Richard S. Bird Using circular programs to eliminate multiple traversals of data , 2004, Acta Informatica.

[39]  Eric Van Wyk,et al.  Silver: An extensible attribute grammar system , 2008, Sci. Comput. Program..

[40]  Elnar Hajiyev,et al.  Keynote Address: .QL for Source Code Analysis , 2007 .