Search in sources :

Example 11 with ExprParser

use of org.matheclipse.core.parser.ExprParser in project symja_android_library by axkr.

the class HashedOrderlessMatcher method defineHashRule.

public void defineHashRule(final String lhs1Str, final String lhs2Str, final String rhsStr, final String conditionStr) {
    ExprParser parser = new ExprParser(EvalEngine.get());
    IExpr lhs1 = parser.parse(lhs1Str);
    // final Parser parser = new Parser();
    // ASTNode parsedAST = parser.parse(lhs1Str);
    // final IExpr lhs1 = AST2Expr.CONST.convert(parsedAST);
    IExpr lhs2 = parser.parse(lhs2Str);
    // parsedAST = parser.parse(lhs2Str);
    // final IExpr lhs2 = AST2Expr.CONST.convert(parsedAST);
    IExpr rhs = parser.parse(rhsStr);
    // parsedAST = parser.parse(rhsStr);
    // final IExpr rhs = AST2Expr.CONST.convert(parsedAST);
    IExpr condition = null;
    if (conditionStr != null) {
        condition = parser.parse(conditionStr);
    // parsedAST = parser.parse(conditionStr);
    // condition = AST2Expr.CONST.convert(parsedAST);
    }
    defineHashRule(lhs1, lhs2, rhs, condition);
}
Also used : IExpr(org.matheclipse.core.interfaces.IExpr) ExprParser(org.matheclipse.core.parser.ExprParser)

Aggregations

IExpr (org.matheclipse.core.interfaces.IExpr)11 ExprParser (org.matheclipse.core.parser.ExprParser)11 SyntaxError (org.matheclipse.parser.client.SyntaxError)3 MathException (org.matheclipse.parser.client.math.MathException)2 EvalEngine (org.matheclipse.core.eval.EvalEngine)1 IAST (org.matheclipse.core.interfaces.IAST)1