| CSC 2371 Spring 2007 -
Compiler Construction - 3 Credits
Instructor: Dr. Steve Cooper (610-660-1561, scooper@sju.edu)
Classroom:
Mondays 4:00-5:15 in McShain 2
Wednesdays 4:00-5:15 in McShain 2
Office Hours: I am planning to hold office hours at the
Center of Visualization office, located at 203 West City Ave. Suite B-2.
For those of you who haven't been to my office, just go to Starbucks
and walk about 15 feet to your left.
My tentative schedule for office hours is:
- Monday 1:00-2:00 PM
- Wednesday 2:00-4:00 PM
- Thursday 1:00-2:00 PM
I will also be available at other times by appointments.
Objectives: My objectives for you for this class are the following
(largely borrowed from the ACM's CC2001 objectives):
- To describe the steps and algorithms used by language translators.
- To recognize the underlying formal models such as finite state automata,
push-down automata and their connection to language definition through
regular expressions and grammars.
- To discuss the effectiveness of optimization.
- To explain the impact of a separate compilation facility and the existence of program libraries on the compilation process.
Prior Assumed Knowledge: I assume that you have achieved a sufficient
level of mastery of programming in a high level language (preferably both in
an imperative language such as C as well as in an object oriented programming
language such as C++ or Java -- this must include data structures).
Note that we will spend little to no time in
class discussing programming.
Text: The required text for the course is
Programming Language Processors in Java: Compilers and Interpreters
by David Watt and Deryck Brown. (Prentice-Hall)
(click here for
the Prentice Hall website).
The authors maintain their own website, where, among other things, you can get
the code for the Triangle compiler. Please go to
http://www.dcs.gla.ac.uk/~daw/books/PLPJ/ to get it.
Please note that I will likely assign readings from outside the text
as well -- I'll be making those readings available at the library or
providing web references.
It is
expected that you will do the assigned readings before the class, and be ready
to ask about parts of the text that you found difficult. I will
not "hound" you about doing the readings. I will assume you have done
them, and will
expect you to ask questions if you have difficulties. I will also not
generally
go over parts of the text unless you ask me questions about it.
Calculation of your grade:
Labs: 10%
Homeworks: 25%
Interpreter: 10%
Compiler modification: 15%
Midterm: 20%
Final: 30%
Yes, I know that this totals 110%. To convert to percentages to 100%, just divide everything by 1.1.
Attendance: You are expected to attend ALL classes.
Missing more than two classes without prior approval will result
in a lower course grade.
Plagiarism: I should not have to mention this in an upper-level
college course, but I have run into problems in the past. Plagiarism may be
defined to be the copying of another’s text
(or code) or ideas without due credit
(via appropriate quotation marks and footnotes/endnotes). If I find that
you have plagiarized, you will, at a minimum, fail the class.
Cheating: Cheating on the exams or on the homeworks or on the labs
(and being caught) will result in an
automatic failure for the class.
Due Dates:
Work is due at the start of the class on the due date. Late work will be
accepted up to 1 week late for 50% of the score.
Course Schedule: I am providing you with a tentative schedule of the
coverage of material. Depending on the class, the schedule may need to be
changed. We will "cross that bridge" should we need to get to it.
The following schedule lists due dates for all assignments and reading. I
reserve the right to adjust the schedule to meet the needs of the class.
I am planning to assign several (perhaps even weekly) lab assignments. We
do not have any lab time in class. So, I will make sure that I am
available in a lab at set hours, so that you will be able to ask me
questions as you are working on the labs.
Tentative Schedule
| Week |
Monday |
Wednesday |
| Week 1 |
01/15/2007
No class
Martin Luther King Jr. Holiday
|
01/17/2007
Introduction
What is a compiler?
The major parts of a compiler
Lecture notes
Text: Chapter 1
|
| Week 2 |
01/22/2007
Review of Java topics: Packages and the visitor design pattern
An introduction to the Triangle syntax
Lecture notes
Text: Chapter 1, Section 3
Lab: Lab 1
Homework: Homework 1
|
01/24/2007
An introduction to the Triangle sematics
Abstract syntax
Lecture notes
Text: Chapter 1, Section 3
|
| Week 3 |
01/29/2007
Language Processors
Translators, Compilers, and Interpreters
Bootstrapping
Lecture notes
Text: Chapter 2
Due: Lab 1
Due: Homework 1
Lab: Lab 2
Homework: Homework 2
|
01/31/2007
Compilers
Phases
Passes
Lecture notes
Text: Chapter 3
|
| Week 4 |
02/05/2007
No class - I am out of town
Due: Lab 2
|
02/07/2007
|
| Week 5 |
02/12/2007
Syntactic Analysis
Lexing
Regular Expressions
Lecture notes
Text: Chapter 4, Sections 1-2, 5
Code: Please bring hard copies of the following Triangle modules (with
line numbering turned on) to class: Compiler.java,
Parser.java,
Scanner.java, Token.java
Due: Homework 2
Lab: Lab 3
Homework: Homework 3
|
02/14/2007
Due: Lab 3
|
| Week 6 |
02/19/2007
Syntactic Analysis
Parsing
Recursive Descent parsers
Lecture notes
Text: Chapter 4, Section 3
Code: Please bring hard copies of the following Triangle modules (with
line numbering turned on) to class: Compiler.java,
Parser.java,
Scanner.java, Token.java
Due: Homework 3
Lab: Lab 4
Homework: Homework 4, part 1
|
02/21/2007
Review homworks 2 and 3, and the associated labs
Due: Lab 4
|
| Week 7 |
02/26/2007
Syntactic Analysis
Building an AST
Lecture notes
Text: Chapter 4, Section 4
Code: Please bring hard copies of the following Triangle modules (with
line numbering turned on) to class:
Parser.java, Terminal.java,
ConstDeclaration.java, Identifier.java
Due: Homework 4, part 1
Lab: Lab 5
Homework: Homework 4, part 2
|
02/28/2007
Reviewing homework 4 (the java fragment I have given you).
Review for the exam
Due: Lab 5
|
| Week 8 |
03/05/2007
Spring Break - no classes
|
03/07/2007
Spring Break - no classes
|
| Week 9 |
03/12/2007
Midterm Exam
Due: Homework 4, part 2
|
03/14/2007
Contextual Analysis
Identification
Lecture notes
Text: Chapter 5, Section 1
|
| Week 10 |
03/19/2007
Contextual Analysis
Type checking
Lecture notes
Text: Chapter 5, Sections 2-4
Lab: Lab 7
|
03/21/2007
Discussion of the Interpreter project. Please
download and print off the assignment prior to class
It is available here.
|
| Week 11 |
03/26/2007
Run time organization
Storage
Lecture notes
Text: Chapter 6, Sections 1-4
Lab: Lab 8
Homework: Homework 5
Due: Lab 7
|
03/28/2007
No class today -- Instead, each team must schedule a 1 hour meeting with
me on Thursday or Friday to work on the interpreter project
|
| Week 12 |
04/02/2007
No Class - I am out of town
Due: Lab 8
|
04/04/2007
No Class - I am out of town
Due: Homework 5
|
| Week 13 |
04/09/2007
Run time organization continued
Lecture notes
Text: Chapter 6, Sections 5-8
Lab: Lab 9
Interpreter project is due
|
04/11/2007
Code Generation
Code selection and templates
Lecture notes
Text: Chapter 7, Section 1
|
| Week 14 |
04/16/2007
Code Generation
Review of TAM
The code generation algorithm
Lecture notes
Text: Chapter 7, Section 2
Appendix C
Homework: Homework 6
Homework hint: here
Due: Lab 9
|
04/18/2007
|
| Week 15 |
04/23/2007
Lecture notes
Text: Chapter 7, Sections 3-4
|
04/25/2007
|
| Week 16 |
04/30/2007
Final Exam: Cumulative -- covering the entire semester
4:15 PM - 6:15 PM
Dr. Hodgson's sample final from last spring
Due: Homework 6
|
|
|
WARNING TO STUDENTS |
| This is a challenging class. Compilers
is a difficult and time consuming class.
This class will require a large investment
of your time and effort to complete. If you do not have the time
and energy to dedicate to performing the work for this class you
should NOT enroll. The requirements for this class
will NOT be reduced no matter how much other work you encounter in
other classes you may be enrolled in. |
|