Computer Science 211
Data Structures

Mount Holyoke College
Fall 2009

Lab 5: P.S.: It's Just a Stack
Due: 9:00 AM, Friday, October 30, 2009

This week's assignment is described in Section 10.5 of Bailey. You will learn about the PostScript language, and gain experience using stacks and making use of an existing partial implementation.

Getting Started

First, carefully read the lab description in the text and this handout. You are certain to have questions, so be sure to leave plenty of time to discuss this assignment with me and the TAs.

Before you begin, copy the starter files from the the shared area under labs/postscript. Familiarize yourself with these three classes and make sure you understand how they work.

Next, develop a sketch of the Interpreter class. This is where you will process the tokens being delivered to your interpreter by the provided Iterator class. No later than Monday, October 26, please either see me to go over your sketch of this class or email it to me for comment and discussion (for 3 points).

Notes and Guidelines

Bonus Opportunity

For a bonus point, you can implement procedures as described in thought question 3. If you design everything else properly, this should be almost a trivial extension.

For another bonus point, you can implement the if operator as described in thought question 4.


When you're finished, please submit the following by email to jteresco AT

You should not include the three files from the textbook's web page in your submission.


This lab assignment is graded out of 30 points. As in all labs, you will be graded on design, documentation, style, and correctness. Be sure to document your program with appropriate comments (use Javadoc!), including your name and a general description at the top of the file, a description of each method with pre and postconditions where appropriate. Also use comments and descriptive variable names to clarify sections of the code which may not be clear to someone trying to understand it.

Grading Breakdown

Pre-lab design 3 points
Program design 2 points
Program style 2 points
Program documentation 5 points
Program correctness 12 points
Procedure support 1 bonus point
if operator support 1 bonus point
Thought questions 6 points

The program design grade will be based on the design choices you make in the implementation of the Interperter class. The program style grade will be based on code formatting and approriate use of Java naming conventions. The program documentation grade is, of course, based on the comments you provide (including Javadoc and pre and postconditions as appropriate). The program correctness grade is based on how well your program meets the functionality requirements.