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 keyType &, label lineNumber=0) | |
| Construct keyType 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 |
Construct keyType token.
Definition at line 181 of file tokenI.H.
References keyType::FUNCTIONNAME, token::FUNCTIONNAME, token::functionNameTokenPtr_, keyType::PATTERN, token::STRING, token::stringTokenPtr_, keyType::Type(), keyType::UNDEFINED, token::UNDEFINED, keyType::VARIABLE, token::VARIABLE, token::variableTokenPtr_, keyType::WORD, token::WORD, and token::wordTokenPtr_.

|
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 299 of file tokenI.H.
Referenced by Foam::operator<<(), and Ostream::write().

|
inline |
|
inline |
Definition at line 309 of file tokenI.H.
Referenced by codeBlockEntry::execute(), Foam::operator>>(), primitiveEntry::read(), functionEntry::readArgOrList(), dictionary::tokens(), and OTstream::write().

| 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 324 of file tokenI.H.
Referenced by blockDescriptor::blockDescriptor(), dictionaryListEntry::dictionaryListEntry(), genericFvPatchField< Type >::genericFvPatchField(), blockVertex::New(), entry::New(), Foam::operator>>(), tokeniser::priority(), Foam::blockMeshTools::read(), functionEntry::readArgList(), functionEntry::readArgOrList(), IOPosition< CloudType >::readData(), specieCoeffs::setLRhs(), and Foam::units::table().

|
inline |
Definition at line 329 of file tokenI.H.
Referenced by blockDescriptor::blockDescriptor(), dictionaryListEntry::dictionaryListEntry(), blockVertex::New(), entry::New(), Foam::operator<<(), Foam::operator>>(), tokeniser::priority(), Foam::blockMeshTools::read(), functionEntry::readArgList(), functionEntry::readArgOrList(), Istream::readBeginList(), IOPosition< CloudType >::readData(), Istream::readEndList(), Foam::units::table(), and Ostream::write().

|
inline |
Definition at line 342 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(), keyType::operator=(), Foam::operator>>(), PatchInjection< CloudType >::PatchInjection(), Foam::blockMeshTools::read(), functionEntry::readFuncNameArgList(), IOobject::readHeader(), blendingMethod::readParameter(), and specieCoeffs::specieCoeffs().

|
inline |
Definition at line 347 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(), saturationPressureModel::New(), tokeniser::nextToken(), decomposedBlockData::numBlocks(), Foam::operator<<(), keyType::operator=(), Foam::operator>>(), Foam::blockMeshTools::read(), functionEntry::readFuncNameArgList(), IOobject::readHeader(), blendingMethod::readParameter(), specieCoeffs::specieCoeffs(), Foam::units::table(), and Ostream::write().

|
inline |
Definition at line 360 of file tokenI.H.
Referenced by ifeqEntry::execute(), codeBlockEntry::execute(), keyType::operator=(), and Foam::operator>>().

|
inline |
Definition at line 365 of file tokenI.H.
References functionName::null, and functionName::typeName.
Referenced by ifeqEntry::execute(), codeBlockEntry::execute(), Foam::operator<<(), keyType::operator=(), Foam::operator>>(), and Ostream::write().

|
inline |
Definition at line 378 of file tokenI.H.
Referenced by keyType::operator=(), and Foam::operator>>().

|
inline |
Definition at line 383 of file tokenI.H.
References variable::null, and variable::typeName.
Referenced by Foam::operator<<(), keyType::operator=(), Foam::operator>>(), and Ostream::write().

|
inline |
Definition at line 396 of file tokenI.H.
Referenced by streamEntry::codeString(), keyType::operator=(), Foam::operator>>(), functionEntry::readArgList(), functionEntry::readFileNameArgList(), functionEntry::readFuncNameArgList(), and streamEntry::resultStream().

|
inline |
Definition at line 401 of file tokenI.H.
References string::null, and string::typeName.
Referenced by Foam::operator<<(), keyType::operator=(), Foam::operator>>(), and Ostream::write().

|
inline |
Definition at line 414 of file tokenI.H.
Referenced by streamEntry::codeString(), Foam::operator>>(), and streamEntry::resultStream().

|
inline |
Definition at line 419 of file tokenI.H.
References verbatimString::null, and verbatimString::typeName.
Referenced by Foam::operator<<(), Foam::operator>>(), and Ostream::write().

|
inline |
Definition at line 444 of file tokenI.H.
References string::null, and string::typeName.
Referenced by streamEntry::codeString(), functionEntry::readArgList(), and streamEntry::resultStream().

|
inline |
Definition at line 473 of file tokenI.H.
Referenced by Foam::operator>>().

|
inline |
Definition at line 485 of file tokenI.H.
Referenced by Foam::operator<<(), Foam::operator>>(), and Ostream::write().

|
inline |
Definition at line 510 of file tokenI.H.
Referenced by Foam::operator>>().

|
inline |
Definition at line 519 of file tokenI.H.
Referenced by Foam::operator<<(), Foam::operator>>(), and Ostream::write().

