L Computer Science &
        Electrical Engineering

Compiler Construction – D7011E
Lp3 2012


News


Oct 25 Page restored from backup again.

Course aim

The student shall be able to

Course content


Official description in the course catalog.

Lecturer

Viktor Leijon
Phone: 070 280 99 97
Email:

Examiner

Johan Nordlander
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

Viw the on-line schedule information.

Written exam: October 31, 2012 (5 hours)
Makeup exam: May 6, 2013

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 and LLVM
pdf 8, 9, (9.2) 7, 8, (18)
12 Optimization using LLVM pdf 8, 9, (9.2)
7, 8, (18)
13
Instruction selection
pdf 8
9
14 Memory Management
pdf 7 13
15 Recapitulation & wrapping up pdf - -


Programming project

Step
Theme
Deadline
0
Warm-up: A simple calculator
Sept 13
1
Lexical analysis for MiniJava
Sept 24
2
Parsing MiniJava
Oct 8
3
MiniJava type-checking
Oct 12
4
Code generation Oct 19
5
Optimization using LLVM
Oct 26


Example exams

2010

2008

Course evaluations

VT 2012 course report (only in Swedish)
VT 2012 raw scores

2010

2008

Links to related information

The MiniJava project

The Java Language Specification

ANTLR homepage

LLVM homepage

ANTLR reference

How to write unmaintainable code