MCPcopy Index your code
hub / github.com/Aghajari/MathParser / parse

Method parse

MathParser/src/com/aghajari/math/MathParser.java:168–185  ·  view source on GitHub ↗

Parses and calculates the expression @param expression the expression to parse and calculate @throws MathParserException If something went wrong @throws BalancedParenthesesException If parentheses aren't balanced @throws MathInvalidParameterException If parameter

(String expression)

Source from the content-addressed store, hash-verified

166 * @throws MathVariableNotFoundException If couldn't find the variable
167 */
168 public double parse(String expression) throws MathParserException {
169 String org = expression;
170 validate(expression);
171 try {
172 initDefaultVariables();
173 expression = firstSimplify(expression);
174 calculateVariables();
175
176 return round(calculate(expression, org));
177 } catch (Exception e) {
178 if (e instanceof MathParserException)
179 throw e;
180 else if (e.getCause() instanceof MathParserException)
181 throw (MathParserException) e.getCause();
182 else
183 throw new MathParserException(org, e.getMessage(), e);
184 }
185 }
186
187 /**
188 * validate syntax

Callers 6

mainMethod · 0.95
sigmaMethod · 0.95
limitMethod · 0.95
orderAgainMethod · 0.45
IFMethod · 0.45
applyMethod · 0.45

Calls 6

validateMethod · 0.95
initDefaultVariablesMethod · 0.95
firstSimplifyMethod · 0.95
calculateVariablesMethod · 0.95
roundMethod · 0.95
calculateMethod · 0.95

Tested by

no test coverage detected