CSE 304: Compiler Design

Fall 2008


Contents:


Class Place and Time:

Mon., Wed. 3:50am -- 5:10pm
Old Chem. 138
CS 2129

Course Materials:

The web pages of this course will be hosted on Stony Brook's Blackboard system.

All course handouts, including homework assignments, will be available on Blackboard for you to download and print, if desired. No paper copies will be handed out.

You can access Blackboard at : http://blackboard.stonybrook.edu

If you have used Stony Brook's Blackboard system previously, your login information (Username and Password) has not changed. If you have never used Stony Brook's Blackboard system, your initial password is your SOLAR ID# and your username is the same as your Stony Brook (sparky) username, which is generally your first initial and the first 7 letters of your last name.

For help or more information see: http://www.ic.sunysb.edu/helpdesk/bb.shtml.

Course Objectives and Outline:

Compilers and interpreters are very widely used. Every programmer uses these tools to execute programs written in high-level languages. It is hence essential for a computer scientist to understand the process by which programs written in high-level languages are translated and executed. The main objective of this course is to gain an in-depth understanding of the above process.

Most complex software systems are not monolithic; they are programmable using special-purpose languages. An understanding of the language translation process thus plays an important role in the design of real-life systems.

An important side benefit of this course would be that you will gain significant experience in OO-programming with C++.

In the class, we will discuss the theoretical aspects of designing a compiler. In the homework assignments, you will then apply the theory you have learned in the class (directly and indirectly) to develop a complete compiler for a high-level language. The problem of language translation is traditionally decomposed into many phases. Most common are:

All phases use a symbol table to keep track of the properties (types, number of parameters etc.) of each symbol (variables, procedures etc.). In the end, code is generated for an abstract machine which may be interpreted (as in Java), or may be translated further into machine instructions (as in C). We will cover each of these topics in detail.

Advanced topics such as program optimization, machine code generation and storage management will be discussed in the lectures.

Text Book:

Aho, Lam, Sethi, Ullman. Compiler Design: Principles, Techniques, and Tools (Wddison Wesley, 2nd Edition). ISBN: 978-0321486813.

Programming Languages and Course Software:

The compiler will be written in C++. This course requires significant C++ programming. This course is not for novice programmers. We will use GNU g++ compiler on Linux, Solaris or within the cygwin environment for Windows. You should be familiar with working in an UNIX environment, including the use of Makefiles and so on. If not, be prepared to pick this up in the first couple of weeks of the course.

Grading:

Homework Assignments: 20%
Project Presentation: 5%
2 Mid-Term Exams: 2 x 25% = 50%
Final Exam: 25%

You must turn the homeworks in on the day they are due (i.e. by midnight at the end of that day, if you must). Since the homeworks will include programming exercises, students are urged to plan ahead to avoid congestion of the computer facilities at the last minute. If your program is incomplete or is not working by the due date, turn in whatever you have. Late homeworks may not be graded. If some sort of emergency prevents you from submitting your homework on time, supplying us with suitable documentation might influence our choice. Programming assignments will be handed in electronically using the Blackboard system.

A note on project presentations: Near the end of the semester, each student will make a presentation of a particular portion of his/her homework to the instructor. The portion of homework to be presented will be determined by the instructor; the student is expected to come prepared on all aspects of his/her code. The motivation for the presentation is to guage the understanding and insight the student had obtained by performing the homework.

There will be 6 homework assignments in all. Students may work in pairs (i.e. teams of 2) on the assignments. The best 5 scores out of the 6 assignments will be used for the final grade.

You are advised to start working on the assignments at the earliest possible time even if the deadlines are far away. The date the assignments are due will be clearly specified in the homework handout, on the web; any changes in deadlines will be posted on the course homepages and the discussion board (all on Blackboard).

Assignments are due by 11:59pm on the specified date.

Students with Special Needs:

If you have a physical, psychological, medical or learning disability that may impact on your ability to carry out assigned course work, I would urge that you contact the staff in the Disablility Support Services office (DSS), ECC Building (behind SAC), 632-6748/TDD. DSS will review your concerns and determine, with you, what accommodations are necessary and appropriate. All information and documentation of disability is confidential.

The Importance of Being Earnest:

Because a primary goal of the course is to teach professionalism, any academic dishonesty will be viewed as evidence that this goal has not been achieved. Any act of cheating will be treated with utmost seriousness.

You may discuss the homework problems in this course with other students, as long as you are willing to post the material on the class discussion board. However each student's submission, including written material and coding, must be their own work, and only their own work. Remember that there are many different ways to solve the same problem; even solutions with the same central idea can be formulated in many different ways. Therefore, suspiciously similar homework solutions will be considered as evidence of disallowed collaboration or copying. Any evidence that written homework submissions or source code have been copied, shared, or transmitted in any way between students (this includes using source code downloaded from the Internet or written by others in previous semesters!) will be regarded as evidence of academic dishonesty.

Copying an assignment from another student in this class or obtaining a solution from some other source will lead to an automatic F for this course and to a disciplinary action. Allowing another student to copy one's work will be treated as an act of academic dishonesty, leading to the same penalty as copying.

You should learn how to protect your data. Failure to do so is also unprofessional and it may expose you to the danger that someone will copy your homework and will submit it as his or her own (see above).

All cases of academic dishonesty will be reviewed by the graduate program director. Note that academic dishonesty carries substantial penalties in such cases, such as receiving an `F' grade, or expulsion from the University.

Be advised that any evidence of academic dishonesty will be treated with utmost seriousness. Those involved will be prosecuted to the fullest extent permitted by the University and College laws.


C.R. Ramakrishnan