70 return (
this == &right);
76 return (
this != &right);
96 G4cout <<
" Default value : taken from the current value" <<
G4endl;
111 std::ostringstream os;
112 os << theDefaultValue;
119 std::ostringstream os;
120 os << theDefaultValue;
127 std::ostringstream os;
128 os << theDefaultValue;
139 ed <<
"This method can be used only for a string-type parameter that is "
140 "used to specify a unit.\n"
141 <<
"This parameter <" <<
parameterName <<
"> is defined as ";
196 while(!(aToken = candidateTokenizer()).
empty())
199 if(aToken == newValue)
202 G4cerr <<
"parameter value (" << newValue
203 <<
") is not listed in the candidate List." <<
G4endl;
204 G4cerr <<
" Candidates are:";
206 while(!(aToken = candidateListTokenizer()).
empty())
220 std::istringstream is(newValue);
241 G4cerr <<
"Illegal Expression in parameter range." <<
G4endl;
244 if(result.
I)
return 1;
257 if(
IsDouble(newValueString.data()) == 0)
259 G4cerr << newValue <<
": double value expected." <<
G4endl;
264 if(
IsInt(newValueString.data(), 10) == 0)
271 if(
IsInt(newValueString.data(), 20) == 0)
281 if(newValueString ==
"Y" || newValueString ==
"N" ||
282 newValueString ==
"YES" || newValueString ==
"NO" ||
283 newValueString ==
"1" || newValueString ==
"0" ||
284 newValueString ==
"T" || newValueString ==
"F" ||
285 newValueString ==
"TRUE" || newValueString ==
"FALSE")
303 if(*p ==
'+' || *p ==
'-')
307 if(isdigit((
G4int)(*p)))
309 while(isdigit((
G4int)(*p)))
316 if(length > maxDigits)
339 if(
IsInt(str, maxExplength = 7))
357 while(isdigit((
G4int)(*p)))
372 if(*p ==
'e' || *p ==
'E')
376 while(isdigit((
G4int)(*p)))
382 if(*p ==
'e' || *p ==
'E')
397 while(isdigit((
G4int)(*p)))
403 if(*p ==
'e' || *p ==
'E')
412 while(isdigit((
G4int)(*p)))
418 if(*p ==
'e' || *p ==
'E')
425 while(isdigit((
G4int)(*p)))
431 if(*p ==
'e' || *p ==
'E')
438 if(*p ==
'e' || *p ==
'E')
442 while(isdigit((
G4int)(*p)))
448 if(*p ==
'e' || *p ==
'E')
479 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
489 G4cerr <<
"Parameter range: illegal type at '||'" <<
G4endl;
499 result.
I += (p.
L != 0
L);
503 result.
I += (p.
D != 0.0);
524 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
534 G4cerr <<
"Parameter range: illegal type at '&&'" <<
G4endl;
544 result.
I *= (p.
L != 0
L);
548 result.
I *= (p.
D != 0.0);
575 result.
I =
Eval2(arg1, operat, arg2);
585 G4cerr <<
"Parameter range: error at EqualityExpression" <<
G4endl;
608 result.
I =
Eval2(arg1, operat, arg2);
631 G4cerr <<
"Parameter range: operator " << (char)
token <<
" is not supported."
644 G4cerr <<
"Parameter range: operator " << (char)
token <<
" is not supported."
685 G4cerr <<
"Parameter range error: "
686 <<
"operator '!' is not supported (sorry)." <<
G4endl;
838 G4cerr <<
"no param name is specified at the param range." <<
G4endl;
850 result = (arg1 > arg2);
854 result = (arg1 >= arg2);
858 result = (arg1 < arg2);
862 result = (arg1 <= arg2);
866 result = (arg1 == arg2);
870 result = (arg1 != arg2);
874 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
878 G4cerr <<
"CompareInt " << arg1 <<
" " << opr << arg2 <<
" result: " << result
892 result = (arg1 > arg2);
896 result = (arg1 >= arg2);
900 result = (arg1 < arg2);
904 result = (arg1 <= arg2);
908 result = (arg1 == arg2);
912 result = (arg1 != arg2);
916 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
920 G4cerr <<
"CompareInt " << arg1 <<
" " << opr << arg2 <<
" result: " << result
934 result = (arg1 > arg2);
938 result = (arg1 >= arg2);
942 result = (arg1 < arg2);
946 result = (arg1 <= arg2);
950 result = (arg1 == arg2);
954 result = (arg1 != arg2);
958 G4cerr <<
"Parameter range: error at CompareDouble" <<
G4endl;
962 G4cerr <<
"CompareDouble " << arg1 <<
" " << opr <<
" " << arg2
963 <<
" result: " << result <<
G4endl;
975 while((c =
G4UIpGetc()) ==
' ' || c ==
'\t' || c ==
'\n')
980 if(isdigit(c) || c ==
'.')
984 buf += (
unsigned char) c;
986 }
while(c ==
'.' || isdigit(c) || c ==
'e' || c ==
'E' || c ==
'+' ||
990 std::istringstream is(t);
991 if(
IsInt(buf.data(), 20))
1007 if(isalpha(c) || c ==
'_')
1011 buf += (
unsigned char) c;
1012 }
while((c =
G4UIpGetc()) != EOF && (isalnum(c) || c ==
'_'));
1021 G4cerr << buf <<
" is not a parameter name." <<
G4endl;
1077 G4cerr <<
"bp=" <<
bp <<
" c=" << c
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static constexpr double L
@ fParameterOutOfCandidates
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
static G4String CategoryOf(const char *unitName)
static G4String UnitsList(const char *unitCategory)
void SetDefaultValue(const char *theDefaultValue)
G4int CheckNewValue(const char *newValue)
yystype PrimaryExpression(void)
G4int CompareInt(G4int arg1, G4int op, G4int arg2)
yystype AdditiveExpression(void)
G4int CandidateCheck(const char *newValue)
G4int TypeCheck(const char *newValue)
G4int RangeCheck(const char *newValue)
G4int CompareDouble(double arg1, G4int op, double arg2)
G4bool currentAsDefaultFlag
G4int Follow(G4int expect, G4int ifyes, G4int ifno)
yystype MultiplicativeExpression(void)
G4String parameterGuidance
G4int ExpectExponent(const char *str)
G4String parameterCandidate
G4int CompareLong(G4long arg1, G4int op, G4long arg2)
yystype RelationalExpression(void)
yystype EqualityExpression(void)
G4int Eval2(yystype arg1, G4int op, yystype arg2)
void SetParameterCandidates(const char *theString)
yystype LogicalANDExpression(void)
G4bool operator!=(const G4UIparameter &right) const
G4int IsInt(const char *str, short maxDigit)
yystype LogicalORExpression(void)
G4bool operator==(const G4UIparameter &right) const
G4int G4UIpUngetc(G4int c)
G4int IsDouble(const char *str)
yystype UnaryExpression(void)
void SetDefaultUnit(const char *theDefaultUnit)
void to_upper(G4String &str)
Convert string to uppercase.