The first compiler compiles a very simple expression-oriented language to MIPS assembly language. The resulting programs can be run by QtSpim.
int x = 4;
x = y;
print x;
The source code for this compiler is in JBurg distributions 1.20 and later; the paths shown here are relative to BaseJBurgDirectory/docs/tutorial
. To build the tutorial, use Apache ant.
This compiler has only four components:
src/jburg/tutorial/first/Main.java
)src/jburg/tutorial/first/first.g
)src/jburg/tutorial/first/first.jbg
)src/jburg/tutorial/common/TemplateManager.java
and src/templates/MIPS.stg
)| Compiler Overview | Front End | Code Generator | Templates |
Wiki: FirstCodeGenerator
Wiki: FirstFrontEnd
Wiki: Tutorial
Wiki: TutorialCompilerTemplates