21#include "EvtGenBase/EvtPatches.hh"
22#include "EvtGenBase/EvtPatches.hh"
26#include "EvtGenBase/EvtParser.hh"
27#include "EvtGenBase/EvtReport.hh"
72 fin.open(filename.c_str());
74 report(
ERROR,
"EvtGen") <<
"Could not open file '"<<filename.c_str()<<
"'"<<endl;
85 while(fin.peek() != EOF){
89 while((c=fin.get()) !=
'\n' && i<
MAXBUF) {
94 report(
ERROR,
"EvtGen") <<
"Error in EvtParser: line:"
95 <<line<<
" to long"<<endl;
104 if (buf[i]==
'#') buf[i]=0;
109 istrstream ist(buf,strlen(buf));
118 }
while(buf2[i++]!=0);
122 if (semicolon) addToken(line,
";");
134void EvtParser::addToken(
int line,
const std::string&
string){
138 if (_ntoken==_lengthoftokenlist) {
140 int new_length=1000+4*_lengthoftokenlist;
144 int* newlinelist=
new int[new_length];
145 std::string* newtokenlist=
new std::string[new_length];
149 for(i=0;i<_ntoken;i++){
150 newlinelist[i]=_linelist[i];
151 newtokenlist[i]=_tokenlist[i];
154 delete [] _tokenlist;
157 _tokenlist=newtokenlist;
158 _linelist=newlinelist;
160 _lengthoftokenlist=new_length;
165 _tokenlist[_ntoken]=string;
167 _linelist[_ntoken]=line;
ostream & report(Severity severity, const char *facility)
int getLineofToken(int i)
const std::string & getToken(int i)
int Read(const std::string filename)