OpenFOAM logo
Open Source CFD Toolkit

token Class Reference

Collaboration diagram for token:

Collaboration graph
[legend]
List of all members.

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 wordwordToken () const
bool isString () const
const stringstringToken () 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 compoundcompoundToken () const
compoundtransferCompoundToken ()
label lineNumber () const
labellineNumber ()
void setBad ()
 Set bad.
InfoProxy< tokeninfo () 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

token undefinedToken
 Static undefined token.

Friends

Istreamoperator>> (Istream &, token &)
Ostreamoperator<< (Ostream &, const token &)
Ostreamoperator<< (Ostream &, const punctuationToken &)
ostream & operator<< (ostream &, const punctuationToken &)
ostream & operator<< (ostream &, const InfoProxy< token > &)

Member Enumeration Documentation

enum punctuationToken
 

Standard punctuation tokens.

Enumeration values:
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.

enum tokenType
 

Enumeration defining the types of token.

Enumeration values:
UNDEFINED 
PUNCTUATION 
WORD 
STRING 
LABEL 
FLOAT_SCALAR 
DOUBLE_SCALAR 
COMPOUND 
ERROR 

Definition at line 75 of file token.H.


Constructor & Destructor Documentation

token  )  [inline]
 

Construct null.

Definition at line 71 of file tokenI.H.

token const token  )  [inline]
 

Construct as copy.

Definition at line 78 of file tokenI.H.

References token::COMPOUND, token::compoundTokenPtr_, token::DOUBLE_SCALAR, token::doubleScalarToken_, token::FLOAT_SCALAR, token::floatScalarToken_, token::LABEL, token::labelToken_, token::PUNCTUATION, token::punctuationToken_, token::STRING, token::stringTokenPtr_, token::WORD, and token::wordTokenPtr_.

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

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

Definition at line 361 of file tokenI.H.

doubleScalar doubleScalarToken  )  const [inline]
 

Definition at line 298 of file tokenI.H.

bool error  )  const [inline]
 

Definition at line 197 of file tokenI.H.

floatScalar floatScalarToken  )  const [inline]
 

Definition at line 279 of file tokenI.H.

bool good  )  const [inline]
 

Definition at line 187 of file tokenI.H.

InfoProxy<token> info  )  const [inline]
 

Return info proxy.

Used to print token information to a stream

Definition at line 365 of file token.H.

bool isCompound  )  const [inline]
 

Definition at line 356 of file tokenI.H.

bool isDoubleScalar  )  const [inline]
 

Definition at line 293 of file tokenI.H.

References Foam::doubleScalar.

bool isFloatScalar  )  const [inline]
 

Definition at line 274 of file tokenI.H.

References Foam::floatScalar.

bool isLabel  )  const [inline]
 

Definition at line 256 of file tokenI.H.

References Foam::label.

bool isNumber  )  const [inline]
 

Definition at line 334 of file tokenI.H.

bool isPunctuation  )  const [inline]
 

Definition at line 202 of file tokenI.H.

bool isScalar  )  const [inline]
 

Definition at line 312 of file tokenI.H.

bool isString  )  const [inline]
 

Definition at line 238 of file tokenI.H.

bool isWord  )  const [inline]
 

Definition at line 220 of file tokenI.H.

label labelToken  )  const [inline]
 

Definition at line 261 of file tokenI.H.

label & lineNumber  )  [inline]
 

Definition at line 380 of file tokenI.H.

label lineNumber  )  const [inline]
 

Definition at line 375 of file tokenI.H.

References Foam::label.

scalar number  )  const [inline]
 

Definition at line 339 of file tokenI.H.

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:

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   label  )  const [inline]
 

Definition at line 601 of file tokenI.H.

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 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   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 token  )  const [inline]
 

Definition at line 571 of file tokenI.H.

References token::operator==(), and p.

Here is the call graph for this function:

void operator= compound  )  [inline]
 

Definition at line 493 of file tokenI.H.

void operator= const   doubleScalar  )  [inline]
 

Definition at line 486 of file tokenI.H.

void operator= const   floatScalar  )  [inline]
 

Definition at line 479 of file tokenI.H.

void operator= const   label  )  [inline]
 

Definition at line 472 of file tokenI.H.

void operator= const string  )  [inline]
 

Definition at line 467 of file tokenI.H.

void operator= string  )  [inline]
 

Definition at line 460 of file tokenI.H.

void operator= const word  )  [inline]
 

Definition at line 455 of file tokenI.H.

void operator= word  )  [inline]
 

Definition at line 448 of file tokenI.H.

void operator= const   punctuationToken  )  [inline]
 

Definition at line 441 of file tokenI.H.

void operator= const token  )  [inline]
 

Definition at line 395 of file tokenI.H.

References token::COMPOUND, token::compoundTokenPtr_, token::DOUBLE_SCALAR, token::doubleScalarToken_, token::FLOAT_SCALAR, token::floatScalarToken_, token::LABEL, token::labelToken_, token::PUNCTUATION, token::punctuationToken_, token::STRING, token::stringTokenPtr_, token::WORD, and token::wordTokenPtr_.

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   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   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 string  )  const [inline]
 

Definition at line 551 of file tokenI.H.

References token::LABEL.

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   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 token  )  const [inline]
 

Definition at line 501 of file tokenI.H.

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

token::punctuationToken pToken  )  const [inline]
 

Definition at line 207 of file tokenI.H.

scalar scalarToken  )  const [inline]
 

Definition at line 317 of file tokenI.H.

void setBad  )  [inline]
 

Set bad.

Definition at line 386 of file tokenI.H.

References token::type_.

const string & stringToken  )  const [inline]
 

Definition at line 243 of file tokenI.H.

Referenced by token::operator==().

compound& transferCompoundToken  ) 
 

token::tokenType type  )  const [inline]
 

Definition at line 182 of file tokenI.H.

References token::ERROR.

bool undefined  )  const [inline]
 

Definition at line 192 of file tokenI.H.

const word & wordToken  )  const [inline]
 

Definition at line 225 of file tokenI.H.

Referenced by token::operator==().


Friends And Related Function Documentation

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

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

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

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

Istream& operator>> Istream ,
token
[friend]
 


Member Data Documentation

token undefinedToken [static]
 

Static undefined token.

Definition at line 239 of file token.H.


The documentation for this class was generated from the following files:
For further information go to www.openfoam.org