www.cemf.ir
token Class Reference

Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our needs. More...

+ Collaboration diagram for token:

Classes

union  content
 A union of token types. More...
 

Public Types

enum  tokenType {
  UNDEFINED = 0, FLAG, PUNCTUATION, BOOL,
  INT64, FLOAT, DOUBLE, WORD,
  STRING, DIRECTIVE, VARIABLE, ERROR
}
 Enumeration defining the types of token. More...
 
enum  flagType { NO_FLAG = 0, ASCII = 1, BINARY = 2 }
 Stream or output control flags (1-byte width) More...
 
enum  punctuationToken : char {
  NULL_TOKEN = '\0', SPACE = ' ', TAB = '\t', NL = '\n',
  END_STATEMENT = ';', BEGIN_LIST = '(', END_LIST = ')', BEGIN_SQR = '[',
  END_SQR = ']', BEGIN_BLOCK = '{', END_BLOCK = '}', COLON = ':',
  COMMA = ',', DOLLAR = '$', SQUOTE = '\'', DQUOTE = '"',
  SUBTRACT = '-', DIVIDE = '/', BEGIN_STRING = DQUOTE, END_STRING = DQUOTE
}
 Standard punctuation tokens (a character) More...
 

Public Member Functions

constexpr token () noexcept
 Default construct, initialized to an UNDEFINED token. More...
 
 token (const token &t)
 Copy construct. More...
 
 token (token &&t)
 Move construct. The original token is left as UNDEFINED. More...
 
 token (punctuationToken p, int32 lineNumber=0)
 Construct punctuation character token. More...
 
 token (const uint64 val, int32 lineNumber=0)
 Construct int64 token. More...
 
 token (const uint32 val, int32 lineNumber=0)
 Construct int64 token. More...
 
 token (const uint8 val, int32 lineNumber=0)
 Construct int8 token. More...
 
 token (const int64 val, int32 lineNumber=0)
 Construct int64 token. More...
 
 token (const int32 val, int32 lineNumber=0)
 Construct int64 token. More...
 
 token (const int8 val, int32 lineNumber=0)
 Construct int64 token. More...
 
 token (const float val, int32 lineNumber=0)
 Construct float token. More...
 
 token (const double val, int32 lineNumber=0)
 Construct double token. More...
 
 token (const word &w, int32 lineNumber=0, bool isString=false)
 Copy construct word & string token. More...
 
 token (word &&w, int32 lineNumber=0, bool isString=false)
 Move construct word & string token. More...
 
 token (iIstream &is)
 Construct from iIstream. More...
 
 ~token ()
 Destructor. More...
 
word name () const
 Return the name of the token type. More...
 
tokenType type () const
 Return the token type. More...
 
bool setType (const tokenType tokType)
 Change the token type, for similar types. More...
 
int32 lineNumber () const
 The line number for the token. More...
 
int32lineNumber ()
 The line number for the token. More...
 
bool good () const
 True if token is not UNDEFINED or ERROR. More...
 
bool undefined () const
 Token is UNDEFINED. More...
 
bool error () const
 Token is ERROR. More...
 
bool isBool () const
 Token is BOOL. More...
 
bool isFlag () const
 Token is FLAG. More...
 
bool isPunctuation () const
 Token is PUNCTUATION. More...
 
bool isSeparator () const
 Token is PUNCTUATION and isseparator. More...
 
bool isEndStatement () const
 Token is end statement. More...
 
bool isEndBlock () const
 Token is end endBlock. More...
 
bool isInt64 () const
 Token is int64. More...
 
bool isInt32 () const
 Token is int32. More...
 
bool isFloat () const
 Token is float. More...
 
bool isDouble () const
 Token is double. More...
 
bool isReal () const
 Token is float or double. More...
 
bool isNumber () const
 Token is int, float or duble. More...
 
bool isWord () const
 Token is word or DIRECTIVE word. More...
 
