Department of Computer Sciences
fit wordmark

CSE 4251/5251: Compiler Construction (Spring 2009)

General info

Instructor

Ryan Stansifer <ryan@cs.fit.edu>

Office hours

Check my WWW page for upto date information, you are welcome to send me e-mail at ryan@cs.fit.edu.

Lectures

Lectures are from 5pm to 6:15 Tuesdays and Thursdays in CRF-401.

Class URL

http://www.cs.fit.edu/~ryan/cse4251/

Mailing List

The class has a mailing list on the Florida Tech new Sympa list server. Please join, read and contribute to it. Important announcements will be sent to the list. Members can receive all e-mail sent to the list; also anyone can view the latest postings via RSS: RSS feed icion

Catalog Description

CSE 4251 - COMPILER THEORY. COMPILER THEORY. Introduces formal languages, the construction of scanners and recursive descent, LL(1) and LR(1) parsers, intermediate forms, symbol tables, code generation and optimization of resultant code. Prerequisites: CSE 2010 and CSE 3101.

Overview

In this class we will write an entire compiler in Java for a simple, imperative language. Knowledge of basic algorithms: trees, graphs, etc, is required. CSE 2010 is a prerequisite. CSE 3101 Machine and Assembly Language, is also a prerequisite. CSE 4250 Programming Languages, CSE 4051 Advanced Java programming, and CSE 4083 Formal Languages and Automata Theory are all helpful, but not required.

Goals

Textbook

The textbook for this class is:

Appel Andrew W. Appel with Jens Palsberg.
Modern Compiler Implementation in Java, second edition.
Cambridge, England: Cambridge University Press, 2002.
ISBN: 052182060-X
book cover
Get the second edition, not the first!

We will write a compiler for a subset of Java called MiniJava (see the EBNF grammar). The compiler will produce SPARC assembly code. It really requires very little understanding of SPARC architecture and assembly language to write a simple compiler. But there are some details that must be understood. A thorough discussion of these topics can be found in:

Paul Richard P. Paul.
SPARC Architecture, Assembly Language Programming, and C, second edition.
Upper Saddle River, New Jersey: Prentice-Hall, 2000.
ISBN: 0-13-025596-3
book cover
or in Sparc Architecture Standard. You are assumed to have the equivalent of CSE3101 Machine and Assembly Language.

Please get a TRACKS account, if you do not already have one. if you need access to a SPARC computer with GNU development software. It is required to use this environment (though most of the Java development can take place on any platform). You may use ssh to login in remotely to to use a SPARC computer.

Warning

This class requires considerable programming. Good time management is required. It is impossible to extend the length of the semester. The compiler must be finished by the end of the semester --- no extensions, no incompletes.

For this reason, a good grade in this class does impress recruiters. From the ACM Computer Science Curriculum 2008

Several industrialists passed very positive comment about compiler courses. Although many companies do not engage in anything related to compilers, comile writing tended to be seen as a microcosm for realistic software development. So good compiler writers are often seen as desirable; they tend to be good software engineers.

Grades

The numeric scores for the assignments are available on the WWW.

The course grade is determined primarily by the compiler project. Any completed, reasonably functional compiler will earn an 'A' for the course. This is subject to some conditions: a reasonable grade on the midterm, the on-time completion of the milestones, the adherence to the compiler design in the textbook, following the submission requirements, and writing the code yourself. Failure to meet these conditions makes it difficult to evaluate and assign grades equitably, in such circumstances expect an 'F'.

There will be one midterm test. It will cover scanning and parsing. There will be no final test.

Important Links

Calendar and Important Dates

Tuesday, 13 January 2009first lecture
Friday, 16 January 2009assignment #1
Monday, 19 January 2009Martin Luther King Jr. Day (no classes)
Friday, 23 January 2009assignment #2
Friday, 30 January 2009Lexer, assignment #3
Friday, 13 February 2009Parser, assignment #4
Monday, 16 February 2009President's Day (no classes)
Thursday, 21 February 2009Midterm Exam
2-6 March 2009Spring break (no classes)
Friday, 13 March 2009Syntax and Semantics, assignment #5
Friday, 20 March 2009Last day to withdraw
Monday, 31 March 2009Frames and Trees, assignment #6
Thu, 16 April 2009class canceled
Friday, 17 April 2009Instruction Section, assignment #7
Tue, 21 April 2009ICPC World Finals (no class)
Thu, 23 April 2009ICPC World Finals (no class)
Thursday, 28 April 2009last lecture
Monday, 4 May 2009Complete Compiler, assignment #8

Syllabus

Week 1
Introduction, software development, what is a compiler

Week 2 and 3
Regular expressions, FSA, NFA, DFA

Week 4 and 5
Parsing

Week 6
Constructing Syntax Trees

Week 7
Midterm exam
Week 8
Symbol tables, Type checking

Week 9
Activation records

Week 11 and 12
Dataflow Analysis

Week 13
Register Allocation


Ryan Stansifer <ryan@cs.fit.edu>
Document location: http://www.cs.fit.edu/~ryan/cse4251/index.html
Last modified: Mon May 25 14:25:24 EDT 2009