This database contains the 2018-19 versions of syllabuses.
Note: Whilst every effort is made to keep the syllabus and assessment records correct, the precise details must be checked with the lecturer(s).
This is a practical module 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.
On successful completion of the module, a student will 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.
Availability and prerequisites
This module delivery is available for selection on the below-listed programmes. The relevant programme structure will specify whether the module is core, optional, or elective.
In order to be eligible to select this module as optional or elective, where available, students must meet all prerequisite conditions to the satisfaction of the module leader. Places for students taking the module as optional or elective are limited and will be allocated according to the department’s module selection policy.
Programmes on which available:
There are no formal prerequsities.
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)
- Regular expressions
- Finite state automata (deterministic and non-deterministic)
- Translating regular expressions into finite state automata
- Automatic lexer generators (JLex/JFlex)
Syntax analysis (parsing)
- Context-free grammars
- 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
- Syntax-directed definitions
- Abstract syntax tree construction
- Symbol table management
- Scoping and type checking
- Basic implementation techniques (Visitor methodology)
Intermediate code generation
- Three address code
- IR instructions
- Translation methodologies
Code generation and optimisation
- Run-time storage organisation
- A simple code generation algorithm
- Optimisation of intermediate code
- Optimisation of target code (Peephole optimisation)
An indicative reading list is available via http://readinglists.ucl.ac.uk/departments/comps_eng.html.
The module is delivered through a combination of lectures, tutorials, seminars, written and programming exercises, and project work.
This module delivery is assessed as below:
Written examination (2hrs 30mins)
In order to pass this module delivery, students must:
- achieve an overall weighted module mark of at least 40%; and
- achieve a mark of at least 30% in any components of assessment weighed ≥ 30% of the module.
Where a component comprises multiple assessments, the minimum mark applies to the overall component.