CSE 40243/60243 - Compilers and Language Design - Fall 2016

MWF 10:30-11:20AM, DeBartolo 331
Prof. Douglas Thain
Email: dthain@nd.edu
Office: 382 Fitzpatrick Hall
Office Hours: TBA

Overview

Compilers is a challenging and fun course in which students will design and implement a complete compiler for a C-like language from top to bottom. The course brings together many different elements of computer science, ranging from the theoretical (formal grammar classes) to the very practical (x86 assembly language) with a pinch of software engineering in the middle. After completing the course, you will be able to write programs that manipulate computer languages in different ways, ranging from simple interactive calculators to programs that translate one language to another.

Students completing the course may also experience some side effects:

  • You will learn how to use pointers really well.
  • You will gain experience in engineering a complex piece of software, including source code control, testing, and evolution.
  • You will truly understand the C language inside and out, which will make you a better programmer all around.
  • Course Syllabus

    Textbook and Online Materials

  • Keith Cooper and Linda Torczon, Engineering a Compiler, 2nd edition, Morgan Kauffman, 2012. ISBN: 978-0-12-088478-0
  • Overview of C-Minor 2016
  • CMinor Starter Code and Examples
  • Introduction to X86-64 Assembly for Compiler Writers
  • Intel Corp, Intel-64 and IA-32 Architectures Software Developer's Manuals, 2015
  • Schedule

    This schedule is approximate and will be updated as the class proceeds.

    Week Lecture Topic Reading Notes Reference Assignment
    Aug 22 Introduction Ch 1 Intro NotesC-Minor
    Aug 29 Scanning: Regex / Flex Ch 2.1-2.3 Overview NotesFlex Manual
    Sep 5 Scanning: Automata Ch 2.4-2.5 Scanner Notes HW1 Due Friday
    Sep 12 Parsing: Top Down and LL(1) Ch 3.1-3.3 LL(1) Notes Scanner Due Friday
    Sep 19 Parsing: Bottom Up and LR(1) Ch 3.4-3.5 LR(1) Notes SLR Handout HW2 Due Friday
    Sep 26 Parsing: Bison Bison Notes Bison Manual HW3 Due Friday
    Oct 3 Abstract Syntax Tree Ch 5.1, 5.2, 5.5 AST Notes AST Handout
    Oct 10 Typechecking Ch 4 Name Resolution Notes Midterm Wednesday, Old Midterm
    Oct 17 Fall Break
    Oct 24 Typechecking Ch 4 Type Checking Notes Parser Due Wed
    Oct 31 Intermediate Representation Ch 5
    Nov 7 Assembly Language Intro to X86-64
    Nov 14 Code Generation Ref Ch 6/7 Type Checker Due Friday
    Nov 21 Code Generation (Thanksgiving)
    Nov 28 Optimization Ch 8
    Dec 5 Optimization Ch 10 Code Generator Due Friday
    Dec 12
    10:30AM
    4:15-6:15PM
    Final ExamFinal Exam, Old Final