Programming Language Technology

Course codes: Chalmers DAT151, DAT150, GU DIT230
Spring Term 2015 (LP3)

Official URL:

Google group: (please provide your full name and date of birth when requesting membership!)


Last year course page:

News and changes

2015-03-03 Lab4 is up.

2015-02-17 Lab3 is up. Note that you have to submit something for the first deadline in order to resubmit to the final deadline.

2015-02-16 Change in schedule: "Hands-on with lab 3" shifted to Feb 24. Deadlines of labs 3 and 4 and final deadline have been shifted back to accommodate for the extra week in LP3.

2015-02-10 Lab2 now has the correct test program to compile under ghc-7.6 and up. Also, it has seen minor modifications in the expression grammar. (However, they are neutral wrt. the testsuite. If you already started with the 2014 grammar, you can choose to stick with it.)

2015-01-19 Lab1 is up. To submit, first register at Fire.

2015-01-13 First version of this page - mostly a copy of the 2014 material. Updates forthcoming soon.


All lectures are in HA2.

Material: plt = course book, dragon = Dragon book. Slides follow closely the plt book.

Date Time Title Material
Tue 20/1 13-15 Introduction: Compilation Phases slides, plt 1, dragon 1
Thu 22/1 13-15 Grammars slides, plt 2, dragon 2.8.2,4.1-4.3
Tue 27/1 13-15 Hands-on with Lab 1 lab1 PM
Thu 29/1 13-15 Theory of lexing and parsing slides, plt 3, dragon 3,4
Mon 2/2 23 Lab 1 deadline lab1 PM
Thu 5/2 13-15 Type checking slides, plt 4, dragon 5,6
Tue 10/2 13-15 Interpreters slides, plt 5
Thu 12/2 13-15 Hands-on with Lab 2 lab2 PM
Mon 16/2 23 Lab 2 deadline lab2 PM
Tue 17/2 13-15 Code generation slides, plt 6, dragon 6,7
Tue 24/2 13-15 Hands-on with Lab 3, The language design space slides, plt 8, dragon 1. lab3 PM
Thu 26/2 13-15 Functional programming languages slides, plt 7, dragon 6.5,7.3
Mon 2/3 23 Lab 3 deadline lab3 PM
Tue 3/3 13-15 Hands-on with Lab 4 lab4 PM
Thu 5/3 13-15 Preparing for the exam Training Exam
Mon 16/3 23 Lab 4 deadline lab4 PM
Fri 20/3 14-18 Exam (in house M) old exams
Sat 21/3 23 Final lab deadline all lab returns
Wed 15/4 8.30-12.30 Exam (in house M) old exams
Wed 19/8 14-18 Exam (in house J) old exams

The official course schema is in Time Edit.


The aim of the course is to give understanding of how programming languages are designed, documented, and implemented. The course covers the basic techniques and tools needed to write interpreters, and gives a summary introduction to compilation as well. Those who have passed the course should be able to

  1. define the lexical structure of programming languages by using regular expressions, explain the functioning of finite automata, and implement lexical analysers by using standard tools;
  2. define the syntax of programming languages by using context-free grammars, explain the principles of LL and LR parsing, and implement parsers by using standard tools;
  3. define and implement abstract syntax;
  4. master the technique of syntax-directed translation and its efficient implementation in their chosen programming language;
  5. formulate typing rules and implement type checkers;
  6. formulate operational semantic rules and implement interpreters;
  7. write simple code generators;
  8. be familiar with the basic implementation issues of both imperative and functional languages;
  9. design and implement special-purpose programming languages.
  10. master the principles of polymorphic type checking by unification
  11. implement an interpreter for a functional language


Andreas Abel, course responsible.

John Camilleri, Mauricio Chimento, Daniel Hausknecht, Inari Listenmaa, assistants.

The fastest way to get an answer is to mail the course's Google group Please provide your full name and date of birth when requesting membership! Otherwise your request will be bounced back or ignored.

Google Group

If you have any general questions regarding the course, the labs or the exercises, please ask them in our Google group This will reach all teachers and fellow students. If you are not yet member of the group, you have to

You will have to give your real name and your person number (or date of birth) when you register, otherwise your membership is not approved. This is necessary to identify you as a participant of the course.

Laboration times and supervision


The lab rooms and supervision are available from Tuesday 20 January till 10 March.

Attendance in these classes is optional. Normally, each student should attend at most one supervised laboration time each week. Since attendance is not compulsory, there may be room for more times. But, if there is lack of room, those who attend their first supervision of the week have priority to get a place and supervisor help.


There will be four laborations, written individually or in pairs.

Reporting is done via Fire. Before reporting, you must run your program through a test suite, such as the one for lab 1.

Final deadline is Saturday 21 March for all returned and corrected labs. No labs will be graded after this deadline.

We guarantee two gradings per lab: one for the version submitted before the ordinary deadline for that lab, the other for a resubmission before the final deadline. If your first submission is after the lab deadline, only one grading is guaranteed.


The main book will be one that developed from earlier editions of this course:

If you are really interested in the topic, for instance, if you want to continue with the Compiler Construction course, you should also consider the Dragon book,

Both books are available at web bookshops. The main book will also be sold at Cremona.


Written exam, usual grading scales.

Date: 20 March

Time: 2:00 afternoon

Place: M (Hörsalsvägen 5)

The exam has the same structure as these old exams.

Further, here are some exercises and solutions to prepare for the exam.


BNF Converter,

Precompiled Java tools (Cup and JLex)