Welcome to CS 440 Spring 2005!
This page will be used to post all relevant material for this class, including
web references, notes, home-works, midterm and final specification, etc.
For an overview, check the course syllabus.
I will be in Room 435 an hour before classes. Note: it is always a good idea to send me a brief e-mail a couple of days in advance.
The TA for this class is Xiaorong Zhou. Her office hours are: Wednesday, from 2pm to 5pm (Warning: this schedule may change). You can reach her via e-mail
As I mentioned in class we will be following the guidelines
of Prof. E. White's previous CS440 class.
Dr. White has kindly given me permission to use her excellent powerpoint presentations, which
your can find here.
Occasional deviations from the table below will be promptly documented on this
page.
|
Date |
Topics |
|
Slides |
|
January 24 |
Introduction |
Dragon 1, 3.3, 3.6, 3.7 |
|
|
January 31 |
Lexical Analysis |
Dragon 2.6, 3.1, 3.2, 3.5, 3.8 |
|
|
February 7 |
Syntax Analysis: |
Dragon 2.2, 2.4, 4.1- 4.8 |
General: powerpoint |
|
February 28 |
Syntax Directed Translation |
Dragon |
|
|
March 7 |
Midterm |
|
|
|
March 21 |
Typechecking |
Dragon 6 |
|
|
|
|
|
|
|
March 28 |
Finish Typechecking |
Dragon 6 |
|
|
April 4 |
Intermediate code |
Dragon 8 |
|
|
April 11 |
Runtime Environments |
Dragon 7 |
|
|
April 18 |
Code Generation |
Dragon 9 |
|
|
April 25 |
Code Optimization |
Dragon 10 |
|
|
May 2 |
Final Exam Review |
|
|
We have mentioned in class NP hard problems and P= ? NP . You can read on P/NP in the Wikipedia.
You can learn more about regular expressions at the regular expressions info site
The main topic of today is Lexical Analysis & Lex. You can lean about Lex (aside of course the Lex & Yacc book and the powerpoint presentation) from tutorials freely available on the web. This one is particularly concise: worth a look.
This page is dedicated to both Lex and Yacc: check out their on-line manuals.
Here is a link to the first Homework. Hand in a hardcopy to me in class on 02/14/05.
There are still a few homeworks missing: please go to the Computer Science Department and drop them into Xiaorong Zhou's mailbox. You have time till friday's afternoon (after that date she will not grade them).
Today we have completed the material covered in the PowerPoint slides 3 (Parsing) and started LL Parsing. I used the concise presentation that is available in the Wikipedia. It contains several links to related topics: check them out. Also take a look at the PowerPoint slides 4 where LL Parsing is discussed.
Next time I am going to assign a programming task.
Today's topic is LR Parsing. Once again, we will use mainly the reference in the Wikipedia.
Here is a link to you first programming assignment. Send it directly to my TA via e-mail before next class: in the subject of the e-mail specify PA1CS440-YourName.
Next class is Midterm. As you know from the Syllabus, it is
a closed book exam. It will last the entire class, starting at 7.30 pm.
The exam will be a set of 15-20 questions, some multiple-choices (and some
not).
You will have to provide an answer and a short motivation.
Exercises may include conceptual topics covered in class, snippets of code,
and/or simple exercises like the ones you have seen in HW1 (but smaller).
Here is a list of topics:
1. Lex: Chapter 1- and 2 of Oreilly book (all)
2. Generalities on compilers: all Chapter 1 of Dragon Book
3. Languages, Operations on Languages, and Regular expressions. Dragon page 92 to 98
4. Finite Automata (NFA and DFA): Dragon pages 113 to 127
5. Generalities on Context-free Languages: all Power Point Presentation number 3. This includes FIRST and FOLLOW sets
6. LL Parsing and LL(1) Parser Algorithm: Wikipedia 's article used in class, included section on how to obtain the parsing table
7. LR Parsing and LR(1) Parser Algorithm: again, use corresponding Wikipedia 's article.
For any additional question, send me an email.
I have returned the results of the midterm and the first programming task. People that were not there can pick it up before class next time.
Here is Programming Task Number 2 : do exercises 1, 2
and 6 at page 78-79 of "Using Yacc" chapter
3 of the O'Reilly Book. All these exercises expand the basic calculator example
in the chapter. You can use the code for the basic calculator and build on top
of it.
You have 2 weeks starting from today to return your PT2 to Xiaorong.
Send it in the same format as the last Programming Task.
We have mentioned in class functional languages, like ML.
Though functional programming is not part of this course, you may want to
familiarize yourself with one language in this family. You may try Haskell.
For Unification the best course is this: read carefully the last section of
chapter 6 of the Dragon book, and work out the example contained therein (if
you can go through a single example from beginning to end, it will become
clear). In class I briefly summarized what equivalence realtions are (you need to know them to follow the
Unification Algorithm).
You can get SPIM for either DOS or Unix
here.
There are scores of SPIM tutorials on the Web. The one I
used in class has the privilege of being concise, and contains a couple of very
simple examples.
This page
contains an entire course on programming in Assembler using SPIM: it is truly
an excellent reference, but it covers much more than we need here. However,
learning more about Assembler never hurts...
Your next programming task (two weeks from now) will use SPIM.
Here is a link to the second Homework.
You must send it to the TA by next Monday. Your e-mail should have 'CS440--HW2'
in the header.
The final will follow the same format as the midterm: it
will be 15-20 questions, some multiple-choice, some not.
Here is the list of topics :
1) Yacc, as in the “intro to Yacc” chapter of the Oreilly book.
2) Syntax-directed translation: Dragon’s 5.1 (all) and ppt notes
3) Type-checking: Dragon 6.1, 6.2, structural equivalence (page 353-357),
Overloading, Polymorphism (look up ppt notes)
4) Unification: Dragon 6.6
5) SPIM: look up the examples we have seen in class.
6) Runtime environments: Dragon 7.1 and 7-2 (activation trees, control stacks, storage organization)
7) Parameter passing: Dragon 7.5
8) Intermediate Code Generation: Dragon 8.1 and ppt notes
9) Register allocation: ppt notes on Graph Coloring Algorithm and corresponding examples
Also Dragon 9.1.
10) Code Optimization: ppt notes on Peephole Optimization, Block Level Optimization, Reachable Declarations.
For any additional question, send me an email.