bool isDirective () const
 Token is DIRECTIVE (word variant) More...
 
bool isString () const
 Token is STRING, VARIABLE or VERBATIM string. More...
 
bool isVariable () const
 Token is VARIABLE (string variant) More...
 
bool isStringType () const
 Token is WORD, DIRECTIVE, STRING, VARIABLE or VERBATIM. More...
 
bool boolToken () const
 Return boolean token value. More...
 
int flagToken () const
 Return flag bitmask value. More...
 
punctuationToken pToken () const
 Return punctuation character. More...
 
int64 int64Token () const
 Return int64 value. More...
 
int32 int32Token () const
 Return int32 value. More...
 
float floatToken () const
 Return float value. More...
 
double doubleToken () const
 Return double value. More...
 
real realToken () const
 Return float or double value. More...
 
real number () const
 Return int64, float or double value. More...
 
const wordwordToken () const
 Return const reference to the word contents. More...
 
const wordstringToken () const
 Return const reference to the string contents. More...
 
void reset ()
 Reset token to UNDEFINED and clear any allocated storage. More...
 
void setBad ()
 Clear token and set to be ERROR. More...
 
void swap (token &tok)
 Swap token contents: type, data, line-number. More...
 
void operator= (const token &tok)
 Copy assign. More...
 
void operator= (token &&tok)
 Move assign. More...
 
void operator= (const punctuationToken p)
 Copy assign from punctuation. More...
 
void operator= (const int64 val)
 Copy assign from int64. More...
 
void operator= (const int32 val)
 Copy assign from int32. More...
 
void operator= (const float val)
 Copy assign from float. More...
 
void operator= (const double val)
 Copy assign from double. More...
 
void operator= (const word &w)
 Copy assign from word. More...
 
void operator= (word &&w)
 Move assign from word. More...
 
bool operator== (const token &tok) const
 
bool operator== (const punctuationToken p) const
 
bool operator== (const int64 val) const
 
bool operator== (const int32 val) const
 
bool operator== (const float val) const
 
bool operator== (const double val) const
 
bool operator== (const word &w) const
 
bool operator!= (const token &tok) const
 
bool operator!= (const punctuationToken p) const
 
bool operator!= (const int64 val) const
 
bool operator!= (const int32 val) const
 
bool operator!= (const float val) const
 
bool operator!= (const double val) const
 
bool operator!= (const word &w) const
 
iOstreamprintInfo (iOstream &os) const
 
std::ostream & printInfo (std::ostream &os) const
 
void operator= (word *)=delete
 

Static Public Member Functions

static const token undefinedToken ()
 An undefined token. More...
 
static token endList ()
 
static token beginList ()
 
static token endStatement ()
 
static token beginBlock ()
 
static token endBlocK ()
 
static token beginSquare ()
 
static token endSquare ()
 
static token space ()
 
static token newLine ()
 
static token boolean (bool on)
 Create a bool token. More...
 
static token flag (int bitmask)
 Create a token with stream flags, no sanity check. More...
 
static bool isseparator (int c)
 True if the character is a punctuation separator (eg, in ISstream). More...
 

Private Member Functions

void setUndefined ()
 Set as UNDEFINED and zero the union content without any checking. More...
 
void parseError (const char *expected) const
 Parse error, expected 'expected', found ... More...
 

Private Attributes

content data_
 The data content (as a union). More...
 
tokenType type_
 The token type. More...
 
int32 lineNumber_
 Line number in the file the token was read from. More...
 

Friends

iOstreamoperator<< (iOstream &os, const token &tok)
 
iOstreamoperator<< (iOstream &os, const punctuationToken &pt)
 
std::ostream & operator<< (std::ostream &os, const token &tok)
 
std::ostream & operator<< (std::ostream &os, const punctuationToken &pt)
 

Detailed Description

Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our needs.

Definition at line 44 of file token.hpp.

Member Enumeration Documentation

◆ tokenType

enum tokenType

