muParser API -
1.35
|
Token reader for the ParserBase class. More...
#include <muParserTokenReader.h>
Public Member Functions | |
ParserTokenReader (ParserBase *a_pParent) | |
Constructor. More... | |
ParserTokenReader * | Clone (ParserBase *a_pParent) const |
Create instance of a ParserTokenReader identical with this and return its pointer. More... | |
void | AddValIdent (identfun_type a_pCallback) |
void | SetVarCreator (facfun_type a_pFactory, void *pUserData) |
void | SetFormula (const string_type &a_strFormula) |
Initialize the token Reader. More... | |
void | SetArgSep (char_type cArgSep) |
bool | HasVarCreator () const |
Check whether a variable factory is installed. 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... | |
varmap_type & | GetUsedVar () |
Return a map containing the used variables only. | |
char_type | GetArgSep () const |
void | IgnoreUndefVar (bool bIgnore) |
Set Flag that controls behaviour in case of undefined variables being found. More... | |
void | ReInit () |
Reset the token reader to the start of the formula. More... | |
token_type | ReadNextToken () |
Read the next token from the string. | |
Token reader for the ParserBase class.
Definition at line 54 of file muParserTokenReader.h.
mu::ParserTokenReader::ParserTokenReader | ( | ParserBase * | a_pParent | ) |
Constructor.
Create a Token reader and bind it to a parser object.
a_pParent | Parent parser object of the token reader. |
Definition at line 120 of file muParserTokenReader.cpp.
Referenced by Clone().
ParserTokenReader * mu::ParserTokenReader::Clone | ( | ParserBase * | 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 |
Definition at line 155 of file muParserTokenReader.cpp.
const string_type & mu::ParserTokenReader::GetExpr | ( | ) | const |
Return a reference to the formula.
nothrow |
Definition at line 205 of file muParserTokenReader.cpp.
int mu::ParserTokenReader::GetPos | ( | ) | const |
Return the current position of the token reader in the formula string.
nothrow |
Definition at line 194 of file muParserTokenReader.cpp.
|
inline |
Check whether a variable factory is installed.
Variable factories automatically create new variables when a unknown variable is found in an expression.
Definition at line 74 of file muParserTokenReader.h.
void mu::ParserTokenReader::IgnoreUndefVar | ( | bool | bIgnore | ) |
Set Flag that controls behaviour in case of undefined variables being found.
If true, the parser does not throw an exception if an undefined variable is found. otherwise it does. This variable is used internally only! It suppresses a "undefined variable" exception in GetUsedVar(). Those function should return a complete list of variables including those the are not defined by the time of it's call.
Definition at line 238 of file muParserTokenReader.cpp.
void mu::ParserTokenReader::ReInit | ( | ) |
Reset the token reader to the start of the formula.
The syntax flags will be reset to a value appropriate for the start of a formula.
nothrow |
Definition at line 252 of file muParserTokenReader.cpp.
Referenced by SetFormula().
void mu::ParserTokenReader::SetFormula | ( | const string_type & | a_strFormula | ) |
Initialize the token Reader.
Sets the formula position index to zero and set Syntax flags to default for initial formula parsing.
Definition at line 223 of file muParserTokenReader.cpp.