muParserX  2.0.0
Public Member Functions | List of all members
mup::TokenReader Class Reference

Token reader for the ParserXBase class. More...

Public Member Functions

 TokenReader (ParserXBase *a_pParent)
 Constructor. More...
 
 ~TokenReader ()
 Destructor (trivial). More...
 
TokenReaderClone (ParserXBase *a_pParent) const
 Create instance of a ParserTokenReader identical with this and return its pointer. More...
 
int GetPos () const
 Return the current position of the token reader in the formula string. More...
 
const string_typeGetExpr () const
 Return a reference to the formula. More...
 
const var_maptypeGetUsedVar () const
 Return a map containing the used variables only.
 
void SetExpr (const string_type &a_sExpr)
 Initialize the token Reader. More...
 
void ReInit ()
 Reset the token reader to the start of the formula. More...
 
ptr_tok_type ReadNextToken ()
 Read the next token from the string.
 

Detailed Description

Token reader for the ParserXBase class.

Constructor & Destructor Documentation

◆ TokenReader()

mup::TokenReader::TokenReader ( ParserXBase a_pParent)

Constructor.

Create a Token reader and bind it to a parser object.

\pre [assert] a_pParser may not be nullptr
\post #m_pParser==a_pParser
\param a_pParent Parent parser object of the token reader.

◆ ~TokenReader()

mup::TokenReader::~TokenReader ( )

Destructor (trivial).

\throw nothrow

Member Function Documentation

◆ Clone()

TokenReader * mup::TokenReader::Clone ( ParserXBase a_pParent) const

Create instance of a ParserTokenReader identical with this and return its pointer.

This is a factory method the calling function must take care of the object destruction.

Returns
A new ParserTokenReader object.
Exceptions
nothrow

◆ GetExpr()

const string_type & mup::TokenReader::GetExpr ( ) const

Return a reference to the formula.

\return #m_sExpr
\throw nothrow

◆ GetPos()

int mup::TokenReader::GetPos ( ) const

Return the current position of the token reader in the formula string.

\return #m_nPos
\throw nothrow

◆ ReInit()

void mup::TokenReader::ReInit ( )

Reset the token reader to the start of the formula.

Postcondition
#m_nPos==0, #m_nSynFlags = noOPT | noBC | noPOSTOP | noSTR
Exceptions
nothrow
See also
ESynCodes

The syntax flags will be reset to a value appropriate for the start of a formula.

◆ SetExpr()

void mup::TokenReader::SetExpr ( const string_type a_sExpr)

Initialize the token Reader.

Sets the expression position index to zero and set Syntax flags to
default for initial parsing.
Here is the call graph for this function:


muParserX documentation - (C) 2010 Ingo Berg