Assignment Three, CS351 S2001

Implement a very simple parser

parser library

See the enclosed file parser.h file. You should finish it, carefully respecting the given API.
Also be sure to read the log of spec changes. These changes are also reflected in parser.h and this file where appropriate (which means you don't really have to read the log, but it may be helpful).

The libarary should not leak storage - you may want to use memory leak checking tools to test this. You need to write a test suite for the library, and a program that automatically runs through your test suite. The suite should carefully test all functionality of the library. (Fewer points will be taken off for a bug in the library if it is caught by your test suite.)

Layout

Please ~bap/bin/cs351-submit hw3 where the directory hw3 has the precise structure described here. If what you turn in does not follow the given stucture or compilation conventions, our scripts will fail to process it correctly. The libparse0 subdir should also contain all files required to build your parsing library. The libparse0/Makefile's default target should generate libparse0.a, a static library to which other programs can be linked. (A line libfoo.a: libfoo.a(bar.o baz.o) in a Makefile is enough to tell make to package together the given .o files to make the given static library file. See this example.)

The tester/ subdir should contain all files to build your library-using testing program, except of course the parsing library. Its Makefile should have a default target to build your tester executable (whatever you choose to call it) but not run it, and another target "test" which (builds if necessary and) runs the testing program in such a way as to test the library thoroughly. Ie it should put the library through its paces using your own test suite.

The tester/Makefile's default target should build a program which is statically linked using the make variable $(LIBPARSE), to which your Makefile should give a default value

 PARSEDIR=../libparse0
 LIBPARSE=$(PARSEDIR)/libparse0.a
so we can override PARSEDIR from the command line. Similarly your source files should
 #include "parse.h"
which is found in ../libparse0/ via a g++ switch -I$(PARSEDIR). You should not include any other non-system include files.

You must use the makefile variable PARSEDIR as the path to find both the libarary and its associated include file(s) so we can override from the commandline when we invoke make.

Both Makefiles should also have clean targets.

The bugs.log file should contain a chronological list of the bugs you found while writing the library, their status, and the notes you made while finding and fixing them.


Due date: Noon Sun Mar 6. Extra credit for assignments turned in on Sun Mar 4.