Enumeration defining the types of token.

Since these values are also used to tag content in Pstream, the maximum number of types is limited to 30.

Enumerator
UNDEFINED 

An undefined token-type.

FLAG 
PUNCTUATION 

stream flag (1-byte bitmask)

BOOL 

single character punctuation

INT64 

boolean type

FLOAT 

int64 (integer) type

DOUBLE 

float (single-precision) type

WORD 

double (double-precision) type

STRING 

A pFlow::word.

DIRECTIVE 

A string whth double quuote.

VARIABLE 

A dictionary #directive (word variant)

ERROR 

A dictionary $variable (string variant)

Definition at line 51 of file token.hpp.

◆ flagType

enum flagType

Stream or output control flags (1-byte width)

Enumerator
NO_FLAG 
ASCII 

No flags.

BINARY 

ASCII-mode stream.

Definition at line 74 of file token.hpp.

◆ punctuationToken

enum punctuationToken : char

Standard punctuation tokens (a character)

Enumerator
NULL_TOKEN 
SPACE 

Nul character.

TAB 

Space [isspace].

NL 

Tab [isspace].

END_STATEMENT 

Newline [isspace].

BEGIN_LIST 

End entry [isseparator].

END_LIST 

Begin list [isseparator].

BEGIN_SQR 

End list [isseparator].

END_SQR 

Begin dimensions [isseparator].

BEGIN_BLOCK 

End dimensions [isseparator].

END_BLOCK 

Begin block [isseparator].

COLON 

End block [isseparator].

COMMA 

Colon [isseparator].

DOLLAR 

Comma [isseparator].

SQUOTE 

Dollar - start variable.

DQUOTE 

Single quote.

SUBTRACT 

Double quote.

DIVIDE 

Subtract or start of negative number.

BEGIN_STRING 

Divide [isseparator].

END_STRING 

Begin string with double quote.

Definition at line 83 of file token.hpp.

Constructor & Destructor Documentation

◆ token() [1/15]

constexpr token ( )
inlineconstexprnoexcept

Default construct, initialized to an UNDEFINED token.

Definition at line 89 of file tokenI.hpp.

Referenced by token::beginBlock(), token::beginList(), token::beginSquare(), token::endBlocK(), token::endList(), token::endSquare(), token::endStatement(), token::newLine(), and token::space().

+ Here is the caller graph for this function:

◆ token() [2/15]

token ( const token t)
inline

Copy construct.

Definition at line 97 of file tokenI.hpp.

References token::data_, token::content::stringPtr, token::type_, and token::content::wordPtr.

◆ token() [3/15]

token ( token &&  t)
inline

Move construct. The original token is left as UNDEFINED.

Definition at line 127 of file tokenI.hpp.

◆ token() [4/15]

token ( punctuationToken  p,
int32  lineNumber = 0 
)
inlineexplicit

Construct punctuation character token.

Definition at line 138 of file tokenI.hpp.

References token::data_, and token::content::punctuationVal.

◆ token() [5/15]

token ( const uint64  val,
int32  lineNumber = 0 
)
inlineexplicit

Construct int64 token.

Definition at line 147 of file tokenI.hpp.

References token::data_, and token::content::int64Val.

◆ token() [6/15]

token ( const uint32  val,
int32  lineNumber = 0 
)
inlineexplicit

Construct int64 token.

Definition at line 156 of file tokenI.hpp.

References token::data_, and token::content::int64Val.

◆ token() [7/15]

token ( const uint8  val,
int32  lineNumber = 0 
)
inlineexplicit

Construct int8 token.

Definition at line 165 of file tokenI.hpp.

References token::data_, and token::content::int64Val.

◆ token() [8/15]

token ( const int64  val,
int32  lineNumber = 0 
)
inlineexplicit

Construct int64 token.

Definition at line 174 of file tokenI.hpp.

References token::data_, and token::content::int64Val.

◆ token() [9/15]

