Compilation A
Summer Semester 2003
School of Computer and Communication Sciences
Programming Methods Laboratory (LAMP)
 
 
Home
Staff
Research
Publications
Events
Teaching
  CompilationA
    News
    Overview
    Schedule
    Lectures
    Exercises
    Project
    Exam
    Contacts
    Links
Jobs
   
 
  
     

Lectures: Friday 10:15-11:00, room CO 2
Exercises: Friday 11:15-12:00, room INF1

News

8/07/03
30/06/03
  • Put up some details on the results from correcting your compilers.
26/06/03
  • 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.
20/06/03
  • 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.
19/06/03
  • Slides for lecture 12 are up.
18/06/03
  • 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.

Overview

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).

Contents:
  1. Compiler Overview (Slides, portrait)
  2. Lexical Analysis (Slides, portrait)
  3. Syntactic Analysis (Slides, portrait)
  4. Abstract Syntax (Slides, portrait)
  5. Semantic Analysis (Slides, portrait)
  6. Code generation (Slides, portrait)
  7. Interpretation (Slides, portrait)
References:
Lecturer: Dr. Erik Stenman

Schedule

Date Lectures: 8:15-9:00, room CO2 Exercises: 11:15-12:00, room INF1
14.03.03 Introductory Lecture
Lexical Analysis (11:15-12:00)
 
21.03.03 Lexical Analysis Assignment 1: A lexer
 
NEW SCHEDULE
 
Date Lectures: 10:15-11:00, room CO2 Exercises: 11:15-12:00, room INF1
28.03.03 Syntactic Analysis Assignment: Finish the lexer
04.04.03 Syntactic Analysis Assignment 2: A parser
11.04.03 Abstract Syntax Assignment: more parser
18.04.03 Good Friday  
25.04.03 Easter break  
02.05.03 EPFL Open Day  
09.05.03 Visitors Assignment: more parser
16.05.03 Semantic Analysis Assignment: finish the parser
23.05.03 Code generation SG0211 Assignment 3: Type analysis
30.05.03 Code generation cont Assignment: more analysis
06.06.03 LAB INF1 Assignment 4: Code generation
13.06.03 Interpretation Assignment: Code generation
20.06.03 Interpretation cont Assignment: Code generation

Lectures

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.
    Slides: Interpretation (cont), also in portrait format.
  • Week 11
    In this lecture we will talk about runtime environments and interpretation.
    Slides: Interpretation, also in portrait format.
  • Week 9
    In this lecture we will continue talking about code generation, mainly through an example of generating code for Expressive on the EVM.
    Suggested reading: Code.java, Generator.java. (T Appel: Chapter 7,8,9)
    Slides: Code generation through example, also in portrait format.
  • 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)
    Slides: Introduction ot code generation, also in portrait format.
    The EVM, also in portrait format.
  • Week 7
    In this lecture semantic analysis will be presented.
    Suggested reading: Appel: Chapter 5
    Slides: Semantic Analysis, also in portrait format.
  • Week 6
    In this lecture the Visitor pattern for working with the abstract syntax will be presented.
    Suggested reading: Appel: Chapter 4.3
    Slides: Visitors, also in portrait format.
  • Week 5
    In this lecture abstract syntax trees and actions in JavaCup will be presented.
    Suggested reading: The JavaCup Manual Appel: Chapter 4.0 - 4.2
    Slides: Abstract Syntax, also in portrait format.
  • Week 4
    In this lecture parsing with JavaCup will be presented.
    Suggested reading: The JavaCup Manual Appel: Chapter 3.4 - 3.5
    Slides: Parsing, also in portrait format.
  • Week 3
    In this lecture parsing will be presented.
    Suggested reading: Appel: Chapter 3.0 to 3.2 (T 3.3)
    Suggested exercises: Appel: 3.1, 3.3 a-c, g (T: 3.4, 3.5, 3.6)
    Slides: Parsing, also in portrait format.
  • 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.
    Suggested reading: Appel: Chapter 2.3 to 2.5
    JLex Manual
    Suggested exercises: Appel: (T: 2.9)
    Slides: Scanner generators, also in portrait format. The assignment, also in portrait format.
  • Week 1
    The first two lectures will give an introduction to compilers and then continue by describing how lexical analysis is done.
    Suggested reading: Appel: Chapter 1, 2.0, 2.1, 2.2. Wirth: Chapter 1 to 3 (only 16 pages). JLex Manual
    Suggested exercises: Appel: 2.1 a-f (P: 1.1 a-b, T: 2.3 a-b) Wirth: (T: 2.2)
    Slides: Part I and Part II also in black and white for printing: Part I and Part II, also in portrait format.

Exercises

  • Exercise 1 (ps)

Project

Project description is here.

Deadline and credits

  • 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.
You will need at least 50% on the exam to get the grade 3.

Exam

We have put up a special page with information about the exam and some example exam questions.

Contacts

Useful Links


     
   [an error occurred while processing this directive]  
Last modified: Monday, 01-Mar-2004 14:19:12 CET