A token holds items read from Istream. More...
Classes | |
class | compound |
Abstract base class for complex tokens. More... | |
class | Compound |
A templated class for holding compound tokens. More... | |
Public Types | |
enum | tokenType : char { UNDEFINED = 0 , PUNCTUATION = char(128) , WORD , FUNCTIONNAME , VARIABLE , STRING , VERBATIMSTRING , INTEGER_32 , INTEGER_64 , UNSIGNED_INTEGER_32 , UNSIGNED_INTEGER_64 , FLOAT_SCALAR , DOUBLE_SCALAR , LONG_DOUBLE_SCALAR , COMPOUND , ERROR } |
Enumeration defining the types of token. 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 = ',' , HASH = '#' , BEGIN_STRING = '"' , END_STRING = BEGIN_STRING , ASSIGN = '=' , ADD = '+' , SUBTRACT = '-' , MULTIPLY = '*' , DIVIDE = '/' } |
Standard punctuation tokens. More... | |
Public Member Functions | |
token () | |
Construct null. More... | |
token (const token &) | |
Copy constructor. More... | |
token (punctuationToken, label lineNumber=0) | |
Construct punctuation character token. More... | |
token (const word &, label lineNumber=0) | |
Construct word token. More... | |
token (const string &, label lineNumber=0) | |
Construct string token. More... | |
token (const verbatimString &, label lineNumber=0) | |
Construct verbatimString token. More... | |
token (const int32_t, label lineNumber=0) | |
Construct 32-bit integer token. More... | |
token (const int64_t, label lineNumber=0) | |
Construct 64-bit integer token. More... | |
token (const uint32_t, label lineNumber=0) | |
Construct unsigned 32-bit integer token. More... | |
token (const uint64_t, label lineNumber=0) | |
Construct unsigned 64-bit integer token. More... | |
token (const floatScalar, label lineNumber=0) | |
Construct floatScalar token. More... | |
token (const doubleScalar, label lineNumber=0) | |
Construct doubleScalar token. More... | |
token (const longDoubleScalar, label lineNumber=0) | |
Construct longDoubleScalar token. More... | |
token (Istream &) | |
Construct from Istream. More... | |
~token () | |
Destructor. More... | |
tokenType | type () const |
tokenType & | type () |
bool | good () const |
bool | undefined () const |
bool | error () const |
const word & | typeName () const |
Return the type name of the token. More... | |
bool | isPunctuation () const |
punctuationToken | pToken () const |
bool | isWord () const |
const word & | wordToken () const |
bool | isFunctionName () const |
const functionName & | functionNameToken () const |
bool | isVariable () const |
const variable & | variableToken () const |
bool | isString () const |
const string & | stringToken () const |
bool | isVerbatimString () const |
const verbatimString & | verbatimStringToken () const |
bool | isAnyString () const |
const string & | anyStringToken () const |
bool | isInteger32 () const |
int32_t | integer32Token () const |
bool | isInteger64 () const |
int64_t | integer64Token () const |
bool | isUnsignedInteger32 () const |
uint32_t | unsignedInteger32Token () const |
bool | isUnsignedInteger64 () const |
uint64_t | unsignedInteger64Token () const |
bool | isLabel () const |
label | labelToken () const |
bool | isULabel () const |
uLabel | uLabelToken () const |
bool | isFloatScalar () const |
floatScalar | floatScalarToken () const |
bool | isDoubleScalar () const |
doubleScalar | doubleScalarToken () const |
bool | isLongDoubleScalar () const |
longDoubleScalar | longDoubleScalarToken () const |
bool | isScalar () const |
scalar | scalarToken () const |
bool | isNumber () const |
scalar | number () const |
bool | isCompound () const |
const compound & | compoundToken () const |
compound & | transferCompoundToken (const Istream &is) |
label | lineNumber () const |
label & | lineNumber () |
void | setBad () |
Set bad. More... | |
InfoProxy< token > | info () const |
Return info proxy. More... | |
void | operator= (const token &) |
void | operator= (const punctuationToken) |
void | operator= (word *) |
void | operator= (const word &) |
void | operator= (functionName *) |
void | operator= (const functionName &) |
void | operator= (variable *) |
void | operator= (const variable &) |
void | operator= (string *) |
void | operator= (const string &) |
void | operator= (verbatimString *) |
void | operator= (const verbatimString &) |
void | operator= (const int32_t) |
void | operator= (const int64_t) |
void | operator= (const uint32_t) |
void | operator= (const uint64_t) |
void | operator= (const floatScalar) |
void | operator= (const doubleScalar) |
void | operator= (const longDoubleScalar) |
void | operator= (compound *) |
bool | operator== (const token &) const |
bool | operator== (const punctuationToken) const |
bool | operator== (const word &) const |
bool | operator== (const functionName &) const |
bool | operator== (const variable &) const |
bool | operator== (const string &) const |
bool | operator== (const verbatimString &) const |
bool | operator== (const int32_t) const |
bool | operator== (const int64_t) const |
bool | operator== (const uint32_t) const |
bool | operator== (const uint64_t) const |
bool | operator== (const floatScalar) const |
bool | operator== (const doubleScalar) const |
bool | operator== (const longDoubleScalar) const |
bool | operator!= (const token &) const |
bool | operator!= (const punctuationToken) const |
bool | operator!= (const word &) const |
bool | operator!= (const functionName &) const |
bool | operator!= (const variable &) const |
bool | operator!= (const string &) const |
bool | operator!= (const verbatimString &) const |
bool | operator!= (const int32_t) const |
bool | operator!= (const int64_t) const |
bool | operator!= (const uint32_t) const |
bool | operator!= (const uint64_t) const |
bool | operator!= (const floatScalar) const |
bool | operator!= (const doubleScalar) const |
bool | operator!= (const longDoubleScalar) const |
Static Public Attributes | |
static token | undefinedToken |
Static undefined token. More... | |
Friends | |
Istream & | operator>> (Istream &, token &) |
Ostream & | operator<< (Ostream &, const token &) |
Ostream & | operator<< (Ostream &, const punctuationToken &) |
ostream & | operator<< (ostream &, const punctuationToken &) |
ostream & | operator<< (ostream &, const InfoProxy< token > &) |
A token holds items read from Istream.
enum tokenType : char |
enum punctuationToken : char |
Copy constructor.
Definition at line 82 of file tokenI.H.
References token::COMPOUND, token::compoundTokenPtr_, token::DOUBLE_SCALAR, token::doubleScalarToken_, token::ERROR, token::FLOAT_SCALAR, token::floatScalarToken_, token::FUNCTIONNAME, token::functionNameTokenPtr_, token::integer32Token_, token::integer64Token_, token::INTEGER_32, token::INTEGER_64, token::LONG_DOUBLE_SCALAR, token::longDoubleScalarTokenPtr_, token::PUNCTUATION, token::punctuationToken_, token::STRING, token::stringTokenPtr_, token::UNDEFINED, token::UNSIGNED_INTEGER_32, token::UNSIGNED_INTEGER_64, token::unsignedInteger32Token_, token::unsignedInteger64Token_, token::VARIABLE, token::variableTokenPtr_, token::VERBATIMSTRING, token::verbatimStringTokenPtr_, token::WORD, and token::wordTokenPtr_.
|
inline |
|
inline |
Construct verbatimString token.
|
inline |
|
inline |
|
inline |
Construct from Istream.
Definition at line 34 of file tokenIO.C.
References Istream::read().
|
inline |
|
inline |
Definition at line 255 of file tokenI.H.
Referenced by Foam::operator<<().
|
inline |
|
inline |
Definition at line 265 of file tokenI.H.
Referenced by Foam::operator>>(), and primitiveEntry::read().
|
inline |
Definition at line 270 of file tokenI.H.
Referenced by Foam::operator>>().
const Foam::word & typeName | ( | ) | const |
Return the type name of the token.
Definition at line 101 of file token.C.
References token::COMPOUND, token::PUNCTUATION, and token::UNDEFINED.
|
inline |
Definition at line 280 of file tokenI.H.
Referenced by blockDescriptor::blockDescriptor(), dictionaryListEntry::dictionaryListEntry(), genericFvPatchField< Type >::genericFvPatchField(), blockVertex::New(), entry::New(), Foam::operator>>(), tokeniser::priority(), Foam::blockMeshTools::read(), IOPosition< CloudType >::readData(), functionEntry::readFuncNameArgs(), and specieCoeffs::setLRhs().
|
inline |
Definition at line 285 of file tokenI.H.
Referenced by blockDescriptor::blockDescriptor(), dictionaryListEntry::dictionaryListEntry(), blockVertex::New(), entry::New(), Foam::operator<<(), Foam::operator>>(), tokeniser::priority(), Foam::blockMeshTools::read(), Istream::readBeginList(), IOPosition< CloudType >::readData(), Istream::readEndList(), and functionEntry::readFuncNameArgs().
|
inline |
Definition at line 298 of file tokenI.H.
Referenced by blockDescriptor::blockDescriptor(), genericFvPatchField< Type >::genericFvPatchField(), genericPointPatchField< Type >::genericPointPatchField(), blockVertex::New(), saturationPressureModel::New(), saturationTemperatureModel::New(), Function1< Type >::New(), Function2< Type >::New(), tokeniser::nextToken(), decomposedBlockData::numBlocks(), sizeGroup::iNew::operator()(), keyType::operator=(), Foam::operator>>(), PatchInjection< CloudType >::PatchInjection(), Foam::blockMeshTools::read(), functionEntry::readFuncNameArgs(), IOobject::readHeader(), blendingMethod::readParameter(), and specieCoeffs::specieCoeffs().
|
inline |
Definition at line 303 of file tokenI.H.
References word::null, and word::typeName.
Referenced by blockDescriptor::blockDescriptor(), genericFvPatchField< Type >::genericFvPatchField(), genericPointPatchField< Type >::genericPointPatchField(), Field< tensor >::map(), blockVertex::New(), tokeniser::nextToken(), decomposedBlockData::numBlocks(), sizeGroup::iNew::operator()(), Foam::operator<<(), keyType::operator=(), Foam::operator>>(), Foam::blockMeshTools::read(), functionEntry::readFuncNameArgs(), IOobject::readHeader(), blendingMethod::readParameter(), and specieCoeffs::specieCoeffs().
|
inline |
Definition at line 316 of file tokenI.H.
Referenced by ifeqEntry::execute(), keyType::operator=(), and Foam::operator>>().
|
inline |
Definition at line 321 of file tokenI.H.
References functionName::null, and functionName::typeName.
Referenced by ifeqEntry::execute(), Foam::operator<<(), keyType::operator=(), and Foam::operator>>().
|
inline |
Definition at line 334 of file tokenI.H.
Referenced by keyType::operator=(), and Foam::operator>>().
|
inline |
Definition at line 339 of file tokenI.H.
References variable::null, and variable::typeName.
Referenced by Foam::operator<<(), keyType::operator=(), and Foam::operator>>().
|
inline |
Definition at line 352 of file tokenI.H.
Referenced by keyType::operator=(), Foam::operator>>(), and functionEntry::readFuncNameArgs().
|
inline |
Definition at line 357 of file tokenI.H.
References string::null, and string::typeName.
Referenced by Foam::operator<<(), keyType::operator=(), Foam::operator>>(), and functionEntry::readFuncNameArgs().
|
inline |
Definition at line 370 of file tokenI.H.
Referenced by Foam::operator>>().
|
inline |
Definition at line 375 of file tokenI.H.
References verbatimString::null, and verbatimString::typeName.
Referenced by Foam::operator<<(), and Foam::operator>>().
|
inline |
Definition at line 400 of file tokenI.H.
References string::null, and string::typeName.
Referenced by functionEntry::readFuncNameArgs().
|
inline |
Definition at line 429 of file tokenI.H.
Referenced by Foam::operator>>().
|
inline |
Definition at line 441 of file tokenI.H.
Referenced by Foam::operator<<(), and Foam::operator>>().
|
inline |
Definition at line 466 of file tokenI.H.
Referenced by Foam::operator>>().
|
inline |
Definition at line 475 of file tokenI.H.
Referenced by Foam::operator<<(), and Foam::operator>>().
|
inline |
Definition at line 500 of file tokenI.H.
Referenced by Foam::operator>>().
|
inline |
Definition at line 512 of file tokenI.H.
Referenced by Foam::operator<<(), and Foam::operator>>().
|
inline |
Definition at line 537 of file tokenI.H.
Referenced by Foam::operator>>().
|
inline |
Definition at line 546 of file tokenI.H.
Referenced by Foam::operator<<(), and Foam::operator>>().
|
inline |
Definition at line 571 of file tokenI.H.
References Foam::labelMax, and Foam::labelMin.
Referenced by dictionaryListEntry::dictionaryListEntry(), genericFvPatchField< Type >::genericFvPatchField(), genericPointPatchField< Type >::genericPointPatchField(), entry::New(), decomposedBlockData::numBlocks(), Foam::operator>>(), PackedList< nBits >::read(), PtrList< T >::read(), Foam::blockMeshTools::read(), and IOPosition< CloudType >::readData().
|
inline |
Definition at line 590 of file tokenI.H.
Referenced by dictionaryListEntry::dictionaryListEntry(), genericFvPatchField< Type >::genericFvPatchField(), genericPointPatchField< Type >::genericPointPatchField(), Foam::operator>>(), PackedList< nBits >::read(), PtrList< T >::read(), Foam::blockMeshTools::read(), and IOPosition< CloudType >::readData().
|
inline |
Definition at line 615 of file tokenI.H.
References Foam::uLabelMax.
|
inline |
|
inline |
Definition at line 664 of file tokenI.H.
Referenced by Foam::operator<<().
|
inline |
Definition at line 683 of file tokenI.H.
Referenced by Foam::operator<<().
|
inline |
Definition at line 702 of file tokenI.H.
Referenced by Foam::operator<<().
|
inline |
Definition at line 745 of file tokenI.H.
References isScalar.
Referenced by CrankNicolsonDdtScheme< Type >::CrankNicolsonDdtScheme(), Foam::operator>>(), dimensionSet::readNoBegin(), blendingMethod::readParameter(), and specieCoeffs::specieCoeffs().
|
inline |
Definition at line 755 of file tokenI.H.
References isScalar.
Referenced by CrankNicolsonDdtScheme< Type >::CrankNicolsonDdtScheme(), genericFvPatchField< Type >::genericFvPatchField(), Foam::operator>>(), dimensionSet::readNoBegin(), blendingMethod::readParameter(), and specieCoeffs::specieCoeffs().
|
inline |
Definition at line 784 of file tokenI.H.
Referenced by genericFvPatchField< Type >::genericFvPatchField(), and genericPointPatchField< Type >::genericPointPatchField().
|
inline |
Definition at line 789 of file tokenI.H.
Referenced by genericFvPatchField< Type >::genericFvPatchField(), dictionary::lookupCompoundScoped(), and Foam::operator<<().
Foam::token::compound & transferCompoundToken | ( | const Istream & | is | ) |
Definition at line 128 of file token.C.
References Foam::abort(), Foam::FatalIOError, and FatalIOErrorInFunction.
|
inline |
Definition at line 803 of file tokenI.H.
Referenced by Foam::operator<<(), UIPstream::read(), ISstream::read(), and ITstream::read().
|
inline |
|
inline |
Set bad.
Definition at line 814 of file tokenI.H.
References clear().
Referenced by UIPstream::read(), and ISstream::read().
Return info proxy.
Used to print token information to a stream
Definition at line 422 of file token.H.
Referenced by blockDescriptor::blockDescriptor(), dictionaryListEntry::dictionaryListEntry(), blockVertex::New(), Foam::operator>>(), Foam::blockMeshTools::read(), Istream::readBegin(), Istream::readBeginList(), IOPosition< CloudType >::readData(), Istream::readEnd(), Istream::readEndList(), blendingMethod::readParameter(), and specieCoeffs::specieCoeffs().
|
inline |
Definition at line 823 of file tokenI.H.
References clear(), token::compoundTokenPtr_, token::doubleScalarToken_, token::ERROR, token::floatScalarToken_, token::functionNameTokenPtr_, token::integer32Token_, token::integer64Token_, token::longDoubleScalarTokenPtr_, token::punctuationToken_, token::stringTokenPtr_, token::UNDEFINED, token::unsignedInteger32Token_, token::unsignedInteger64Token_, token::variableTokenPtr_, token::verbatimStringTokenPtr_, and token::wordTokenPtr_.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 1023 of file tokenI.H.
References token::compoundTokenPtr_, token::doubleScalarToken_, Foam::equal(), token::ERROR, token::floatScalarToken_, token::functionNameTokenPtr_, token::integer32Token_, token::integer64Token_, token::longDoubleScalarTokenPtr_, token::punctuationToken_, token::stringTokenPtr_, token::UNDEFINED, token::unsignedInteger32Token_, token::unsignedInteger64Token_, token::variableTokenPtr_, token::verbatimStringTokenPtr_, and token::wordTokenPtr_.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 1138 of file tokenI.H.
References Foam::equal(), and s().
|
inline |
Definition at line 1143 of file tokenI.H.
References Foam::equal(), and s().
|
inline |
Definition at line 1148 of file tokenI.H.
References Foam::equal(), and s().
|
inline |
Definition at line 1156 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1161 of file tokenI.H.
References Foam::operator==(), and p.
|
inline |
Definition at line 1166 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1171 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1176 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1181 of file tokenI.H.
References Foam::operator==(), and s().
|
inline |
Definition at line 1186 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1191 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1196 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1201 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1206 of file tokenI.H.
References Foam::operator==().
|
inline |
Definition at line 1211 of file tokenI.H.
References Foam::operator==(), and s().
|
inline |
Definition at line 1216 of file tokenI.H.
References Foam::operator==(), and s().
|
inline |
Definition at line 1221 of file tokenI.H.
References Foam::operator==(), and s().
|
friend |
|
friend |
|
static |
Static undefined token.
Definition at line 240 of file token.H.
Referenced by Istream::peekBack(), and ITstream::read().
punctuationToken punctuationToken_ |
Definition at line 256 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
word* wordTokenPtr_ |
Definition at line 257 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
functionName* functionNameTokenPtr_ |
Definition at line 258 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
variable* variableTokenPtr_ |
Definition at line 259 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
string* stringTokenPtr_ |
Definition at line 260 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
verbatimString* verbatimStringTokenPtr_ |
Definition at line 261 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
int32_t integer32Token_ |
Definition at line 262 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
int64_t integer64Token_ |
Definition at line 263 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
uint32_t unsignedInteger32Token_ |
Definition at line 264 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
uint64_t unsignedInteger64Token_ |
Definition at line 265 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
floatScalar floatScalarToken_ |
Definition at line 266 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
doubleScalar doubleScalarToken_ |
Definition at line 267 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
longDoubleScalar* longDoubleScalarTokenPtr_ |
Definition at line 268 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().
|
mutable |
Definition at line 269 of file token.H.
Referenced by Foam::operator<<(), token::operator=(), token::operator==(), and token::token().