token ( const int32  val,
int32  lineNumber = 0 
)
inlineexplicit

Construct int64 token.

Definition at line 183 of file tokenI.hpp.

References token::data_, and token::content::int64Val.

◆ token() [10/15]

token ( const int8  val,
int32  lineNumber = 0 
)
inlineexplicit

Construct int64 token.

Definition at line 192 of file tokenI.hpp.

References token::data_, and token::content::int64Val.

◆ token() [11/15]

token ( const float  val,
int32  lineNumber = 0 
)
inlineexplicit

Construct float token.

Definition at line 201 of file tokenI.hpp.

References token::data_, and token::content::floatVal.

◆ token() [12/15]

token ( const double  val,
int32  lineNumber = 0 
)
inlineexplicit

Construct double token.

Definition at line 211 of file tokenI.hpp.

References token::data_, and token::content::doubleVal.

◆ token() [13/15]

token ( const word w,
int32  lineNumber = 0,
bool  isString = false 
)
inlineexplicit

Copy construct word & string token.

Definition at line 221 of file tokenI.hpp.

References token::data_, token::isString(), token::content::stringPtr, token::type_, and token::content::wordPtr.

+ Here is the call graph for this function:

◆ token() [14/15]

token ( word &&  w,
int32  lineNumber = 0,
bool  isString = false 
)
inlineexplicit

Move construct word & string token.

Definition at line 238 of file tokenI.hpp.

References token::data_, token::isString(), token::content::stringPtr, token::type_, and token::content::wordPtr.

+ Here is the call graph for this function:

◆ token() [15/15]

token ( iIstream is)
explicit

Construct from iIstream.

Definition at line 100 of file tokenIO.cpp.

References iIstream::read().

+ Here is the call graph for this function:

◆ ~token()

~token ( )
inline

Destructor.

Definition at line 255 of file tokenI.hpp.

Member Function Documentation

◆ undefinedToken()

static const token undefinedToken ( )
inlinestatic

An undefined token.

◆ endList()

static token endList ( )
inlinestatic

Definition at line 113 of file token.hpp.

References token::token().

Referenced by pFlow::endListToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginList()

static token beginList ( )
inlinestatic

Definition at line 118 of file token.hpp.

References token::token().

Referenced by pFlow::beginListToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ endStatement()

static token endStatement ( )
inlinestatic

Definition at line 123 of file token.hpp.

References token::token().

Referenced by pFlow::endStatementToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginBlock()

static token beginBlock ( )
inlinestatic

Definition at line 128 of file token.hpp.

References token::token().

Referenced by pFlow::beginBlockToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ endBlocK()

static token endBlocK ( )
inlinestatic

Definition at line 133 of file token.hpp.

References token::token().

Referenced by pFlow::endBlocKToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginSquare()

static token beginSquare ( )
inlinestatic

Definition at line 138 of file token.hpp.

References token::token().

+ Here is the call graph for this function:

◆ endSquare()

static token endSquare ( )
inlinestatic

Definition at line 143 of file token.hpp.

References token::token().

+ Here is the call graph for this function:

◆ space()

static token space ( )
inlinestatic

Definition at line 148 of file token.hpp.

References token::token().

Referenced by pFlow::spaceToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newLine()

static token newLine ( )
inlinestatic

Definition at line 153 of file token.hpp.

References token::token().

Referenced by pFlow::newLineToken().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUndefined()

void setUndefined ( )
inlineprivate

Set as UNDEFINED and zero the union content without any checking.

Definition at line 79 of file tokenI.hpp.

◆ parseError()

void parseError ( const char *  expected) const
private

Parse error, expected 'expected', found ...

Definition at line 30 of file token.cpp.

References pFlow::endl(), and fatalError.

+ Here is the call graph for this function:

◆ boolean()

pFlow::token boolean ( bool  on)
inlinestatic

Create a bool token.

Definition at line 28 of file tokenI.hpp.

