Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UIcommand.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4UIcommand
27//
28// Author: Makoto Asai (SLAC), 1998
29// --------------------------------------------------------------------
30
31#include "G4UIcommand.hh"
32#include "G4UImessenger.hh"
33#include "G4UImanager.hh"
34#include "G4UIcommandStatus.hh"
35#include "G4StateManager.hh"
36#include "G4UnitsTable.hh"
37#include "G4Tokenizer.hh"
38#include "G4ios.hh"
39#include <sstream>
40#include <iomanip>
41
42#include "G4UItokenNum.hh"
43
44#include "G4Threading.hh"
45
46using namespace G4UItokenNum;
47
48// --------------------------------------------------------------------
49G4UIcommand::G4UIcommand(const char* theCommandPath,
50 G4UImessenger* theMessenger, G4bool tBB)
51 : toBeBroadcasted(tBB)
52 , messenger(theMessenger)
53{
54 G4String comStr = theCommandPath;
55 G4UIcommandCommonConstructorCode(comStr);
56 availabelStateList.clear();
57 availabelStateList.push_back(G4State_PreInit);
58 availabelStateList.push_back(G4State_Init);
59 availabelStateList.push_back(G4State_Idle);
60 availabelStateList.push_back(G4State_GeomClosed);
61 availabelStateList.push_back(G4State_EventProc);
62 availabelStateList.push_back(G4State_Abort);
63}
64
65// --------------------------------------------------------------------
66void G4UIcommand::G4UIcommandCommonConstructorCode(const char* theCommandPath)
67{
68 commandPath = theCommandPath;
69 commandName = theCommandPath;
70 G4int commandNameIndex = (G4int)commandName.rfind('/');
71 commandName.erase(0, commandNameIndex + 1);
72#ifdef G4MULTITHREADED
73 if((messenger != nullptr) && messenger->CommandsShouldBeInMaster() &&
75 {
76 toBeBroadcasted = false;
78 }
79 else
80 {
82 }
83#else
85#endif
86}
87
88// --------------------------------------------------------------------
90{
91 if(messenger==nullptr)
92 { // this must be a directory
93 if(typ != CmdDirectory)
94 {
96 ed << "A UI command <" << commandPath
97 << "> is defined without vaild messenger.";
98 G4Exception("G4UIcommand::SetCommandType","UI2031",
100 }
101 else if(commandPath.back() != '/')
102 {
104 ed << "G4UIcommand Warning : \n"
105 << " <" << commandPath << "> must be a directory."
106 << " '/' is appended.";
107 G4Exception("G4UIcommand::SetCommandType","UI2032",
108 JustWarning,ed);
109 commandPath += "/";
110 }
111 }
112 commandType = typ;
113}
114
115// --------------------------------------------------------------------
117{
119 if(fUImanager != nullptr)
120 {
121 fUImanager->RemoveCommand(this);
122 }
123
124 std::size_t n_parameterEntry = parameter.size();
125 for(std::size_t i_thParameter = 0; i_thParameter < n_parameterEntry;
126 ++i_thParameter)
127 {
128 delete parameter[i_thParameter];
129 }
130 parameter.clear();
131}
132
133// --------------------------------------------------------------------
135{
136 return (commandPath == right.GetCommandPath());
137}
138
139// --------------------------------------------------------------------
141{
142 return (commandPath != right.GetCommandPath());
143}
144
145// --------------------------------------------------------------------
147{
148 G4String correctParameters;
149 std::size_t n_parameterEntry = parameter.size();
150 if(n_parameterEntry != 0)
151 {
152 G4String aToken;
153 G4String correctToken;
154 G4Tokenizer parameterToken(parameterList);
155 for(std::size_t i_thParameter = 0; i_thParameter < n_parameterEntry;
156 ++i_thParameter)
157 {
158 if(i_thParameter > 0)
159 {
160 correctParameters.append(" ");
161 }
162 aToken = parameterToken();
163 if(aToken.length() > 0 && aToken[0] == '"')
164 {
165 while(aToken.back() != '"' ||
166 (aToken.length() == 1 && aToken[0] == '"'))
167 {
168 G4String additionalToken = parameterToken();
169 if(additionalToken.empty())
170 {
171 return G4int(fParameterUnreadable + i_thParameter);
172 }
173 aToken += " ";
174 aToken += additionalToken;
175 }
176 }
177 else if(i_thParameter == n_parameterEntry - 1 &&
178 parameter[i_thParameter]->GetParameterType() == 's')
179 {
180 G4String anotherToken;
181 while(!((anotherToken = parameterToken()).empty()))
182 {
183 std::size_t idxs = anotherToken.find("#");
184 if(idxs == std::string::npos)
185 {
186 aToken += " ";
187 aToken += anotherToken;
188 }
189 else if(idxs > 0)
190 {
191 aToken += " ";
192 aToken += anotherToken.substr(0, idxs);
193 break;
194 }
195 else
196 {
197 break;
198 }
199 }
200 }
201
202 if(aToken.empty() || aToken == "!")
203 {
204 if(parameter[i_thParameter]->IsOmittable())
205 {
206 if(parameter[i_thParameter]->GetCurrentAsDefault())
207 {
208 G4Tokenizer cvSt(messenger->GetCurrentValue(this));
209 G4String parVal;
210 for(std::size_t ii = 0; ii < i_thParameter; ++ii)
211 {
212 parVal = cvSt();
213 if(parVal[0] == '"')
214 {
215 while(parVal.back() != '"')
216 {
217 G4String additionalToken = cvSt();
218 if(additionalToken.empty())
219 {
220 return G4int(fParameterUnreadable + i_thParameter);
221 }
222 parVal += " ";
223 parVal += additionalToken;
224 }
225 }
226 }
227 G4String aCVToken = cvSt();
228 if(aCVToken[0] == '"')
229 {
230 while(aCVToken.back() != '"')
231 {
232 G4String additionalToken = cvSt();
233 if(additionalToken.empty())
234 {
235 return G4int(fParameterUnreadable + i_thParameter);
236 }
237 aCVToken += " ";
238 aCVToken += additionalToken;
239 }
240 }
241 correctParameters.append(aCVToken);
242 }
243 else
244 {
245 correctParameters.append(
246 parameter[i_thParameter]->GetDefaultValue());
247 }
248 }
249 else
250 {
251 return G4int(fParameterUnreadable + i_thParameter);
252 }
253 }
254 else
255 {
256 G4int stat = parameter[i_thParameter]->CheckNewValue(aToken);
257 if(stat != 0)
258 {
259 return stat + G4int(i_thParameter);
260 }
261 correctParameters.append(aToken);
262 }
263 }
264 }
265
266 if(CheckNewValue(correctParameters) != 0)
267 {
268 return fParameterOutOfRange + 99;
269 }
270
272 {
273 return 0;
274 }
275
276 messenger->SetNewValue(this, correctParameters);
277 return 0;
278}
279
280// --------------------------------------------------------------------
282{
283 return messenger->GetCurrentValue(this);
284}
285
286// --------------------------------------------------------------------
288{
289 availabelStateList.clear();
290 availabelStateList.push_back(s1);
291}
292
293// --------------------------------------------------------------------
296{
297 availabelStateList.clear();
298 availabelStateList.push_back(s1);
299 availabelStateList.push_back(s2);
300}
301
302// --------------------------------------------------------------------
306{
307 availabelStateList.clear();
308 availabelStateList.push_back(s1);
309 availabelStateList.push_back(s2);
310 availabelStateList.push_back(s3);
311}
312
313// --------------------------------------------------------------------
318{
319 availabelStateList.clear();
320 availabelStateList.push_back(s1);
321 availabelStateList.push_back(s2);
322 availabelStateList.push_back(s3);
323 availabelStateList.push_back(s4);
324}
325
326// --------------------------------------------------------------------
332{
333 availabelStateList.clear();
334 availabelStateList.push_back(s1);
335 availabelStateList.push_back(s2);
336 availabelStateList.push_back(s3);
337 availabelStateList.push_back(s4);
338 availabelStateList.push_back(s5);
339}
340
341// --------------------------------------------------------------------
343{
344 G4bool av = false;
345 G4ApplicationState currentState =
347
348 std::size_t nState = availabelStateList.size();
349 for(std::size_t i = 0; i < nState; ++i)
350 {
351 if(availabelStateList[i] == currentState)
352 {
353 av = true;
354 break;
355 }
356 }
357
358 return av;
359}
360
361// --------------------------------------------------------------------
362G4double G4UIcommand::ValueOf(const char* unitName)
363{
364 G4double value = 0.;
365 value = G4UnitDefinition::GetValueOf(unitName);
366 return value;
367}
368
369// --------------------------------------------------------------------
371{
372 return G4UnitDefinition::GetCategory(unitName);
373}
374
375// --------------------------------------------------------------------
376G4String G4UIcommand::UnitsList(const char* unitCategory)
377{
378 G4String retStr;
380 std::size_t i;
381 for(i = 0; i < UTbl.size(); ++i)
382 {
383 if(UTbl[i]->GetName() == unitCategory)
384 {
385 break;
386 }
387 }
388 if(i == UTbl.size())
389 {
390 G4cerr << "Unit category <" << unitCategory << "> is not defined."
391 << G4endl;
392 return retStr;
393 }
394 G4UnitsContainer& UCnt = UTbl[i]->GetUnitsList();
395 retStr = UCnt[0]->GetSymbol();
396 std::size_t je = UCnt.size();
397 for(std::size_t j = 1; j < je; ++j)
398 {
399 retStr += " ";
400 retStr += UCnt[j]->GetSymbol();
401 }
402 for(std::size_t k = 0; k < je; ++k)
403 {
404 retStr += " ";
405 retStr += UCnt[k]->GetName();
406 }
407 return retStr;
408}
409
410// --------------------------------------------------------------------
412{
413 G4cout << G4endl;
414 G4cout << G4endl;
415 if(commandPath.back() != '/')
416 {
417 G4cout << "Command " << commandPath << G4endl;
418 }
420 {
421 G4cout << " ---- available only in worker thread" << G4endl;
422 }
423 G4cout << "Guidance :" << G4endl;
424 std::size_t n_guidanceEntry = commandGuidance.size();
425 for(std::size_t i_thGuidance = 0; i_thGuidance < n_guidanceEntry; ++i_thGuidance)
426 {
427 G4cout << commandGuidance[i_thGuidance] << G4endl;
428 }
429 if(!rangeString.empty())
430 {
431 G4cout << " Range of parameters : " << rangeString << G4endl;
432 }
433 std::size_t n_parameterEntry = parameter.size();
434 if(n_parameterEntry > 0)
435 {
436 for(std::size_t i_thParameter = 0; i_thParameter < n_parameterEntry;
437 ++i_thParameter)
438 {
439 parameter[i_thParameter]->List();
440 }
441 }
442 G4cout << G4endl;
443}
444
445// --------------------------------------------------------------------
447{
448 G4String vl = "0";
449 if(boolVal)
450 {
451 vl = "1";
452 }
453 return vl;
454}
455
456// --------------------------------------------------------------------
458{
459 std::ostringstream os;
460 os << intValue;
461 G4String vl = os.str();
462 return vl;
463}
464
465// --------------------------------------------------------------------
467{
468 std::ostringstream os;
469 os << longValue;
470 G4String vl = os.str();
471 return vl;
472}
473
474// --------------------------------------------------------------------
476{
477 std::ostringstream os;
479 {
480 os << std::setprecision(17) << doubleValue;
481 }
482 else
483 {
484 os << doubleValue;
485 }
486 G4String vl = os.str();
487 return vl;
488}
489
490// --------------------------------------------------------------------
492 const char* unitName)
493{
494 G4String unt = unitName;
495 G4double uv = ValueOf(unitName);
496
497 std::ostringstream os;
499 {
500 os << std::setprecision(17) << doubleValue / uv << " " << unitName;
501 }
502 else
503 {
504 os << doubleValue / uv << " " << unitName;
505 }
506 G4String vl = os.str();
507 return vl;
508}
509
510// --------------------------------------------------------------------
512{
513 std::ostringstream os;
515 {
516 os << std::setprecision(17) << vec.x() << " " << vec.y() << " " << vec.z();
517 }
518 else
519 {
520 os << vec.x() << " " << vec.y() << " " << vec.z();
521 }
522 G4String vl = os.str();
523 return vl;
524}
525
526// --------------------------------------------------------------------
528 const char* unitName)
529{
530 G4String unt = unitName;
531 G4double uv = ValueOf(unitName);
532
533 std::ostringstream os;
535 {
536 os << std::setprecision(17) << vec.x() / uv << " " << vec.y() / uv << " "
537 << vec.z() / uv << " " << unitName;
538 }
539 else
540 {
541 os << vec.x() / uv << " " << vec.y() / uv << " " << vec.z() / uv << " "
542 << unitName;
543 }
544 G4String vl = os.str();
545 return vl;
546}
547
548// --------------------------------------------------------------------
550{
552 G4bool vl = false;
553 if(v == "Y" || v == "YES" || v == "1" || v == "T" || v == "TRUE")
554 {
555 vl = true;
556 }
557 return vl;
558}
559
560// --------------------------------------------------------------------
562{
563 G4int vl;
564 std::istringstream is(st);
565 is >> vl;
566 return vl;
567}
568
569// --------------------------------------------------------------------
571{
572 G4long vl;
573 std::istringstream is(st);
574 is >> vl;
575 return vl;
576}
577
578// --------------------------------------------------------------------
580{
581 G4double vl;
582 std::istringstream is(st);
583 is >> vl;
584 return vl;
585}
586
587// --------------------------------------------------------------------
589{
590 G4double vl;
591 char unts[30];
592
593 std::istringstream is(st);
594 is >> vl >> unts;
595 G4String unt = unts;
596
597 return (vl * ValueOf(unt));
598}
599
600// --------------------------------------------------------------------
602{
603 G4double vx;
604 G4double vy;
605 G4double vz;
606 std::istringstream is(st);
607 is >> vx >> vy >> vz;
608 return G4ThreeVector(vx, vy, vz);
609}
610
611// --------------------------------------------------------------------
613{
614 G4double vx;
615 G4double vy;
616 G4double vz;
617 char unts[30];
618 std::istringstream is(st);
619 is >> vx >> vy >> vz >> unts;
620 G4String unt = unts;
621 G4double uv = ValueOf(unt);
622 return G4ThreeVector(vx * uv, vy * uv, vz * uv);
623}
624
625// ----- the following is used by CheckNewValue() --------------------
626
627#include <ctype.h> // isalpha(), toupper()
628
630{
631 yystype result;
632 // if( TypeCheck(newValue) == 0 ) return 1;
633 if(!rangeString.empty())
634 {
635 if(RangeCheck(newValue) == 0)
636 {
638 }
639 }
640 return 0; // succeeded
641}
642
643// --------------------------------------------------------------------
644G4int G4UIcommand::TypeCheck(const char* t)
645{
646 G4String aNewValue;
647 char type;
648 std::istringstream is(t);
649 for(auto& i : parameter)
650 {
651 is >> aNewValue;
652 type = (char)std::toupper(i->GetParameterType());
653 switch(type)
654 {
655 case 'D':
656 if(IsDouble(aNewValue) == 0)
657 {
658 G4cerr << aNewValue << ": double value expected." << G4endl;
659 return 0;
660 }
661 break;
662 case 'I':
663 if(IsInt(aNewValue, 10) == 0)
664 {
665 G4cerr << aNewValue << ": integer expected." << G4endl;
666 return 0;
667 }
668 break;
669 case 'L':
670 if(IsInt(aNewValue, 20) == 0)
671 {
672 G4cerr << aNewValue << ": long int expected." << G4endl;
673 return 0;
674 }
675 break;
676 case 'S':
677 break;
678 case 'B':
679 G4StrUtil::to_upper(aNewValue);
680 if(aNewValue == "Y" || aNewValue == "N" || aNewValue == "YES" ||
681 aNewValue == "NO" || aNewValue == "1" || aNewValue == "0" ||
682 aNewValue == "T" || aNewValue == "F" || aNewValue == "TRUE" ||
683 aNewValue == "FALSE")
684 {
685 return 1;
686 }
687 else
688 {
689 return 0;
690 }
691 break;
692 default:;
693 }
694 }
695 return 1;
696}
697
698// --------------------------------------------------------------------
699G4int G4UIcommand::IsInt(const char* buf, short maxDigits)
700{
701 const char* p = buf;
702 G4int length = 0;
703 if(*p == '+' || *p == '-')
704 {
705 ++p;
706 }
707 if(isdigit((G4int) (*p)) != 0)
708 {
709 while(isdigit((G4int) (*p)) != 0)
710 {
711 ++p;
712 ++length;
713 }
714 if(*p == '\0')
715 {
716 if(length > maxDigits)
717 {
718 G4cerr << "digit length exceeds" << G4endl;
719 return 0;
720 }
721 return 1;
722 }
723 else
724 {
725 // G4cerr <<"illegal character after int:"<<buf<<G4endl;
726 }
727 }
728 else
729 {
730 // G4cerr <<"illegal int:"<<buf<<G4endl;
731 }
732 return 0;
733}
734
735// --------------------------------------------------------------------
736G4int G4UIcommand::ExpectExponent(const char* str) // used only by IsDouble()
737{
738 G4int maxExplength;
739 if(IsInt(str, maxExplength = 7) != 0)
740 {
741 return 1;
742 }
743 else
744 {
745 return 0;
746 }
747}
748
749// --------------------------------------------------------------------
750G4int G4UIcommand::IsDouble(const char* buf)
751{
752 const char* p = buf;
753 switch(*p)
754 {
755 case '+':
756 case '-':
757 ++p;
758 if(isdigit(*p) != 0)
759 {
760 while(isdigit((G4int) (*p)) != 0)
761 {
762 ++p;
763 }
764 switch(*p)
765 {
766 case '\0':
767 return 1;
768 // break;
769 case 'E':
770 case 'e':
771 return ExpectExponent(++p);
772 // break;
773 case '.':
774 ++p;
775 if(*p == '\0')
776 {
777 return 1;
778 }
779 if(*p == 'e' || *p == 'E')
780 {
781 return ExpectExponent(++p);
782 }
783 if(isdigit(*p) != 0)
784 {
785 while(isdigit((G4int) (*p)) != 0)
786 {
787 ++p;
788 }
789 if(*p == '\0')
790 {
791 return 1;
792 }
793 if(*p == 'e' || *p == 'E')
794 {
795 return ExpectExponent(++p);
796 }
797 }
798 else
799 {
800 return 0;
801 }
802 break;
803 default:
804 return 0;
805 }
806 }
807 if(*p == '.')
808 {
809 ++p;
810 if(isdigit(*p) != 0)
811 {
812 while(isdigit((G4int) (*p)) != 0)
813 {
814 ++p;
815 }
816 if(*p == '\0')
817 {
818 return 1;
819 }
820 if(*p == 'e' || *p == 'E')
821 {
822 return ExpectExponent(++p);
823 }
824 }
825 }
826 break;
827 case '.':
828 ++p;
829 if(isdigit(*p) != 0)
830 {
831 while(isdigit((G4int) (*p)) != 0)
832 {
833 ++p;
834 }
835 if(*p == '\0')
836 {
837 return 1;
838 }
839 if(*p == 'e' || *p == 'E')
840 {
841 return ExpectExponent(++p);
842 }
843 }
844 break;
845 default: // digit is expected
846 if(isdigit(*p) != 0)
847 {
848 while(isdigit((G4int) (*p)) != 0)
849 {
850 ++p;
851 }
852 if(*p == '\0')
853 {
854 return 1;
855 }
856 if(*p == 'e' || *p == 'E')
857 {
858 return ExpectExponent(++p);
859 }
860 if(*p == '.')
861 {
862 ++p;
863 if(*p == '\0')
864 {
865 return 1;
866 }
867 if(*p == 'e' || *p == 'E')
868 {
869 return ExpectExponent(++p);
870 }
871 if(isdigit(*p) != 0)
872 {
873 while(isdigit((G4int) (*p)) != 0)
874 {
875 ++p;
876 }
877 if(*p == '\0')
878 {
879 return 1;
880 }
881 if(*p == 'e' || *p == 'E')
882 {
883 return ExpectExponent(++p);
884 }
885 }
886 }
887 }
888 }
889 return 0;
890}
891
892// --------------------------------------------------------------------
893G4int G4UIcommand::RangeCheck(const char* t)
894{
895 yystype result;
896 char type;
897 bp = 0; // reset buffer pointer for G4UIpGetc()
898 std::istringstream is(t);
899 for(unsigned i = 0; i < parameter.size(); ++i)
900 {
901 type = (char)std::toupper(parameter[i]->GetParameterType());
902 switch(type)
903 {
904 case 'D':
905 is >> newVal[i].D;
906 break;
907 case 'I':
908 is >> newVal[i].I;
909 break;
910 case 'L':
911 is >> newVal[i].L;
912 break;
913 case 'S':
914 is >> newVal[i].S;
915 break;
916 case 'B':
917 is >> newVal[i].C;
918 break;
919 default:;
920 }
921 }
922 // PrintToken(); // Print tokens (consumes all tokens)
923 token = Yylex();
924 result = Expression();
925
926 if(paramERR == 1)
927 {
928 return 0;
929 }
930 if(result.type != CONSTINT)
931 {
932 G4cerr << "Illegal Expression in parameter range." << G4endl;
933 return 0;
934 }
935 if(result.I != 0)
936 {
937 return 1;
938 }
939 G4cerr << "parameter out of range: " << rangeString << G4endl;
940 return 0;
941}
942
943// ------------------ syntax node functions ------------------
944
945yystype G4UIcommand::Expression()
946{
947 yystype result;
948#ifdef DEBUG
949 G4cerr << " Expression()" << G4endl;
950#endif
951 result = LogicalORExpression();
952 return result;
953}
954
955// --------------------------------------------------------------------
956yystype G4UIcommand::LogicalORExpression()
957{
958 yystype result;
959 yystype p;
960 p = LogicalANDExpression();
961 if(token != LOGICALOR)
962 {
963 return p;
964 }
965 if(p.type == CONSTSTRING || p.type == IDENTIFIER)
966 {
967 G4cerr << "Parameter range: illegal type at '||'" << G4endl;
968 paramERR = 1;
969 }
970 result.I = p.I;
971 while(token == LOGICALOR)
972 {
973 token = Yylex();
974 p = LogicalANDExpression();
975 if(p.type == CONSTSTRING || p.type == IDENTIFIER)
976 {
977 G4cerr << "Parameter range: illegal type at '||'" << G4endl;
978 paramERR = 1;
979 }
980 switch(p.type)
981 {
982 case CONSTINT:
983 result.I += p.I;
984 result.type = CONSTINT;
985 break;
986 case CONSTLONG:
987 result.I += static_cast<int>(p.L != 0L);
988 result.type = CONSTINT;
989 break;
990 case CONSTDOUBLE:
991 result.I += static_cast<int>(p.D != 0.0);
992 result.type = CONSTINT;
993 break;
994 default:
995 G4cerr << "Parameter range: unknown type" << G4endl;
996 paramERR = 1;
997 }
998 }
999 return result;
1000}
1001
1002// --------------------------------------------------------------------
1003yystype G4UIcommand::LogicalANDExpression()
1004{
1005 yystype result;
1006 yystype p;
1007 p = EqualityExpression();
1008 if(token != LOGICALAND)
1009 {
1010 return p;
1011 }
1012 if(p.type == CONSTSTRING || p.type == IDENTIFIER)
1013 {
1014 G4cerr << "Parameter range: illegal type at '&&'" << G4endl;
1015 paramERR = 1;
1016 }
1017 result.I = p.I;
1018 while(token == LOGICALAND)
1019 {
1020 token = Yylex();
1021 p = EqualityExpression();
1022 if(p.type == CONSTSTRING || p.type == IDENTIFIER)
1023 {
1024 G4cerr << "Parameter range: illegal type at '&&'" << G4endl;
1025 paramERR = 1;
1026 }
1027 switch(p.type)
1028 {
1029 case CONSTINT:
1030 result.I *= p.I;
1031 result.type = CONSTINT;
1032 break;
1033 case CONSTLONG:
1034 result.I *= static_cast<int>(p.L != 0L);
1035 result.type = CONSTINT;
1036 break;
1037 case CONSTDOUBLE:
1038 result.I *= static_cast<int>(p.D != 0.0);
1039 result.type = CONSTINT;
1040 break;
1041 default:
1042 G4cerr << "Parameter range: unknown type." << G4endl;
1043 paramERR = 1;
1044 }
1045 }
1046 return result;
1047}
1048
1049// --------------------------------------------------------------------
1050yystype G4UIcommand::EqualityExpression()
1051{
1052 yystype arg1, arg2;
1053 G4int operat;
1054 yystype result;
1055#ifdef DEBUG
1056 G4cerr << " EqualityExpression()" << G4endl;
1057#endif
1058 result = RelationalExpression();
1059 if(token == EQ || token == NE)
1060 {
1061 operat = token;
1062 token = Yylex();
1063 arg1 = result;
1064 arg2 = RelationalExpression();
1065 result.I = Eval2(arg1, operat, arg2); // semantic action
1066 result.type = CONSTINT;
1067#ifdef DEBUG
1068 G4cerr << " return code of Eval2(): " << result.I << G4endl;
1069#endif
1070 }
1071 else
1072 {
1073 if(result.type != CONSTINT && result.type != CONSTDOUBLE)
1074 {
1075 G4cerr << "Parameter range: error at EqualityExpression" << G4endl;
1076 paramERR = 1;
1077 }
1078 }
1079 return result;
1080}
1081
1082// --------------------------------------------------------------------
1083yystype G4UIcommand::RelationalExpression()
1084{
1085 yystype arg1, arg2;
1086 G4int operat;
1087 yystype result;
1088#ifdef DEBUG
1089 G4cerr << " RelationalExpression()" << G4endl;
1090#endif
1091
1092 arg1 = AdditiveExpression();
1093 if(token == GT || token == GE || token == LT || token == LE)
1094 {
1095 operat = token;
1096 token = Yylex();
1097 arg2 = AdditiveExpression();
1098 result.I = Eval2(arg1, operat, arg2); // semantic action
1099 result.type = CONSTINT;
1100#ifdef DEBUG
1101 G4cerr << " return code of Eval2(): " << result.I << G4endl;
1102#endif
1103 }
1104 else
1105 {
1106 result = arg1;
1107 }
1108#ifdef DEBUG
1109 G4cerr << " return RelationalExpression()" << G4endl;
1110#endif
1111 return result;
1112}
1113
1114// --------------------------------------------------------------------
1115yystype G4UIcommand::AdditiveExpression()
1116{
1117 yystype result;
1118 result = MultiplicativeExpression();
1119 if(token != '+' && token != '-')
1120 {
1121 return result;
1122 }
1123 G4cerr << "Parameter range: operator " << (char) token << " is not supported."
1124 << G4endl;
1125 paramERR = 1;
1126 return result;
1127}
1128
1129// --------------------------------------------------------------------
1130yystype G4UIcommand::MultiplicativeExpression()
1131{
1132 yystype result;
1133 result = UnaryExpression();
1134 if(token != '*' && token != '/' && token != '%')
1135 {
1136 return result;
1137 }
1138 G4cerr << "Parameter range: operator " << (char) token << " is not supported."
1139 << G4endl;
1140 paramERR = 1;
1141 return result;
1142}
1143
1144// --------------------------------------------------------------------
1145yystype G4UIcommand::UnaryExpression()
1146{
1147 yystype result;
1148 yystype p;
1149#ifdef DEBUG
1150 G4cerr << " UnaryExpression" << G4endl;
1151#endif
1152 switch(token)
1153 {
1154 case '-':
1155 token = Yylex();
1156 p = UnaryExpression();
1157 if(p.type == CONSTINT)
1158 {
1159 result.I = -p.I;
1160 result.type = CONSTINT;
1161 }
1162 if(p.type == CONSTLONG)
1163 {
1164 result.L = -p.L;
1165 result.type = CONSTLONG;
1166 }
1167 if(p.type == CONSTDOUBLE)
1168 {
1169 result.D = -p.D;
1170 result.type = CONSTDOUBLE;
1171 }
1172 break;
1173 case '+':
1174 token = Yylex();
1175 result = UnaryExpression();
1176 break;
1177 case '!':
1178 token = Yylex();
1179 G4cerr << "Parameter range error: "
1180 << "operator '!' is not supported (sorry)." << G4endl;
1181 paramERR = 1;
1182 result = UnaryExpression();
1183 break;
1184 default:
1185 result = PrimaryExpression();
1186 }
1187 return result;
1188}
1189
1190// --------------------------------------------------------------------
1191yystype G4UIcommand::PrimaryExpression()
1192{
1193 yystype result;
1194#ifdef DEBUG
1195 G4cerr << " primary_exp" << G4endl;
1196#endif
1197 switch(token)
1198 {
1199 case IDENTIFIER:
1200 result.S = yylval.S;
1201 result.type = token;
1202 token = Yylex();
1203 break;
1204 case CONSTINT:
1205 result.I = yylval.I;
1206 result.type = token;
1207 token = Yylex();
1208 break;
1209 case CONSTLONG:
1210 result.L = yylval.L;
1211 result.type = token;
1212 token = Yylex();
1213 break;
1214 case CONSTDOUBLE:
1215 result.D = yylval.D;
1216 result.type = token;
1217 token = Yylex();
1218 break;
1219 case '(':
1220 token = Yylex();
1221 result = Expression();
1222 if(token != ')')
1223 {
1224 G4cerr << " ')' expected" << G4endl;
1225 paramERR = 1;
1226 }
1227 token = Yylex();
1228 break;
1229 default:
1230 return result;
1231 }
1232 return result; // never executed
1233}
1234
1235//---------------- semantic routines ----------------------------------
1236
1237G4int G4UIcommand::Eval2(const yystype& arg1, G4int op, const yystype& arg2)
1238{
1239 char newValtype;
1240 if((arg1.type != IDENTIFIER) && (arg2.type != IDENTIFIER))
1241 {
1242 G4cerr << commandName << ": meaningless comparison" << G4endl;
1243 paramERR = 1;
1244 }
1245
1246 if(arg1.type == IDENTIFIER)
1247 {
1248 unsigned i = IndexOf(arg1.S);
1249 newValtype = (char)std::toupper(parameter[i]->GetParameterType());
1250 switch(newValtype)
1251 {
1252 case 'I':
1253 if(arg2.type == CONSTINT)
1254 {
1255 return CompareInt(newVal[i].I, op, arg2.I);
1256 //===================================================================
1257 // MA - 2018.07.23
1258 }
1259 else if(arg2.type == IDENTIFIER)
1260 {
1261 unsigned iii = IndexOf(arg2.S);
1262 char newValtype2 = (char)std::toupper(parameter[iii]->GetParameterType());
1263 if(newValtype2 == 'I')
1264 {
1265 return CompareInt(newVal[i].I, op, newVal[iii].I);
1266 }
1267 else if(newValtype2 == 'L')
1268 {
1269 G4cerr << "Warning : Integer is compared with long int : "
1270 << rangeString << G4endl;
1271 return CompareLong(newVal[i].I, op, newVal[iii].L);
1272 }
1273 else if(newValtype2 == 'D')
1274 {
1275 G4cerr << "Warning : Integer is compared with double : "
1276 << rangeString << G4endl;
1277 return CompareDouble(newVal[i].I, op, newVal[iii].D);
1278 }
1279 //===================================================================
1280 }
1281 else
1282 {
1283 G4cerr << "integer operand expected for " << rangeString << '.'
1284 << G4endl;
1285 }
1286 break;
1287 case 'L':
1288 if(arg2.type == CONSTINT)
1289 {
1290 return CompareLong(newVal[i].L, op, arg2.I);
1291 }
1292 else if(arg2.type == CONSTLONG)
1293 {
1294 return CompareLong(newVal[i].L, op, arg2.L);
1295 }
1296 else if(arg2.type == IDENTIFIER)
1297 {
1298 unsigned iii = IndexOf(arg2.S);
1299 char newValtype2 = (char)std::toupper(parameter[iii]->GetParameterType());
1300 if(newValtype2 == 'I')
1301 {
1302 return CompareLong(newVal[i].L, op, newVal[iii].I);
1303 }
1304 if(newValtype2 == 'L')
1305 {
1306 return CompareLong(newVal[i].L, op, newVal[iii].L);
1307 }
1308 else if(newValtype2 == 'D')
1309 {
1310 G4cerr << "Warning : Long int is compared with double : "
1311 << rangeString << G4endl;
1312 return CompareDouble(newVal[i].L, op, newVal[iii].D);
1313 }
1314 //===================================================================
1315 }
1316 else
1317 {
1318 G4cerr << "integer operand expected for " << rangeString << '.'
1319 << G4endl;
1320 }
1321 break;
1322 case 'D':
1323 if(arg2.type == CONSTDOUBLE)
1324 {
1325 return CompareDouble(newVal[i].D, op, arg2.D);
1326 }
1327 else if(arg2.type == CONSTINT)
1328 { // integral promotion
1329 return CompareDouble(newVal[i].D, op, arg2.I);
1330 //===================================================================
1331 // MA - 2018.07.23
1332 }
1333 else if(arg2.type == CONSTLONG)
1334 {
1335 return CompareDouble(newVal[i].D, op, arg2.L);
1336 }
1337 else if(arg2.type == IDENTIFIER)
1338 {
1339 unsigned iii = IndexOf(arg2.S);
1340 char newValtype2 = (char)std::toupper(parameter[iii]->GetParameterType());
1341 if(newValtype2 == 'I')
1342 {
1343 return CompareDouble(newVal[i].D, op, newVal[iii].I);
1344 }
1345 else if(newValtype2 == 'L')
1346 {
1347 return CompareDouble(newVal[i].D, op, newVal[iii].L);
1348 }
1349 else if(newValtype2 == 'D')
1350 {
1351 return CompareDouble(newVal[i].D, op, newVal[iii].D);
1352 }
1353 //===================================================================
1354 }
1355 break;
1356 default:;
1357 }
1358 }
1359 if(arg2.type == IDENTIFIER)
1360 {
1361 unsigned i = IndexOf(arg2.S);
1362 newValtype = (char)std::toupper(parameter[i]->GetParameterType());
1363 switch(newValtype)
1364 {
1365 case 'I':
1366 if(arg1.type == CONSTINT)
1367 {
1368 return CompareInt(arg1.I, op, newVal[i].I);
1369 }
1370 else
1371 {
1372 G4cerr << "integer operand expected for " << rangeString << '.'
1373 << G4endl;
1374 }
1375 break;
1376 case 'L':
1377 if(arg1.type == CONSTLONG)
1378 {
1379 return CompareLong(arg1.L, op, newVal[i].L);
1380 }
1381 else
1382 {
1383 G4cerr << "long int operand expected for " << rangeString << '.'
1384 << G4endl;
1385 }
1386 break;
1387 case 'D':
1388 if(arg1.type == CONSTDOUBLE)
1389 {
1390 return CompareDouble(arg1.D, op, newVal[i].D);
1391 }
1392 else if(arg1.type == CONSTINT)
1393 { // integral promotion
1394 return CompareDouble(arg1.I, op, newVal[i].D);
1395 }
1396 break;
1397 default:;
1398 }
1399 }
1400 return 0;
1401}
1402
1403// --------------------------------------------------------------------
1404G4int G4UIcommand::CompareInt(G4int arg1, G4int op, G4int arg2)
1405{
1406 G4int result = -1;
1407 G4String opr;
1408 switch(op)
1409 {
1410 case GT:
1411 result = static_cast<G4int>(arg1 > arg2);
1412 opr = ">";
1413 break;
1414 case GE:
1415 result = static_cast<G4int>(arg1 >= arg2);
1416 opr = ">=";
1417 break;
1418 case LT:
1419 result = static_cast<G4int>(arg1 < arg2);
1420 opr = "<";
1421 break;
1422 case LE:
1423 result = static_cast<G4int>(arg1 <= arg2);
1424 opr = "<=";
1425 break;
1426 case EQ:
1427 result = static_cast<G4int>(arg1 == arg2);
1428 opr = "==";
1429 break;
1430 case NE:
1431 result = static_cast<G4int>(arg1 != arg2);
1432 opr = "!=";
1433 break;
1434 default:
1435 G4cerr << "Parameter range: error at CompareInt" << G4endl;
1436 paramERR = 1;
1437 }
1438#ifdef DEBUG
1439 G4cerr << "CompareInt " << arg1 << " " << opr << arg2 << " result: " << result
1440 << G4endl;
1441#endif
1442 return result;
1443}
1444
1445// --------------------------------------------------------------------
1446G4int G4UIcommand::CompareLong(G4long arg1, G4int op, G4long arg2)
1447{
1448 G4int result = -1;
1449 G4String opr;
1450 switch(op)
1451 {
1452 case GT:
1453 result = static_cast<G4int>(arg1 > arg2);
1454 opr = ">";
1455 break;
1456 case GE:
1457 result = static_cast<G4int>(arg1 >= arg2);
1458 opr = ">=";
1459 break;
1460 case LT:
1461 result = static_cast<G4int>(arg1 < arg2);
1462 opr = "<";
1463 break;
1464 case LE:
1465 result = static_cast<G4int>(arg1 <= arg2);
1466 opr = "<=";
1467 break;
1468 case EQ:
1469 result = static_cast<G4int>(arg1 == arg2);
1470 opr = "==";
1471 break;
1472 case NE:
1473 result = static_cast<G4int>(arg1 != arg2);
1474 opr = "!=";
1475 break;
1476 default:
1477 G4cerr << "Parameter range: error at CompareInt" << G4endl;
1478 paramERR = 1;
1479 }
1480#ifdef DEBUG
1481 G4cerr << "CompareInt " << arg1 << " " << opr << arg2 << " result: " << result
1482 << G4endl;
1483#endif
1484 return result;
1485}
1486
1487// --------------------------------------------------------------------
1488G4int G4UIcommand::CompareDouble(G4double arg1, G4int op, G4double arg2)
1489{
1490 G4int result = -1;
1491 G4String opr;
1492 switch(op)
1493 {
1494 case GT:
1495 result = static_cast<G4int>(arg1 > arg2);
1496 opr = ">";
1497 break;
1498 case GE:
1499 result = static_cast<G4int>(arg1 >= arg2);
1500 opr = ">=";
1501 break;
1502 case LT:
1503 result = static_cast<G4int>(arg1 < arg2);
1504 opr = "<";
1505 break;
1506 case LE:
1507 result = static_cast<G4int>(arg1 <= arg2);
1508 opr = "<=";
1509 break;
1510 case EQ:
1511 result = static_cast<G4int>(arg1 == arg2);
1512 opr = "==";
1513 break;
1514 case NE:
1515 result = static_cast<G4int>(arg1 != arg2);
1516 opr = "!=";
1517 break;
1518 default:
1519 G4cerr << "Parameter range: error at CompareDouble" << G4endl;
1520 paramERR = 1;
1521 }
1522#ifdef DEBUG
1523 G4cerr << "CompareDouble " << arg1 << " " << opr << " " << arg2
1524 << " result: " << result << G4endl;
1525#endif
1526 return result;
1527}
1528
1529// --------------------------------------------------------------------
1530unsigned G4UIcommand::IndexOf(const char* nam)
1531{
1532 unsigned i;
1533 G4String pname;
1534 for(i = 0; i < parameter.size(); ++i)
1535 {
1536 pname = parameter[i]->GetParameterName();
1537 if(pname == nam)
1538 {
1539 return i;
1540 }
1541 }
1542 paramERR = 1;
1543 G4cerr << "parameter name:" << nam << " not found." << G4endl;
1544 return 0;
1545}
1546
1547// --------------------------------------------------------------------
1548unsigned G4UIcommand::IsParameter(const char* nam)
1549{
1550 G4String pname;
1551 for(auto& i : parameter)
1552 {
1553 pname = i->GetParameterName();
1554 if(pname == nam)
1555 {
1556 return 1;
1557 }
1558 }
1559 return 0;
1560}
1561
1562// --------------------- utility functions ----------------------------
1563
1564tokenNum G4UIcommand::Yylex() // reads input and returns token number, KR486
1565{ // (returns EOF)
1566 G4int c;
1567 G4String buf;
1568
1569 while((c = G4UIpGetc()) == ' ' || c == '\t' || c == '\n')
1570 {
1571 ;
1572 }
1573 if(c == EOF)
1574 {
1575 return (tokenNum) EOF; // KR488
1576 }
1577 buf = "";
1578 if((isdigit(c) != 0) || c == '.')
1579 { // I or D
1580 do
1581 {
1582 buf += (unsigned char)c;
1583 c = G4UIpGetc();
1584 } while(c == '.' || (isdigit(c) != 0) || c == 'e' || c == 'E' || c == '+' ||
1585 c == '-');
1586 G4UIpUngetc(c);
1587 const char* t = buf;
1588 std::istringstream is(t);
1589 if(IsInt(buf.data(), 20) != 0)
1590 {
1591 is >> yylval.I;
1592 return CONSTINT;
1593 }
1594 else if(IsDouble(buf.data()) != 0)
1595 {
1596 is >> yylval.D;
1597 return CONSTDOUBLE;
1598 }
1599 else
1600 {
1601 G4cerr << buf << ": numeric format error." << G4endl;
1602 }
1603 }
1604 buf = "";
1605 if((isalpha(c) != 0) || c == '_')
1606 { // IDENTIFIER
1607 do
1608 {
1609 buf += (unsigned char) c;
1610 } while((c = G4UIpGetc()) != EOF && ((isalnum(c) != 0) || c == '_'));
1611 G4UIpUngetc(c);
1612 if(IsParameter(buf) != 0u)
1613 {
1614 yylval.S = buf;
1615 return IDENTIFIER;
1616 }
1617 else
1618 {
1619 G4cerr << buf << " is not a parameter name." << G4endl;
1620 paramERR = 1;
1621 }
1622 }
1623 switch(c)
1624 {
1625 case '>':
1626 return (tokenNum) Follow('=', GE, GT);
1627 case '<':
1628 return (tokenNum) Follow('=', LE, LT);
1629 case '=':
1630 return (tokenNum) Follow('=', EQ, '=');
1631 case '!':
1632 return (tokenNum) Follow('=', NE, '!');
1633 case '|':
1634 return (tokenNum) Follow('|', LOGICALOR, '|');
1635 case '&':
1636 return (tokenNum) Follow('&', LOGICALAND, '&');
1637 default:
1638 return (tokenNum) c;
1639 }
1640}
1641
1642// --------------------------------------------------------------------
1643G4int G4UIcommand::Follow(G4int expect, G4int ifyes, G4int ifno)
1644{
1645 G4int c = G4UIpGetc();
1646 if(c == expect)
1647 {
1648 return ifyes;
1649 }
1650 G4UIpUngetc(c);
1651 return ifno;
1652}
1653
1654//------------------ low level routines -------------------------------
1655
1656G4int G4UIcommand::G4UIpGetc()
1657{ // emulation of getc()
1658 std::size_t length = rangeString.length();
1659 if(bp < (G4int)length)
1660 {
1661 return rangeString[bp++];
1662 }
1663 else
1664 {
1665 return EOF;
1666 }
1667}
1668
1669// --------------------------------------------------------------------
1670G4int G4UIcommand::G4UIpUngetc(G4int c)
1671{ // emulation of ungetc()
1672 if(c < 0)
1673 {
1674 return -1;
1675 }
1676 if(bp > 0 && c == rangeString[bp - 1])
1677 {
1678 --bp;
1679 }
1680 else
1681 {
1682 G4cerr << "G4UIpUngetc() failed." << G4endl;
1683 G4cerr << "bp=" << bp << " c=" << c << " pR(bp-1)=" << rangeString[bp - 1]
1684 << G4endl;
1685 paramERR = 1;
1686 return -1;
1687 }
1688 return 0;
1689}
@ GT
Definition: Evaluator.cc:68
@ LT
Definition: Evaluator.cc:68
@ NE
Definition: Evaluator.cc:68
@ GE
Definition: Evaluator.cc:68
@ LE
Definition: Evaluator.cc:68
@ EQ
Definition: Evaluator.cc:68
G4ApplicationState
@ G4State_EventProc
@ G4State_Init
@ G4State_Idle
@ G4State_Abort
@ G4State_GeomClosed
@ G4State_PreInit
@ JustWarning
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:83
long G4long
Definition: G4Types.hh:87
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
@ fParameterUnreadable
@ fParameterOutOfRange
std::vector< G4UnitDefinition * > G4UnitsContainer
std::vector< G4UnitsCategory * > G4UnitsTable
Definition: G4UnitsTable.hh:68
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
double z() const
double x() const
double y() const
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
G4UIcommand()=default
static G4ThreeVector ConvertTo3Vector(const char *st)
Definition: G4UIcommand.cc:601
G4bool toBeBroadcasted
Definition: G4UIcommand.hh:219
static G4String CategoryOf(const char *unitName)
Definition: G4UIcommand.cc:370
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:362
virtual ~G4UIcommand()
Definition: G4UIcommand.cc:116
void SetCommandType(CommandType)
Definition: G4UIcommand.cc:89
static G4long ConvertToLongInt(const char *st)
Definition: G4UIcommand.cc:570
virtual G4int DoIt(G4String parameterList)
Definition: G4UIcommand.cc:146
G4UItokenNum::yystype yystype
Definition: G4UIcommand.hh:214
G4bool operator==(const G4UIcommand &right) const
Definition: G4UIcommand.cc:134
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:446
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:137
G4int CheckNewValue(const char *newValue)
Definition: G4UIcommand.cc:629
G4bool IsAvailable()
Definition: G4UIcommand.cc:342
static G4int ConvertToInt(const char *st)
Definition: G4UIcommand.cc:561
static G4String UnitsList(const char *unitCategory)
Definition: G4UIcommand.cc:376
static G4bool ConvertToBool(const char *st)
Definition: G4UIcommand.cc:549
static G4double ConvertToDouble(const char *st)
Definition: G4UIcommand.cc:579
static G4double ConvertToDimensionedDouble(const char *st)
Definition: G4UIcommand.cc:588
virtual void List()
Definition: G4UIcommand.cc:411
G4bool workerThreadOnly
Definition: G4UIcommand.hh:221
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:287
G4bool operator!=(const G4UIcommand &right) const
Definition: G4UIcommand.cc:140
static G4ThreeVector ConvertToDimensioned3Vector(const char *st)
Definition: G4UIcommand.cc:612
G4String GetCurrentValue()
Definition: G4UIcommand.cc:281
static G4bool DoublePrecisionStr()
Definition: G4UImanager.cc:160
static G4UImanager * GetMasterUIpointer()
Definition: G4UImanager.cc:91
void AddNewCommand(G4UIcommand *newCommand)
Definition: G4UImanager.cc:277
void RemoveCommand(G4UIcommand *aCommand)
Definition: G4UImanager.cc:293
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
virtual G4String GetCurrentValue(G4UIcommand *command)
G4bool CommandsShouldBeInMaster() const
virtual void SetNewValue(G4UIcommand *command, G4String newValue)
static G4double GetValueOf(const G4String &)
static G4String GetCategory(const G4String &)
static G4UnitsTable & GetUnitsTable()
void to_upper(G4String &str)
Convert string to uppercase.
G4String to_upper_copy(G4String str)
Return uppercase copy of string.
G4bool IsWorkerThread()
Definition: G4Threading.cc:123
G4bool IsMasterThread()
Definition: G4Threading.cc:124
G4double D
Definition: G4UItokenNum.hh:68
yystype { tokenNum type{ tokenNum::NONE } yystype
Definition: G4UItokenNum.hh:67