@Override public void run() { try { startRequest(); if (fTraceEvaluation) { fEvaluationResult = evalTrace(fParsedExpression, null, F.List()); } else { fEvaluationResult = evaluate(fParsedExpression); } } catch (final Exception e) { if (Config.DEBUG) { e.printStackTrace(); } fException = e; } catch (final OutOfMemoryError e) { if (Config.DEBUG) { e.printStackTrace(); } fEvaluationResult = F.$str("OutOfMemoryError"); // fException = e; } catch (final StackOverflowError e) { if (Config.DEBUG) { e.printStackTrace(); } fEvaluationResult = F.$str("StackOverflowError"); // fException = e; } }
/** * Runs the evaluation of the given math formula <code>String</code> in a time * limited thread * * @param traceEvaluation * */ public IExpr constrainedEval(final Writer writer, final String inputString, boolean traceEvaluation) throws Exception { fEvaluationResult = null; fException = null; fParsedExpression = null; fEvalEngine.setStopRequested(false); fTraceEvaluation = traceEvaluation; try { EvalEngine.set(fEvalEngine); fParsedExpression = fEvalEngine.parse(inputString); } catch (final RuntimeException e) { throw e; } return constrainedEval(writer, fParsedExpression); }
/** * Runs the evaluation of the given math formula <code>String</code> in a time * limited thread * * @param traceEvaluation * */ public IExpr constrainedEval(final Writer writer, final String inputString, boolean traceEvaluation) throws Exception { fEvaluationResult = F.NIL; fException = null; fParsedExpression = null; fEvalEngine.setStopRequested(false); fTraceEvaluation = traceEvaluation; try { EvalEngine.set(fEvalEngine); fParsedExpression = fEvalEngine.parse(inputString); } catch (final RuntimeException e) { throw e; } return constrainedEval(writer, fParsedExpression); }
public void run() { try { startRequest(); if (fTraceEvaluation) { fEvaluationResult = evalTrace(fParsedExpression, null, F.List()); } else { fEvaluationResult = evaluate(fParsedExpression); } } catch (final Exception e) { if (Config.DEBUG) { e.printStackTrace(); } fException = e; } catch (final OutOfMemoryError e) { if (Config.DEBUG) { e.printStackTrace(); } fEvaluationResult = F.stringx("OutOfMemoryError"); // fException = e; } catch (final StackOverflowError e) { if (Config.DEBUG) { e.printStackTrace(); } fEvaluationResult = F.stringx("StackOverflowError"); // fException = e; } }