51 extern std::ofstream
ofile;
110 const char* ofname =
"clparse.out";
112 ofile <<
"Output file open\n";
116 std::ifstream istr(fname);
118 while (line.
readLine(istr) && ! istr.eof())
122 for (
G4int i=0; i < ntokens; i++)
149 while (!(token1=next(
"\"")).isNull())
154 tokens[ntokens++] = token1;
159 while (!(token2=lev2()).isNull())
161 tokens[ntokens] = token2;
178 const char*
context = tokens[0];
179 const char* routine = tokens[1];
180 const char* wcard =
"*";
184 if ((select != 0) && (select != wcard))
186 if ( strcmp(select,context) ) {
return; }
191 ofile <<
"Do routine " << routine <<
" in context " << context <<
G4endl;
193 if ( !strcmp(routine,
"GSVOLU") ) {
PG4gsvolu(&tokens[2]);
return;}
194 if ( !strcmp(routine,
"GSPOS") ) {
PG4gspos (&tokens[2]);
return;}
195 if ( !strcmp(routine,
"GSPOSP") ) {
PG4gsposp(&tokens[2]);
return;}
196 if ( !strcmp(routine,
"GSATT") ) {
PG4gsatt (&tokens[2]);
return;}
197 if ( !strcmp(routine,
"GSROTM") ) {
PG4gsrotm(&tokens[2]);
return;}
198 if ( !strcmp(routine,
"GSDVN") ) {
PG4gsdvn (&tokens[2]);
return;}
199 if ( !strcmp(routine,
"GSDVT") ) {
PG4gsdvt (&tokens[2]);
return;}
200 if ( !strcmp(routine,
"GSDVX") ) {
PG4gsdvx (&tokens[2]);
return;}
201 if ( !strcmp(routine,
"GSDVN2") ) {
PG4gsdvn2(&tokens[2]);
return;}
202 if ( !strcmp(routine,
"GSDVT2") ) {
PG4gsdvt2(&tokens[2]);
return;}
203 if ( !strcmp(routine,
"GSMATE") ) {
PG4gsmate(&tokens[2]);
return;}
204 if ( !strcmp(routine,
"GSMIXT") ) {
PG4gsmixt(&tokens[2]);
return;}
205 if ( !strcmp(routine,
"GSTMED") ) {
PG4gstmed(&tokens[2]);
return;}
206 if ( !strcmp(routine,
"GSTPAR") ) {
PG4gstpar(&tokens[2]);
return;}
207 if ( !strcmp(routine,
"GSPART") ) {
PG4gspart(&tokens[2]);
return;}
208 if ( !strcmp(routine,
"GSDK") ) {
PG4gsdk (&tokens[2]);
return;}
209 if ( !strcmp(routine,
"GSDET") ) {
PG4gsdet (&tokens[2]);
return;}
210 if ( !strcmp(routine,
"GSDETV") ) {
PG4gsdetv(&tokens[2]);
return;}
211 if ( !strcmp(routine,
"GSDETA") ) {
PG4gsdeta(&tokens[2]);
return;}
212 if ( !strcmp(routine,
"GSDETH") ) {
PG4gsdeth(&tokens[2]);
return;}
213 if ( !strcmp(routine,
"GSDETD") ) {
PG4gsdetd(&tokens[2]);
return;}
214 if ( !strcmp(routine,
"GSDETU") ) {
PG4gsdetu(&tokens[2]);
return;}
215 if ( !strcmp(routine,
"GGCLOS") ) {
PG4ggclos();
return;}
227 G4int i =0, ipt = 0,
k = 0;
228 G4int ni =0, nr = 0, nq = 0;
229 while (ptypes[i] !=
'\0')
234 Ipar[ni] = atoi(tokens[ipt].
data());
239 Rpar[nr] = atof(tokens[ipt].
data());
243 Spar[nq] = tokens[ipt];
249 Ipar[ni] = atoi(tokens[ipt].
data());
256 Rpar[nr] = atof(tokens[ipt].
data());
267 Rpar[nr] = atof(tokens[ipt].
data());
274 Spar[nq] = tokens[ipt];
279 ofile <<
"unidentified ptype '" << ptypes[i] <<
G4endl;