//$Id: main.C,v 1.1 1995/09/22 17:54:58 salil Exp salil $ // ---------------------------------------------------------------------- // COPYRIGHT (C) 1995 Northeastern University. // All rights reserved // // isthmus-cd & isthmus-pp are tools developed by the Isthmus development // team. A number of people contributed to this project. // Some of the important contributors are .. // Mathew Wojcik, Mohnish Anumala, Karl Lieberherr and Salil Pradhan // // Permission is granted to make, distribute and modify copies of this // software provided the copyright notice and this permission notice are // preserved on all copies. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // //----------------------------------------------------------------------- #include "UNKNOWN.h" void out_of_store() { cerr << "UNKNOWN: operator new failed, out of store\n"; exit( 1 ); } #ifndef __GNUC__ extern PF set_new_handler( PF ); #else extern "C" PF set_new_handler( PF ); #endif /* * GEN_DIR is a global variable containing the path of the generation * environment. This path is used to find the cd-print and cd-parse * class dictionaries. * Do NOT delete the following statement. */ char* GEN_DIR = getenv( "GEN_DIR" ); int main( int argc, char* argv[], char* envp[] ) { // set new handler to catch out of memory exception set_new_handler( &out_of_store ); //---------------------------------------- // Parsing an object //---------------------------------------- // specify file to parse in const int MAXPATH = 256; char Dem_input[MAXPATH]; cout << "Isthmus-cd 1.1\nAttempting to generate remote proxy code ....." <= 2 ) strcpy( Dem_input, argv[1] ); else { strcpy( Dem_input, "notmod/cds/cd-inter" ); // default input } // parse it in cout << "Parsing in cd-inter in: " << Dem_input << "." << endl; Demeter_in* iDemeter_in = new Demeter_in(); if ( ( Demeter_in* ) iDemeter_in -> g_parse( Dem_input ) == NULL ) { cerr << "Parser error." << endl; exit(1); } cout << endl; ofstream outFile2, outFile3; outFile2.open("objectHandler.C", ios::out); outFile3.open("objectHandler.h", ios::out); iDemeter_in->stdmethods_list1(outFile2); cout << "objectHandler.C generated..." << endl; iDemeter_in->stdmethods_list2(outFile3); cout << "objectHandler.h generated..." << endl; outFile2.close(); outFile3.close(); char* tmp_filename1 = "./notmod/headers/UNKNOWN-CLASSlist.h"; char* tmp_filename2 = "./notmod/headers/UNKNOWN-CLASScmd.h"; char* tmp_filename3 = "./notmod/headers/UNKNOWN-CLASShandlers.h"; char* tmp_filename4 = "./notmod/headers/UNKNOWN-CLASSactivate.h"; ofstream outFile4(tmp_filename1, ios::out); ofstream outFile5(tmp_filename2, ios::out); ofstream outFile6(tmp_filename3, ios::out); ofstream outFile7(tmp_filename4, ios::out); if ( !outFile4 ) { cerr << "UNKNOWN error: unable to open " << tmp_filename1 << " for output" << endl; exit( 1 ); } if ( !outFile5 ) { cerr << "UNKNOWN error: unable to open " << tmp_filename2 << " for output" << endl; exit( 1 ); } if ( !outFile6 ) { cerr << "UNKNOWN error: unable to open " << tmp_filename3 << " for output" << endl; exit( 1 ); } iDemeter_in -> class_list( outFile4, outFile5, outFile6, outFile7 ); cout << "UNKNOWN-CLASSlist.h generated..." << endl; cout << "UNKNOWN-CLASScmd.h generated..." << endl; cout << "UNKNOWN-CLASShandlers.h generated..." << endl; cout << "UNKNOWN-CLASSactivate.h generated..." << endl; outFile4.close(); outFile5.close(); outFile6.close(); outFile7.close(); iDemeter_in -> create_super_header_files(); iDemeter_in -> gen_main_tcl(); cout << "main.tcl.sample generated..." << endl; system("cp $GEN_DIR/TclTkDemeter.C ."); cout << "Created : TclTkDemeter.C ... " <