     CSE 109    Progam 6    Due   9 PM Thursday 16 April 2009
     (Late Collection dates:  9 PM  18, 19 April 2008)

     This programming assignment is the last step of four in which we
     will create a program to run FPCLAC programs on the STCALC calculator.
     For this assignment I ask you to write a program that parses FPCALC
     programs (a superset of PCALC programs).  The immediately preceding
     sentence is subtly misleading.  Your p6.cc should be a copy of p5.cc
     with only one change. Instead of declaring a variable of type ProgCalc
     for doing the parsing, you should declare the same variable to be of
     type FullCalc.  The class FullCalc should be a subclass of the class
     ProgCalc.  FullCalc should override some methods of ProgCalc so that
     the instances of the class FullCalc can parse and execute FPCALC
     statments like
           push x*x*x + 2*(3-x)
           jumpGE one
     If your methods in ProgCalc are properly modularized, this should
     involve having FullCalc overried a few methods in ProgCalc.

     Your program should read the command line, expecting the name of an
     input file and, optionally, the string "-v". The input file should
     consist of what purports to be an FPCALC program. It then should
     parse each line as it is encountered and either diagnose a syntax error
     and quit or execute the command on that line.

     NOTE: IT IS VERY IMPORTANT THAT YOU IMPLEMENT THIS ASSIGNMENT SO THAT
     FullCalc IS A SUBCLASS OF ProgCalc.

     The program should execute the FPCALC program in one of two modes:
        (1)  Nonverbose (no -v argument on the command line). It simply
             displays to the terminal the data entered (as each is read in
             response to the command "enter") and the output (in response to
             the command "getScreen").
        (2)  Verbose (-v argument on the command line). In addition to the
             display in (1), also echo the text of the line being executed.

     The use of class ProgCalc should look something like:
          FullCalc p;
          ifstream in;
          bool verbose;
          ....
          .....
          p.load(in);
          p.run(verbose);

     To submit your assignment, create a subdirectory of /cse109.091 called
     p6 (that is, from your root directory cse109.091/p6) for doing your
     work.  Finally, indicate you wish the assignment to be collected by
     executing the unix command "touch DONE", which will create a file of
     0 bytes named DONE.  Then all files in the subdirectory p6 (but not
     in subdirectories of the subdirectory p6) will be collected.  I will
     test your program using your Makefile.

     [I repeat the instructions for using my files from /proj/csc109/p5]
     Note: This assignment depends on classes Lex, Word, Table< , >, Calc,
           and StCalc developed in earlier assignments.  It would be best if
           you used your versions of these files, but you can use the object
           files lex.o, calc.o, stcalc.o, word.o, and check.o, as well as the
           template and header files table.t, word.h, lex.h, calc.h, stcalc.h,
           and check.h

           To aid you I have stored these files in /proj/csc109/p5. If you
           use them, it is VERY IMPORTANT that you use them as I direct.
           Remember, you don't want to aggravate me.  First, in your Makefile,
           all references to the .o files used from /proj.csc109/p5 should be
           prefixed with /proj/csc109/p5.

           For example, the p6: command might be
               p6: p6.o /proj/csc109/p5/lex.o  /proj/csc109/p5/word.o
                          /proj/csc109/p5/calc.o /proj/csc109/p5/stcalc.o
                          /proj/csc109/p5/check.o   progcalc.o  fullcalc.o
               <tab>  g++ -o p6 p6.o /proj/csc109/p5/lex.o
                           /proj/csc109/p5/word.o
                          /proj/csc109/p5/calc.o /proj/csc109/p5/stcalc.o
                          /proj/csc109/p5/check.o   progcalc.o  fullcalc.o
           where the files for the given command are all on one line, which
           emacs will allow, but for which I have insufficient room here.
           Thus, the above example from the Makefile has only two (long) lines.
           Also, note that (I think) I have all the references to p5 and p6
           correct.

           Second, to use my .h files, your .cc files should have include
           statements that prefix the name of the particular .h file with
           /proj/csc109/p5/, e.g.,
           #include "/proj/csc109/p5/check.h"

     Note: I will store some test files in /proj/csc109/p6.  I will use
           these files, and perhaps others, to test your program.

     Note: You should compare the behavior of your program to the behavior
           of fpcalc, my solution to this assignment.

     Note: I WILL NOT BE ABLE TO PROVIDE THE FILES progcalc.h and progcalc.cc
           when you do this assignment. Thus, you must get p5 running in
           order to do p6. I am ready to help anyone getting their p5 running
           once they have submitted it for grading.

     Once again I remind you to avoid unfair collaboration.  To understand
     what is meant by "unfair collaboration" read the syllabus again.
