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 40 extern const double DblNiN;
44 typedef char* ( *MultiArgFunc ) (
int paramcnt,
double* args,
45 CStrMap* strparams,
double* result );
46 typedef int ( *
PrmSrchFunc ) (
const char* str,
size_t len,
double* value,
63 OP_ADD, OP_SUB, OP_MUL, OP_DIV, OP_MOD,
OP_UNK,
70 static const signed char OpPriorities[OP_FUNC_MULTIARG + 1];
77 explicit Operation() : Func( 0 ), PrevValTop( 0 ), StrParams( 0 ) {}
78 explicit Operation( OperType_t op ) : OperType( op ), Func( 0 ), PrevValTop( 0 ), StrParams( 0 ) {}
79 explicit Operation( OperType_t op,
const void* p,
signed char a,
CStrMap* pM ) : OperType( op ), Func( p ), PrevValTop( a ), StrParams( pM ) {}
97 const char* ParseFormula(
bool ConvertUpperCase );
98 const char* PrepareFormula();
100 const char* CalcToObr();
107 const char* Parse(
const char* Formula,
bool ConvertUpperCase );
108 const char* Eval(
double* result );
114 #ifdef _MSC_VER // *JS* 115 # pragma warning(pop) 118 #endif //_MATHPARSER_H_ std::vector< double > ValStack
Common types used in the public GenApi interface.
#define MATHPARSERDLL_API
static const Operation BrOp
static const Operation CommaOp
std::vector< char > errbuf
int(* PrmSrchFunc)(const char *str, size_t len, double *value, void *param)
static const Operation CbrOp
Expression parser and evaluator of CSwissKnife.
static const Operation ItvOp
static const Operation NegOp
double(* OneArgFunc)(double arg)
std::vector< double > ValStackEval
std::vector< Operation > OpStack
static CStaticFuncMapDouble DoubleFunctions
declspec's to be used for GenApi Windows dll
static CSymTable MathSymTable
std::vector< Operation > OpStackEval
Operation(OperType_t op, const void *p, signed char a, CStrMap *pM)
Lexical analyzer for CIntSwissKnife.