BAPS/src/baps.cpp

00001 /*************************************************************************
00002  *
00003  * File Name: BAPS.cpp
00004  *            BAPS v2.0
00005  * Author   : David Ong Tat Wee
00006  * Date     : 25 Apr 2000
00007  * 
00008  * Copyright (C) 1998, 1999, 2000
00009  * All Rights Reserved by
00010  * The RAS Group, Algorithms Lab
00011  * School of Computing
00012  * National University of Singapore
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 // Global Constants
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    // DOTW : 25 Apr 2000
00046    //
00047    // Safety check for environment variables BAPHOME and BAPTMP to be
00048    // set before running program
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 

Generated on Tue Sep 9 15:40:10 2008 for BAP by  doxygen 1.5.3