51extern std::ofstream
ofile;
110 const char* ofname =
"clparse.out";
112 ofile <<
"Output file open\n";
115 std::ifstream istr(fname);
120 for (
G4int i=0; i < ntokens; i++)
147 while (!(token1=next(
"\"")).empty())
152 tokens[ntokens++] = token1;
157 while (!(token2=lev2()).empty())
159 tokens[ntokens] = token2;
176 const char* context = tokens[0];
177 const char* routine = tokens[1];
178 const char* wcard =
"*";
182 if ((select != 0) && (select != wcard))
184 if ( strcmp(select,context) ) {
return; }
189 ofile <<
"Do routine " << routine <<
" in context " << context <<
G4endl;
191 if ( !strcmp(routine,
"GSVOLU") ) {
PG4gsvolu(&tokens[2]);
return;}
192 if ( !strcmp(routine,
"GSPOS") ) {
PG4gspos (&tokens[2]);
return;}
193 if ( !strcmp(routine,
"GSPOSP") ) {
PG4gsposp(&tokens[2]);
return;}
194 if ( !strcmp(routine,
"GSATT") ) {
PG4gsatt (&tokens[2]);
return;}
195 if ( !strcmp(routine,
"GSROTM") ) {
PG4gsrotm(&tokens[2]);
return;}
196 if ( !strcmp(routine,
"GSDVN") ) {
PG4gsdvn (&tokens[2]);
return;}
197 if ( !strcmp(routine,
"GSDVT") ) {
PG4gsdvt (&tokens[2]);
return;}
198 if ( !strcmp(routine,
"GSDVX") ) {
PG4gsdvx (&tokens[2]);
return;}
199 if ( !strcmp(routine,
"GSDVN2") ) {
PG4gsdvn2(&tokens[2]);
return;}
200 if ( !strcmp(routine,
"GSDVT2") ) {
PG4gsdvt2(&tokens[2]);
return;}
201 if ( !strcmp(routine,
"GSMATE") ) {
PG4gsmate(&tokens[2]);
return;}
202 if ( !strcmp(routine,
"GSMIXT") ) {
PG4gsmixt(&tokens[2]);
return;}
203 if ( !strcmp(routine,
"GSTMED") ) {
PG4gstmed(&tokens[2]);
return;}
204 if ( !strcmp(routine,
"GSTPAR") ) {
PG4gstpar(&tokens[2]);
return;}
205 if ( !strcmp(routine,
"GSPART") ) {
PG4gspart(&tokens[2]);
return;}
206 if ( !strcmp(routine,
"GSDK") ) {
PG4gsdk (&tokens[2]);
return;}
207 if ( !strcmp(routine,
"GSDET") ) {
PG4gsdet (&tokens[2]);
return;}
208 if ( !strcmp(routine,
"GSDETV") ) {
PG4gsdetv(&tokens[2]);
return;}
209 if ( !strcmp(routine,
"GSDETA") ) {
PG4gsdeta(&tokens[2]);
return;}
210 if ( !strcmp(routine,
"GSDETH") ) {
PG4gsdeth(&tokens[2]);
return;}
211 if ( !strcmp(routine,
"GSDETD") ) {
PG4gsdetd(&tokens[2]);
return;}
212 if ( !strcmp(routine,
"GSDETU") ) {
PG4gsdetu(&tokens[2]);
return;}
213 if ( !strcmp(routine,
"GGCLOS") ) {
PG4ggclos();
return;}
225 G4int i =0, ipt = 0, k = 0;
226 G4int ni =0, nr = 0, nq = 0;
227 while (ptypes[i] !=
'\0')
232 Ipar[ni] = atoi(tokens[ipt].data());
237 Rpar[nr] = atof(tokens[ipt].data());
241 Spar[nq] = tokens[ipt];
245 for (k=0; k <
narray; k++)
247 Ipar[ni] = atoi(tokens[ipt].data());
252 for (k=0; k <
narray; k++)
254 Rpar[nr] = atof(tokens[ipt].data());
263 for (k=0; k <
narray; k++)
265 Rpar[nr] = atof(tokens[ipt].data());
270 for (k=0; k <
narray; k++)
272 Spar[nq] = tokens[ipt];
277 ofile <<
"unidentified ptype '" << ptypes[i] <<
G4endl;
std::vector< G4LogicalVolume * > G3SensVolVector
G3G4DLL_API char gSeparator
void PG4gsdk(G4String *tokens)
void PG4gsatt(G4String *tokens)
void G3CLEval(G4String *tokens, char *select)
G3SensVolVector G3SensVol
void PG4gsdetd(G4String *tokens)
void G3CLRead(G4String &fname, char *select=0)
void PG4gsvolu(G4String *tokens)
void PG4gsdeta(G4String *tokens)
void PG4gsrotm(G4String *tokens)
void PG4gsdvt2(G4String *tokens)
void PG4gsdeth(G4String *tokens)
void PG4gsdvn2(G4String *tokens)
void PG4gsdvx(G4String *tokens)
void PG4gsmate(G4String *tokens)
void PG4gstmed(G4String *tokens)
void PG4gsposp(G4String *tokens)
void G3fillParams(G4String *tokens, const char *ptypes)
void PG4gsdetu(G4String *tokens)
G4int G3CLTokens(G4String *line, G4String *tokens)
void PG4gsmixt(G4String *tokens)
void PG4gspart(G4String *tokens)
void PG4gspos(G4String *tokens)
void PG4gsdvn(G4String *tokens)
void PG4gstpar(G4String *tokens)
void PG4gsdvt(G4String *tokens)
void PG4gsdetv(G4String *tokens)
void PG4gsdet(G4String *tokens)
std::istream & readline(std::istream &is, G4String &str, G4bool skipWhite=true)
Read characters into a G4String from an input stream until end-of-line.