예제 #1
0
파일: polish.cpp 프로젝트: pnkfelix/glx-gle
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
파일: polish.cpp 프로젝트: pnkfelix/glx-gle
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
파일: polish.cpp 프로젝트: pnkfelix/glx-gle
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);
}