36 using namespace G4UItokenNum;
91 return (
this == &right );
96 return (
this != &right );
110 {
G4cout <<
" Default value : taken from the current value" <<
G4endl; }
121 std::ostringstream os;
122 os << theDefaultValue;
128 std::ostringstream os;
129 os << theDefaultValue;
140 ed <<
"This method can be used only for a string-type parameter that is used to specify a unit.\n"
141 <<
"This parameter <" <<
parameterName <<
"> is defined as ";
143 case 'D': ed <<
"double.";
break;
144 case 'I': ed <<
"integer.";
break;
145 case 'B': ed <<
"bool.";
break;
146 default: ed <<
"undefined.";
176 while( ! (aToken=candidateTokenizer()).isNull() )
179 if(aToken==newValue)
return iToken;
181 G4cerr <<
"parameter value (" << newValue
182 <<
") is not listed in the candidate List." <<
G4endl;
190 std::istringstream is(newValue);
193 case 'D': { is >>
newVal.
D; }
break;
194 case 'I': { is >>
newVal.
I; }
break;
202 G4cerr <<
"Illegal Expression in parameter range." <<
G4endl;
205 if ( result.
I )
return 1;
219 G4cerr<<newValue<<
": double value expected."
224 if(
IsInt(newValueString.
data(),20)== 0) {
225 G4cerr<<newValue<<
": integer expected."
232 if ( newValueString ==
"Y" || newValueString ==
"N"
233 ||newValueString ==
"YES" || newValueString ==
"NO"
234 ||newValueString ==
"1" || newValueString ==
"0"
235 ||newValueString ==
"T" || newValueString ==
"F"
236 ||newValueString ==
"TRUE" || newValueString ==
"FALSE")
249 IsInt(
const char* buf,
short maxDigits)
253 if( *p ==
'+' || *p ==
'-') { ++
p; }
254 if( isdigit( (
G4int)(*p) )) {
257 if( length > maxDigits) {
276 if(
IsInt( str, maxExplength=7 ))
return 1;
285 case '+':
case '-': ++
p;
287 while( isdigit( (
G4int)(*p) )) { ++
p; }
293 if( *p ==
'\0' )
return 1;
296 while( isdigit( (
G4int)(*p) )) { ++
p; }
297 if( *p ==
'\0' )
return 1;
299 }
else return 0;
break;
303 if( *p ==
'.' ) { ++
p;
305 while( isdigit( (
G4int)(*p) )) { ++
p; }
306 if( *p ==
'\0' )
return 1;
313 while( isdigit( (
G4int)(*p) )) { ++
p; }
314 if( *p ==
'\0' )
return 1;
319 while( isdigit( (
G4int)(*p) )) { ++
p; }
320 if( *p ==
'\0' )
return 1;
322 if( *p ==
'.' ) { ++
p;
323 if( *p ==
'\0' )
return 1;
326 while( isdigit( (
G4int)(*p) )) { ++
p; }
327 if( *p ==
'\0' )
return 1;
358 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
367 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
375 result.
I += (p.
D != 0.0);
393 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
402 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
410 result.
I *= (p.
D != 0.0);
436 result.
I =
Eval2( arg1, operat, arg2 );
443 G4cerr <<
"Parameter range: error at EqualityExpression"
467 result.
I =
Eval2( arg1, operat, arg2 );
485 if(
token !=
'+' &&
token !=
'-' )
return result;
486 G4cerr <<
"Parameter range: operator "
488 <<
" is not supported." <<
G4endl;
498 G4cerr <<
"Parameter range: operator "
500 <<
" is not supported." <<
G4endl;
530 G4cerr <<
"Parameter range error: "
531 <<
"operator '!' is not supported (sorry)."
584 <<
": meaningless comparison "
595 G4cerr <<
"integer operand expected for "
616 G4cerr <<
"integer operand expected for "
631 G4cerr <<
"no param name is specified at the param range."<<
G4endl;
641 case GT: result = ( arg1 > arg2); opr=
">" ;
break;
642 case GE: result = ( arg1 >= arg2); opr=
">=";
break;
643 case LT: result = ( arg1 < arg2); opr=
"<" ;
break;
644 case LE: result = ( arg1 <= arg2); opr=
"<=";
break;
645 case EQ: result = ( arg1 == arg2); opr=
"==";
break;
646 case NE: result = ( arg1 != arg2); opr=
"!=";
break;
648 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
653 << arg1 <<
" " << opr << arg2
654 <<
" result: " << result
666 case GT: result = ( arg1 > arg2); opr=
">";
break;
667 case GE: result = ( arg1 >= arg2); opr=
">=";
break;
668 case LT: result = ( arg1 < arg2); opr=
"<";
break;
669 case LE: result = ( arg1 <= arg2); opr=
"<=";
break;
670 case EQ: result = ( arg1 == arg2); opr=
"==";
break;
671 case NE: result = ( arg1 != arg2); opr=
"!=";
break;
673 G4cerr <<
"Parameter range: error at CompareDouble" <<
G4endl;
677 G4cerr <<
"CompareDouble "
678 << arg1 <<
" " << opr <<
" "<< arg2
679 <<
" result: " << result
693 while(( c=
G4UIpGetc())==
' '|| c==
'\t' || c==
'\n' )
698 if (isdigit(c) || c==
'.') {
702 }
while (c==
'.' || isdigit(c) ||
703 c==
'e' || c==
'E' || c==
'+' || c==
'-');
706 std::istringstream is(t);
719 if (isalpha(c)|| c==
'_') {
722 }
while ((c=
G4UIpGetc()) != EOF && (isalnum(c) || c==
'_'));