References token::data_, token::content::int64Val, and token::type_.

◆ flag()

pFlow::token flag ( int  bitmask)
inlinestatic

Create a token with stream flags, no sanity check.

Parameters
bitmaskthe flags to set

Definition at line 38 of file tokenI.hpp.

References token::data_, token::content::flagVal, and token::type_.

◆ isseparator()

bool isseparator ( int  c)
inlinestatic

True if the character is a punctuation separator (eg, in ISstream).

Since it could also start a number, SUBTRACT is not included as a separator.

Parameters
cthe character to test, passed as int for consistency with isdigit, isspace etc.

Definition at line 48 of file tokenI.hpp.

References token::BEGIN_BLOCK, token::BEGIN_LIST, token::BEGIN_SQR, token::COLON, token::COMMA, token::DIVIDE, token::END_BLOCK, token::END_LIST, token::END_SQR, and token::END_STATEMENT.

◆ name()

pFlow::word name ( ) const

Return the name of the token type.

Definition at line 110 of file tokenIO.cpp.

◆ type()

pFlow::token::tokenType type ( ) const
inline

Return the token type.

Definition at line 302 of file tokenI.hpp.

Referenced by pFlow::printTokenInfo(), and Ostream::write().

+ Here is the caller graph for this function:

◆ setType()

bool setType ( const tokenType  tokType)
inline

Change the token type, for similar types.

This can be used to change between string-like variants (eg, STRING, VARIABLE, etc) To change types entirely (eg, STRING to DOUBLE), use the corresponding assignment operator.

Returns
true if the change was successful or no change was required

Definition at line 308 of file tokenI.hpp.

Referenced by Istream::read().

+ Here is the caller graph for this function:

◆ lineNumber() [1/2]

pFlow::int32 & lineNumber ( ) const
inline

The line number for the token.

Definition at line 378 of file tokenI.hpp.

Referenced by pFlow::printTokenInfo(), iTstream::read(), and Istream::read().

+ Here is the caller graph for this function:

◆ lineNumber() [2/2]

int32& lineNumber ( )
inline

The line number for the token.

◆ good()

bool good ( ) const
inline

True if token is not UNDEFINED or ERROR.

Definition at line 390 of file tokenI.hpp.

Referenced by pFlow::badInput(), iEntry< Key, T * >::createEntry(), iIstream::findKeywordAndVal(), iIstream::nextData(), pFlow::operator>>(), Logical::read(), dataEntry::readDataEntry(), iEntry< Key, T * >::readKeyword(), and oTstream::write().

+ Here is the caller graph for this function:

◆ undefined()

bool undefined ( ) const
inline

Token is UNDEFINED.

Definition at line 396 of file tokenI.hpp.

◆ error()

bool error ( ) const
inline

Token is ERROR.

Definition at line 402 of file tokenI.hpp.

Referenced by iIstream::findTokenAndNext(), iIstream::findTokenAndNextSilent(), iIstream::findTokenResume(), iIstream::findTokenResumeSilent(), and iIstream::nextData().

+ Here is the caller graph for this function:

◆ isBool()

bool isBool ( ) const
inline

Token is BOOL.

Definition at line 408 of file tokenI.hpp.

◆ isFlag()

bool isFlag ( ) const
inline

Token is FLAG.

Definition at line 426 of file tokenI.hpp.

◆ isPunctuation()

bool isPunctuation ( ) const
inline

Token is PUNCTUATION.

Definition at line 444 of file tokenI.hpp.

Referenced by pFlow::readDataAscii(), dataEntry::readDataEntry(), and List< std::any >::readList().

+ Here is the caller graph for this function:

◆ isSeparator()

bool isSeparator ( ) const
inline

Token is PUNCTUATION and isseparator.

Definition at line 482 of file tokenI.hpp.

◆ isEndStatement()

bool isEndStatement ( ) const
inline

◆ isEndBlock()

bool isEndBlock ( ) const
inline

