Tutorial (ECOOP 2008)
Material for the JastAdd tutorial given at ECOOP 2008
This tutorial gives an introduction to the JastAdd system and the JastAdd Extensible Java Compiler.
Annotated slides for the tutorial are available in [pdf] and [powerpoint]
Introduction
We first give an overview of the design principles and mechanisms used in JastAdd.
Tiny State Transition Diagram Language
We give a hands-on tutorial of the system by creating a tiny domain-specific language from scratch. Unzip the boilerplate archive below and build the project using the build.xml Apache Ant file in Lang.
> ant
You can run the minimal compiler through the following command line:
> java Lang Lang.test
The program should print the message: Hello. The complete implementation of the compiler is available in the sample solution.
[Slides] [Boilerplate code] [Sample solution]
Java 1.4 Frontend Extension
JastAddJ is a complete Java 5 compiler implemented as a Java 1.4 compiler with Java 5 as modular language extensions. We show how the Java 1.4 compiler can be extended in a modular fashion with support for the Enhanced For Statement as introduced in Java 5. If you are would like to extend the complete Java 5 compiler you may use the boilerplate code available here.
[Slides] [Boilerplate code] [Sample solution]
Where to go from here
Finally we give an overview of available infrastructure and extensions that can be helpful when building your own compilers.