|
inline |
Definition at line 544 of file tokenI.H.
Referenced by Foam::operator>>().

|
inline |
Definition at line 556 of file tokenI.H.
Referenced by Foam::operator<<(), Foam::operator>>(), and Ostream::write().

|
inline |
Definition at line 581 of file tokenI.H.
Referenced by codeBlockDictEntry::codeBlockDictEntry(), codeBlockStreamEntry::codeBlockStreamEntry(), and Foam::operator>>().

|
inline |
Definition at line 590 of file tokenI.H.
Referenced by codeBlockDictEntry::codeBlockDictEntry(), codeBlockStreamEntry::codeBlockStreamEntry(), Foam::operator<<(), and Foam::operator>>().

|
inline |
Definition at line 615 of file tokenI.H.
References Foam::labelMax, and Foam::labelMin.
Referenced by codeBlockDictEntry::codeBlockDictEntry(), codeBlockStreamEntry::codeBlockStreamEntry(), 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 634 of file tokenI.H.
Referenced by codeBlockDictEntry::codeBlockDictEntry(), codeBlockStreamEntry::codeBlockStreamEntry(), 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 659 of file tokenI.H.
References Foam::uLabelMax.
|
inline |
|
inline |
Definition at line 708 of file tokenI.H.
Referenced by Foam::operator<<().

|
inline |
Definition at line 727 of file tokenI.H.
Referenced by Foam::operator<<().

|
inline |
Definition at line 746 of file tokenI.H.
Referenced by Foam::operator<<().

|
inline |
Definition at line 789 of file tokenI.H.
References isScalar.
Referenced by CrankNicolsonDdtScheme< Type >::CrankNicolsonDdtScheme(), Foam::operator>>(), dimensionSet::readNoBeginOrEnd(), blendingMethod::readParameter(), specieCoeffs::specieCoeffs(), and Foam::units::table().

|
inline |
Definition at line 799 of file tokenI.H.
References isScalar.
Referenced by CrankNicolsonDdtScheme< Type >::CrankNicolsonDdtScheme(), genericFvPatchField< Type >::genericFvPatchField(), Foam::operator>>(), blendingMethod::readParameter(), specieCoeffs::specieCoeffs(), and Foam::units::table().

|
inline |
Definition at line 828 of file tokenI.H.
Referenced by genericFvPatchField< Type >::genericFvPatchField(), and genericPointPatchField< Type >::genericPointPatchField().

|
inline |
Definition at line 833 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 847 of file tokenI.H.
Referenced by streamEntry::codeString(), codeBlockEntry::execute(), tokeniser::nextToken(), Foam::operator<<(), Istream::putBack(), UIPstream::read(), ISstream::read(), ITstream::read(), functionEntry::readArgList(), and streamEntry::resultStream().

|
inline |
|
inline |
Set bad.
Definition at line 858 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 426 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 867 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 1067 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 1182 of file tokenI.H.
References Foam::equal(), and s().

|
inline |
Definition at line 1187 of file tokenI.H.
References Foam::equal(), and s().

|
inline |
Definition at line 1192 of file tokenI.H.
References Foam::equal(), and s().

|
inline |
Definition at line 1200 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1205 of file tokenI.H.
References Foam::operator==(), and p.

|
inline |
Definition at line 1210 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1215 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1220 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1225 of file tokenI.H.
References Foam::operator==(), and s().

|
inline |
Definition at line 1230 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1235 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1240 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1245 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1250 of file tokenI.H.
References Foam::operator==().

|
inline |
Definition at line 1255 of file tokenI.H.
References Foam::operator==(), and s().

|
inline |
Definition at line 1260 of file tokenI.H.
References Foam::operator==(), and s().

|
inline |
Definition at line 1265 of file tokenI.H.
References Foam::operator==(), and s().

|
friend |
|
friend |
|
static |
Static undefined token.
Definition at line 241 of file token.H.
Referenced by Istream::peekBack(), and ITstream::read().
| punctuationToken punctuationToken_ |
Definition at line 257 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| word* wordTokenPtr_ |
Definition at line 258 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| functionName* functionNameTokenPtr_ |
Definition at line 259 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| variable* variableTokenPtr_ |
Definition at line 260 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| string* stringTokenPtr_ |
Definition at line 261 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| verbatimString* verbatimStringTokenPtr_ |
Definition at line 262 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| int32_t integer32Token_ |
Definition at line 263 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| int64_t integer64Token_ |
Definition at line 264 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| uint32_t unsignedInteger32Token_ |
Definition at line 265 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| uint64_t unsignedInteger64Token_ |
Definition at line 266 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| floatScalar floatScalarToken_ |
Definition at line 267 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| doubleScalar doubleScalarToken_ |
Definition at line 268 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
| longDoubleScalar* longDoubleScalarTokenPtr_ |
Definition at line 269 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().
|
mutable |
Definition at line 270 of file token.H.
Referenced by token::operator=(), token::operator==(), and token::token().