A low-level input/scan token content. No defined constructors/destructors. All memory management is manual! More...
#include <exprScanToken.H>

Public Types | |
| enum | tokenType : unsigned char { LABEL = 0 , SCALAR , VECTOR , WORD } |
| Tagged union types. More... | |
Public Member Functions | |
| void | setLabel (label val) |
| Assign type/value to be LABEL. Does not call destroy(). | |
| void | setScalar (scalar val) |
| Assign type/value to be SCALAR. Does not call destroy(). | |
| void | setVector (scalar x, scalar y, scalar z) |
| Assign type/value to be VECTOR. Does not call destroy(). | |
| void | setVector (const vector &val) |
| Assign type/value to be VECTOR. Does not call destroy(). | |
| void | setWord (const word &val) |
| Assign type/value to be WORD (name). Does not call destroy(). | |
| bool | is_pointer () const noexcept |
| True if a pointer type. | |
| void | destroy () |
| Manual deletion of pointer types. | |
Static Public Member Functions | |
| static scanToken | null () |
| Return a null token (label = 0) - in lieu of a default constructor. | |
Public Attributes | |
| union { | |
| Foam::label labelValue | |
| Foam::scalar scalarValue | |
| Foam::vector * vectorPtr | |
| Foam::word * wordPtr | |
| Foam::word * name_ | |
| }; | |
| The data content (as a union). | |
| tokenType | type_ |
| The token type. | |
A low-level input/scan token content. No defined constructors/destructors. All memory management is manual!
Definition at line 47 of file exprScanToken.H.
| enum tokenType : unsigned char |
Tagged union types.
| Enumerator | |
|---|---|
| LABEL | |
| SCALAR | |
| VECTOR | |
| WORD | |
Definition at line 52 of file exprScanToken.H.
|
static |
Return a null token (label = 0) - in lieu of a default constructor.
Definition at line 25 of file exprScanToken.C.
References LABEL, labelValue, and type_.
| void setLabel | ( | label | val | ) |
Assign type/value to be LABEL. Does not call destroy().
Definition at line 50 of file exprScanToken.C.
References LABEL, labelValue, and type_.
| void setScalar | ( | scalar | val | ) |
Assign type/value to be SCALAR. Does not call destroy().
Definition at line 57 of file exprScanToken.C.
References SCALAR, scalarValue, and type_.
| void setVector | ( | scalar | x, |
| scalar | y, | ||
| scalar | z ) |
| void setVector | ( | const vector & | val | ) |
| void setWord | ( | const word & | val | ) |
|
inlinenoexcept |
True if a pointer type.
Definition at line 118 of file exprScanToken.H.
References Foam::noexcept, type_, VECTOR, and WORD.
| void destroy | ( | ) |
| Foam::label labelValue |
Definition at line 70 of file exprScanToken.H.
Referenced by null(), and setLabel().
| Foam::scalar scalarValue |
Definition at line 71 of file exprScanToken.H.
Referenced by setScalar().
| Foam::vector* vectorPtr |
Definition at line 72 of file exprScanToken.H.
Referenced by destroy(), setVector(), and setVector().
| Foam::word* wordPtr |
Definition at line 73 of file exprScanToken.H.
| Foam::word* name_ |
Definition at line 74 of file exprScanToken.H.
| union { ... } |
The data content (as a union).
For memory alignment have this appear as the first member.
| tokenType type_ |
The token type.
Definition at line 80 of file exprScanToken.H.
Referenced by destroy(), is_pointer(), null(), setLabel(), setScalar(), setVector(), setVector(), and setWord().