30 #include "muParserTemplateMagic.h"
61 stream.imbue(Parser::s_locale);
63 stringstream_type::pos_type iEnd = stream.tellg();
65 if (iEnd == (stringstream_type::pos_type) - 1)
99 DefineNameChars(
_T(
"0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"));
100 DefineOprtChars(
_T(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-*^/?<>=#!$%&|~'_{}"));
178 void Parser::OnDetectVar(
string_type* ,
int& ,
int& )
224 *a_Var = a_fPos + 2 * fEpsilon; f[0] =
Eval();
225 *a_Var = a_fPos + 1 * fEpsilon; f[1] =
Eval();
226 *a_Var = a_fPos - 1 * fEpsilon; f[2] =
Eval();
227 *a_Var = a_fPos - 2 * fEpsilon; f[3] =
Eval();
230 fRes = (-f[0] + 8 * f[1] - 8 * f[2] + f[3]) / (12 * fEpsilon);
void DefineInfixOprtChars(const char_type *a_szCharset)
Define the set of valid characters to be used in names of infix operators.
#define _T(x)
Activate this option in order to compile with OpenMP support.
void DefineNameChars(const char_type *a_szCharset)
Define the set of valid characters to be used in names of functions, variables, constants.
virtual void InitFun()
Initialize the default functions.
void AddValIdent(identfun_type a_pCallback)
Add a value parsing function.
Definition of the standard floating point parser.
virtual void InitCharSets()
Define the character sets.
A class singling out integer types at compile time using template meta programming.
value_type Eval() const
Calculate the result.
std::basic_stringstream< char_type, std::char_traits< char_type >, std::allocator< char_type > > stringstream_type
Typedef for easily using stringstream that respect the parser stringtype.
void DefineInfixOprt(const string_type &a_strName, fun_type1 a_pOprt, int a_iPrec=prINFIX, bool a_bAllowOpt=true)
Add a user defined operator.
void DefineOprtChars(const char_type *a_szCharset)
Define the set of valid characters to be used in names of binary operators and postfix operators...
static int IsVal(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal)
Default value recognition callback.
virtual void InitConst()
Initialize constants.
void DefineFun(const string_type &a_strName, T a_pFun, bool a_bAllowOpt=true)
Define a parser function without arguments.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
A template class for providing wrappers for essential math functions.
Namespace for mathematical applications.
string_type::value_type char_type
The character type used by the parser.
void DefineConst(const string_type &a_sName, value_type a_fVal)
Add a user defined constant.
value_type Diff(value_type *a_Var, value_type a_fPos, value_type a_fEpsilon=0) const
Numerically differentiate with regard to a variable.
MUP_STRING_TYPE string_type
The stringtype used by the parser.
virtual void InitOprt()
Initialize operators.
Mathematical expressions parser (base parser engine).