Compilers and Computer Architecture

Module code: G5035
Level 5
15 credits in autumn semester
Teaching method: Class, Lecture
Assessment modes: Unseen examination, Coursework

Topics on this module include:

  • low­-level versus high-­level languages
  • an introduction to language implementation techniques, compilers and interpreters, grammars and parsing
  • hardware implications, instruction set design and implementation
  • lexical analysis
  • the relevance of finite­state automata and regular grammars
  • implementation techniques
  • problems for particular languages, syntax analysis ­ overview of grammars and parsing techniques
  • top­-down and bottom­-up parsing
  • predictive parsing, shift-­reduce parsing
  • implementing hand­-coded top­-down predictive parsers
  • semantic analysis and code generation­ from trees and from flat intermediate codes
  • symbol tables
  • type checking
  • handling of specific high­-level language constructs
  • runtime storage allocation and scoping
  • instruction set consequences
  • hardware aspects of performance enhancement ­ caches, pipelining and parallelism
  • recent developments in processor design
  • code optimisation
  • introduction to flow analysis.


Further Programming or ability to program in Java.

Module learning outcomes

  • Explain the structure of a conventional compiler, showing the interfaces between the phases.
  • Use formal syntactic specifications for common high-level language constructs in the construction of the analysis phase of a compiler.
  • Implement modules of a complete compiler for a simple source language and a simple target architecture.
  • Explain the key characteristics of the instruction set of a simple modern processor and illustrate how it can be used in compiler-generated code.