00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "def.h"
00017 #include "BAPPackage.h"
00018 #include "BAPSolver.h"
00019
00020 using std::cout;
00021 using std::endl;
00022 using std::cerr;
00023
00024
00025 const int TAB = 3, DETAIL = 2;
00026
00027 int main(int argc, char *argv[])
00028 {
00029 if (argc != 2 && argc != 3)
00030 {
00031 string Name(argv[0]);
00032 cout << "Usage:" << endl
00033 << endl
00034 << " " << Name << " <Project File>" << endl
00035 << " Eg. " << Name << " proj-d002-gp001-001.prj" << endl
00036 << endl
00037 << "Copyright (C) 1998 All Rights Reserved by" << endl
00038 << "The RAS Group, Algorithms Lab" << endl
00039 << "The National University of Singapore" << endl
00040 << endl;
00041 exit (0);
00042 }
00043
00044
00045
00046
00047
00048
00049
00050 if (getenv("BAPHOME") == NULL)
00051 {
00052 cerr << "environment variable BAPHOME not set!" << endl;
00053 exit(0);
00054 }
00055 if (getenv("BAPTMP") == NULL)
00056 {
00057 cerr << "environment variable BAPTMP not set!" << endl;
00058 exit(0);
00059 }
00060
00061 string ProjectFile(argv[1]);
00062 string Job("all");
00063 BAPPackage TheBAP(ProjectFile);
00064
00065 if (argc == 3)
00066 {
00067 Job = argv[2];
00068 }
00069
00070 BAPSolver Solver(TheBAP, Job);
00071 Solver.Solve();
00072
00073 cout << "End of program" << endl;
00074 return 0;
00075 }
00076