#ifndef PROG_H #define PROG_H #include using namespace std; #include "word.h" #include "tree.t" #include "lex.h" class Prog{ private: Lex lex; int token; Tree tab; public: Prog(); void parse(); private: void input(); void inc(); void plus(); void compute(); void prog(); void check(bool b, const char * mess); void next(); void expect(int tok,const char *mess); }; #endif #include "prog.h" Prog::Prog(){} void Prog::parse(){ Word line, linaux; cin>>line>>linaux; line+=' '; //white space to replace eoln //NOTE: I do not test whether all of "read" is on the //first line and the "write" starts the second line line+=linaux.str(); lex.set(line); cout<<"Parse: "<"<"); break; default: check(false," IDENT or '<' expected"); } } void Prog::check(bool b, const char * mess){ if(!b){ //cerr<<"token="<