use of org.matheclipse.parser.client.operator.PrefixOperator in project symja_android_library by axkr.
the class DoubleFormFactory method convertOperator.
protected boolean convertOperator(final Operator operator, final IAST list, final StringBuilder buf, final int precedence, ISymbol head) {
if ((operator instanceof PrefixOperator) && (list.isAST1())) {
convertPrefixOperator(buf, list, (PrefixOperator) operator, precedence);
return true;
}
if ((operator instanceof InfixOperator) && (list.size() > 2)) {
InfixOperator infixOperator = (InfixOperator) operator;
if (head.equals(S.Plus)) {
if (fPlusReversed) {
convertPlusOperatorReversed(buf, list, infixOperator, precedence);
} else {
convertPlusOperator(buf, list, infixOperator, precedence);
}
return true;
} else if (head.equals(S.Times)) {
convertTimesFraction(buf, list, infixOperator, precedence, NO_PLUS_CALL);
return true;
} else if (list.isPower()) {
convertPowerOperator(buf, list, infixOperator, precedence);
return true;
} else if (list.isAST(S.Apply)) {
if (list.size() == 3) {
convertInfixOperator(head, buf, list, ASTNodeFactory.APPLY_OPERATOR, precedence);
return true;
}
if (list.size() == 4 && list.arg2().equals(F.CListC1)) {
convertInfixOperator(head, buf, list, ASTNodeFactory.APPLY_LEVEL_OPERATOR, precedence);
return true;
}
return false;
} else if (list.size() != 3 && infixOperator.getGrouping() != InfixOperator.NONE) {
return false;
}
convertInfixOperator(head, buf, list, (InfixOperator) operator, precedence);
return true;
}
if ((operator instanceof PostfixOperator) && (list.isAST1())) {
convertPostfixOperator(buf, list, (PostfixOperator) operator, precedence);
return true;
}
return false;
}
Aggregations