Compiler Construction
Spring 2009

 

Textbook :
book cover   Compilers: Principles, Techniques, and Tools, 2/E
Alfred V. Aho, Monica S. Lam,
Ravi Sethi, Jeffrey D. Ullman
Publisher: Addison-Wesley, 2007
ISBN-10:0321486811
ISBN-13:9780321486813


Schedule :

Announcements:

There are no notices yet!

Homework, Exams, and Grades

This file will be updated throughout the semester and contains homework and programming assginments.

Homework #1 is uploaded. Deadline for this homework is Sunday, April 12, 2009 (23 Farvardin 1388).

Homework #2 is uploaded. Deadline for this homework is Sunday, May 03, 2009 (13 OrdiBehesht 1388).

Homework #3 is uploaded. Deadline for this homework is Sunday, May 17, 2009 (27 OrdiBehesht 1388).

Homework #4 is uploaded. Deadline for this homework is Sunday, May 31, 2009 (10 Khordad 1388).


Midterm Exam:Sunday, 27 OrdiBehesht 1388
Final Exam: Tuesday, 26 Khordad 1388


Grading

Homework and programming assignments: 25%
Midterm exam: 30%
Final exam: 40%
Class participation: 5%

Previous Exams

Fall 2005 - Midterm (First semester of 84-85)
Fall 2005 - Final (First semester of 84-85)
Spring 2005 - Midterm (2nd semester of 84-85)
Spring 2005 - Final (2nd semester of 84-85)
Fall 2006 - Midterm (First semester of 85-86)
Fall 2006 - Final (First semester of 85-86)
Spring 2006 - Midterm (2nd semester of 85-86)
Spring 2006 - Final (2nd semester of 85-86)
Fall 2007 - Midterm (First semester of 86-87)
Fall 2007 - Final (First semester of 86-87)
Spring 2008 - Midterm (2nd semester of 86-87)
Spring 2008 - Final (2nd semester of 86-87)

Lecture Slides

1- Anatomy of a Compiler:

This set of slides takes 2-3 sessions of our class. In these sessions we speak about anatomy of a compiler and glimpse each phase of compilation. We introduce lexical analysis, syntax analysis, semantic analysis, intermediate code generation, and code optimization, and examine each of them in an example. Here you can download the color slides and here you can find the b/w slides which is more suitable for printing.

2- Lexical Analysis:

This set of slides takes 2 sessions of our class. We learn how one can build lexical analyzer using regular grammars and finite automata. Here you can download the color slides and here you can find the b/w slides which is more suitable for printing.

3- Syntax Analysis - Top Down Parsing:

We invest 3 sessions on this set of slides. We start discussing on context free grammars (CFGs) and use them to make a syntax analyzer. For this we first study "grammar ambiguity", "left recursion", and "common left factor" in CFGs. We also introduce a family of grammars called LL(1). Next we learn how to build a top-down parser. We study two ways for building a top-down parser. The first is "recursive descent predictive" method, and the second one is "table driven" method. Download the color slides, or the b/w slides.

4- Syntax Analysis - Bottom up Parsing (1):

This set of slides takes 2 sessions. We start learning Bottom up Parsing and we see how a Shift Reduce Parser works. We also introduce the problems a shift reduce parser may encounter (Shift-Reduce & Reduce-Reduce Conflict). Finally, we see the Parse Table with which the parser performs its tasks. Download the color slides, or the b/w slides.

5- Syntax Analyser - Bottom up Parsing (2)

In the sessions we use this set of slides, we will see how LR(0) parsers work.We also learn how to construct the LR(0) parse table. We also introduce different kinds of LR parsers, and compare the LR and LL parsers. Download the color slides, or the b/w slides.

6- Syntax Analyser - Bottom up Parsing (3)

This set of slides are about SLR(1) parsers. We see what the defec of LR(0) is and learn how SLR(1) parsers improve this flaw using the notion of the follow sets. Download the color slides, or the b/w slides.

7- Syntax Analyser - Bottom up Parsing (4)

Download the color slides, or the b/w slides.

Teaching Assistant

Mostafa Jalambadani is the TA for this course.
book cover
Mostafa Jalambadani

Some Useful Links