Token is end endBlock.

Definition at line 460 of file tokenI.hpp.

Referenced by iIstream::findTokenResume(), and iIstream::findTokenResumeSilent().

+ Here is the caller graph for this function:

◆ isInt64()

bool isInt64 ( ) const
inline

Token is int64.

Definition at line 492 of file tokenI.hpp.

Referenced by pFlow::readDataAscii(), and pFlow::readDataAsciiBinary().

+ Here is the caller graph for this function:

◆ isInt32()

bool isInt32 ( ) const
inline

Token is int32.

Definition at line 497 of file tokenI.hpp.

◆ isFloat()

bool isFloat ( ) const
inline

Token is float.

Definition at line 518 of file tokenI.hpp.

◆ isDouble()

bool isDouble ( ) const
inline

Token is double.

Definition at line 536 of file tokenI.hpp.

◆ isReal()

bool isReal ( ) const
inline

Token is float or double.

Definition at line 554 of file tokenI.hpp.

◆ isNumber()

bool isNumber ( ) const
inline

Token is int, float or duble.

Definition at line 580 of file tokenI.hpp.

Referenced by pFlow::checkNumberToken(), and pFlow::operator>>().

+ Here is the caller graph for this function:

◆ isWord()

bool isWord ( ) const
inline

◆ isDirective()

bool isDirective ( ) const
inline

Token is DIRECTIVE (word variant)

Definition at line 612 of file tokenI.hpp.

◆ isString()

bool isString ( ) const
inline

Token is STRING, VARIABLE or VERBATIM string.

Definition at line 633 of file tokenI.hpp.

Referenced by pFlow::operator>>(), Logical::read(), and token::token().

+ Here is the caller graph for this function:

◆ isVariable()

bool isVariable ( ) const
inline

Token is VARIABLE (string variant)

Definition at line 666 of file tokenI.hpp.

◆ isStringType()

bool isStringType ( ) const
inline

Token is WORD, DIRECTIVE, STRING, VARIABLE or VERBATIM.

Definition at line 671 of file tokenI.hpp.

◆ boolToken()

bool boolToken ( ) const
inline

Return boolean token value.

Report FatalIOError and return false if token is not BOOL or INT64

Definition at line 414 of file tokenI.hpp.

◆ flagToken()

int flagToken ( ) const
inline

Return flag bitmask value.

Report FatalIOError and return NO_FLAG if token is not FLAG

Definition at line 432 of file tokenI.hpp.

◆ pToken()

pFlow::token::punctuationToken pToken ( ) const
inline

Return punctuation character.

Report FatalIOError and return \0 if token is not PUNCTUATION

Definition at line 470 of file tokenI.hpp.

Referenced by pFlow::operator<<(), pFlow::printTokenInfo(), iIstream::readBeginList(), dataEntry::readDataEntry(), iIstream::readEndList(), and iIstream::readEndStatement().

+ Here is the caller graph for this function:

◆ int64Token()

pFlow::int64 int64Token ( ) const
inline

Return int64 value.

Definition at line 502 of file tokenI.hpp.

Referenced by pFlow::operator<<(), pFlow::printTokenInfo(), pFlow::readDataAscii(), and pFlow::readDataAsciiBinary().

+ Here is the caller graph for this function:

◆ int32Token()

pFlow::int32 int32Token ( ) const
inline

Return int32 value.

Report FatalIOError and return 0 if token is not INT64

Definition at line 513 of file tokenI.hpp.

◆ floatToken()

float floatToken ( ) const
inline

Return float value.

Report FatalIOError and return 0 if token is not FLOAT

Definition at line 524 of file tokenI.hpp.

Referenced by pFlow::operator<<(), and pFlow::printTokenInfo().

+ Here is the caller graph for this function:

◆ doubleToken()

double doubleToken ( ) const
inline

Return double value.

Report FatalIOError and return 0 if token is not DOUBLE

Definition at line 542 of file tokenI.hpp.

