示例#1
0
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);
}
示例#2
0
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);
}
示例#3
0
int EnvWrap::evalInt( const QString& nm )
{
	try
	{	
		double result = evalDouble(nm);
		return (int) result;
	}
	catch(ExpressionHasNotThisTypeException& exc)
	{
		throw ExpressionHasNotThisTypeException("Int",nm);
	}
	return int();
}
示例#4
0
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);
}