OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

token Class Reference

Collaboration diagram for token:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 69 of file token.H.


Public Types

enum  tokenType {
  UNDEFINED, PUNCTUATION, WORD, STRING,
  LABEL, FLOAT_SCALAR, DOUBLE_SCALAR, COMPOUND,
  ERROR
}
 Enumeration defining the types of token. More...
enum  punctuationToken {
  NULL_TOKEN = '\0', SPACE = ' ', TAB = '\t', NL = '\n',
  END_STATEMENT = ';', BEGIN_LIST = '(', END_LIST = ')', BEGIN_SQR = '[',
  END_SQR = ']', BEGIN_BLOCK = '{', END_BLOCK = '}', COLON = ':',
  COMMA = ',', BEGIN_STRING = '"', END_STRING = '"', ASSIGN = '=',
  ADD = '+', SUBTRACT = '-', MULTIPLY = '*', DIVIDE = '/'
}
 Standard punctuation tokens. More...

Public Member Functions

 token ()
 Construct null.
 token (const token &)
 Construct as copy.
 token (punctuationToken p, label lineNumber=0)
 Construct punctuation character token.
 token (const word &w, label lineNumber=0)
 Construct word token.
 token (const string &s, label lineNumber=0)
 Construct string token.
 token (const label, label lineNumber=0)
 Construct label token.
 token (const floatScalar s, label lineNumber=0)
 Construct floatScalar token.
 token (const doubleScalar s, label lineNumber=0)
 Construct doubleScalar token.
 token (Istream &)
 Construct from Istream.
 ~token ()
tokenType type () const
bool good () const
bool undefined () const
bool error () const
bool isPunctuation () const
punctuationToken pToken () const
bool isWord () const
const word & wordToken () const
bool isString () const
const string & stringToken () const
bool isLabel () const
label labelToken () const
bool isFloatScalar () const
floatScalar floatScalarToken () const
bool isDoubleScalar () const
doubleScalar doubleScalarToken () const
bool isScalar () const
scalar scalarToken () const
bool isNumber () const
scalar number () const
bool isCompound () const
const compound & compoundToken () const
compound & transferCompoundToken ()
label lineNumber () const
label & lineNumber ()
void setBad ()
 Set bad.
InfoProxy< token > info () const
 Return info proxy.
void operator= (const token &)
void operator= (const punctuationToken)
void operator= (word *)
void operator= (const word &)
void operator= (string *)
void operator= (const string &)
void operator= (const label)
void operator= (const floatScalar)
void operator= (const doubleScalar)
void operator= (compound *)
bool operator== (const token &) const
bool operator== (const punctuationToken) const
bool operator== (const word &) const
bool operator== (const string &) const
bool operator== (const label) const
bool operator== (const floatScalar) const
bool operator== (const doubleScalar) const
bool operator!= (const token &) const
bool operator!= (const punctuationToken) const
bool operator!= (const word &) const
bool operator!= (const string &) const
bool operator!= (const label) const
bool operator!= (const floatScalar) const
bool operator!= (const doubleScalar) const

Static Public Attributes

static token undefinedToken
 Static undefined token.

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 > &)

Classes

class  Compound
class  compound
 Abstract base class for complex tokens. More...

Member Enumeration Documentation

enum tokenType

Enumeration defining the types of token.

Enumerator:
UNDEFINED 
PUNCTUATION 
WORD 
STRING 
LABEL 
FLOAT_SCALAR 
DOUBLE_SCALAR 
COMPOUND 
ERROR 

Definition at line 75 of file token.H.

Standard punctuation tokens.

Enumerator:
NULL_TOKEN 
SPACE 
TAB 
NL 
END_STATEMENT 
BEGIN_LIST 
END_LIST 
BEGIN_SQR 
END_SQR 
BEGIN_BLOCK 
END_BLOCK 
COLON 
COMMA 
BEGIN_STRING 
END_STRING 
ASSIGN 
ADD 
SUBTRACT 
MULTIPLY 
DIVIDE 

