MADNESS
version 0.9
|
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) |
int | GetPos () const |
Return the current position of the token reader in the formula string. More... | |
const string_type & | GetFormula () const |
Return a reference to the formula. More... | |
const varmap_type & | GetUsedVar () const |
Return a map containing the used variables only. More... | |
char_type | GetArgSep () const |
void | IgnoreUndefVar (bool bIgnore) |
Set Flag that contronls behaviour in case of undefined variables beeing 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. More... | |
Token reader for the ParserBase class.
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. |
Referenced by Clone().
void mu::ParserTokenReader::AddValIdent | ( | identfun_type | a_pCallback | ) |
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 |
References ParserTokenReader().
char_type mu::ParserTokenReader::GetArgSep | ( | ) | const |
const string_type & mu::ParserTokenReader::GetFormula | ( | ) | const |
Return a reference to the formula.
nothrow |
int mu::ParserTokenReader::GetPos | ( | ) | const |
Return the current position of the token reader in the formula string.
nothrow |
const varmap_type & mu::ParserTokenReader::GetUsedVar | ( | ) | const |
Return a map containing the used variables only.
void mu::ParserTokenReader::IgnoreUndefVar | ( | bool | bIgnore | ) |
Set Flag that contronls behaviour in case of undefined variables beeing 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 supresses 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.
ParserTokenReader::token_type mu::ParserTokenReader::ReadNextToken | ( | ) |
Read the next token from the string.
References mu::ecUNASSIGNABLE_TOKEN, and mu::ParserBase::ValidNameChars().
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 |
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.
References ReInit().
void mu::ParserTokenReader::SetVarCreator | ( | facfun_type | a_pFactory, |
void * | pUserData | ||
) |
References a_pFactory, and pUserData.