Referenced by pFlow::operator<<(), and pFlow::printTokenInfo().

+ Here is the caller graph for this function:

◆ realToken()

pFlow::real realToken ( ) const
inline

Return float or double value.

Report FatalIOError and return 0 if token is not a FLOAT or DOUBLE

Definition at line 564 of file tokenI.hpp.

◆ number()

pFlow::real number ( ) const
inline

Return int64, float or double value.

Report FatalIOError and return 0 if token is not a INT64, FLOAT or DOUBLE

Definition at line 586 of file tokenI.hpp.

Referenced by pFlow::checkNumberToken(), and pFlow::operator>>().

+ Here is the caller graph for this function:

◆ wordToken()

const pFlow::word & wordToken ( ) const
inline

Return const reference to the word contents.

Report FatalIOError and return "" if token is not a WORD or DIRECTIVE

Definition at line 618 of file tokenI.hpp.

References pFlow::nullWord.

Referenced by pFlow::checkWordToken(), iIstream::findTokenAndNext(), iIstream::findTokenAndNextSilent(), iIstream::findTokenResume(), iIstream::findTokenResumeSilent(), iIstream::nextData(), pFlow::operator<<(), pFlow::operator>>(), pFlow::printTokenInfo(), Logical::read(), iEntry< Key, T * >::readKeyword(), and Ostream::write().

+ Here is the caller graph for this function:

◆ stringToken()

const pFlow::word & stringToken ( ) const
inline

Return const reference to the string contents.

Report FatalIOError and return "" if token is not a STRING, VARIABLE, VERBATIM or an upcast WORD or DIRECTIVE

Definition at line 642 of file tokenI.hpp.

References pFlow::nullWord.

Referenced by pFlow::operator<<(), pFlow::operator>>(), pFlow::printTokenInfo(), and Logical::read().

+ Here is the caller graph for this function:

◆ reset()

void reset ( )
inline

Reset token to UNDEFINED and clear any allocated storage.

Definition at line 263 of file tokenI.hpp.

Referenced by pFlow::operator>>(), iIstream::peekBack(), iTstream::read(), and iIstream::resetPutBack().

+ Here is the caller graph for this function:

◆ setBad()

void setBad ( )
inline

Clear token and set to be ERROR.

Definition at line 676 of file tokenI.hpp.

Referenced by Istream::read(), and Istream::readWordToken().

+ Here is the caller graph for this function:

◆ swap()

void swap ( token tok)
inline

Swap token contents: type, data, line-number.

Definition at line 289 of file tokenI.hpp.

References token::data_, token::lineNumber_, and token::type_.

◆ operator=() [1/10]

void operator= ( const token tok)
inline

Copy assign.

Definition at line 685 of file tokenI.hpp.

References token::data_, token::lineNumber_, token::content::stringPtr, token::type_, and token::content::wordPtr.

◆ operator=() [2/10]

void operator= ( token &&  tok)
inline

Move assign.

Definition at line 723 of file tokenI.hpp.

◆ operator=() [3/10]

void operator= ( const punctuationToken  p)
inline

Copy assign from punctuation.

Definition at line 736 of file tokenI.hpp.

◆ operator=() [4/10]

void operator= ( const int64  val)
inline

Copy assign from int64.

Definition at line 744 of file tokenI.hpp.

◆ operator=() [5/10]

void operator= ( const int32  val)
inline

Copy assign from int32.

Definition at line 751 of file tokenI.hpp.

◆ operator=() [6/10]

void operator= ( const float  val)
inline

Copy assign from float.

Definition at line 759 of file tokenI.hpp.

◆ operator=() [7/10]

void operator= ( const double  val)
inline

Copy assign from double.

Definition at line 767 of file tokenI.hpp.

◆ operator=() [8/10]

void operator= ( const word w)
inline

Copy assign from word.

Definition at line 775 of file tokenI.hpp.

◆ operator=() [9/10]

