Welcome to the ‘Programming Languages’ course, lectured in January to April 2010 by myself.
Previous courses
I taught some of this material in 2009, 2008, and 2007. Slides and videos of previous lectures are online and are a good source of information.The course handbook contains the module descriptor for F28PL on page 52. The coursework is worth 40%, the exam is worth 60%.
There is also an online stackexchange site called Haggis. Questions? Answers? Go there.
Slides and videos for the current year are below.
The assignment
There will be two assignments. The first one is here; test data is here. The assignment is due by 25 February 2010. 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; your submission must be a single pdf file (no archive like zip or rar), whose name includes your full name and regno. Don't forget to include the test data.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
-
15:15-16:15 on Tuesdays in EM244.
- 11:15-12:15 on Wednesdays in EM336.
- 16:15-17:15 on Thursdays in EM182.
- There is also labwork (which is not optional!) 15:15-17:15 on Mondays in EM250.
- 11:15-12:15 on Wednesdays in EM336.
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.Note: the videos are just avi files (typically 150-300Mb). They are not streaming video. This is because of technical limitations; online streaming video services only allow 10 minutes of video, and I do not want to administer my own streaming video server from the department.
Downloading these videos to your Heriot-Watt filespace may fail, if the file exceeds your filespace quotas. In that case, download onto a USB stick or other mass storage device instead.
-
Lecture 1, 20100112.
(Introduction; Languages and grammars) -
Lecture 2, 20100113.
(Languages and grammars) -
Lecture 3, 20100114.
(Left recursion, bad grammars, grammar transformation) -
Class discussion 1, 20100119.
(Discussing the first lab session.) -
Lecture 4, 20100120.
(Lexing and regexps) Thanks to Scott for this link: Regular Expression Laboratory. -
Lecture 5, 20100121.
(Scope, block structure, symbol table, strong vs. weakly typed languages, static vs. dynamic type checking) -
Lecture 6, 20100126.
(Efficient symbol tables, hash functions) -
Lecture 7, 20100127.
(Top-down and bottom-up table-driven parsing.) -
Lecture 8, 20100202.
(YACC.) -
Lecture 9, 20100203.
(Recursive descent parsing.) -
Lecture 10, 20100216.
(C programming.) -
[video]
-
Lecture 11, 20100218.
(C programming.) -
[video]
-
Lecture 12, 20100223.
(C programming.) -
[video]
-
Lecture 13, 20100224.
(C programming.) -
[video]
-
Lecture 14, 20100225.
(Pointers.) -
[video]
Programs
Example LEX programs are here.Exercise sheets
Questions 1 and 2 from last year's exam are now online, to be done during the lab on 8 February 2010. If possible, submit your answers at the end of the lab to /u1/cs2/public/F28PL using the submit script you will find in that directory. Exercise sheet 1. Exercise sheet 1.Exercise sheet 2. You'll want to look at these programs.