Compiler Construction 2015
Lecture: Wednesday 14.15-16.00, room 141.
Laboratory: Wednesday 16.15-18.00 in room 104+137, and
Thursday 10.15-12.00 (Kristian Baclawski) in room 104+137
This year's course will be based on LLVM.
is at the bottom of this page.
Introduction, Organizational Issues. Planned Topics.
History of high-level programming languages, and their compilation.
(Exercises are below.)
Basics of LLVM. Examples of translations from C++ into
More examples of translations from C++ into LLVM.
Treatment of temporaries and class objects in expressions.
Note that I updated the
28.10.2015. Now that you what is the intermediate goal (LLVM),
we will study how to obtain it.
We start with the
NDFAs, regular expresssions.
More about tokenizing: Transformation from NDFA to DFA.
Minimization of a DFA.
During the lecture, I didn't like the minimization algorithm.
I improved it.
18.11.2015. Top-Down Parsing.
Slides (They were revised.)
Rest of Top-Down parsing. Definitions of FIRST and FOLLOW.
Start of Bottom-Up Parsing.
computation of prefix automaton in Bottom-Up parsing.
Computation of lookahead sets in bottom-up parsing.
Type checking/overload resolution/insertion of conversions.
The slides used during the lecture were incredibly buggy.
Please use the improved
(currently morning 14 jan) version:
Mail me if you still find bugs.
More about type checking.
Lowering to intermediate representation.
Mail me if you find bugs in the slides.
Probably still about lowering.
Optimization through abstract interpretation.
?, we still need to catch up one lecture.
Possible topic is transformation to and from SSA.
This is not a programming exercise!
Solutions will be published next week, after
Mr. Baclawski's lab.
First part is again not a programming exercise.
Second part uses Flex.
It seems that you cannot download the sources from there, but
flex is in the depository for Ubuntu and Debian.
You can use this Makefile,
and this file as starting point.
You need the file
about top-down vs. bottom-up parsing.
about bottom-up parsing.
You need maphoon,
about type checking, and insertion of conversions.
About intermediate code generation.
Principles of Compiler Design.
Alfred V. Aho, Jeffrey D. Ullman,
Addison-Wesley Publishing Company, 1977.
(The book with the dragon. Old but still very good on syntactic analysis.)
The compiler design Handbook.
(Optimizations and Machine Code Generation),
Edited by Y.N. Srikant and Priti Shankar.
Elements of Compiler Design.
Auerbach Publications, Taylor and Francis Group.
Advanced Compiler Design and Implementation
Steven S. Muchnick, Morgan Kaufmann Publishers, Inc.