COP 5621 -- Compiler Construction
Mondays and Wednesdays, 2:00-3:15, ECS 132
- Geoffrey Smith
- Office: ECS 320
- Telephone: 305 348-6037
- E-mail: smithg @ cs.fiu.edu
- Office Hours: Mondays and Wednesdays, 3:20 -- 4:50
I'll usually be happy to meet at other times.
Send email, call, or drop by.
- Modern Compiler Implementation in Java
by Andrew Appel (Cambridge University Press, 1998).
See the author's web site at
for errata and supporting software.
- The Java Programming Language, Third Edition
by Ken Arnold, James Gosling, and David Holmes (Addison-Wesley, 2000)
is recommended if you need to learn Java.
- On the Web, lots of Java documentation is available at
and SCS UNIX documentation is available at
In this course, we will study the technology underlying modern compilers.
The course will be centered on the development of a compiler for a
language called Tiger.
Tiger is a small language designed especially for a student compiler
project, but it is quite expressive and interesting.
Your compilers will be written in Java, using tools similar to the
well-known Unix tools lex and yacc for lexical analysis
and parsing, respectively.
Your compilers will have a sophisticated "back end" to generate
good SPARC assembly language code.
Given that one is unlikely ever to write a real compiler,
what is the value of taking this course?
There are a number of answers:
Even if you're never going to write a compiler, you do
(as a programmer) interact with compilers all the time.
It is therefore beneficial to have a deeper understanding of what
goes on inside a compiler.
Learning about compilers gives one a deeper understanding of the "guts"
of programming languages, and a better understanding of (for example)
Modern compilers are written using broadly useful technologies like
lex and yacc, which can be used in a variety of text-processing
Compilers are large and complex.
For this reason, writing a compiler is an excellent testbed
for software engineering approaches.
In particular, we will have a chance to gain insight into the strengths
and weaknesses of Java's linguistic support for well-structured software.
We will try to cover Part I (chapters 1 through 12) of Appel's book,
more or less completely.
The compiler project will be written in Java under UNIX.
You will be using the workstations in the SCS Grad Lab
(ECS 256) to telnet to the SPARC server
(Note that you can connect to goliath from Windows NT
machines by using Xwin32.)
You will get accounts for the Grad Lab automatically,
and you will be able to get a key by seeing the graduate secretary,
If you have trouble with your account, you can see the help staff
at the JCCL (ECS 241) or ExLab (ECS 281).
If you are new to UNIX, you should spend some time soon looking
at the UNIX documentation at
Note that to access Java, JLex, and CUP, you need to set some
To do this, please add the following lines to your .cshrc file:
setenv JAVA_HOME /depot/J2SE-1.4
setenv CLASSPATH "/homes/smithg/javatools:."
Also note that I will be providing you with skeleton files to help
you with the compiler project; these files will be accessed at
A mailing list, cop5621, has been established to allow you
to post questions and carry on discussions.
To subscribe, send email to firstname.lastname@example.org with message body
Then you can post messages by mailing to email@example.com.
Note that you can improve your class participation score by
being helpful on the mailing list!
Grades in this course will be based on a midterm exam and on
programming assignments that culminate in the compiler.
For the compiler project, you will work in groups of two or three.
In lieu of a final exam, you will present your finished
compilers to me at the end of the semester.
|Compiler project ||70%|
|Midterm Exam ||20%|
Programs will be scored on a 5-point scale:
5: basically perfect
4: mostly fine, some small deficiencies
3: some significant deficiencies
2: major deficiencies, but on the right track
I expect you to maintain a high level of academic integrity in this course.
The basic principle to follow is that the work that you submit should
be the result of your group's own effort.
It is definitely not acceptable to copy code from other groups, books,
or from the Web.
Furthermore, if you get help from other sources, please be generous
in citing them.
I will grant incompletes only in extreme circumstances,
such as medical emergencies.
I expect you to attend class regularly and promptly,
and to participate in discussions.
Please don't be shy about asking questions--if something is unclear
to you, it is probably unclear to others as well.
COP 5621 home page.