Definition at line 92 of file token.H.


Constructor & Destructor Documentation

token (  )  [inline]

Construct null.

Definition at line 71 of file tokenI.H.

token ( punctuationToken  p,
label  lineNumber = 0 
) [inline]

Construct punctuation character token.

Definition at line 123 of file tokenI.H.

token ( const word &  w,
label  lineNumber = 0 
) [inline]

Construct word token.

Definition at line 131 of file tokenI.H.

token ( const string &  s,
label  lineNumber = 0 
) [inline]

Construct string token.

Definition at line 139 of file tokenI.H.

token ( const   label,
label  lineNumber = 0 
) [inline]

Construct label token.

Definition at line 147 of file tokenI.H.

token ( const floatScalar  s,
label  lineNumber = 0 
) [inline]

Construct floatScalar token.

Definition at line 155 of file tokenI.H.

token ( const doubleScalar  s,
label  lineNumber = 0 
) [inline]

Construct doubleScalar token.

Definition at line 163 of file tokenI.H.

token ( Istream &   ) 

Construct from Istream.

~token (  )  [inline]

Definition at line 174 of file tokenI.H.


Member Function Documentation

token::tokenType type (  )  const [inline]

Definition at line 182 of file tokenI.H.

References token::ERROR, and token::UNDEFINED.

bool good (  )  const [inline]

Definition at line 187 of file tokenI.H.

References token::UNDEFINED.

bool undefined (  )  const [inline]

Definition at line 192 of file tokenI.H.

References token::ERROR.

bool error (  )  const [inline]

Definition at line 197 of file tokenI.H.

References token::PUNCTUATION.

bool isPunctuation (  )  const [inline]

Definition at line 202 of file tokenI.H.

References token::PUNCTUATION.

token::punctuationToken pToken (  )  const [inline]

Definition at line 207 of file tokenI.H.

bool isWord (  )  const [inline]

Definition at line 220 of file tokenI.H.

References token::WORD.

const word & wordToken (  )  const [inline]

Definition at line 225 of file tokenI.H.

Referenced by token::operator==().

Here is the caller graph for this function:

bool isString (  )  const [inline]

Definition at line 238 of file tokenI.H.

References token::STRING.

const string & stringToken (  )  const [inline]

Definition at line 243 of file tokenI.H.

Referenced by token::operator==().

Here is the caller graph for this function:

bool isLabel (  )  const [inline]

Definition at line 256 of file tokenI.H.

References token::LABEL.

label labelToken (  )  const [inline]

Definition at line 261 of file tokenI.H.

bool isFloatScalar (  )  const [inline]

Definition at line 274 of file tokenI.H.

References token::FLOAT_SCALAR.

floatScalar floatScalarToken (  )  const [inline]

Definition at line 279 of file tokenI.H.

bool isDoubleScalar (  )  const [inline]

Definition at line 293 of file tokenI.H.

References token::DOUBLE_SCALAR.

doubleScalar doubleScalarToken (  )  const [inline]

Definition at line 298 of file tokenI.H.

bool isScalar (  )  const [inline]

Definition at line 312 of file tokenI.H.

References token::FLOAT_SCALAR.

scalar scalarToken (  )  const [inline]

Definition at line 317 of file tokenI.H.

bool isNumber (  )  const [inline]

Definition at line 334 of file tokenI.H.

References token::LABEL.

scalar number (  )  const [inline]

Definition at line 339 of file tokenI.H.

bool isCompound (  )  const [inline]

Definition at line 356 of file tokenI.H.

References token::COMPOUND.

const token::compound & compoundToken (  )  const [inline]

Definition at line 361 of file tokenI.H.

compound& transferCompoundToken (  ) 

label lineNumber (  )  const [inline]

Definition at line 375 of file tokenI.H.

label & lineNumber (  )  [inline]

Definition at line 380 of file tokenI.H.

References token::ERROR.

void setBad (  )  [inline]

Set bad.

