L Computer Science &
        Electrical Engineering

Compiler Construction – D7011E
Lp3 2012


News


Jan 17 Course start.
Jan 24
Cleaning up and clarification of the project instructions regarding mandatory test cases.
Jan 31
Added lost MiniJava grammar link to the project instructions, step 1. Use this for the definition of MiniJava keywords and reserved symbols.

Course aim

The student shall be able to

Course content


Official description in the course catalog.

Examiner & lecturer

Johan Nordlander
Room: A3316
Phone: 070 6207461
Email:

Literature



New book:
Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman.
Compilers: principles, techniques and tools(2nd ed.),
Addison Wesley, 2007, ISBN: 0321486811.
Note that this is the hardcover variant, all versions of this book should be okay, as long as it is the
2nd edition. Please do not buy the 1st edition.

Previously we used the following book, and if you happen to already own, it also covers all of the
important material:

Andrew W. Appel with Jens Palsberg
Modern compiler implementation in Java.
Cambridge University Press, 2nd edition, 2002.
ISBN: 0-521-82060-X.

Schedule

View the on-line schedule information.

Written exam: March 21 (5 hours)

Lecture notes

Lecture
Contents
Slides
Book chapter
(Aho et al.)
Book chapter
(Appel)
1 Introduction pdf
1, (2) 1
2 Lexical analysis and finite automata pdf
3.1-3.4 2
3 Lexer generators pdf 3.5-3.11 2
4 Introduction to parsing pdf 4.1-4.4 3
5 Details of top-down & bottom-up parsing pdf 4.5-4.5 3
6 Parser generators and abstract syntax pdf 4.8-4.9, (5) 3, 4
7 Semantic analysis pdf 6.1-6.3 5
8 Introduction to code generation pdf (6.4-6.9), 8 6, 7
9 Implementing functions and objects pdf (7.1, 7.2), 8 6, 7, (14)
10 Continuing code generation pdf 8 6, 7
11 Introduction to optimization pdf 8, 9, (9.2) 7, 8, (18)
12 Garbage Collection pdf 7 13
13 Instruction selection pdf 8 9
14 Polymorphic types pdf N/A 16
15 An advanced topic (PCC) -
- -
16 Recapitulation & wrapping up pdf - -


Programming project

Step
Theme
Deadline
0
Warm-up: A simple calculator
Jan 25
1
Lexical analysis for MiniJava
Feb 1
2
Parsing MiniJava
Feb 15
3
MiniJava type-checking
Feb 29
4
Generating LLVM
March 14
5
LLVM optimization
March 20


Example exams

2010

2008

Course evaluations

2010

2008

Links to related information

The MiniJava project

The Java Language Specification

ANTLR homepage

LLVM homepage

ANTLR reference

How to write unmaintainable code