26 #ifndef MU_PARSER_TOKEN_READER_H
27 #define MU_PARSER_TOKEN_READER_H
66 void SetVarCreator(
facfun_type a_pFactory,
void *pUserData);
103 sfSTART_OF_LINE = noOPT | noBC | noPOSTOP | noASSIGN | noIF | noELSE | noARG_SEP,
112 int ExtractToken(
const char_type *a_szCharSet,
115 int ExtractOperatorToken(
string_type &a_sTok,
int a_iPos)
const;
117 bool IsBuiltIn(token_type &a_Tok);
118 bool IsArgSep(token_type &a_Tok);
119 bool IsEOF(token_type &a_Tok);
120 bool IsInfixOpTok(token_type &a_Tok);
121 bool IsFunTok(token_type &a_Tok);
122 bool IsPostOpTok(token_type &a_Tok);
123 bool IsOprt(token_type &a_Tok);
124 bool IsValTok(token_type &a_Tok);
125 bool IsVarTok(token_type &a_Tok);
126 bool IsStrVarTok(token_type &a_Tok);
127 bool IsUndefVarTok(token_type &a_Tok);
128 bool IsString(token_type &a_Tok);
133 token_type& SaveBeforeReturn(
const token_type &tok);
139 bool m_bIgnoreUndefVar;
149 void *m_pFactoryData;
150 std::list<identfun_type> m_vIdentFun;
154 token_type m_lastTok;
void IgnoreUndefVar(bool bIgnore)
Set Flag that controls behaviour in case of undefined variables being found.
std::map< string_type, std::size_t > strmap_type
Type for assigning a string name to an index in the internal string table.
std::map< string_type, value_type * > varmap_type
Type used for storing variables.
varmap_type & GetUsedVar()
Return a map containing the used variables only.
int GetPos() const
Return the current position of the token reader in the formula string.
ParserTokenReader(ParserBase *a_pParent)
Constructor.
std::map< string_type, ParserCallback > funmap_type
Container for Callback objects.
std::map< string_type, value_type > valmap_type
Type used for storing constants.
token_type ReadNextToken()
Read the next token from the string.
void ReInit()
Reset the token reader to the start of the formula.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
void SetFormula(const string_type &a_strFormula)
Initialize the token Reader.
Namespace for mathematical applications.
string_type::value_type char_type
The character type used by the parser.
Token reader for the ParserBase class.
ParserTokenReader * Clone(ParserBase *a_pParent) const
Create instance of a ParserTokenReader identical with this and return its pointer.
MUP_STRING_TYPE string_type
The stringtype used by the parser.
This file contains the parser token definition.
int(* identfun_type)(const char_type *sExpr, int *nPos, value_type *fVal)
Callback used for functions that identify values in a string.
value_type *(* facfun_type)(const char_type *, void *)
Callback used for variable creation factory functions.
const string_type & GetExpr() const
Return a reference to the formula.
Mathematical expressions parser (base parser engine).
This file contains standard definitions used by the parser.