CS 445 - Compilers - Fall 2009

Class News

Nov 16
You can now submit code for sample code generation. See the submit tool for source code below the homework submit page.

Nov 16
The testing script is now available for assignment 5.

Nov 14
Assignment 5 has been posted!

Nov 11
In assignment 4 I am now sorting the errors as I did in assignment 3.

Nov 8
It seems the expected test answers in the submission script for assignment 4 were from an earlier compiler. The error messages do not even match the error routine supplied with the assignment and yet neither I nor anyone else spotted this until now. The tests in the test data tar file were correct. I have corrected the expected output for the submission script and moved the due date out two days. I'll take comments by email and on Monday.

Nov 2
The testing script is now available for assignment 4.

Nov 2
Assignment 4 has been posted!

Oct 26
Extra Credit

Oct 26
testDataA3.tar and testDataB2.tar on the test data page have been updated including a couple of new files in A3 and output files in B2. Cheers.

Oct 26
The testing script is now available for assignment 3.

Oct 14
I will not give your compiler any syntax errors in the testing for assignment 3. We'll do that on assignment 4. This makes assignment 3 a little easier (but not much).

Oct 14
Assignment 3 testdata is on the test data page. The test script hasn't been instaled yet.

Oct 12
Be very very sure you study this midterm for the test on Tuesday Oct 13! We will go over what we can in class on the 12th.

Oct 11
Assignment 3 has been posted.

Oct 5
First exam is on Oct 13.

Oct 4
There is no example of the unary * operator in the everything.c- example in assignment 2. I have put some into a new everything.c- linked in the same place in assignment 2. Cheers.

Sep 28
The getopt protocol for handling filenames without an dash option may be handled differently on different machines. If you use getopt you may want to use the getopt code and example provided in the links section on this page which shows you how to invoke that version of the getopt. This way it will run on your home machine and on wormulon.

Sep 26
The testing script is now available for assignment 2

Sep 22
Assignment 2 has been posted.

Sep 4
The testing script is now available Give it a try using the submission page link. Report any problems. I will be in and out of internet connection all holiday weekend.

Sep 4
Right now we are having some trouble with disk mounting on the testing system so in the meantime I have put some sample input and output on the test data page.

Sep 2
The calc code and its makefile can be found in links section at the bottom of the page.

Aug 31
Infrequently Asked Questions

Aug 28
Assignment 1 has been posted.

Aug 27
Computer Science Senior Seminar is at 3:30 on Thursdays (currently in BEL 205). Anyone can show up to listen to computer science talks. For some this is a class. Cheers.

Aug 25
Eight more books are on order at the bookstore. They should be here within a week.

Aug 10
Welcome to Compilers! Be sure to read the material in the Service Links section below. You are responsible for everything that appears on the class web pages.

Note: The assignments will only become active links when the assignment is given out.

Time: 2:30-3:20 MTWF [note the days. We will talk about this in class]
Location:EP 214
Text: Compiler Construction: Principles and Practice by
Kenneth Louden, ISBN: 0534939724, Published by Brooks and Cole

Office Hours: My schedule
Class Objectives: Formal and General Class Objectives

Class Description

An introduction to compiler design and construction. This is a hands-on compiler construction course in which each student will work independently to construct a compiler that actually compiles a rather complex C like language including recursive functions and arrays. The student will be carefully guided toward a successful completion by working on incremental development and testing of the compiler.

Goals:

  1. Understand the basic theory of languages and techniques for simple language translation.
  2. Understand the features of compilers and interpreters.
  3. Understand why compilers behave as they do and why languages may be designed the way they are in response to compiler constraints.
  4. Understand the basic components and layered design of a compiler and the rational for their use.
  5. Each student will be responsible for independently building a simple compiler for a virtual machine and augment it with new features. The compiler will handle typing, procedure invocation, arrays, recursion, optimization, global and local scope, etc. The instructor will help the student to achieve this goal over a series of assignments, but it is up to the student to keep up with the assignments and complete each on time.
It is highly recommended that students be proficient in C or C++ and have good data structures skills. The students will be expected to write a program that has from 1000 to 4000 lines of code depending on how they solve the problems presented. Since this is a phased development, completing each assignment in sequence and having good time management skills is critical.

CS445 Class Schedule by Week

Wk#

In-Class Week

Topics/Links Assignments Comments
1Aug 24 Introduction to the class, what we plan on doing, how the class works, where to find stuff. How is a compiler organized.    
2Aug 31 Scanners and how they are defined, grammars, intro to flex and bison Read Chapter 1, assignment 1  
3Sep 7 more on scanners, UNIX tools for homework submission, syntactic analysis Read Chapter 2 NO CLASS ON MONDAY
4Sep 14 Context Free Grammar review, Intro to LL(1) parsing Read Chapter 3  
5Sep 21 First and Follow sets, formal LL(1) development Read Chapter 4, assignment 2  
6Sep 28 various LR parsings and getting bison to build your syntax tree, grammar conditioning such as removing left recursion Read Chapter 5  
7Oct 5 More on LR parsing and syntax trees    
8Oct 13 Symbol tables, type checking, and discuss what you need to know to do assignment 3 Assignment 3, Read Chapter 6 TEST TUESDAY over chapts 1-5
9Oct 19 attribute grammars and how to finish out our syntax tree    
10Oct 26 discuss assignment 3   No Class Oct 21 and 23
11Nov 2 Using the error token in Bison, start looking at the Tiny Virtual Machine Assignment 4  
12Nov 9 More on the virtual machine and assignment 4    
13Nov 16 Memory allocation and code generation Read Chapter 7, Assignment 5  
14Nov 23 More on code generation, extensions to C- that are common in many languages but that we won't actually include.    
15Nov 30   FALL BREAK  
16Dec 7 Optimizations in general, local optimizations, code selection, register allocation, How to add more features to C- such as strings, prototypes, and for statements, how to build linkers and loaders code generation assignment due this coming weekend!!!  
17Dec 14 Final   Final Exam Friday Dec 17 3:30-5:30pm

Service Links

Documentation

Code

Cool Links

These links are provided to entertaining and informative. You don't need to study them unless it is suggested that you do so. These links are not guaranteed to accurate, contain information that is safe to download, or not offend your morals, good sense or good taste, or to give sound financial advice. Some small parts may pose a choking hazzard for children...