muParserX 2.0.0
|
Token reader for the ParserXBase class. More...
#include <mpTokenReader.h>
Public Member Functions | |
TokenReader (ParserXBase *a_pParent) | |
Constructor. More... | |
~TokenReader () | |
Destructor (trivial). More... | |
TokenReader * | Clone (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_type & | GetExpr () const |
Return a reference to the formula. More... | |
const var_maptype & | GetUsedVar () 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. | |
Token reader for the ParserXBase class.
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.
mup::TokenReader::~TokenReader | ( | ) |
Destructor (trivial).
\throw nothrow
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.
nothrow |
const string_type & mup::TokenReader::GetExpr | ( | ) | const |
Return a reference to the formula.
\return #m_sExpr \throw nothrow
int mup::TokenReader::GetPos | ( | ) | const |
Return the current position of the token reader in the formula string.
\return #m_nPos \throw nothrow
void mup::TokenReader::ReInit | ( | ) |
Reset the token reader to the start of the formula.
nothrow |
The syntax flags will be reset to a value appropriate for the start of a formula.
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.