diff --git a/src/EvtGenBase/EvtParser.cpp b/src/EvtGenBase/EvtParser.cpp index 603653b..43390d2 100644 --- a/src/EvtGenBase/EvtParser.cpp +++ b/src/EvtGenBase/EvtParser.cpp @@ -1,172 +1,172 @@ //-------------------------------------------------------------------------- // // Environment: // This software is part of the EvtGen package developed jointly // for the BaBar and CLEO collaborations. If you use all or part // of it, please give an appropriate acknowledgement. // // Copyright Information: See EvtGen/COPYRIGHT // Copyright (C) 1998 Caltech, UCSB // // Module: EvtParser.cc // // Description: Reading the decay table and produce a list of tokens. // // Modification history: // // RYD Febuary 11, 1998 Module created // //------------------------------------------------------------------------ // #include "EvtGenBase/EvtPatches.hh" #include "EvtGenBase/EvtPatches.hh" #include #include #include #include "EvtGenBase/EvtParser.hh" #include "EvtGenBase/EvtReport.hh" using namespace std; #define MAXBUF 1024 EvtParser::EvtParser(){ _ntoken=0; _lengthoftokenlist=0; _tokenlist=0; _linelist=0; } EvtParser::~EvtParser(){ delete [] _tokenlist; delete [] _linelist; } int EvtParser::getNToken(){ return _ntoken; } const std::string& EvtParser::getToken(int i){ return _tokenlist[i]; } int EvtParser::getLineofToken(int i){ return _linelist[i]; } int EvtParser::read(const std::string filename){ ifstream fin; fin.open(filename.c_str()); if (!fin) { EvtGenReport(EVTGEN_ERROR,"EvtGen") << "Could not open file '"<>buf2){ i=0; int semicolon=0; do{ if (buf2[i]==';') { buf2[i]=0; semicolon=1; } }while(buf2[i++]!=0); if (buf2[0]!=0){ addToken(line,buf2); } if (semicolon) addToken(line,";"); } } fin.close(); return 0; } void EvtParser::addToken(int line,const std::string& string){ //EvtGenReport(EVTGEN_INFO,"EvtGen") <<_ntoken<<" "<