Compilers

Module aims

In this module you will have an opportunity to:

  • appreciate how a compiler for a high-level programming language works
  • understand how programming language design is influenced by compiler structure and how computer architecture is influenced by the needs of compiled programs
  • develop the technical skills needed for constructing practical compiler components, such as parsers, interpreters, semantic analysers, code generators and code optimisers   

Learning outcomes

Upon successful completion of this module, you will be able to:

  • use regular expressions and context-free grammars to specify programming language syntax
  • explain how parsers and parser generators work
  • use state of the art tools to implement a parser for a given grammar
  • generate machine code from the internal representation of a program
  • use static analysis to facilitate code and register optimisation
  • explain the role of run-time systems in supporting program execution
     

Module syllabus

This module cover the following topics:

  • Lexical Analysis
  • LL and LR Parsing
  • Semantic Analysis
  • Runtime memory organisation
  • Code Generation
  • Code Optimisation
     

Teaching methods

The module aims to build your understanding through lively interactive classes, driven by exposure to principles, examples in various programming languages, interesting ideas, and provocative challenges. You will develop and test your understanding through unassessed, formative tutorial exercises, which will include examples of past exam paper questions. The course leads directly into a compiler laboratory exercise, which forms part of Computing Practical 2 that runs in parallel with the module. This close coupling between the module content and compiler laboratory exercise provides an opportunity for you to appreciate how the theoretical underpinnings of compiler design are put into practice.           

Assessments

There will be one practical coursework exercise that contributes 15% of the mark for the module. There will be a final written exam, which counts for the remaining 85% of the marks.         

                           
There will be detailed feedback on the coursework exercises which will include written feedback on your individual submission and in-class feedback explaining common pitfalls and suggestions for improvement.                           

Module leaders

Dr Naranker Dulay
Professor Paul Kelly