Compiler Construction

ECEN 4553 & 5523
CSCI 4555 & 5525
Fall 2009

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 11:00am-11:50am

Location: ECCS 1B12

Office hours: Thursday 1:00pm-2:00pm

Textbook: None.

Course notes:  pdf (Will be updated periodically.)

Recommended books:

Grading: homework 10%, quizzes 30%, final project 10%, midterm exam 20%, final exam 30%.

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

Policies regarding honor code, religious observances, disabilities, and classroom behavior can be found here.

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/4.
  2. Parsing with PLY (Python Lex-Yacc), due 9/11.
  3. Register allocation, due 9/25.
  4. Polymorphism and heap allocation, due 10/9.
  5. Functions, due 10/23.
  6. Objects and classes, due 11/6.
  7. Final project proposal due 11/13, instructions.
  8. Final project, first draft of write-up due 11/30.
  9. Final project, slides due 12/4.
    Presentation schedule for the week of 12/7:
    • Monday, 11:00-11:20, Thomas Nelson and co.
    • Monday, 11:20-11:40, Zainab Aljaroudi and co.
    • Monday, 11:40-11:55, Daniel Stutzman
    • Wednesday, 11:00-11:20, Carlos Tafoya and co.
    • Wednesday, 11:20-11:40, Sri Teja Basava and co.
    • Wednesday, 11:40-11:55, Christopher Schwaab
    • Friday, 11:00-11:20, David Hover and co.
    • Friday, 11:20-11:40, Arlen Cox and co.
    • Friday, 11:40-11:55, Krista Hasling
    • Friday, 11:55-12:15, Paul Niewoonder and co.
  10. Final project, final write-up and compiler due 12/11.

Instructions for turning in assignments: Assignments are due by 6am of the due date. Upload your compiler using the web-form at the URL given in the email to the google group.

Quizzes (given in class):

  1. Sept. 4, solution
  2. Sept. 11, solution
  3. Sept. 25, solution
  4. Oct. 26, solution
  5. Nov. 6, solution


  1. Midterm: in class on Oct. 19, solution
  2. Final: Dec. 12, 4:30pm-7:00pm

Grades are posted here.

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