During the Spring of 2006, I will be teaching CS 605, which is a course in compiler construction. Students will build a complete compiler for a small language from a set of skeletons implementing a subset of the language. Students will work in teams of two students on this project, which will be the major determinant of the student's grade. This course is normally considered to be very challenging and to require a large amount of student time and a lot of Java programming. Course materials, including the skeletons of the project be found later on this page. The project will be built in Java. The project will be very Object-Oriented. You don't need to know Java prior to starting the course, however, provided that you are thoroughly familiar with C++.
Assuming that you know C at least, you can get a copy of the Java Tutorial (2ed) by Campione and Walrath from Addison-Wesley.
You will need access to a recent version of a compiler for Java. For Java, version 1.1 or later will be REQUIRED, including inner classes. You will not be able to adapt an older compiler for this course. The instructor recommends Codewarrior for Java (it comes with both Java and C++). Microsoft Java compilers may not support needed features of the language. Borland compilers, if recent, will be OK. The JDK 1.3 or JDK 1.4 from Sun is free and is adequate for the course, but is somewhat awkward to use without an IDE. Sun also provides Documentation and tutorials. Here is Sun's Java Tutorial You will need a text editor to use it. The integrated environments set themselves up when you install them. I use Eclipse from eclipse.org. It is very complete and is free, but takes some learning. I also use Codewarrior from MetroWerks and the JDK. I like Codewarrior and it is up to date and very complete. I will test things with both Codewarrior and with JDK 1.4. Here is some information on Java vs. C++. TheJDK comes with a debugger JDB. Here is how to use it.
If you already have it you can use Kawa from Allaire. Be sure to pay the registration fee if you use Kawa or the trial period will expire during the course and will disable the product. Here is some additional information on settin up and using Kawa. Kawa has an integrated debugger also. (Sadly, Kawa is obsolete--if you have it, use it, however). JCreator is similar to Kawa.
JBuilder from Borland works well on both PC's and the Macintosh. It may work on Unix/Linux as well.
One of the best is the new Eclipse system from http://eclipse.org. It is free. However, it will give you a lot of warnings for the code we will write. These may be distracting. It should work on any system.
You can use the TextPad editor effectively also. (NOT NotePad). It is also quite cheap.
You can also get a copy of Sun ONE for Java. It is quite complex, though.
The compiler will be built using an Attribute Grammar system called CoCo/R (Compiler-Compiler) from H. Mossenbock in Linz, Austria. Here is the home page of COCO. Note, however, that I have modified some of the files to be more compatible with what we shall do. The modidifed files are in the course materials (see below).
The next link describes a language is suitable for a reasonable student compiler project. The language you will compile in this course is similar to this one, but NOT the same.
GCL: A Language For A Compiler Project
If you are planning to take this course, you will find the Languages Principles Course to be helpful. Some of the theoretical background of compilers is discussed there, as well as in the course on Computability and Automata.
Throughout the term your work is to be submitted in a plain manila folder. This folder should have your name on it on the outside and on the tab. At the end of the term your work is to be submitted bound into an ACCOPress or equivalent binder. You should tape an envelope conataining the disk with all of your code to the inside of the binder. Do not use three ring binders to submit your work. There is more on submitting your work in the course notes.
There are many things you need to do in this course to be successful. The online syllabus can help with this. It also contains a FAQ.
Students develop a compiler starting with skeleton framework for a simple language. The compiler will be developed in Java. There is also a pre-built sample compiler that you can test your own compiler against. You can ftp the course software by clicking below.
This software is now up to date (January 22, 2006).
Additional materials, including updates to some of the packaged files are occasionally made here. At this time there is nothing avaliable.
If you have trouble with any of these files, send me EMAIL at berginf@pace.edu.
Please inform me about typos and other errors.
Back to Joseph Bergin's Home Page
Last Updated: January 22, 2006