||Friday 10:15-11:00, room CO 2
||Friday 11:15-12:00, room INF1
- Put up some details on the results
from correcting your compilers.
- The deadline for the last part of the progect - the interpreter -
is 18:00 on Friday, 11/07/03.
Submission instructions will be posted separately at the project
Web page. Please do not submit anything before that. If you have
already submitted your interpreter, you will have to re-submit it.
- The last bonus project is on.
It is completely voluntarily, if you do it you can get up to
10 extra points on the exam. The project is to write an interpreter for
"Expressive" which works over the AST.
More information about the project, including a framework is at the
project Web page.
- Slides for lecture 12 are up.
- Some information about the Exam
including example questions are up..
- Since many of you complained about having a bonus
project after the end of the semester I am prepared to scrap
that project. We will discuss this and make a decision at
the lecture on Friday. If the project is on it will be to
write an interpreter over the AST.
This course will teach the basic principles of compilers.
Emphasized are parts of the compiler, which are of general interest.
This is a very practical course, and during the course an interpreter for a
small programming language (called Expressive) will be written.
Java will be used for the implementation of this interpreter.
Since the focus of this course is on the practical implementation the
theoretical aspects of compilers will be treated rather lightly.
We will suggest further reading in the course books for the theoretically interested student,
and sometimes even some suggested further reading for the practically interested
(marked with T and P respectively).
- Compiler Overview (Slides,
- Lexical Analysis (Slides,
- Syntactic Analysis (Slides,
- Abstract Syntax (Slides,
- Semantic Analysis (Slides,
- Code generation (Slides,
- Interpretation (Slides,
Lecturer: Dr. Erik Stenman
The slides of these lectures are available as postscript files (6 color slides per page).
- Week 12
In this lecture we will finish up interpretation and then briefly
sum up the course.
Interpretation (cont), also in
- Week 11
In this lecture we will talk about runtime environments and interpretation.
Interpretation, also in
- Week 9
In this lecture we will continue talking about code generation, mainly through
an example of generating code for Expressive on the EVM.
Code.java, Generator.java. (T Appel: Chapter 7,8,9)
Code generation through example, also in
- Week 8
In this lecture we will start talking about code generation
and the machine we are compiling to (EVM).
Suggested reading: (T Appel: Chapter 7,8,9)
Introduction ot code generation, also in
The EVM, also in
- Week 7
In this lecture semantic analysis will be presented.
Appel: Chapter 5
Semantic Analysis, also in
- Week 6
In this lecture the Visitor pattern for working with the abstract syntax will be presented.
Suggested reading: Appel: Chapter 4.3
Visitors, also in
- Week 5
In this lecture abstract syntax trees and actions in JavaCup will be presented.
The JavaCup Manual
Appel: Chapter 4.0 - 4.2
Abstract Syntax, also in
- Week 4
In this lecture parsing with JavaCup will be presented.
The JavaCup Manual
Appel: Chapter 3.4 - 3.5
Parsing, also in
- Week 3
In this lecture parsing will be presented.
Appel: Chapter 3.0 to 3.2 (T 3.3)
Appel: 3.1, 3.3 a-c, g (T: 3.4, 3.5, 3.6)
Parsing, also in
- Week 2
The lecture will conclude Part II by presenting how a scanner generator turns
a description into a program, the project will also be presented.
Appel: Chapter 2.3 to 2.5
Appel: (T: 2.9)
Scanner generators, also in
The assignment, also in
- Week 1
The first two lectures will give an introduction to compilers and
then continue by describing how lexical analysis is done.
Appel: Chapter 1, 2.0, 2.1, 2.2.
Wirth: Chapter 1 to 3 (only 16 pages).
Appel: 2.1 a-f (P: 1.1 a-b, T: 2.3 a-b)
Wirth: (T: 2.2)
Part I and Part II also in black and white for printing:
Part I and Part II, also in
Project description is here.
Deadline and credits
You will need at least 50% on the exam to get the grade 3.
- A working parser handed in before 23.5.03 will give a ~10% bonus on the exam.
- A full working compiler handed in before 20.6.03 will give another ~20% bonus on the exam.
- A working interpreter handed in before the exam (date to be announced) gives yet another ~10% on the exam.
We have put up a special page with information about the exam and some example exam questions.