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 (" << newValue
161 <<
") is not listed in the candidate List." <<
G4endl;
169 std::istringstream is(newValue);
172 case 'D': { is >>
newVal.
D; }
break;
173 case 'I': { is >>
newVal.
I; }
break;
181 G4cerr <<
"Illegal Expression in parameter range." <<
G4endl;
184 if ( result.
I )
return 1;
198 G4cerr<<newValue<<
": double value expected."
203 if(
IsInt(newValueString.
data(),20)== 0) {
204 G4cerr<<newValue<<
": integer expected."
211 if ( newValueString ==
"Y" || newValueString ==
"N"
212 ||newValueString ==
"YES" || newValueString ==
"NO"
213 ||newValueString ==
"1" || newValueString ==
"0"
214 ||newValueString ==
"T" || newValueString ==
"F"
215 ||newValueString ==
"TRUE" || newValueString ==
"FALSE")
228 IsInt(
const char* buf,
short maxDigits)
232 if( *p ==
'+' || *p ==
'-') { ++p; }
233 if( isdigit( (
G4int)(*p) )) {
234 while( isdigit( (
G4int)(*p) )) { ++p; ++length; }
236 if( length > maxDigits) {
255 if(
IsInt( str, maxExplength=7 ))
return 1;
264 case '+':
case '-': ++p;
266 while( isdigit( (
G4int)(*p) )) { ++p; }
272 if( *p ==
'\0' )
return 1;
275 while( isdigit( (
G4int)(*p) )) { ++p; }
276 if( *p ==
'\0' )
return 1;
278 }
else return 0;
break;
282 if( *p ==
'.' ) { ++p;
284 while( isdigit( (
G4int)(*p) )) { ++p; }
285 if( *p ==
'\0' )
return 1;
292 while( isdigit( (
G4int)(*p) )) { ++p; }
293 if( *p ==
'\0' )
return 1;
298 while( isdigit( (
G4int)(*p) )) { ++p; }
299 if( *p ==
'\0' )
return 1;
301 if( *p ==
'.' ) { ++p;
302 if( *p ==
'\0' )
return 1;
305 while( isdigit( (
G4int)(*p) )) { ++p; }
306 if( *p ==
'\0' )
return 1;
337 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
346 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
354 result.
I += (p.
D != 0.0);
372 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
381 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
389 result.
I *= (p.
D != 0.0);
415 result.
I =
Eval2( arg1, operat, arg2 );
422 G4cerr <<
"Parameter range: error at EqualityExpression"
446 result.
I =
Eval2( arg1, operat, arg2 );
464 if(
token !=
'+' &&
token !=
'-' )
return result;
465 G4cerr <<
"Parameter range: operator "
467 <<
" is not supported." <<
G4endl;
477 G4cerr <<
"Parameter range: operator "
479 <<
" is not supported." <<
G4endl;
509 G4cerr <<
"Parameter range error: "
510 <<
"operator '!' is not supported (sorry)."
563 <<
": meaningless comparison "
574 G4cerr <<
"integer operand expected for "
595 G4cerr <<
"integer operand expected for "
610 G4cerr <<
"no param name is specified at the param range."<<
G4endl;
620 case GT: result = ( arg1 > arg2); opr=
">" ;
break;
621 case GE: result = ( arg1 >= arg2); opr=
">=";
break;
622 case LT: result = ( arg1 < arg2); opr=
"<" ;
break;
623 case LE: result = ( arg1 <= arg2); opr=
"<=";
break;
624 case EQ: result = ( arg1 == arg2); opr=
"==";
break;
625 case NE: result = ( arg1 != arg2); opr=
"!=";
break;
627 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
632 << arg1 <<
" " << opr << arg2
633 <<
" result: " << result
645 case GT: result = ( arg1 > arg2); opr=
">";
break;
646 case GE: result = ( arg1 >= arg2); opr=
">=";
break;
647 case LT: result = ( arg1 < arg2); opr=
"<";
break;
648 case LE: result = ( arg1 <= arg2); opr=
"<=";
break;
649 case EQ: result = ( arg1 == arg2); opr=
"==";
break;
650 case NE: result = ( arg1 != arg2); opr=
"!=";
break;
652 G4cerr <<
"Parameter range: error at CompareDouble" <<
G4endl;
656 G4cerr <<
"CompareDouble "
657 << arg1 <<
" " << opr <<
" "<< arg2
658 <<
" result: " << result
672 while(( c=
G4UIpGetc())==
' '|| c==
'\t' || c==
'\n' )
677 if (isdigit(c) || c==
'.') {
681 }
while (c==
'.' || isdigit(c) ||
682 c==
'e' || c==
'E' || c==
'+' || c==
'-');
685 std::istringstream is(t);
698 if (isalpha(c)|| c==
'_') {
701 }
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)