tokenI.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 // based on OpenFOAM stream, with some modifications/simplifications
21 // to be tailored to our needs
22 
23 
24 #include <algorithm>
25 
26 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
27 
29 {
30  token tok;
31  tok.type_ = tokenType::BOOL;
32  tok.data_.int64Val = on;
33 
34  return tok;
35 }
36 
37 
38 inline pFlow::token pFlow::token::flag(int bitmask)
39 {
40  token tok;
41  tok.type_ = tokenType::FLAG;
42  tok.data_.flagVal = bitmask;
43 
44  return tok;
45 }
46 
47 
48 inline bool pFlow::token::isseparator(int c)
49 {
50  // NOTE: keep synchronized with ISstream::read(token&)
51 
52  switch (c)
53  {
55  case token::BEGIN_LIST :
56  case token::END_LIST :
57  case token::BEGIN_SQR :
58  case token::END_SQR :
59  case token::BEGIN_BLOCK :
60  case token::END_BLOCK :
61  case token::COLON :
62  case token::COMMA :
63  // Excluded token::SUBTRACT since it could start a number
64  case token::DIVIDE :
65  {
66  return true;
67  }
68 
69  default:
70  break;
71  }
72 
73  return false;
74 }
75 
76 
77 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
78 
80 {
81  type_ = tokenType::UNDEFINED;
82  data_.int64Val = 0; // bit-wise zero for union content
83 
84 }
85 
86 
87 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
88 
89 inline constexpr pFlow::token::token() noexcept
90 :
91  data_(), // bit-wise zero for union content
92  type_(tokenType::UNDEFINED),
93  lineNumber_(0)
94 {}
95 
96 
97 inline pFlow::token::token(const token& tok)
98 :
99  data_(tok.data_), // bit-wise copy of union content
100  type_(tok.type_),
101  lineNumber_(tok.lineNumber_)
102 {
103  // Fundamental: values already handled by bit-wise copy
104  // Pointer: duplicate content or increase refCount
105 
106  switch (type_)
107  {
108  case tokenType::WORD:
109  case tokenType::DIRECTIVE:
110  {
111  data_.wordPtr = new word(*tok.data_.wordPtr);
112  break;
113  }
114 
115  case tokenType::STRING:
116  case tokenType::VARIABLE:
117  {
118  data_.stringPtr = new word(*tok.data_.stringPtr);
119  break;
120  }
121  default:
122  break;
123  }
124 }
125 
126 
128 :
129  data_(tok.data_), // bit-wise copy of union content
130  type_(tok.type_),
131  lineNumber_(tok.lineNumber_)
132 {
133  tok.setUndefined(); // zero the union content without any checking
134  tok.lineNumber_ = 0;
135 }
136 
137 
139 :
140  data_(),
141  type_(tokenType::PUNCTUATION),
142  lineNumber_(lineNumber)
143 {
144  data_.punctuationVal = p;
145 }
146 
147 inline pFlow::token::token(const label val, int32 lineNumber)
148 :
149  data_(),
150  type_(tokenType::INT64),
151  lineNumber_(lineNumber)
152 {
153  data_.int64Val = static_cast<int64>(val);
154 }
155 
156 inline pFlow::token::token(const uint32 val, int32 lineNumber)
157 :
158  data_(),
159  type_(tokenType::INT64),
160  lineNumber_(lineNumber)
161 {
162  data_.int64Val = static_cast<int64>(val);
163 }
164 
165 inline pFlow::token::token(const int64 val, int32 lineNumber)
166 :
167  data_(),
168  type_(tokenType::INT64),
169  lineNumber_(lineNumber)
170 {
171  data_.int64Val = val;
172 }
173 
174 inline pFlow::token::token(const int32 val, int32 lineNumber)
175 :
176  data_(),
177  type_(tokenType::INT64),
178  lineNumber_(lineNumber)
179 {
180  data_.int64Val = static_cast<int64>(val);
181 }
182 
183 inline pFlow::token::token(const float val, int32 lineNumber)
184 :
185  data_(),
186  type_(tokenType::FLOAT),
187  lineNumber_(lineNumber)
188 {
189  data_.floatVal = val;
190 }
191 
192 
193 inline pFlow::token::token(const double val, int32 lineNumber)
194 :
195  data_(),
196  type_(tokenType::DOUBLE),
197  lineNumber_(lineNumber)
198 {
199  data_.doubleVal = val;
200 }
201 
202 
203 inline pFlow::token::token(const word& w, int32 lineNumber, bool isString)
204 :
205  data_(),
206  type_(tokenType::WORD),
207  lineNumber_(lineNumber)
208 {
209  if(isString)
210  {
211  data_.stringPtr = new word(w);
212  type_ = tokenType::STRING;
213  } else
214  {
215  data_.wordPtr = new word(w);
216  }
217 }
218 
219 
220 inline pFlow::token::token(word&& w, int32 lineNumber, bool isString)
221 :
222  data_(),
223  type_(tokenType::WORD),
224  lineNumber_(lineNumber)
225 {
226  if(isString)
227  {
228  data_.stringPtr = new word(std::move(w));
229  type_ = tokenType::STRING;
230  } else
231  {
232  data_.wordPtr = new word(std::move(w));
233  }
234 }
235 
236 
238 {
239  reset();
240 }
241 
242 
243 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
244 
245 inline void pFlow::token::reset()
246 {
247  switch (type_)
248  {
249  case tokenType::WORD:
250  case tokenType::DIRECTIVE:
251  {
252  delete data_.wordPtr;
253  break;
254  }
255 
256  case tokenType::STRING:
257  case tokenType::VARIABLE:
258  {
259  delete data_.stringPtr;
260  break;
261  }
262 
263  default:
264  break;
265  }
266 
267  setUndefined();
268 }
269 
270 
271 inline void pFlow::token::swap(token& tok)
272 {
273  if (this == &tok)
274  {
275  return; // Self-swap is a no-op
276  }
277 
278  std::swap(data_, tok.data_);
279  std::swap(type_, tok.type_);
280  std::swap(lineNumber_, tok.lineNumber_);
281 }
282 
283 
285 {
286  return type_;
287 }
288 
289 
291 {
292  if (type_ == tokType)
293  {
294  // No change required
295  return true;
296  }
297 
298  switch (tokType)
299  {
300  case tokenType::BOOL:
301  case tokenType::INT64:
302  {
303  switch (type_)
304  {
305  case tokenType::BOOL:
306  case tokenType::INT64:
307  type_ = tokType;
308  return true;
309  break;
310 
311  default:
312  break;
313  }
314  }
315  break;
316 
317  case tokenType::WORD:
318  case tokenType::DIRECTIVE:
319  {
320  switch (type_)
321  {
322  case tokenType::WORD:
323  case tokenType::DIRECTIVE:
324  type_ = tokType;
325  return true;
326  break;
327 
328  default:
329  break;
330  }
331  }
332  break;
333 
334  case tokenType::STRING:
335  case tokenType::VARIABLE:
336  {
337  switch (type_)
338  {
339  // could also go from WORD to STRING etc - to be decided
340  case tokenType::STRING:
341  case tokenType::VARIABLE:
342  type_ = tokType;
343  return true;
344  break;
345 
346  default:
347  break;
348  }
349  }
350  break;
351 
352  default:
353  break;
354  }
355 
356  return false;
357 }
358 
359 
361 {
362  return lineNumber_;
363 }
364 
365 
367 {
368  return lineNumber_;
369 }
370 
371 
372 inline bool pFlow::token::good() const
373 {
374  return (type_ != tokenType::UNDEFINED && type_ != tokenType::ERROR);
375 }
376 
377 
378 inline bool pFlow::token::undefined() const
379 {
380  return (type_ == tokenType::UNDEFINED);
381 }
382 
383 
384 inline bool pFlow::token::error() const
385 {
386  return (type_ == tokenType::ERROR);
387 }
388 
389 
390 inline bool pFlow::token::isBool() const
391 {
392  return (type_ == tokenType::BOOL);
393 }
394 
395 
396 inline bool pFlow::token::boolToken() const
397 {
398  if (type_ == tokenType::BOOL || type_ == tokenType::INT64)
399  {
400  return data_.int64Val;
401  }
402 
403  parseError("bool");
404  return false;
405 }
406 
407 
408 inline bool pFlow::token::isFlag() const
409 {
410  return (type_ == tokenType::FLAG);
411 }
412 
413 
414 inline int pFlow::token::flagToken() const
415 {
416  if (type_ == tokenType::FLAG)
417  {
418  return data_.flagVal;
419  }
420 
421  parseError("flag bitmask");
422  return NO_FLAG;
423 }
424 
425 
426 inline bool pFlow::token::isPunctuation() const
427 {
428  return (type_ == tokenType::PUNCTUATION);
429 }
430 
431 inline bool pFlow::token::isEndStatement() const
432 {
433  if( type_ == tokenType::PUNCTUATION )
434  {
435  return pToken() == punctuationToken::END_STATEMENT;
436  }
437 
438  return false;
439 }
440 
441 
442 inline bool pFlow::token::isEndBlock() const
443 {
444  if( type_ == tokenType::PUNCTUATION )
445  {
446  return pToken() == punctuationToken::END_BLOCK;
447  }
448 
449  return false;
450 }
451 
453 {
454  if (type_ == tokenType::PUNCTUATION)
455  {
456  return data_.punctuationVal;
457  }
458 
459  parseError("punctuation character");
460  return punctuationToken::NULL_TOKEN;
461 }
462 
463 
464 inline bool pFlow::token::isSeparator() const
465 {
466  return
467  (
468  type_ == tokenType::PUNCTUATION
469  && isseparator(data_.punctuationVal)
470  );
471 }
472 
473 
474 inline bool pFlow::token::isInt64() const
475 {
476  return (type_ == tokenType::INT64);
477 }
478 
479 inline bool pFlow::token::isInt32() const
480 {
481  return (type_ == tokenType::INT64);
482 }
483 
485 {
486  if (type_ == tokenType::INT64)
487  {
488  return data_.int64Val;
489  }
490 
491  parseError("int64");
492  return 0;
493 }
494 
496 {
497  return static_cast<int32>(int64Token());
498 }
499 
500 inline bool pFlow::token::isFloat() const
501 {
502  return (type_ == tokenType::FLOAT);
503 }
504 
505 
506 inline float pFlow::token::floatToken() const
507 {
508  if (type_ == tokenType::FLOAT)
509  {
510  return data_.floatVal;
511  }
512 
513  parseError("float");
514  return 0;
515 }
516 
517 
518 inline bool pFlow::token::isDouble() const
519 {
520  return (type_ == tokenType::DOUBLE);
521 }
522 
523 
524 inline double pFlow::token::doubleToken() const
525 {
526  if (type_ == tokenType::DOUBLE)
527  {
528  return data_.doubleVal;
529  }
530 
531  parseError("double");
532  return 0;
533 }
534 
535 
536 inline bool pFlow::token::isReal() const
537 {
538  return
539  (
540  type_ == tokenType::FLOAT
541  || type_ == tokenType::DOUBLE
542  );
543 }
544 
545 
547 {
548  if (type_ == tokenType::FLOAT)
549  {
550  return data_.floatVal;
551  }
552  else if (type_ == tokenType::DOUBLE)
553  {
554  return data_.doubleVal;
555  }
556 
557  parseError("real");
558  return 0;
559 }
560 
561 
562 inline bool pFlow::token::isNumber() const
563 {
564  return (type_ == tokenType::INT64 || isReal());
565 }
566 
567 
569 {
570  if (isInt64())
571  {
572  return int64Token();
573  }
574  if (isReal())
575  {
576  return realToken();
577  }
578 
579  parseError("number (int64 or real)");
580  return 0;
581 }
582 
583 
584 inline bool pFlow::token::isWord() const
585 {
586  return
587  (
588  type_ == tokenType::WORD
589  || type_ == tokenType::DIRECTIVE
590  );
591 }
592 
593 
594 inline bool pFlow::token::isDirective() const
595 {
596  return (type_ == tokenType::DIRECTIVE);
597 }
598 
599 
601 {
602  if
603  (
604  type_ == tokenType::WORD
605  || type_ == tokenType::DIRECTIVE
606  )
607  {
608  return *data_.wordPtr;
609  }
610 
611  parseError("word");
612  return nullWord;
613 }
614 
615 inline bool pFlow::token::isString() const
616 {
617  return
618  (
619  type_ == tokenType::STRING
620  || type_ == tokenType::VARIABLE
621  );
622 }
623 
625 {
626  if
627  (
628  type_ == tokenType::STRING
629  || type_ == tokenType::VARIABLE
630  )
631  {
632  return *data_.stringPtr;
633  }
634  else if
635  (
636  type_ == tokenType::WORD
637  || type_ == tokenType::DIRECTIVE
638  )
639  {
640  // pFlow::word derives from pFlow::string, no need to cast.
641  return *data_.wordPtr;
642  }
643 
644  parseError("string");
645  return nullWord;
646 }
647 
648 inline bool pFlow::token::isVariable() const
649 {
650  return (type_ == tokenType::VARIABLE);
651 }
652 
653 inline bool pFlow::token::isStringType() const
654 {
655  return (isWord() || isString());
656 }
657 
658 inline void pFlow::token::setBad()
659 {
660  reset();
661  type_ = tokenType::ERROR;
662 }
663 
664 
665 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
666 
667 inline void pFlow::token::operator=(const token& tok)
668 {
669  if (this == &tok)
670  {
671  return; // Self-assignment is a no-op
672  }
673 
674  reset();
675 
676  type_ = tok.type_;
677  data_ = tok.data_; // bit-wise copy of union content
678  lineNumber_ = tok.lineNumber_;
679 
680  // Fundamental: values already handled by bit-wise copy
681  // Pointer: duplicate content or increase refCount
682 
683  switch (type_)
684  {
685  case tokenType::WORD:
686  case tokenType::DIRECTIVE:
687  {
688  data_.wordPtr = new word(*tok.data_.wordPtr);
689  }
690  break;
691 
692  case tokenType::STRING:
693  case tokenType::VARIABLE:
694  {
695  data_.stringPtr = new word(*tok.data_.stringPtr);
696  }
697  break;
698 
699  default:
700  break;
701  }
702 }
703 
704 
705 inline void pFlow::token::operator=(token&& tok)
706 {
707  if (this == &tok)
708  {
709  return; // Self-assignment is a no-op
710  }
711 
712  reset();
713  lineNumber_ = 0;
714  swap(tok);
715 }
716 
717 
719 {
720  reset();
721  type_ = tokenType::PUNCTUATION;
722  data_.punctuationVal = p;
723 }
724 
725 
726 inline void pFlow::token::operator=(const int64 val)
727 {
728  reset();
729  type_ = tokenType::INT64;
730  data_.int64Val = val;
731 }
732 
733 inline void pFlow::token::operator=(const int32 val)
734 {
735  reset();
736  type_ = tokenType::INT64;
737  data_.int64Val = static_cast<int64>(val);
738 }
739 
740 
741 inline void pFlow::token::operator=(const float val)
742 {
743  reset();
744  type_ = tokenType::FLOAT;
745  data_.floatVal = val;
746 }
747 
748 
749 inline void pFlow::token::operator=(const double val)
750 {
751  reset();
752  type_ = tokenType::DOUBLE;
753  data_.doubleVal = val;
754 }
755 
756 
757 inline void pFlow::token::operator=(const word& w)
758 {
759  reset();
760  type_ = tokenType::WORD;
761  data_.wordPtr = new word(w);
762 }
763 
764 
766 {
767  reset();
768  type_ = tokenType::WORD;
769  data_.wordPtr = new word(std::move(w));
770 }
771 
772 
773 inline bool pFlow::token::operator==(const token& tok) const
774 {
775  if (type_ != tok.type_)
776  {
777  return false;
778  }
779 
780  switch (type_)
781  {
782  case tokenType::UNDEFINED:
783  return true;
784 
785  case tokenType::BOOL:
786  return data_.int64Val == tok.data_.int64Val;
787 
788  case tokenType::FLAG:
789  return data_.flagVal == tok.data_.flagVal;
790 
791  case tokenType::PUNCTUATION:
792  return data_.punctuationVal == tok.data_.punctuationVal;
793 
794  case tokenType::INT64:
795  return data_.int64Val == tok.data_.int64Val;
796 
797  case tokenType::FLOAT:
798  return equal(data_.floatVal, tok.data_.floatVal);
799 
800  case tokenType::DOUBLE:
801  return equal(static_cast<real>(data_.doubleVal), static_cast<real>(tok.data_.doubleVal));
802 
803  case tokenType::WORD:
804  case tokenType::DIRECTIVE:
805  return *data_.wordPtr == *tok.data_.wordPtr;
806 
807  case tokenType::STRING:
808  case tokenType::VARIABLE:
809  return *data_.stringPtr == *tok.data_.stringPtr;
810 
811  case tokenType::ERROR:
812  return true;
813  }
814 
815  return false;
816 }
817 
818 
819 inline bool pFlow::token::operator==(const punctuationToken p) const
820 {
821  return (type_ == tokenType::PUNCTUATION && data_.punctuationVal == p);
822 }
823 
824 
825 inline bool pFlow::token::operator==(const int64 val) const
826 {
827  return
828  (
829  type_ == tokenType::INT64
830  && data_.int64Val == val
831  );
832 }
833 
834 inline bool pFlow::token::operator==(const int32 val) const
835 {
836  return
837  (
838  type_ == tokenType::INT64
839  && data_.int64Val == static_cast<int64>(val)
840  );
841 }
842 
843 
844 inline bool pFlow::token::operator==(const float val) const
845 {
846  return
847  (
848  type_ == tokenType::FLOAT
849  && equal(data_.floatVal, val)
850  );
851 }
852 
853 
854 inline bool pFlow::token::operator==(const double val) const
855 {
856  return
857  (
858  type_ == tokenType::DOUBLE
859  && equal( static_cast<real>(data_.doubleVal), static_cast<real>(val))
860  );
861 }
862 
863 inline bool pFlow::token::operator==(const word& w) const
864 {
865  return
866  (
867  type_== tokenType::WORD
868  && *data_.wordPtr == w
869  );
870 }
871 
872 inline bool pFlow::token::operator!=(const token& tok) const
873 {
874  return !operator==(tok);
875 }
876 
877 
878 inline bool pFlow::token::operator!=(const punctuationToken p) const
879 {
880  return !operator==(p);
881 }
882 
883 
884 inline bool pFlow::token::operator!=(const int64 val) const
885 {
886  return !operator==(val);
887 }
888 
889 inline bool pFlow::token::operator!=(const int32 val) const
890 {
891  return !operator==(val);
892 }
893 
894 
895 inline bool pFlow::token::operator!=(const float val) const
896 {
897  return !operator==(val);
898 }
899 
900 
901 inline bool pFlow::token::operator!=(const double val) const
902 {
903  return !operator==(val);
904 }
905 
906 
907 inline bool pFlow::token::operator!=(const word& w) const
908 {
909  return !operator==(w);
910 }
911 
912 
913 // ************************************************************************* //
pFlow::token::setType
bool setType(const tokenType tokType)
Definition: tokenI.hpp:290
pFlow::token::isBool
bool isBool() const
Definition: tokenI.hpp:390
pFlow::token::operator==
bool operator==(const token &tok) const
Definition: tokenI.hpp:773
pFlow::token::type
tokenType type() const
Definition: tokenI.hpp:284
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::token
Definition: token.hpp:42
pFlow::token::undefined
bool undefined() const
Definition: tokenI.hpp:378
pFlow::token::~token
~token()
Definition: tokenI.hpp:237
pFlow::token::data_
content data_
Definition: token.hpp:179
pFlow::token::pToken
punctuationToken pToken() const
Definition: tokenI.hpp:452
pFlow::token::isFloat
bool isFloat() const
Definition: tokenI.hpp:500
pFlow::token::punctuationToken
punctuationToken
Definition: token.hpp:81
pFlow::token::content::stringPtr
word * stringPtr
Definition: token.hpp:171
pFlow::token::isEndBlock
bool isEndBlock() const
Definition: tokenI.hpp:442
pFlow::token::isPunctuation
bool isPunctuation() const
Definition: tokenI.hpp:426
pFlow::token::stringToken
const word & stringToken() const
Definition: tokenI.hpp:624
pFlow::token::END_BLOCK
@ END_BLOCK
End block [isseparator].
Definition: token.hpp:94
pFlow::token::error
bool error() const
Definition: tokenI.hpp:384
pFlow::token::good
bool good() const
Definition: tokenI.hpp:372
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:59
pFlow::token::isDouble
bool isDouble() const
Definition: tokenI.hpp:518
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::token::number
real number() const
Definition: tokenI.hpp:568
pFlow::token::isVariable
bool isVariable() const
Definition: tokenI.hpp:648
pFlow::token::boolean
static token boolean(bool on)
Definition: tokenI.hpp:28
pFlow::int64
long long int int64
Definition: builtinTypes.hpp:55
pFlow::token::int64Token
int64 int64Token() const
Definition: tokenI.hpp:484
pFlow::token::isSeparator
bool isSeparator() const
Definition: tokenI.hpp:464
pFlow::token::content::punctuationVal
punctuationToken punctuationVal
Definition: token.hpp:165
pFlow::token::boolToken
bool boolToken() const
Definition: tokenI.hpp:396
pFlow::token::isStringType
bool isStringType() const
Definition: tokenI.hpp:653
pFlow::nullWord
const word nullWord
Definition: bTypesFunctions.hpp:41
pFlow::token::BEGIN_BLOCK
@ BEGIN_BLOCK
Begin block [isseparator].
Definition: token.hpp:93
pFlow::token::setUndefined
void setUndefined()
Definition: tokenI.hpp:79
pFlow::token::flagToken
int flagToken() const
Definition: tokenI.hpp:414
pFlow::token::reset
void reset()
Definition: tokenI.hpp:245
pFlow::token::token
constexpr token() noexcept
Definition: tokenI.hpp:89
pFlow::token::doubleToken
double doubleToken() const
Definition: tokenI.hpp:524
operator==
INLINE_FUNCTION_HD bool operator==(const quadruple< T > &opr1, const quadruple< T > &opr2)
pFlow::int32
int int32
Definition: builtinTypes.hpp:53
pFlow::token::realToken
real realToken() const
Definition: tokenI.hpp:546
pFlow::token::isseparator
static bool isseparator(int c)
Definition: tokenI.hpp:48
pFlow::token::lineNumber_
int32 lineNumber_
Definition: token.hpp:185
pFlow::token::flag
static token flag(int bitmask)
Definition: tokenI.hpp:38
pFlow::token::content::flagVal
int flagVal
Definition: token.hpp:164
pFlow::token::END_LIST
@ END_LIST
End list [isseparator].
Definition: token.hpp:90
pFlow::token::floatToken
float floatToken() const
Definition: tokenI.hpp:506
pFlow::token::content::wordPtr
word * wordPtr
Definition: token.hpp:170
pFlow::token::isInt64
bool isInt64() const
Definition: tokenI.hpp:474
pFlow::token::COLON
@ COLON
Colon [isseparator].
Definition: token.hpp:95
pFlow::token::isInt32
bool isInt32() const
Definition: tokenI.hpp:479
pFlow::token::END_STATEMENT
@ END_STATEMENT
End entry [isseparator].
Definition: token.hpp:88
pFlow::token::isFlag
bool isFlag() const
Definition: tokenI.hpp:408
pFlow::token::content::floatVal
float floatVal
Definition: token.hpp:166
pFlow::token::tokenType
tokenType
Definition: token.hpp:49
pFlow::token::content::int64Val
int64_t int64Val
Definition: token.hpp:162
pFlow::token::content::doubleVal
double doubleVal
Definition: token.hpp:167
pFlow::token::BEGIN_LIST
@ BEGIN_LIST
Begin list [isseparator].
Definition: token.hpp:89
pFlow::token::swap
void swap(token &tok)
Definition: tokenI.hpp:271
pFlow::token::BEGIN_SQR
@ BEGIN_SQR
Begin dimensions [isseparator].
Definition: token.hpp:91
pFlow::token::DIVIDE
@ DIVIDE
Divide [isseparator].
Definition: token.hpp:102
pFlow::label
std::size_t label
Definition: builtinTypes.hpp:61
pFlow::token::COMMA
@ COMMA
Comma [isseparator].
Definition: token.hpp:96
pFlow::token::operator=
void operator=(const token &tok)
Definition: tokenI.hpp:667
pFlow::token::operator!=
bool operator!=(const token &tok) const
Definition: tokenI.hpp:872
pFlow::token::type_
tokenType type_
Definition: token.hpp:182
pFlow::token::isNumber
bool isNumber() const
Definition: tokenI.hpp:562
pFlow::token::isEndStatement
bool isEndStatement() const
Definition: tokenI.hpp:431
pFlow::token::isDirective
bool isDirective() const
Definition: tokenI.hpp:594
pFlow::token::int32Token
int32 int32Token() const
Definition: tokenI.hpp:495
pFlow::token::END_SQR
@ END_SQR
End dimensions [isseparator].
Definition: token.hpp:92
pFlow::token::wordToken
const word & wordToken() const
Definition: tokenI.hpp:600
pFlow::equal
INLINE_FUNCTION_HD bool equal(const real &s1, const real &s2)
Definition: bTypesFunctions.hpp:188
pFlow::token::setBad
void setBad()
Definition: tokenI.hpp:658
pFlow::token::isString
bool isString() const
Definition: tokenI.hpp:615
pFlow::token::lineNumber
int32 lineNumber() const
Definition: tokenI.hpp:360
pFlow::token::isReal
bool isReal() const
Definition: tokenI.hpp:536
pFlow::token::isWord
bool isWord() const
Definition: tokenI.hpp:584