Syllabus
CSCI 4627
Procedural Languages and Compilers
Spring 2002

Class meeting 9:30-10:45 TTh Austin 304
Instructor Karl Abrahamson
Office Austin 233
Office hours MW 2:00-3:15pm and TTh 11:00-12:15pm or by appointment
Phone 328-1879
Email karl@cs.ecu.edu
Course web page www.cs.ecu.edu/~karl/4627/spr02/
My web page www.cs.ecu.edu/~karl/
Text Compiler Construction: Principles and Practice by Kenneth C. Louden


Prerequisites

CSCI 3601, CSCI 3675, CSCI 3510. You should have a good understanding of programming and be able to write well structured and well organized programs in C++.


Introduction

Compilers are translators that translate from one programming language to another. Early compilers (such as for Fortran and Cobol) were written in a completely ad-hoc way. The cost of writing a compiler was very high, with a typical estimate of 30 person-years to develop a compiler for the relatively simple early languages. The state of the art has improved fantastically since then, with the advent of elegant mathematical tools and related program development tools.

It is useful for a computer scientist to study compiler design for several reasons.

  1. Anyone who does any software development needs to use a compiler. It is a good idea to understand what is going on inside the tools that you use, in order to have a better understanding of their capabilities and their limitations.

  2. Compilers are sophisticated text processors. Most programs need to do some text processing, even if only to read in the contents of a configuration file. Techniques that were developed for writing compilers are useful in a variety of other software.

  3. One of the more useful techniques for software design for large projects is to develop a special-purpose language that makes the project easy to implement. It can take less time and effort, and lead to a higher quality product, to spend the time to develop and implement a small special purpose language and to write the software in that language, than to write the software in a general purpose language.

  4. Compilers benefit tremendously from careful analysis of a problem, and from tools for performing that analysis. A study of compiler design gives a good feeling for how a large problem can be broken down and solved in a manner that is not ad-hoc.

  5. A course in compilers offers a good opportunity to get experience with a larger piece of software.


Course objectives

The student should understand both the theory and practice of compiler design, and be able to implement a complete compiler for a small programming language.


Topics

  1. Overview of compilers. The compilation process and the anatomy of a compiler. (Text, Chapter 1)

  2. Lexical analysis. The role of the lexical analyzer. Finite state machines. Regular expressions. Lexical analysis tools and lexer generators. (Text, Chapter 2)

  3. Context-free grammars. Writing grammars for programming languages. Transformations on grammars. (Text, Chapter 3)

  4. Parsing. Top-down predictive parsing. Recursive descent. Table-driven parsers and LL(1) grammars. Elementary bottom-up parsing and SLR(1) grammars. Discussion of parser generators. (Text, Chapters 4 and 5)

  5. Table management and semantic analysis. The symbol table. (Text, Chapter 6)

  6. Syntax-directed translation. Intermediate code. (Text, Chapter 8)

  7. Discussion of back-end analysis and improvement. Elementary optimizations.


Attendance policy

I will not take attendance. It is up to you to attend class. You are responsible for announcements and assignments given in class. If you miss a class, it is up to you to obtain notes and any other information that was provided in the class. Excuses that you did not know about something because you did not come to class and did not obtain the information will not count for anything at all.

Those who choose not to attend class can count on doing poorly in this course. If you choose not to attend class, then you must live with the consequences of that decision, however bad they are.

No incompletes will be issued in this course except for extraordinary circumstances, and even then only if you are nearly done already, and have done work of acceptable quality that it is realistic that you can pass the course.


Grading

Grading will be on the basis of homework (10%), a programming project (writing a compiler) (35%), two midterm exams (15% each) and a final exam (25%). Cutoffs for grades will tentatively by 90% for an A, 80% for a B, 70% for a C and 60% for a D. Those cutoffs will not be raised.


Weather emergencies

In the event of a weather emergency, information about ECU can be accessed through the following sources: ECU emergency notices http://www.ecu.edu/alert ECU emergency information hotline: 252-328-0062


Students with disabilities

East Carolina University seeks to fully comply with the Americans with Disabilities Act (ADA). Students requesting accommodations based on a covered disability must go to the Department for Disability Support Services, located in Brewster A-114, to verify the disability before any accommodations can occur. The telephone number is 252-328-6799.