Notice: For the latest information and guidance on Purdue's response to COVID-19 please visit:

Intro to Compilers: Compiler Basics


Credit Hours:


Start Date:

August 24, 2020

Learning Objective:

After completing this course, you will be able to:
  • Explain regular expressions and lexing procedures
  • Explain context-free grammars and LL(1) parsing
  • Explain semantic actions and AST construction
  • Explain how to translate ASTs into executable code
  • Build a basic compiler that can translate a program into executable code


This course is an introductory course on compilers. We will cover the full path that a compiler takes in translating high-level source code (e.g., in a language like C) to assembly code that can be run on a machine. We will cover the processes of translating source code into a compiler???s intermediate representation, then generating code from that intermediate representation. Students will also build a basic compiler that translates C code into RISC-V assembly.

Topics Covered:

Finite Automata and Regular Languages
Context Free Lnguages and Parsing
Code Generation


Comfort with programming, especially data structures and recursion. Experience with object oriented programming will also be beneficial.

Applied / Theory:

50 / 50


2 problem sets


Students will build a basic end-to-end compiler that translates programs written in a C-like language into RiscV assembly programs


1 exam


There is no required text for this class. However, students may find the book Engineering a Compiler, by Cooper and Torczon (2nd edition, Morgan Kauffman, ISBN: 978-0120884780) helpful.

Computer Requirements:

A computer that can install and run the latest versions of Java and a Git client

Other Requirements:

Students will be asked to install versions of ANTLR ( and will be required to access GitHub through a suitable Git client

ProEd Minimum Requirements:


Tuition & Fees: