52 extern std::ofstream
ofile;
111 const char* ofname =
"clparse.out";
113 ofile <<
"Output file open\n";
117 std::ifstream istr(fname);
119 while (line.
readLine(istr) && ! istr.eof())
123 for (
G4int i=0; i < ntokens; i++)
150 while (!(token1=next(
"\"")).isNull())
155 tokens[ntokens++] = token1;
160 while (!(token2=lev2()).isNull())
162 tokens[ntokens] = token2;
179 const char* context = tokens[0];
180 const char* routine = tokens[1];
181 const char* wcard =
"*";
185 if ((select != 0) && (select != wcard))
187 if ( strcmp(select,context) ) {
return; }
192 ofile <<
"Do routine " << routine <<
" in context " << context <<
G4endl;
194 if ( !strcmp(routine,
"GSVOLU") ) {
PG4gsvolu(&tokens[2]);
return;}
195 if ( !strcmp(routine,
"GSPOS") ) {
PG4gspos (&tokens[2]);
return;}
196 if ( !strcmp(routine,
"GSPOSP") ) {
PG4gsposp(&tokens[2]);
return;}
197 if ( !strcmp(routine,
"GSATT") ) {
PG4gsatt (&tokens[2]);
return;}
198 if ( !strcmp(routine,
"GSROTM") ) {
PG4gsrotm(&tokens[2]);
return;}
199 if ( !strcmp(routine,
"GSDVN") ) {
PG4gsdvn (&tokens[2]);
return;}
200 if ( !strcmp(routine,
"GSDVT") ) {
PG4gsdvt (&tokens[2]);
return;}
201 if ( !strcmp(routine,
"GSDVX") ) {
PG4gsdvx (&tokens[2]);
return;}
202 if ( !strcmp(routine,
"GSDVN2") ) {
PG4gsdvn2(&tokens[2]);
return;}
203 if ( !strcmp(routine,
"GSDVT2") ) {
PG4gsdvt2(&tokens[2]);
return;}
204 if ( !strcmp(routine,
"GSMATE") ) {
PG4gsmate(&tokens[2]);
return;}
205 if ( !strcmp(routine,
"GSMIXT") ) {
PG4gsmixt(&tokens[2]);
return;}
206 if ( !strcmp(routine,
"GSTMED") ) {
PG4gstmed(&tokens[2]);
return;}
207 if ( !strcmp(routine,
"GSTPAR") ) {
PG4gstpar(&tokens[2]);
return;}
208 if ( !strcmp(routine,
"GSPART") ) {
PG4gspart(&tokens[2]);
return;}
209 if ( !strcmp(routine,
"GSDK") ) {
PG4gsdk (&tokens[2]);
return;}
210 if ( !strcmp(routine,
"GSDET") ) {
PG4gsdet (&tokens[2]);
return;}
211 if ( !strcmp(routine,
"GSDETV") ) {
PG4gsdetv(&tokens[2]);
return;}
212 if ( !strcmp(routine,
"GSDETA") ) {
PG4gsdeta(&tokens[2]);
return;}
213 if ( !strcmp(routine,
"GSDETH") ) {
PG4gsdeth(&tokens[2]);
return;}
214 if ( !strcmp(routine,
"GSDETD") ) {
PG4gsdetd(&tokens[2]);
return;}
215 if ( !strcmp(routine,
"GSDETU") ) {
PG4gsdetu(&tokens[2]);
return;}
216 if ( !strcmp(routine,
"GGCLOS") ) {
PG4ggclos();
return;}
228 G4int i =0, ipt = 0, k = 0;
229 G4int ni =0, nr = 0, nq = 0;
230 while (ptypes[i] !=
'\0')
235 Ipar[ni] = atoi(tokens[ipt].data());
240 Rpar[nr] = atof(tokens[ipt].data());
244 Spar[nq] = tokens[ipt];
248 for (k=0; k <
narray; k++)
250 Ipar[ni] = atoi(tokens[ipt].data());
255 for (k=0; k <
narray; k++)
257 Rpar[nr] = atof(tokens[ipt].data());
265 narray = 3 * std::abs(narray);
266 for (k=0; k <
narray; k++)
268 Rpar[nr] = atof(tokens[ipt].data());
273 for (k=0; k <
narray; k++)
275 Spar[nq] = tokens[ipt];
280 ofile <<
"unidentified ptype '" << ptypes[i] <<
G4endl;
void PG4gsvolu(G4String *tokens)
void PG4gspos(G4String *tokens)
void PG4gsdetd(G4String *tokens)
void PG4gstmed(G4String *tokens)
void PG4gsdvt2(G4String *tokens)
void PG4gsposp(G4String *tokens)
G3SensVolVector G3SensVol
void PG4gsdk(G4String *tokens)
void PG4gsdetv(G4String *tokens)
void PG4gstpar(G4String *tokens)
void PG4gsdvt(G4String *tokens)
std::istream & readLine(std::istream &, G4bool skipWhite=true)
void PG4gsdeth(G4String *tokens)
std::vector< G4LogicalVolume * > G3SensVolVector
G4int G3CLTokens(G4String *line, G4String *tokens)
void PG4gsmixt(G4String *tokens)
void PG4gsrotm(G4String *tokens)
void PG4gsmate(G4String *tokens)
void G3CLRead(G4String &fname, char *select=0)
void PG4gsdvx(G4String *tokens)
void G3CLEval(G4String *tokens, char *select)
void PG4gspart(G4String *tokens)
void PG4gsatt(G4String *tokens)
void PG4gsdvn(G4String *tokens)
void PG4gsdetu(G4String *tokens)
void G3fillParams(G4String *tokens, const char *ptypes)
void PG4gsdet(G4String *tokens)
void PG4gsdvn2(G4String *tokens)
void PG4gsdeta(G4String *tokens)