Advanced

JastAdd - a Java-based system for implementing front ends

Hedin, Görel LU and Magnusson, Eva LU (2001) In Electronic Notes in Theoretical Computer Science 44(2). p.59-78
Abstract
We describe JastAdd, a Java-based system for specifying and implementing the parts of compiler front ends that follow parsing. The system is built on top of a traditional Java parser generator which is used for parsing and tree building. JastAdd adds facilities for specifying and generating object-oriented abstract syntax trees with both declarative behavior (using Reference Attributed Grammars (RAGs)) and imperative behavior (using ordinary Java code). The behavior can be modularized into different aspects, e.g. name analysis, type checking, code generation, etc., that are woven together into classes. The class weaving technique has many advantages over the often used Visitor pattern in that it provides a safe and much simpler interface... (More)
We describe JastAdd, a Java-based system for specifying and implementing the parts of compiler front ends that follow parsing. The system is built on top of a traditional Java parser generator which is used for parsing and tree building. JastAdd adds facilities for specifying and generating object-oriented abstract syntax trees with both declarative behavior (using Reference Attributed Grammars (RAGs)) and imperative behavior (using ordinary Java code). The behavior can be modularized into different aspects, e.g. name analysis, type checking, code generation, etc., that are woven together into classes. The class weaving technique has many advantages over the often used Visitor pattern in that it provides a safe and much simpler interface for many applications and in that it supports modularization of not only methods, but also data. Class weaving is also easy and useful to combine with Visitor techniques in order to achieve the best of both. We also describe the implementation of the RAG evaluator (optimal recursive evaluation) which is implemented very conveniently using Java classes, interfaces, and virtual methods. (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
Electronic Notes in Theoretical Computer Science
volume
44
issue
2
pages
59 - 78
publisher
Elsevier
external identifiers
  • Scopus:18444385248
language
English
LU publication?
yes
id
5b9ff869-409c-49b6-9f59-fbcd471cd059 (old id 525772)
date added to LUP
2007-09-19 15:48:40
date last changed
2016-10-13 04:43:00
@misc{5b9ff869-409c-49b6-9f59-fbcd471cd059,
  abstract     = {We describe JastAdd, a Java-based system for specifying and implementing the parts of compiler front ends that follow parsing. The system is built on top of a traditional Java parser generator which is used for parsing and tree building. JastAdd adds facilities for specifying and generating object-oriented abstract syntax trees with both declarative behavior (using Reference Attributed Grammars (RAGs)) and imperative behavior (using ordinary Java code). The behavior can be modularized into different aspects, e.g. name analysis, type checking, code generation, etc., that are woven together into classes. The class weaving technique has many advantages over the often used Visitor pattern in that it provides a safe and much simpler interface for many applications and in that it supports modularization of not only methods, but also data. Class weaving is also easy and useful to combine with Visitor techniques in order to achieve the best of both. We also describe the implementation of the RAG evaluator (optimal recursive evaluation) which is implemented very conveniently using Java classes, interfaces, and virtual methods.},
  author       = {Hedin, Görel and Magnusson, Eva},
  language     = {eng},
  number       = {2},
  pages        = {59--78},
  publisher    = {ARRAY(0xaadeb48)},
  series       = {Electronic Notes in Theoretical Computer Science},
  title        = {JastAdd - a Java-based system for implementing front ends},
  volume       = {44},
  year         = {2001},
}