COMP207P - Compilers
This database contains 2016-17 versions of the syllabuses. For current versions please see here.
|Taught By||Earl Barr / Yue Jia|
|Aims||This is a practical course whose primary goal is develop an understanding of the operation of compilers and the development and specification of computer-based languages. The course pulls together threads from underlying theory, most notably from logic and from data structures and algorithms, and builds on these a practical exercise in which students create a compiler of their own using commonly available compiler development tools.|
|Learning Outcomes||To be able to: build lexical analysers and use them in the construction of parsers; express the grammar of a programming language; build syntax analysers and use them in the construction of parsers; perform the operations of semantic analysis; build a code generator; discuss the merits of different optimisation schemes.|
- Anatomy of a compiler
The importance of compilers
Structure of a compiler
Analysis (lexical, syntax and semantic analysis)
Synthesis (intermediate code generation, optimisation and code generation)
Compilers vs. interpreters
Lexical analysis (scanning)
Finite state automata (deterministic and non-deterministic)
Translating regular expressions into finite state automata
Automatic lexer generators (JLex/JFlex)
Syntax analysis (parsing)
Derivations and (concrete/abstract) syntax trees
Handling ambiguous grammars
Top-down parsing (LL(k) grammars, recursive descent parsers)
Bottom-up parsing (LR(k) grammars, shift-reduce parsers)
Automatic parser generators (CUP)
Syntactic error recovery
Abstract syntax tree construction
Symbol table management
Scoping and type checking
Basic implementation techniques (Visitor methodology)
Intermediate code generation
Three address code
Code generation and optimisation
Run-time storage organisation
A simple code generation algorithm
Optimisation of intermediate code
Optimisation of target code (Peephole optimisation)
Method of Instruction:
Lecture presentations, problem classes, lab classes.
The course has the following assessment components:
- Written Examination (2.5 hours, 80%);
- Coursework Section (20%).
To pass this course, students must:
- Obtain an overall pass mark of 40% for all components combined;
- Obtain a minimum mark of 30% in each component worth ≥ 30% of the module as a whole.
'Compilers - Principles, Techniques, and Tools' by A.V. Aho, R. Sethi and J.D. Ullman. Addison-Wesley.
'Modern Compiler Implementation in Java' by A.W. Appel. Cambridge University Press.
'Modern Compiler Design' by D. Grune, H.E. Bal, C.J.H. Jacobs, K.G. Langendoen. Wiley.