CISC220, Summer 2006, Project 4

Introduction

In Projects 4 and 5, we will address the problem of HTML tag matching

As we discussed in lecture, you can use a stack to solve the problem of checking open and close tags in HTML for "proper nesting". Open tags are pushed onto the stack. Close tags cause us to pop the top of the stack, and check for a match. If the close tag and the top of the stack doesn't match, or if the stack has nothing to be popped we return a failure. We also return a failure if the stack is not empty when we hit end of file.

In Project 4, you will do test-driven development of two classes:

In Project 5, you use these classes to solve the problem

Project 5 will use the classes you developed to write a program that accepts HTML input, and either prints "ok", or gives a report of one of three kinds of errors that may be encountered:

More about what you will do in Project 4

I am providing you with two files, HTMLTagTest.cc and HTMLTagStackTest.cc, that contain test cases for these two classes. Those files can be found at:

From these two files, you should be able to "back engineer" what the interface to these classes should be (i.e. what the member functions are), and what the behavior of those member functions is supposed to be. You will write:

You will also need the following files, which you can copy directly from one of my lecture code directories. They may need to be adjusted to fit the problem, i.e. if they don't have the correct versions of assertEquals() for mixes of C strings and C++ strings.

What to do

  1. Work with HTMLTagTest.cc first. Write the .h and .cc files for the HTMLTag_C class first. It is suggested that the first time out, you just write "stubs" for the member functions, so that all the tests fail, then write correct versions so that all the tests pass. As part of this step, you'll need to:
  2. Repeat this process for HTMLTagStackTest.cc, and the .h and .cc files for HTMLTagStack_C.
  3. Produce a script and a tar file documenting your work. For this project, include listings (cat the files) of all your .cc and .h files, as well as your Makefile (even the ones that I provided you with, or that you copied from the web site.) This is in case different folks use different versions of the RunTests_C files, and also to have a handy documentation for the grader of the test files.

Special Notes

What you can change, and what you should not change

Grading:

 

End of file proj4.html, for Project 4, CISC220, 06J