Syllabus for Compiler Design I

Kompilatorteknik I


  • 5 credits
  • Course code: 1DL321
  • Education cycle: First cycle
  • Main field(s) of study and in-depth level: Computer Science G2F, Technology G2F

    Explanation of codes

    The code indicates the education cycle and in-depth level of the course in relation to other courses within the same main field of study according to the requirements for general degrees:

    First cycle

    • G1N: has only upper-secondary level entry requirements
    • G1F: has less than 60 credits in first-cycle course/s as entry requirements
    • G1E: contains specially designed degree project for Higher Education Diploma
    • G2F: has at least 60 credits in first-cycle course/s as entry requirements
    • G2E: has at least 60 credits in first-cycle course/s as entry requirements, contains degree project for Bachelor of Arts/Bachelor of Science
    • GXX: in-depth level of the course cannot be classified

    Second cycle

    • A1N: has only first-cycle course/s as entry requirements
    • A1F: has second-cycle course/s as entry requirements
    • A1E: contains degree project for Master of Arts/Master of Science (60 credits)
    • A2E: contains degree project for Master of Arts/Master of Science (120 credits)
    • AXX: in-depth level of the course cannot be classified

  • Grading system: Fail (U), Pass (3), Pass with credit (4), Pass with distinction (5)
  • Established: 2012-03-08
  • Established by:
  • Revised: 2018-08-30
  • Revised by: The Faculty Board of Science and Technology
  • Applies from: week 30, 2019
  • Entry requirements: 60 credits including 15 credits in mathematics, including Automata Theory, and 30 credits in computer science, including Operating Systems and a second course in computer programming or Process-Oriented Programming
  • Responsible department: Department of Information Technology

Learning outcomes

To pass, the student must understand, how simple imperative programming languages equivalent to C can be compiled to machine code for RISC-like machines.

On completion of the course, the student should be able to:

  • structure a compiler as a sequence of distinct translation steps
  • use regular languages to describe the lexical elements of a programming language
  • describe lexical analysis using a finite automaton
  • use context free languages to describe the syntactic structure of a programming language
  • use the parsing methods top-down (recursive descent) and bottom-up (LR)
  • use abstract syntax trees to represent the results of the syntactic analysis
  • break down statements and expressions to simpler designs, and translate syntax trees to intermediate code
  • describe how recursive procedure calls can be implemented by means of stacks, activation posts and machine registers
  • translate the simplified intermediate code of a program to machine-specific instructions


Lexical analysis (scanning).
Syntactical analysis (parsing).
Program representation in Abstract Syntax Trees (AST).
Symbol tables and scope rules for C-like languages.
Type-checking for C-like languages.
Different forms of intermediate code (IR).
Generation of intermediate code.
Call stacks and activation posts.
Code generation for RISC-like machines.
Basic blocks, control-flow graphs, liveness analysis, register allocation.


Lectures, laboratory sessions.


The course is examined by written examination (4 credits) and assignments (1 credit).

If there are special reasons for doing so, an examiner may make an exception from the method of assessment indicated and allow a student to be assessed by another method. An example of special reasons might be a certificate regarding special pedagogical support from the disability coordinator of the university.

Reading list

Reading list

Applies from: week 30, 2019

Some titles may be available electronically through the University library.