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

MWF 10:30-11:20AM, DeBartolo 125
Prof. Douglas Thain
Email: dthain@nd.edu
Office: 382 Fitzpatrick Hall
Office Hours: Mon/Wed 1-3PM
TA: Tim Shaffer
Email: trshaffe1@nd.edu
Office: "Fishbowls" on 3rd floor of Fitzpatrick
Office Hours: Tue/Thu 3-5PM

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

    Piazza Discussion Page

    Textbook and Online Materials

  • Douglas Thain, "Compilers and Language Design", online textbook, 2017.
  • Overview of C-Minor 2017
  • 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
  • Typo Points

    To encourage you to read the textbook closely and help me find bugs, I'll award "typo points" for each typo reported to me by email. Each typo point is worth 1/5 of an extra credit point toward your final grade, up to a maximum of 25 typo points, or 5 extra credit points.

    Schedule

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

    Week Lecture Topic Reading Reference Assignment
    Aug 22 Introduction Chap 1 Chap 2C-Minor
    Aug 29 Scanning: Regex / Automata Chap 3 Flex Manual
    Sep 5 Parsing: Top Down and LL(1) Chap 4.1-4.3 HW1 Due Friday
    Sep 12 Parsing: Bottom Up and LR(1) Chap 4.4-4.6 SLR Handout Scanner Due Friday
    Sep 19 Parsing with Bison Chap 5 Bison Manual HW2 Due Friday
    Sep 26 Abstract Syntax Tree Chap 6 AST HandoutHW3 Due Friday
    Oct 3 Typechecking Parser Due Fri
    Oct 10 Catch Up Midterm Wednesday
    Oct 17 Fall Break
    Oct 24 Typechecking
    Oct 31 Intermediate Representation Type Checker Due Friday
    Nov 7 Assembly Language
    Nov 14 Code Generation Translator Due Friday
    Nov 21 Catch Up (Thanksgiving)
    Nov 28 Optimization
    Dec 5 Optimization Code Generator Due Wednesday
    Dec 12
    4:15-6:15PM
    Final Exam