A compiler translates a computer program from a high level language, such as C, Python or Java, to machine code, the internal representation in the computer.
Compilation takes several steps. The first step is lexical analysis, to separate the program into “words”. Syntactic analysis finds the structures. Code generation is often done in two steps, via an intermediate code to machine code. Often the code is improved through code optimization.
The methods and tools from compiler design are useful for other forms of translation, for example from XML to a data structure.
The course is taught in English (and the exams should be written in English too). In order to pass the course, you should pass the assignments (all of them) as well as the written exam.
Please make it your habit to visit this page frequently, since everything related to this course is put here (and the news section will be updated almost daily).
This course is highly influenced by the ( Compiler Design I, 1DL320) from Uppsala University
(Note: The reading list is for the Purple Dragon Book only, I can put other books' reading lists if you are interested)
The Purple Dragon Book:
Chapters | What |
---|---|
Ch1, Ch2 | Overview |
Ch3.1-Ch3.8 | Lexical analysis. 3.2, 3.5, and 3.8 not in detail. |
Ch4-Ch4.6,Ch4.8 | Syntactic analysis. LL(1), LR(0), SLR in detail. LR(1) and LALR(1) not in detail. Error recovery can be skipped. |
Ch5-Ch5.3 | Overview of attribute grammars. Constructing Syntax trees. |
Ch6.5-Ch6.5.3 | Type checking. |
Ch7-Ch7.2,Ch7.4 | Runtime environment. 7.4 not in detail. |
Ch6, not Ch6.7 | Intermediate code generation. Concentrate on the semantics of the programming language constructs and disregard the book's emphasis on doing the translation during parsing: the translation is instead to be done by traversing an explicit syntax tree. |
Ch8-Ch8.4,Ch8.7,Ch8.8 | Code generation. |
Can be found here
Can be found here
The formal description of the course can be found here