Advanced

Rewritable Reference Attributed Grammars

Ekman, Torbjörn LU and Hedin, Görel LU (2004) ECOOP 2004 – Object-Oriented Programming. 18th European Conference In ECOOP 2004 – Object-Oriented Programming. Proceedings (Lecture Notes in Computer Science) 3086. p.144-169
Abstract
This paper presents an object-oriented technique for rewriting abstract syntax trees in order to simplify compilation. The technique, Rewritable Reference Attributed Grammars (ReRAGs), is completely declarative and supports both rewrites and computations by means of attributes. We have implemented ReRAGs in our aspect-oriented compiler compiler tool JastAdd II. Our largest application is a complete static-semantic analyzer for Java 1.4. ReRAGs uses three synergistic mechanisms for supporting separation of concerns: inheritance for model modularization, aspects for cross-cutting concerns, and rewrites that allow computations to be expressed on the most suitable model. This allows compilers to be written in a high-level declarative and... (More)
This paper presents an object-oriented technique for rewriting abstract syntax trees in order to simplify compilation. The technique, Rewritable Reference Attributed Grammars (ReRAGs), is completely declarative and supports both rewrites and computations by means of attributes. We have implemented ReRAGs in our aspect-oriented compiler compiler tool JastAdd II. Our largest application is a complete static-semantic analyzer for Java 1.4. ReRAGs uses three synergistic mechanisms for supporting separation of concerns: inheritance for model modularization, aspects for cross-cutting concerns, and rewrites that allow computations to be expressed on the most suitable model. This allows compilers to be written in a high-level declarative and modular fashion, supporting language extensibility as well as reuse of modules for different compiler-related tools. We present the ReRAG formalism, its evaluation algorithm, and examples of its use. Initial measurements using a subset of the Java class library as our benchmarks indicate that our generated compiler is only a few times slower than the standard compiler, javac, in J2SE 1.4.2 SDK. This shows that ReRAGs are already useful for large-scale practical applications, despite that optimization has not been our primary concern so far. (Less)
Please use this url to cite or link to this publication:
author
organization
publishing date
type
Chapter in Book/Report/Conference proceeding
publication status
published
subject
in
ECOOP 2004 – Object-Oriented Programming. Proceedings (Lecture Notes in Computer Science)
volume
3086
pages
144 - 169
publisher
Springer
conference name
ECOOP 2004 – Object-Oriented Programming. 18th European Conference
external identifiers
  • wos:000222469100007
ISSN
0302-9743
1611-3349
ISBN
978-3-540-22159-3
DOI
10.1007/b98195
language
English
LU publication?
yes
id
fe5b72c1-15c9-4798-8b71-eacedcb5a522 (old id 273215)
date added to LUP
2007-10-22 08:19:27
date last changed
2016-04-15 19:42:26
@inproceedings{fe5b72c1-15c9-4798-8b71-eacedcb5a522,
  abstract     = {This paper presents an object-oriented technique for rewriting abstract syntax trees in order to simplify compilation. The technique, Rewritable Reference Attributed Grammars (ReRAGs), is completely declarative and supports both rewrites and computations by means of attributes. We have implemented ReRAGs in our aspect-oriented compiler compiler tool JastAdd II. Our largest application is a complete static-semantic analyzer for Java 1.4. ReRAGs uses three synergistic mechanisms for supporting separation of concerns: inheritance for model modularization, aspects for cross-cutting concerns, and rewrites that allow computations to be expressed on the most suitable model. This allows compilers to be written in a high-level declarative and modular fashion, supporting language extensibility as well as reuse of modules for different compiler-related tools. We present the ReRAG formalism, its evaluation algorithm, and examples of its use. Initial measurements using a subset of the Java class library as our benchmarks indicate that our generated compiler is only a few times slower than the standard compiler, javac, in J2SE 1.4.2 SDK. This shows that ReRAGs are already useful for large-scale practical applications, despite that optimization has not been our primary concern so far.},
  author       = {Ekman, Torbjörn and Hedin, Görel},
  booktitle    = {ECOOP 2004 – Object-Oriented Programming. Proceedings (Lecture Notes in Computer Science)},
  isbn         = {978-3-540-22159-3},
  issn         = {0302-9743},
  language     = {eng},
  pages        = {144--169},
  publisher    = {Springer},
  title        = {Rewritable Reference Attributed Grammars},
  url          = {http://dx.doi.org/10.1007/b98195},
  volume       = {3086},
  year         = {2004},
}