scanToken Class Reference

A low-level input/scan token content. No defined constructors/destructors. All memory management is manual! More...

Collaboration diagram for scanToken:
[legend]

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(). More...
 
void setScalar (scalar val)
 Assign type/value to be SCALAR. Does not call destroy(). More...
 
void setVector (scalar x, scalar y, scalar z)
 Assign type/value to be VECTOR. Does not call destroy(). More...
 
void setVector (const vector &val)
 Assign type/value to be VECTOR. Does not call destroy(). More...
 
void setWord (const word &val)
 Assign type/value to be WORD (name). Does not call destroy(). More...
 
void destroy ()
 Manual deletion of pointer types. More...
 

Static Public Member Functions

static scanToken null ()
 Return a null token - in lieu of a default constructor. More...
 

Public Attributes

union {
   Foam::label   labelValue
 
   Foam::scalar   scalarValue
 
   Foam::vector *   vectorPtr
 
   Foam::word *   wordPtr
 
   Foam::word *   name_
 
}; 
 The data content (as a union). More...
 
tokenType type_
 The token type. More...
 

Detailed Description

A low-level input/scan token content. No defined constructors/destructors. All memory management is manual!

Definition at line 51 of file exprScanToken.H.

Member Enumeration Documentation

◆ tokenType

enum tokenType : unsigned char

Tagged union types.

Enumerator
LABEL 
SCALAR 
VECTOR 
WORD 

Definition at line 54 of file exprScanToken.H.

Member Function Documentation

◆ null()

Return a null token - in lieu of a default constructor.

Definition at line 32 of file exprScanToken.C.

References scanToken::LABEL, scanToken::labelValue, and scanToken::type_.

◆ setLabel()

void setLabel ( label  val)

Assign type/value to be LABEL. Does not call destroy().

Definition at line 57 of file exprScanToken.C.

◆ setScalar()

void setScalar ( scalar  val)

Assign type/value to be SCALAR. Does not call destroy().

Definition at line 64 of file exprScanToken.C.

◆ setVector() [1/2]

void setVector ( scalar  x,
scalar  y,
scalar  z 
)

Assign type/value to be VECTOR. Does not call destroy().

Definition at line 71 of file exprScanToken.C.

References x, and y.

◆ setVector() [2/2]

void setVector ( const vector val)

Assign type/value to be VECTOR. Does not call destroy().

Definition at line 78 of file exprScanToken.C.

◆ setWord()

void setWord ( const word val)

Assign type/value to be WORD (name). Does not call destroy().

Definition at line 85 of file exprScanToken.C.

◆ destroy()

void destroy ( )

Manual deletion of pointer types.

Definition at line 42 of file exprScanToken.C.

Member Data Documentation

◆ labelValue

Foam::label labelValue

Definition at line 69 of file exprScanToken.H.

Referenced by scanToken::null().

◆ scalarValue

Foam::scalar scalarValue

Definition at line 70 of file exprScanToken.H.

◆ vectorPtr

Foam::vector* vectorPtr

Definition at line 71 of file exprScanToken.H.

◆ wordPtr

Foam::word* wordPtr

Definition at line 72 of file exprScanToken.H.

◆ name_

Foam::word* name_

Definition at line 73 of file exprScanToken.H.

◆ 

union { ... } @1

The data content (as a union).

For memory alignment have this appear as the first member.

◆ type_

tokenType type_

The token type.

Definition at line 77 of file exprScanToken.H.

Referenced by scanToken::null().


The documentation for this class was generated from the following files: