COSC3308		Program-6 (Snobol-1)
        	   Arithmetic Expression Parser               due: 11/13/2006

Task:
  Modify the following Snobol4 program so that
  1. Expressions will contain one more operator such as ^ (probably for exponentiation)
  2. the Unanchored Mode of pattern matching will be used unless otherwise specifically 
     indicated, and
  3. the outputs will include
     a. every expression found in the input string and
     b. an indicator of whether or not the ENTIRE input string is an (expected)
        expression

***Note that there are four input strings to test your program.***
*       
*                                        
*       Parser for simple arithmetic expressions
        &anchor = 1	;* To assure that pattern matching starts only at position-1 
*                          of the subject string.	
        &fullscan = 1   ;* To assure unevaluated operator (*) can match the null string.
        &trim = 1       ;* To trim all trailing blanks from the input string.
        op = any("+*-/")
        var = any("ABCDEFG")                              
        factor = var | "(" *exp ")"
        exp = factor | factor op *exp
LOOP    inp = input                     :f(END)
        inp exp rpos(0)                 :s(YES)
        output = inp "::: IS NOT AN EXPRESSION."   :(LOOP)
YES     output = inp "::: IS AN EXPRESSION."    :(LOOP)
END
A^B+(C-(A+B*C*D)-(E^F)*F)
(((A+B)*C-(D+E)^F^G)*C*D)
(A*(B-C)+D*F^))
A^B(B-C*D)