00001 // Main.cpp - main program declaration. 00002 00003 #include "Parenth.hpp" 00004 00005 // If everything run correctly the program return 0 00006 // else the program return the errorcode level 1 00007 // to indicate that the datafile was not found 00008 // in the current directory. 00009 00010 00011 // How this program is organized to be more reusable: 00012 // ================================================== 00013 // 00014 // Main defines the entry and exit point of the program. 00015 // 00016 // Parenth defines the reading and decoding part of the datafile 00017 // and all the computation that have to be done. 00018 // 00019 // Stack defines the Single-sided Link Nodes Stack class 00020 // that deals with the parenthesis matching in pairs. 00021 // 00022 // Link defines the Single-sided Link nodes used by the Stack class. 00023 // 00024 // Const defines all the MS headers and others constant. 00025 // 00026 // DBase defines the DataType used by Link and Stack class 00027 // used to store information using the String ADT and others types, 00028 // a bit like Shaffer's ELEM type. 00029 // 00030 00031 int main(void) 00032 { 00033 00034 Parenth* p = new Parenth(); 00035 00036 int x = 0; 00037 00038 x = p->read( "parenth.dat" ); 00039 00040 delete p; 00041 00042 return x; // Return ErrorLevel Code, if an error occured. 00043 }