Welcome to the ‘compilers’ course, lectured in January and February 2009 by myself.
Previous courses
I taught this material in 2008 and 2007. For your convenience I will change things as little as possible this time around. Slides and videos of previous lectures are therefore a good source of information for this time around.The assignment
I have not yet set the assignement, but when I do I will need you to e-mail me a pdf, and also put a paper copy in the coursework box in the crush area near EM1.24. I will mark from pdf. Send me one single file with all information I need to give you full marks; don't forget the test data.The deadline will be announced.
Your mission will be this. Test data is here.
The exam
Any student who does all the papers I set in the last two years, and the two exercise sheets, should pass with flying colours.The book
The recommended text is J. P. Bennett's Introduction to Compiling Techniques.The times
-
Tuesday, 11:15 and 16:15 EM244.
- Thursday (lab), 10:15-12:15, EM250.
- Thursday, 16:15, EM244.
- Thursday (lab), 10:15-12:15, EM250.
You may find this useful ...
CutePDF is a free PDF converter; it installs itself as a printer, which you just select to print to from within any program running under Windows, to produce a .pdf file.Slides
If you spot typos contact me.-
Lecture 1, Tuesday 13 January, 11:15.
(Introduction; Languages and grammars) -
Lecture 2, Tuesday 13 January, 16:15.
(Languages and grammars) -
Lecture 3, Thursday 15 January, 16:15.
(Left recursion, bad grammars, grammar transformation) -
Discussion of Exercise Sheet 1, Tuesday 20 January, 11:15.
(Study skills, the importance of not only attempting a question but also of completing and understanding a correct answer, distinction between formative and summative assessment, exercises 1 to 4.) -
[video]
-
Discussion of Exercise Sheet 1, Tuesday 20 January, 16:15.
(More on parse trees. Ambiguous versus non-deterministic grammars. Parse trees versus productions. Exercises 5, 6, and some comments on Exercise 2.) Reencoded. -
[video]
-
Lecture 4, Thursday 22 January, 16:15.
(Lexing and regexps)
Thanks to Scott for this link: Regular Expression Laboratory. -
Lecture 5, Tuesday 27 January, 11:15.
(Symbol tables) -
Lecture 6, Tuesday 27 January, 16:15.
(String tables, hash functions) -
Lecture 7.
(Table-driven parsing) -
Lecture 8.
(YACC)
You may find this page on YACC informative (of course, a web search will reveal many other such websites). -
Lecture 9.
(Recursive descent parsing) -
Post-lab discussion.
(Disambiguating grammaers. Review of part of what you need to know for the exam.) -
[video]
Programs
Example LEX programs are here.Exercise sheets
Exercise sheet 1. Please do Exercise sheet 1 by Sunday January 18 in the evening. I will set up a discussion board shortly, where you can submit your work.Exercise sheet 2. You'll want to look at these programs.
Extra-curricular
Occasionally I become confused during lectures, about general knowledge questions. I try to remember, afterwards, to look them up. Here are two of the more interesting ones:- The high jump.
- The world record for high-jump is approximately 8 feet (2.45 metres).
- Burning bush.
- It was Moses (as one of you suggested) to whom God said ‘I am what I am’ (Exodus 3:14).
- Van der Waals
- Johannes van der Waals was Dutch.
- Mayonnaise.
- Mayonnaise is stiff mostly because of the van der Waals force, but apparently the Casimir effect also plays an important role. Hendrik Casimir was another Dutchman, working at Philips in Eindhoven — just across the road from TU/e where I once worked. The Casimir effect is a force that seems like something straight out of Star Trek.