// main.cpp -- driver for parser class. #include #include #include #include "TokFiler.h" #include "QuadList.h" #include "QuadFiler.h" #include "FileManager.h" #include "Token.h" #include "pmglobs.h" #include "intstack.h" #include "idDescTab.h" #include "funcTab.h" #include "Quad.h" #include "parser.h" int main(int argc, char *argv[]) { parser aparser; char* progName = ""; char* theProgName = ""; if (argc != 2) { cout << "Incorrect number of command line arguments" << endl; cout << "Usage: parser \n"; exit(1); } else { progName = new char[strlen(argv[1]) + 1]; strcpy(progName, argv[1]); cout << "The program name is: " << progName << endl; } aparser.distributeProgName(argv[1]); aparser.getProgramFile(); aparser.seeProgramFile(); aparser.closeProgramFile(); aparser.seeTokens(); // Creating Quadruples: aparser.Tokensequence(); cout << "Displaying s stack ...\n"; aparser.displayStack(); cout << "Displaying qs stack ...\n"; aparser.displayQStack(); aparser.savePROGinfo(); aparser.seeQuads(); return 0; } // end of main.