30 #include "muParserTemplateMagic.h"
69 #if defined(__APPLE__) && defined(NEVERTRUE)
72 std::size_t charsProcessed;
74 if (charsProcessed == 0)
77 *a_iPos += (int)charsProcessed;
89 stream.imbue(Parser::s_locale);
91 stringstream_type::pos_type iEnd = stream.tellg();
93 if (iEnd == (stringstream_type::pos_type) - 1)
128 DefineNameChars(
_T(
"0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"));
129 DefineOprtChars(
_T(
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-*^/?<>=#!$%&|~'_{}"));
209 void Parser::OnDetectVar(
string_type* ,
int& ,
int& )
255 *a_Var = a_fPos + 2 * fEpsilon; f[0] =
Eval();
256 *a_Var = a_fPos + 1 * fEpsilon; f[1] =
Eval();
257 *a_Var = a_fPos - 1 * fEpsilon; f[2] =
Eval();
258 *a_Var = a_fPos - 2 * fEpsilon; f[3] =
Eval();
261 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.
void InitConst() override
Initialize constants.
void AddValIdent(identfun_type a_pCallback)
Add a value parsing function.
Definition of the standard floating point parser.
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.
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.
void InitCharSets() override
Define the character sets.
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.
void InitFun() override
Initialize the default functions.
MUP_STRING_TYPE string_type
The stringtype used by the parser.
void InitOprt() override
Initialize operators.
Mathematical expressions parser (base parser engine).