Compiler Construction

ECEN 4553 & 5523
CSCI 4555 & 5525
Fall 2012

Course Information

High-level programming languages like Python make programming a breeze, but how do they work? There's a big gap between Python and machine instructions for modern computers. Learn how to translate Python programs all the way to Intel x86 assembly language.

Most compiler courses teach one phase of the compiler at a time, such as parsing, semantic analysis, and register allocation. The problem with that approach is it is difficult to understand how the whole compiler fits together and why each phase is designed the way it is. Instead, each week we implement a successively larger subset of the Python language. The very first subset is a tiny language of arithmetic statements, and by the time we are done the language includes objects, inheritance, and first-class functions.

Prerequisites: Fluency in at least one programming language (Java, C, C++, Python, etc.). Students will do a lot of programming in Python, but prior knowledge of Python is not required. The course will start with a crash course on Python and Python is one of the easiest languages to learn. Prior knowledge of an assembly language helps, but is not required.

Distance Learning: This course is also offered through the CAETE program.

Time: MWF 9:00am-9:50am

Location: ECCS 1B28

Office hours: M 3:30-4:30pm, W 10-11am, F 11am-12 in ECOT 342, and by appointment.

Textbook: None.

Course notes:  pdf

Lecture scribbles:  zip

Recommended books:

Grading: participation 5%, homework 20%, quizzes 20%, final project 10%, midterm exam 20%, final exam 25%.

Workload: up to 12 hours of out-of-class work per week.

Quizzes for distance students (CAETE): The questions for quiz will be emailed to you on the morning of the posted date of the quiz and you will email the answers back to Jeremy by midnight of the same day. The quizzes are closed book and should be completed alone, just use your brain and only use the computer to type in your answers. For example, do not use the Python interpreter on your computer to help you answer the quiz.


  1. Integers and variables, due 9/7.
  2. Parsing with PLY (Python Lex-Yacc), due 9/18.
  3. Register allocation, due 9/28.
  4. Polymorphism and heap allocation, due 10/12.
  5. Functions, due 10/26.
  6. Objects and classes, due 11/9.
  7. Final project proposal due 11/16, instructions.
  8. Final project, first draft of write-up due 11/30.
  9. Final project, slides due 12/3.
    Presentation schedule for the week of 12/10:
    • Monday, 9:00-9:15, Andy Sayler and co.
    • Monday, 9:15-9:30, Bharath Hegde and co.
    • Monday, 9:30-9:45, Jerome Biotidara and co.
    • Wednesday, 9:00-9:10, Anthony Cantor
    • Wednesday, 9:10-9:25, Bharadway Dantu and co.
    • Wednesday, 9:25-9:40, Chris Poulton and co.
    • Wednesday, 9:40-9:50, Krishna
    • Friday, 9:00-9:15, Chris Bubernak and co.
    • Friday, 9:15-9:30, Krithika Parthan and co.
    • Friday, 9:30-9:45, Sean Wiese and co.
    • Friday, 9:45-9:55, Scott Pledger and co.
  10. Final project, final write-up and compiler due 12/14.

Instructions for turning in assignments: Assignments are due by 6am of the due date. Upload your compiler using the web-form at the URL announced on Piazza.

Quizzes (given in class):

  1. Sept. 10 solution
  2. Sept. 19 solution
  3. Oct. 1 solution
  4. Oct. 15 solution
  5. Nov. 12 solution


  1. Midterm: in class on Oct. 29, solution
  2. Final: Dec. 17, 1:30pm-4:00pm, ECCS 1B28

Grades are posted here.

If you can't solve a problem, then there's an easier problem you can solve: find it. - George Polya