90 return (
this == &right );
95 return (
this != &right );
109 {
G4cout <<
" Default value : taken from the current value" <<
G4endl; }
120 std::ostringstream os;
121 os << theDefaultValue;
127 std::ostringstream os;
128 os << theDefaultValue;
155 while( ! (aToken=candidateTokenizer()).isNull() )
158 if(aToken==newValue)
return iToken;
160 G4cerr <<
"parameter value is not listed in the candidate List." <<
G4endl;
168 std::istringstream is(newValue);
171 case 'D': { is >>
newVal.
D; }
break;
172 case 'I': { is >>
newVal.
I; }
break;
180 G4cerr <<
"Illegal Expression in parameter range." <<
G4endl;
183 if ( result.
I )
return 1;
197 G4cerr<<newValue<<
": double value expected."
202 if(
IsInt(newValueString.
data(),20)== 0) {
203 G4cerr<<newValue<<
": integer expected."
210 if ( newValueString ==
"Y" || newValueString ==
"N"
211 ||newValueString ==
"YES" || newValueString ==
"NO"
212 ||newValueString ==
"1" || newValueString ==
"0"
213 ||newValueString ==
"T" || newValueString ==
"F"
214 ||newValueString ==
"TRUE" || newValueString ==
"FALSE")
227 IsInt(
const char* buf,
short maxDigits)
231 if( *p ==
'+' || *p ==
'-') { ++p; }
232 if( isdigit( (
G4int)(*p) )) {
233 while( isdigit( (
G4int)(*p) )) { ++p; ++length; }
235 if( length > maxDigits) {
254 if(
IsInt( str, maxExplength=7 ))
return 1;
263 case '+':
case '-': ++p;
265 while( isdigit( (
G4int)(*p) )) { ++p; }
271 if( *p ==
'\0' )
return 1;
274 while( isdigit( (
G4int)(*p) )) { ++p; }
275 if( *p ==
'\0' )
return 1;
277 }
else return 0;
break;
281 if( *p ==
'.' ) { ++p;
283 while( isdigit( (
G4int)(*p) )) { ++p; }
284 if( *p ==
'\0' )
return 1;
291 while( isdigit( (
G4int)(*p) )) { ++p; }
292 if( *p ==
'\0' )
return 1;
297 while( isdigit( (
G4int)(*p) )) { ++p; }
298 if( *p ==
'\0' )
return 1;
300 if( *p ==
'.' ) { ++p;
301 if( *p ==
'\0' )
return 1;
304 while( isdigit( (
G4int)(*p) )) { ++p; }
305 if( *p ==
'\0' )
return 1;
336 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
345 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
353 result.
I += (p.
D != 0.0);
371 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
380 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
388 result.
I *= (p.
D != 0.0);
414 result.
I =
Eval2( arg1, operat, arg2 );
421 G4cerr <<
"Parameter range: error at EqualityExpression"
445 result.
I =
Eval2( arg1, operat, arg2 );
463 if(
token !=
'+' &&
token !=
'-' )
return result;
464 G4cerr <<
"Parameter range: operator "
466 <<
" is not supported." <<
G4endl;
476 G4cerr <<
"Parameter range: operator "
478 <<
" is not supported." <<
G4endl;
508 G4cerr <<
"Parameter range error: "
509 <<
"operator '!' is not supported (sorry)."
562 <<
": meaningless comparison "
573 G4cerr <<
"integer operand expected for "
594 G4cerr <<
"integer operand expected for "
609 G4cerr <<
"no param name is specified at the param range."<<
G4endl;
619 case GT: result = ( arg1 > arg2); opr=
">" ;
break;
620 case GE: result = ( arg1 >= arg2); opr=
">=";
break;
621 case LT: result = ( arg1 < arg2); opr=
"<" ;
break;
622 case LE: result = ( arg1 <= arg2); opr=
"<=";
break;
623 case EQ: result = ( arg1 == arg2); opr=
"==";
break;
624 case NE: result = ( arg1 != arg2); opr=
"!=";
break;
626 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
631 << arg1 <<
" " << opr << arg2
632 <<
" result: " << result
644 case GT: result = ( arg1 > arg2); opr=
">";
break;
645 case GE: result = ( arg1 >= arg2); opr=
">=";
break;
646 case LT: result = ( arg1 < arg2); opr=
"<";
break;
647 case LE: result = ( arg1 <= arg2); opr=
"<=";
break;
648 case EQ: result = ( arg1 == arg2); opr=
"==";
break;
649 case NE: result = ( arg1 != arg2); opr=
"!=";
break;
651 G4cerr <<
"Parameter range: error at CompareDouble" <<
G4endl;
655 G4cerr <<
"CompareDouble "
656 << arg1 <<
" " << opr <<
" "<< arg2
657 <<
" result: " << result
671 while(( c=
G4UIpGetc())==
' '|| c==
'\t' || c==
'\n' )
676 if (isdigit(c) || c==
'.') {
680 }
while (c==
'.' || isdigit(c) ||
681 c==
'e' || c==
'E' || c==
'+' || c==
'-');
684 std::istringstream is(t);
697 if (isalpha(c)|| c==
'_') {
700 }
while ((c=
G4UIpGetc()) != EOF && (isalnum(c) || c==
'_'));
yystype RelationalExpression(void)
yystype AdditiveExpression(void)
G4int IsDouble(const char *str)
yystype MultiplicativeExpression(void)
yystype UnaryExpression(void)
G4bool currentAsDefaultFlag
G4int Follow(G4int expect, G4int ifyes, G4int ifno)
void SetDefaultValue(const char *theDefaultValue)
G4int CandidateCheck(const char *newValue)
G4String parameterCandidate
G4int operator==(const G4UIparameter &right) const
yystype LogicalANDExpression(void)
G4int G4UIpUngetc(G4int c)
G4int CheckNewValue(const char *newValue)
G4int ExpectExponent(const char *str)
G4GLOB_DLL std::ostream G4cout
G4int RangeCheck(const char *newValue)
G4int CompareDouble(double arg1, G4int op, double arg2)
G4int CompareInt(G4int arg1, G4int op, G4int arg2)
const char * data() const
G4int operator!=(const G4UIparameter &right) const
yystype PrimaryExpression(void)
G4int Eval2(yystype arg1, G4int op, yystype arg2)
yystype EqualityExpression(void)
G4int IsInt(const char *str, short maxDigit)
G4int TypeCheck(const char *newValue)
G4String parameterGuidance
G4GLOB_DLL std::ostream G4cerr
yystype LogicalORExpression(void)