Course literature and other resources
The links to the resources on this page were verified on March 13, 2010. Let me know if you find any of them broken!
Text book
The text book for the course is
Aho, Lam, Sethi and Ullman: Compilers: Principles, Techniques, and Tools, 2nd. ed (Pearson International Edition 2007).
Available at Cremona and several web stores.
Additional useful texts
An excellent text book on modern compiling techniques is
Cooper and Torczon: Engineering a Compiler.
Focuses on backend issues; careful choice of material and very well written.
A somewhat dated but nice book on implementing lazy functional languages is
Peyton-Jones and Lester: Implementing functional languages (free download as PDF file).
Software tools
Many software tools are available, in particular for front ends. We give just a few links.
- For C programmers: Flex and Bison.
- For Java programmers: JLex and CUP.
- For Haskell programmers: Alex and Happy.
- Common interface to all the above: BNF Converter.
Flex/Bison and Alex/Happy are installed on the Linux computers in lab rooms. If you prefer to work in Java, download JLex/CUP.
Documentation for project languages
- Javalette. This language only exists as source language for the project in this course, even though it is strongly similar to subsets of C and Java.
See the project description.
The syntax of the base language is specified by the BNFC source file Javalette.cf. You may use this as the basis for your project. On the other hand, if you already have a BNFC file for a similar language (e.g. from the Programming Language Technology course), you might prefer that, if you have supporting code for e.g. type-checking. But you must then make sure to modify it to fit the description of Javalette.
- Jasmin. This assembly version of Java VM bytecode is described on the Jasmin home page.
The Java Virtual Machine Specification is also a useful source.
- LLVM. Downloadable software, documentation and tutorials are available at the LLVM home page. In particular, you will need to consult the LLVM Language Reference Manual and the LLVM Command Guide.
The LLVM tools are available on the Studat Linux machines.
The input/output routines are implemented in runtime.ll.
- x86 assembly language. Two books are available for free download:
- Jasmin. This assembly version of Java VM bytecode is described on the Jasmin home page.
Test program
You can download a collection of Javalette test programs and a driver program that runs your compiler on these test programs.
Unpack the tar archive in some suitable directory and follow instructions in the README.txt file (or see Appendix B in the project description).