19 #ifndef _MATHPARSER_H_ 20 #define _MATHPARSER_H_ 30 #ifdef _MSC_VER // *JS* 31 # pragma warning(push) 32 # pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy' 35 #define ORIGINAL_STACK_SIZE 64 37 extern const double DblErR;
38 extern const double DblNiN;
42 typedef char* ( *MultiArgFunc ) (
int paramcnt,
double* args,
43 CStrMap* strparams,
double* result );
44 typedef int ( *
PrmSrchFunc ) (
const char* str,
size_t len,
double* value,
61 OP_ADD, OP_SUB, OP_MUL, OP_DIV, OP_MOD,
OP_UNK,
68 static const signed char OpPriorities[OP_FUNC_MULTIARG + 1];
75 explicit Operation() : Func( 0 ), PrevValTop( 0 ), StrParams( 0 ) {}
76 explicit Operation( OperType_t op ) : OperType( op ), Func( 0 ), PrevValTop( 0 ), StrParams( 0 ) {}
77 explicit Operation( OperType_t op,
const void* p,
signed char a,
CStrMap* pM ) : OperType( op ), Func( p ), PrevValTop( a ), StrParams( pM ) {}
95 const char* ParseFormula(
bool ConvertUpperCase );
96 const char* PrepareFormula();
98 const char* CalcToObr();
105 const char* Parse(
const char* Formula,
bool ConvertUpperCase );
106 const char* Eval(
double* result );
110 #ifdef _MSC_VER // *JS* 111 # pragma warning(pop) 114 #endif //_MATHPARSER_H_ Map for variables in swissknife expression.
Common types used in the public GenApi interface.
#define MATHPARSERDLL_API
Operation(OperType_t op, const void *p, signed char a, CStrMap *pM)
static const Operation ItvOp
static CSymTable MathSymTable
static CStaticFuncMapDouble DoubleFunctions
std::vector< char > errbuf
static const Operation BrOp
std::vector< Operation > OpStack
int(* PrmSrchFunc)(const char *str, size_t len, double *value, void *param)
std::vector< double > ValStack
std::vector< Operation > OpStackEval
static const Operation CommaOp
static const Operation CbrOp
declspec's to be used for GenApi Windows dll
static const Operation NegOp
double(* OneArgFunc)(double arg)
Expression parser and evaluator of CSwissKnife.
std::vector< double > ValStackEval