// File: parse.h // // Function prototypes for parser #ifndef _parse_h #define _parse_h #include "tree.h" #include "token.h" typedef Tree ETree ; // Exception handling class. // Catch objects of the following type for parsing errors // class ParseError { public: const char *msg ; // point to static string only, please ParseError(const char *s = NULL) : msg(s) {} } ; int Evaluate(const ETree&) ; // evaluate the expression tree ETree *Parse(TokenStream&) ; // catches exceptions ETree *ParseEverything(TokenStream&) ; // catch your own exceptions #endif