Compiler Design 2023

Aim

A compiler is a computer program that translates text written in a given language (called the source language) into another language (the target language). With most compilers the source language is a high-level programming language (e.g., C, C++, Java), and the target language is a lower-level representation such as assembly language or bytecode. In this course we will focus on compiler techniques needed to implement programming languages on a virtual machine. Students will implement a compiler that translates a subset of C into Java bytecode. This bytecode can then be executed on the Java virtual machine (JVM).

Synopsis

This course will cover both practical and theoretical aspects of a compiler. Our main emphasis will be on the compiler frontend (i.e., scanning, parsing, semantic analysis) and on code-generation for the JVM. Compilers are carefully crafted, complex pieces of software. We will apply software-engineering principles such as component-based design, Object-oriented design-patterns and error handling using exceptions with our compiler.

Lectures

See schedule on Portal.

Assignments

Assignment Title Material
1 Scanning LearnUs
2 Parsing LearnUs
3 AST Generation link
4 Semantic Analysis link
5 Code Generation link