CS411: Introduction to Compiler Construction
Winter Session 2011/2012 Term 2
Note: We are using the same textbook and the material will be similar to last year.
News
- Textbook: Modern Compiler Implementation in Java 2nd
Edition. Andrew W. Appel.
Course Info Quick Links
Midterm
The midterm will be on Wednesday February 15th. A small set of sample
problems that may be somewhat like what might possibly be on some midterm
(is that sufficiently non-specific that I can get away with anything????) is
here.
Assignments
Patches
As we go along, I'm sure that either you or I will find more problems with
the starter code that you have been given. Here are the patches so far:
- The patch to the simulator that makes it
work on Linux boxes. It was
pointed out on Piazza last week, but if you missed it you should apply it.
- The patch for this week. This fixes a few
little problems with the IR interpreter and the simulator.
- The patch for this week. This exposes any
syntax errors that the X86_64 simulator detects when it tries to process
your generated code.
- A very important patch that you
should apply right now. This one
fixes another problem with the IR interpreter - in particular, it ensures
that the interpreter treats the last generated fragment as the main one,
rather than the first one (which it did previously).
-
Another very important patch for
MiniJava, that reverses the second patch for phase 3. Because we are
doing MiniJava now, we need to identify the first generated fragment as
the main one, rather than the last one.
-
And another patch for
MiniJava, that provides the runtime routines in the IR interpreter.
-
For MiniJava phase 3, this patch
provides the minijava.analysis package as well a making a few more changes
to the compiler and the X86_64 simulator.
The patches are applied as follows:
- First save the patch to a file, then in eclipse,
- select your project cs411.2011w2.functions
- right click and select Team->Apply Patch
- Select File and browse to where you saved the patch, then click Next
- Make sure the right project is selected in the list, and click
Finish (if you click Next, it will show you a preview of what the patch
is going to do).
- All done.
Project Details and Due Dates:
-
The signup deadline for partners is now Monday, January 16th (not the
Wednesday January 11th date that was in the course information page).
-
Assignment 1 is due on Wednesday, January 11th, at 11:59:59pm.
-
Assignment 2 is due on Wednesday, January 18th, at 11:59:59pm.
-
The first phase of your project, extending the parser to support
functions, is due on Wednesday, January 25th, at 11:59:59pm.
-
The second phase of your project, type checking the
Functions language, is due on Wednesday, February 1st, at 11:59:59pm.
-
The third phase of your project, translating the
Functions language to IR, is due on Wednesday, February 8th, at 11:59:59pm.
-
The fourth phase of your project, code generation for the
Functions language, is due on Friday, February 17th, at 11:59:59pm.
-
The first phase of the MiniJava project, scanning, parsing and semantics
checking of the MiniJava language, is due on Wednesday, March 7th, at
11:59:59pm.
-
The second phase of the MiniJava project, translation of MiniJava to IR, is due on Wednesday, March 14th, at
11:59:59pm.
-
The third phase of the MiniJava project, flowgraph construction and
liveness analysis, is due on Wednesday, March 21st, at
11:59:59pm.
-
The fourth phase of the MiniJava project, interference graph construction and
register allocation, is due on Wednesday, March 28th, at
11:59:59pm.
Random other files
If you are not completely happy with your Functions compiler and would
rather start from (I hope) a working implementation than continue with your
own, I have made my solution available. It also includes the AST nodes that
will be necessary to handle MiniJava. The solution is in: minijava-starter.zip.
If you would like to use them, there are some parsing and type checking
tests in the following files:
They should replace the identically named files in the appropriate test
package in your compiler project.
The sample MiniJava programs from the textbook are in this tar file: sample.tar.gz.
The expected output from the sample MiniJava programs from the textbook are in this tar file: sample-out.tar.gz.
The sample MiniJava project has out-of-date runtime.c and runtime.h files.
These should replace the ones in the runtime subdirectory of your project
and are necessary to run the code natively on Linux or MAC.