Programming Language (IT3005)

Welcome to Jenhui Chen's Fall 2005!
This page will be used to post all relevant material for this class, including web references, notes, homeworks, midterm and final specification, etc.

Textbook:

Robert W. Sebesta, Concepts of Programming Languages, 7th edition, Pearson Addison Wesley, 2005.

Office Hours:

I will be in my Room through 10:00 am to 06:00 pm, Monday to Thursday. 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 Stanley & Pata. Their office hours are: Wednesday, from 2pm to 5pm (Warning: this schedule may change). You can reach them via e-mail

Schedule

I give my powerpoint presentations, which you can find here.
Occasional deviations from the table below will be promptly documented on this page.

Topics

Reading

Slides

Preface None  

Introduction
Preliminaries

1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8

powerpoint

Evolution of the Major Programming Languages

2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 2.10, 2.11, 2.12, 2.13, 2.14, 2.15, 2.16, 2.17, 2.18, 2.19, 2.20

powerpoint

Describing Syntax and Semantics

3.1 Introduction
3.2 The General Problem of Describing Syntax
3.3 Formal Methods of Describing Syntax
3.4 Attribute Grammars
3.5 Describing the Meanings of Programs: Dynamic Semantics

powerpoint

Lexical and Syntax Analysis 4.1 Introduction
4.2 Lexical Analysis
4.3 The Parsing Problem
4.4 Recursive-Descent Parsing
4.5 Bottom-up Parsing
powerpoint

Lexical and Syntax Analysis

YACC: 4.9, 7.6
Lex & Yacc: 1,3,7,8

Lex
Yacc

Midterm Exam

 

 

 

 

 
Names, Bindings, Type Checking, and Scopes 5.1 Introduction
5.2 Names
5.3 Variables
5.4 The Concept of Binding
5.5 Type Checking
5.6 Strong Typing
5.7 Type Compatibility
5.8 Scope
5.9 Scope and Lifetime
5.10 Referencing Environments
5.11 Named Constants
powerpoint
Data Type 6.1 Introduction
6.2 Primitive Data Types
6.3 Character String Types
6.4 User-Defined Ordinal Types
6.5 Array Types
6.6 Associative Arrays
6.7 Record Types
6.8 Union Types
6.9 Pointer and Reference Types
powerpoint
Expressions and Assignment Statements 7.1 Introduction
7.2 Arithmetic Expressions
7.3 Overloaded Operators
7.4 Type Conversions
7.5 Relational and Boolean Expressions
7.6 Short-Circuit Evaluation
7.7 Assignment Statements
7.8 Mixed-mode Assignment
powerpoint
Statement-Level Control Structures 8.1 Introduction
8.2 Selection Statements
8.3 Iterative Statements
8.4 Unconditional Branching
8.5 Guarded Commands
8.6 Conclusions
powerpoint
Final Examination    

Lex's and Yacc's related materials:

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. There is an another useful web site for your arbitrary questions.

Some other interesting topics about NP hard problems and P= ? NP. You can read on P/NP in the web site Wikipedia.

Homework #2

download the requirement statements.

Homework #3

Write a program that can read any given C program language file and extract all the keywords appearing in the given file. As I mentioned in the class, you (of course, not `you' but your executable program) have to recognize each keyword (token) of the source file and produce a text file as your result named "result.txt". This result will contains the identified keywords such as int, double, +, -, *, /, for, while, and switch etc. All of them are also sorted by their appearance counts.
I also give you my first example of Lex, which can let the computer dynamically recognize your input sequence of lines. You can download it and make it via Lex tool and then compile it via the Linux's C compiler. Read it carefully and try to build your first runnable program ASAP, so that you can progress further. Here are Lex tutorial and Lex & Yacc user manual files for you too.
Due to the security policy of our LAB, of course, you have to use putty telnet tool to make a connection to our Linux Server.
Due Date: 06:00 pm, Tuesday, December 26, 2006. (a firm deadline)

Homework #4

In this homework, you have to write a simple calculator that can operate any one of the following operations:

Due Date: 06:00 pm, Friday, January 5, 2007. (a firm deadline)

Homework #5

Reading and Report. Download the given PDF document and write your reading note & learning note.