ECS 142 – Compilers – Spring 2009


Project 1

Project 2

Project 3

Project 4

Lecture Slides


References & Tools



  • March 30, 2009: Welcome to ECS 142 (CRN 93822).

Basic Course Administration:

  • Instructor: Dr. Sean Peisert
    • Email:
    • Office Location: Watershed 2111 (directions)
    • Office Hours: Mondays at 3pm (except 3/30), Wednesdays at 10am, and by appointment
    • Office Hours Location: 1037 Academic Surge

  • TA: Daryl Posnett
    • Email:
    • Office Hours: Thursdays 4-5pm
    • Office Location: Kemper room 55

Official Meeting times and places

  • Lecture
    • Bainer Hall 1130, MWF 9-9:50a
  • Discussion Section
    • Olson Hall 217, M 4:10-5p
  • Midterm
    • May 1 (in class)
  • Final Exam
    • Thursday, June 11, 1:00pm

Course textbook

  • Compilers: Principles, Techniques and Tools, 2nd Edition (aka "The Dragon Book") - by Aho, et al.
  • The first edition of this book is OK.

Course Outline (Rough)

  1. Lexing
  2. Project 1: Lexer
  3. Review of ECS 120: REs, DFAs, NFAs, & conversions
  4. Parsing Algorithms
  5. LR Parsing
  6. Project 2: Parser
  7. LL Parsing
  8. Semantic Checking
  9. Project 3: Semantic Checker
  10. Abstract Syntax Trees (ASTs)
  11. Syntax-Directed Translation (SDT) and Definitions (SDDs)
  12. Type Checking
  13. Runtime Storage
  14. Code Generation
  15. Project 5: Code Generation
  16. Code Optimization

Grading and Schedule

  • The grade for ECS 142 will be based on five projects, one midterm, and a final, as follows:
    • Project 1 (lexer): 5% of final grade (Due: April 10, 11:55 PM)
    • Project 2 (parser): 15% of final grade (Due: April 24, 11:55 PM)
    • Project 3 (semcheck): 30% of final grade (Due: May 22, 11:55 PM)
    • Project 4 (codegen/optimization): 15% of final grade (Due: June 5, 11:55 PM)
    • Midterm: 10% of final grade
    • Final: 25% of final grade
  • Subjective influences like class participation will have an impact in the margins – it does pay to let the instructor know who you are!
  • Late projects are not accepted. If there is any question about working an extra half-hour versus turning the project in on time: turn the project in (you can always resubmit again closer to the deadline). There is a enough time to do these projects, and in that time it is highly recommended that you plan for roadblocks, as you are responsible for working around them. These include, but are not limited to:
    1. Slow server functionality towards the end of the quarter.
    2. "Disk full" errors and quota issues.
    3. Server and network outages.
    4. Picnic Day.
  • Since the projects build upon each other and it is useful for future projects to get feedback from previous ones, we will make every effort to return assignments to you in a timely manner. Limiting your ability to turn things in late is, unfortunately, critical to that goal.
  • As announced in class, all projects must be turned in to pass the course. Students not turning in all projects cannot pass the course regardless of how well they do on other projects and midterms.
  • All appeals on project or exam grading must be made in writing and given to the instructor.


You must do your own work in this class. You and your programming partner cannot use programs from previous years, nor can you use copies of other peoples' programs from this year to help you solve the programming assignments. As you develop a solution to any of the programming projects you must keep copies of your intermediate efforts (paper copies are OK) since you will be asked to produce these if there is any dispute over who wrote a program. Keeping these intermediate copies is a required part of each project. We may ask to see these intermediate copies for any of the programming projects. If you don't have them when asked, you will get a zero for the project grade. Using CVS may help in this matter.

Discussing projects in groups (with the coding done separately, later), is completely legitimate. Copying code for projects -- be it from current or previous compilers courses, books, other universities or anywhere else is not permitted. Please control access permissions on your own computing account appropriately and do not attempt to access others' accounts. Your computer account for this class should only be used to do course work. In particular, under no circumstances may you use your account to sabotage the work of other students either by tampering with others' files or by manipulating the Unix system so that its performance for others will be impaired.

Receiving, providing, or soliciting assistance from another student during a test -- is also not permitted.

Cheating WILL be taken seriously. It is not fair to honest students to take cheating lightly, nor is it fair to the cheater to let him/her go on thinking that is a reasonable alternative in life.

It is expected that all students understand University policies on academic honesty. Cheating on assignments or exams is very serious and will not be tolerated. We will use Moss to check the programming assignments for plagiarism.  Any suspected cases will be reported to Student Judicial Affairs.

Penalties: Anyone copying information or having information copied during a test or in one of the projects will receive an F for the class and will not be allowed to drop. They will be reported to their college dean. If you can prove non-cooperative copying took place, your grade may be restored, but you must prove it to the dean -- I don't want to be involved.

Regrade Policy

If you feel a regrade is needed:
  1. You must clearly describe why your solutions deserve more credits.
  2. Your entire solution will be regraded. In other words, by requesting a regrade, you risk lowering your grade.
  3. You must send your requests to the staff no later than a week after the return of your exams or projects.