CS440 - Language Processors and Programming Environments - Spring 2005

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.

Overview:

For an overview, check the course syllabus.

Office Hours:

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.

TA

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

Schedule

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

Reading

Slides

January 24

Introduction
Review of Regular languages

Dragon 1, 3.3, 3.6, 3.7

powerpoint

January 31

Lexical Analysis
Lex

Dragon 2.6, 3.1, 3.2, 3.5, 3.8
l & y 1,2,6

powerpoint

February 7
February 14
February 21

Syntax Analysis:
Context Free Languages,
LL and LR parsing

Dragon 2.2, 2.4, 4.1- 4.8

General: powerpoint
LL: powerpoint
LR: powerpoint

February 28

Syntax Directed Translation
YACC

Dragon
Translation: 2.3, 5.1-5.3
YACC: 4.9, 7.6
l & y 1,3,7,8


Translation & Yacc: powerpoint

March 7

Midterm

 

 

March 21

Typechecking
Symbol Tables

Dragon 6

powerpoint

 

 

 

 

March 28

Finish Typechecking

Dragon 6

 

April 4

Intermediate code
SPIM

Dragon 8

powerpoint

April 11

Runtime Environments

Dragon 7

powerpoint

April 18

Code Generation

Dragon 9

powerpoint

April 25

Code Optimization

Dragon 10

powerpoint

May 2

Final Exam Review

 

 

01/24/05

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

01/31/05

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.

02/07/05

Here is a link to the first Homework. Hand in a hardcopy to me in class on 02/14/05.

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.

02/21/05

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.

02/28/05

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.

Important: even though this class was not held due to inclement weather, next monday is still Midterm.
Yacc has been taken out of the list. All other topics, of course, remain.

03/21/05

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.

03/28/05

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.

04/04/05

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).

04/11/05

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.

04/18/05

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.

 

04/25/05

You last task before the Final is PT3. Here is a brief description:

Write a SPIM program that asks for a sequence of integers and then uses the QuickSort Algorithm to sort them. It then displays the result (i.e. the ordered list) to the console.

You have two weeks for PT3 starting from today. IMPORTANT: NO DELAYS, PLEASE! : my  TA must return the grades by the time I have graded your final.

Next week I will summarize in class all the topics that go into the final.

 

 

05/02/05

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.