Programming with abstract data types

2/7/99


Click here to start


Table of Contents

Programming with abstract data types

Where are we now?

What do we need?

Defining C++ classes

The Token class

How will we implement it?

Representing the kind of token

Finishing the definition

Defining the member functions

Now comes the (first) hard part

Token constructor, part 1

What are the possibilities?

Our first task

Scanning white-space characters

Where are we now?

Dealing with what we scanned

Reading a word: strategy

Reading a word: code

A note on putback

The reduced code

The Line class

The Line constructor

The reset function

The canfit function

The append and print functions

Putting it all together

And finally, the main program...

Dependencies

Putting it all together

Thoughts on the program

Language dependencies

Objects

Are objects necessary?

What is an object?

What is object identity?

Identity and mutable state

Functional programming

The key issues

Summary

Homework (due Monday)

Author: Andrew Koenig

Email: ark@research.att.com

Home Page: http://www.research.att.com/info/ark