void operator= ( word &&  w)
inline

Move assign from word.

Definition at line 783 of file tokenI.hpp.

◆ operator==() [1/7]

bool operator== ( const token tok) const
inline

◆ operator==() [2/7]

bool operator== ( const punctuationToken  p) const
inline

Definition at line 837 of file tokenI.hpp.

◆ operator==() [3/7]

bool operator== ( const int64  val) const
inline

Definition at line 843 of file tokenI.hpp.

◆ operator==() [4/7]

bool operator== ( const int32  val) const
inline

Definition at line 852 of file tokenI.hpp.

◆ operator==() [5/7]

bool operator== ( const float  val) const
inline

Definition at line 862 of file tokenI.hpp.

References pFlow::equal().

+ Here is the call graph for this function:

◆ operator==() [6/7]

bool operator== ( const double  val) const
inline

Definition at line 872 of file tokenI.hpp.

References pFlow::equal().

+ Here is the call graph for this function:

◆ operator==() [7/7]

bool operator== ( const word w) const
inline

Definition at line 881 of file tokenI.hpp.

◆ operator!=() [1/7]

bool operator!= ( const token tok) const
inline

Definition at line 890 of file tokenI.hpp.

References pFlow::operator==().

+ Here is the call graph for this function:

◆ operator!=() [2/7]

bool operator!= ( const punctuationToken  p) const
inline

Definition at line 896 of file tokenI.hpp.

References pFlow::operator==().

+ Here is the call graph for this function:

◆ operator!=() [3/7]

bool operator!= ( const int64  val) const
inline

Definition at line 902 of file tokenI.hpp.

References pFlow::operator==().

+ Here is the call graph for this function:

◆ operator!=() [4/7]

bool operator!= ( const int32  val) const
inline

Definition at line 907 of file tokenI.hpp.

References pFlow::operator==().

+ Here is the call graph for this function:

◆ operator!=() [5/7]

bool operator!= ( const float  val) const
inline

Definition at line 913 of file tokenI.hpp.

References pFlow::operator==().

+ Here is the call graph for this function:

◆ operator!=() [6/7]

bool operator!= ( const double  val) const
inline

Definition at line 919 of file tokenI.hpp.

References pFlow::operator==().

+ Here is the call graph for this function:

◆ operator!=() [7/7]

bool operator!= ( const word w) const
inline

Definition at line 925 of file tokenI.hpp.

References pFlow::operator==().

+ Here is the call graph for this function:

◆ printInfo() [1/2]

pFlow::iOstream & printInfo ( iOstream os) const

Definition at line 224 of file tokenIO.cpp.

References pFlow::printTokenInfo().

+ Here is the call graph for this function:

◆ printInfo() [2/2]

std::ostream & printInfo ( std::ostream &  os) const

Definition at line 229 of file tokenIO.cpp.

References pFlow::printTokenInfo().

+ Here is the call graph for this function:

◆ operator=() [10/10]

void operator= ( word )
delete

Friends And Related Function Documentation

◆ operator<< [1/4]

iOstream& operator<< ( iOstream os,
const token tok 
)
friend

◆ operator<< [2/4]

iOstream& operator<< ( iOstream os,
const punctuationToken pt 
)
friend

◆ operator<< [3/4]

std::ostream& operator<< ( std::ostream &  os,
const token tok 
)
friend

◆ operator<< [4/4]

std::ostream& operator<< ( std::ostream &  os,
const punctuationToken pt 
)
friend

Member Data Documentation

◆ data_

content data_
private

The data content (as a union).

Definition at line 181 of file token.hpp.

Referenced by token::boolean(), token::flag(), token::operator=(), token::operator==(), token::swap(), and token::token().

◆ type_

tokenType type_
private

◆ lineNumber_

int32 lineNumber_
private

Line number in the file the token was read from.

Definition at line 187 of file token.hpp.

Referenced by token::operator=(), and token::swap().


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