Undergraduate Course: Compiling Techniques (INFR10065)
Course Outline
School | School of Informatics |
College | College of Science and Engineering |
Credit level (Normal year taken) | SCQF Level 10 (Year 3 Undergraduate) |
Availability | Not available to visiting students |
SCQF Credits | 20 |
ECTS Credits | 10 |
Summary | This course describes the phases of a modern programming language compiler with an emphasis on widely-used techniques. The course project will require students to implement a complete compiler from scratch for a simple programming language, targeting a real machine assembly such as RISC-V.
Students will also learn about implementing a compiler pass in a real compiler framework. |
Course description |
* Introduction: structure of a compiler
* Lexical analysis: tokens, regular expressions, Lex
* Parsing: context-free grammars, predictive and LR parsing
* Abstract syntax: semantic actions, abstract parse trees
* Semantic analysis: symbol tables, bindings, type-checking
* Stack frames: representation and abstraction
* Intermediate code: representation trees, translation
* Basic blocks and traces: canonical trees and conditional branches
* Instruction selection: algorithms for selection, RISC and CISC
* Liveness analysis: solution of dataflow equations
* Register allocation: colouring by simplification, coalescing
* Real assembly language: ARM, MIPS, or RISC-V
* Advanced Topics may include: automatic parallelisation, popular open-source compilers: GCC, LLVM, MLIR
|
Entry Requirements (not applicable to Visiting Students)
Pre-requisites |
|
Co-requisites | |
Prohibited Combinations | |
Other requirements | This course is open to all Informatics students including those on joint degrees. For external students where this course is not listed in your DPT, please seek special permission from the course organiser. |
Course Delivery Information
|
Academic year 2024/25, Not available to visiting students (SS1)
|
Quota: None |
Course Start |
Semester 2 |
Timetable |
Timetable |
Learning and Teaching activities (Further Info) |
Total Hours:
200
(
Lecture Hours 33,
Seminar/Tutorial Hours 11,
Programme Level Learning and Teaching Hours 4,
Directed Learning and Independent Learning Hours
152 )
|
Assessment (Further Info) |
Written Exam
0 %,
Coursework
100 %,
Practical Exam
0 %
|
Additional Information (Assessment) |
Coursework 100%: Three practical compiler exercises
The nature of this course means that assessment is only possible while the course is running. Any students entitled to a resit (e.g., visiting students, resits for professional purposes, ordinary degree students, or students with null sits) would need to retake the course in the following academic year. |
Feedback |
Not entered |
No Exam Information |
Learning Outcomes
On completion of this course, the student will be able to:
- analyse compilation tasks and to apply standard compilation techniques
- develop, implement and apply modifications to standard compilation techniques and algorithms wherever this is necessary
- understand and implement design decisions in modern compilers
|
Reading List
* Andrew W. Appel, Modern Compiler Implementation, Cambridge University Press, 1998. Three versions of this book are available which present code fragments from the compiler in the languages C, Standard ML and Java. Students should use whichever version of the book they prefer.
* Alfred V. Aho, Ravi Sethi, Jeffrey D, Ullman, Compilers: Principles, Techniques and Tools. Addison Wesley, 1986.
* Steven Muchnick, Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997
* Reinhard, Wilhelm, Dieter Maurer, Compiler Design. Addison Wesley, 1995.
* Charles N. Fischer, Richard J. LeBlank, Jr., Crafting a Compiler in C. Benjamin/Cummings, 1991.
* Keith Cooper, Linda Torczon, Engineering a Compiler, Morgan Kaufmann |
Contacts
Course organiser | Dr Amir Shaikhha
Tel: (0131 6)50 4379
Email: amir.shaikhha@ed.ac.uk |
Course secretary | Miss Rose Hynd
Tel: (0131 6)50 5194
Email: rhynd@ed.ac.uk |
|
|