You are on page 1of 3

Overview

This course consists of approximately 20 lectures, 9 tutorial sessions, and 20 lab hours.

Lecture Notes, Tutorial and Laboratory exercise sets:

Lecture 1 - Introduction: Compressed B/W version (for printing) and Colour
version (for viewing).
Lecture 2 - Language Grammars: Compressed B/W version (for printing) and
Colour version (for viewing).
Lecture 3 - Grammars II: Compressed B/W version (for printing) and Colour
version (for viewing).
Lecture 4 - A Complete Example of All LP Stages: Compressed B/W version (for
printing) and Colour version (for viewing).
Lecture 5 - Lexical Analysis I: Theory Compressed B/W version (for printing) and
Colour version (for viewing).
Lecture 6 - Lexical Analysis II: Automatic Generation using LEX: Compressed B/W
version (for printing) and Colour version (for viewing).
Lecture 7 - Parsing I (Overview and Top-Down parsing) Compressed B/W version
(for printing) and Colour version (for viewing).
Lecture 8 - Parsing II (Top-Down parsing II) Compressed B/W version (for
printing) and Colour version (for viewing).
Lecture 9 - Parsing III (Bottom up parsing I) Compressed B/W version (for
printing) and Colour version (for viewing).
Lecture 10 - Parsing IV: Automatic generation using YACC/Bison Compressed B/W
version (for printing) and Colour version (for viewing).
Lecture 11 - Parsing V: Bottom up parsing II Compressed B/W version (for
printing) and Colour version (for viewing).
Lecture 12: Context Analysis Compressed B/W version (for printing) and Colour
version (for viewing).
Lecture 13 - Code Generation I: Intermediate Code Generation Compressed B/W
version (for printing) and Colour version (for viewing).
Lecture 14: Code Generation II Compressed B/W version (for printing) and Colour
version (for viewing).
Lecture 15: Code Generation III Compressed B/W version (for printing) and
Colour version (for viewing).
Lecture 16 - Code Generation IV: Code optimisation Compressed B/W version (for
printing) and Colour version (for viewing).
Lecture 17 - GCC Internals Compressed B/W version (for printing) and Colour
version (for viewing). Tutorial exercises are found below; sample solutions will posted a
few days after each tutorial session, to give you a chance to try them on your own first
(you are strongly encouraged to do so; these questions give a good indication of the type
of questions you might get in the exam)
Tutorial Exercises Set 1 - Grammars: Problem sheet Sample answers
Tutorial Exercises Set 2 - DFA/NFA and Grammar rewriting: Problem sheet Sample
answers
Tutorial Exercises Set 3 - Parsing I: Problem sheet Sample answers
Tutorial Exercises Set 4 - Parsing II: Problem sheet Sample answers
Tutorial Exercises Set 5 - Register Allocation: Problem sheet Sample answers The
first four lab sessions will be dedicated in helping you get some experience in writing
C/C++/LEX/YACC programs. There is a laboratory support page created by Liam
Madden here , with useful information and some sample partial solutions. You are
*strongly* adviced to use one of the 3 Unix environments available for all your labwork.
Computing Lab 1 - Preprocessors: here.
Computing Lab 2 - Trees: here.
Computing Lab 3 - Lexical Analysis: here.
Computing Lab 4 - Syntax Analysis: here.
Laboratory sessions 5-10 will be dedicated to components of the assessed practical.

Assessed Coursework

Your assessed coursework involves the construction of a compiler from Pascal to ARM
code - here are the formal instructions. Simple sample programs to test, and some
frequently asked questions can be found here.. You will also be attending an oral
examination during your last lab session, on the 17th of March, between 10-12am, in
which you will be asked to demonstrate your compiler and answer questions on it.

Exams

The exam for this course will be two hours long. It will consist of four questions;
question 1 is mandatory, and carries 40% of the marks. You will have to select 2 out of
three additional questions to answer, each carrying 30% of the marks. Past exam papers
and solutions have distributed to you with the lecture notes pack.

Recommended books

Compilers: Principles, Techniques and Tools (The red dragon Book), 1988, by Aho,
Sethi and Ullman.
Modern Compiler Design, (2001) by Grune, Bal, Jacobs and Langendoen Book's web
page.

Useful links:
Free books

Compiler and Compiler Generators: an introduction using C++ HERE
List of free compiler books HERE
Thinking in C++ by Bruce Eckel: HERE
Compiler Construction using Flex and Bison: HERE

Manuals / software tutorials
The Lex and Yacc page
Lex and Yacc Examples/FAQ/links
Lex and Yacc Primer/HOWTO
GCC documentation

Software & Information

Compiler Construction Tools metapage.
Another Free Compiler Construction Tools metapage.
comp.compilers FAQ page.
C++ resources: a list here. )
Unix tools under windows here.
ISE1 Computer Architecture webpage (ARM resources): here.
GCC compiler collection internals: here.

Linux / Cygwin

Cygwin home page.
Kernel Newbies web page.
The Linux Documentation Project web page.
The Linux Installation HOWTO
Linux HeadQuarters This web page will be updated regularly throughout the
course. Comments welcome.