void GLEPolish::eval(GLEArrayImpl* stk, const char *exp, double *x) throw(ParserError) { int rtype = 1, cp = 0; GLEPcodeList pc_list; GLEPcode pcode(&pc_list); polish(exp, pcode, &rtype); *x = evalDouble(stk, &pc_list, (int*)&pcode[0], &cp); }
void GLEPolish::internalEval(const char *exp, double *x) throw(ParserError) { // difference with eval: no try / catch int rtype = 1, cp = 0; GLEPcodeList pc_list; GLEPcode pcode(&pc_list); internalPolish(exp, pcode, &rtype); GLERC<GLEArrayImpl> stk(new GLEArrayImpl()); *x = evalDouble(stk.get(), &pc_list, (int*)&pcode[0], &cp); }
int EnvWrap::evalInt( const QString& nm ) { try { double result = evalDouble(nm); return (int) result; } catch(ExpressionHasNotThisTypeException& exc) { throw ExpressionHasNotThisTypeException("Int",nm); } return int(); }
void eval_pcode(GLEPcode& pcode, double* x) { int cp = 0; GLERC<GLEArrayImpl> stk(new GLEArrayImpl()); *x = evalDouble(stk.get(), pcode.getPcodeList(), (int*)&pcode[0], &cp); }