Definition at line 386 of file tokenI.H.

References token::type_.

InfoProxy<token> info (  )  const [inline]

Return info proxy.

Used to print token information to a stream

Definition at line 365 of file token.H.

void operator= ( const   punctuationToken  )  [inline]

Definition at line 441 of file tokenI.H.

void operator= ( word *   )  [inline]

Definition at line 448 of file tokenI.H.

void operator= ( const word &   )  [inline]

Definition at line 455 of file tokenI.H.

References token::STRING.

void operator= ( string *   )  [inline]

Definition at line 460 of file tokenI.H.

void operator= ( const string &   )  [inline]

Definition at line 467 of file tokenI.H.

References token::LABEL.

void operator= ( const   label  )  [inline]

Definition at line 472 of file tokenI.H.

void operator= ( const   floatScalar  )  [inline]

Definition at line 479 of file tokenI.H.

void operator= ( const   doubleScalar  )  [inline]

Definition at line 486 of file tokenI.H.

void operator= ( compound *   )  [inline]

Definition at line 493 of file tokenI.H.

bool operator== ( const token &   )  const [inline]

Definition at line 501 of file tokenI.H.

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

Here is the caller graph for this function:

bool operator== ( const   punctuationToken  )  const [inline]

Definition at line 541 of file tokenI.H.

References token::WORD, and token::wordToken().

Here is the call graph for this function:

bool operator== ( const word &   )  const [inline]

Definition at line 546 of file tokenI.H.

References token::STRING, and token::stringToken().

Here is the call graph for this function:

bool operator== ( const string &   )  const [inline]

Definition at line 551 of file tokenI.H.

References token::LABEL.

bool operator== ( const   label  )  const [inline]

Definition at line 556 of file tokenI.H.

References Foam::equal(), and token::FLOAT_SCALAR.

Here is the call graph for this function:

bool operator== ( const   floatScalar  )  const [inline]

Definition at line 561 of file tokenI.H.

References token::DOUBLE_SCALAR, and Foam::equal().

Here is the call graph for this function:

bool operator== ( const   doubleScalar  )  const [inline]

Definition at line 566 of file tokenI.H.

References token::operator==().

Here is the call graph for this function:

bool operator!= ( const token &   )  const [inline]

Definition at line 571 of file tokenI.H.

References token::operator==().

Here is the call graph for this function:

bool operator!= ( const   punctuationToken  )  const [inline]

Definition at line 576 of file tokenI.H.

References token::operator==().

Here is the call graph for this function:

bool operator!= ( const word &   )  const [inline]

Definition at line 581 of file tokenI.H.

References token::operator==().

Here is the call graph for this function:

bool operator!= ( const string &   )  const [inline]

Definition at line 586 of file tokenI.H.

References token::operator==().

Here is the call graph for this function:

bool operator!= ( const   label  )  const [inline]

Definition at line 601 of file tokenI.H.

bool operator!= ( const   floatScalar  )  const [inline]

Definition at line 591 of file tokenI.H.

References token::operator==().

Here is the call graph for this function:

bool operator!= ( const   doubleScalar  )  const [inline]

Definition at line 596 of file tokenI.H.

References token::operator==().

Here is the call graph for this function:


Friends And Related Function Documentation

Istream& operator>> ( Istream &  ,
token &   
) [friend]

Ostream& operator<< ( Ostream &  ,
const token &   
) [friend]

Ostream& operator<< ( Ostream &  ,
const punctuationToken &   
) [friend]

ostream& operator<< ( ostream &  ,
const punctuationToken &   
) [friend]

ostream& operator<< ( ostream &  ,
const InfoProxy< token > &   
) [friend]


Member Data Documentation

Static undefined token.

Definition at line 239 of file token.H.


The documentation for this class was generated from the following files:
  • src/OpenFOAM/db/IOstreams/token/token.H
  • src/OpenFOAM/db/IOstreams/token/tokenI.H
Copyright © 2000-2007 OpenCFD Ltd