@Override public Void visitBinaryOperatorExpression(final BinaryOperatorExpression node, final Void data) { final BinaryOperatorType operator = node.getOperator(); final TypeReference resultType = operator.isRelational() ? BuiltinTypes.Boolean : getType(node); processBinaryExpressionOperand(node.getRight(), node.getLeft(), operator, resultType); processBinaryExpressionOperand(node.getLeft(), node.getRight(), operator, resultType); return super.visitBinaryOperatorExpression(node, data); }
@Override public Void visitBinaryOperatorExpression(final BinaryOperatorExpression node, final Void data) { final TypeReference leftType = getType(node.getLeft()); final TypeReference rightType = getType(node.getRight()); processBinaryExpressionOperand(node.getLeft(), rightType, node.getOperator()); processBinaryExpressionOperand(node.getRight(), leftType, node.getOperator()); return super.visitBinaryOperatorExpression(node, data); }
@Override public Void visitBinaryOperatorExpression(final BinaryOperatorExpression node, final Void data) { final TypeReference leftType = getType(node.getLeft()); final TypeReference rightType = getType(node.getRight()); processBinaryExpressionOperand(node.getLeft(), rightType, node.getOperator()); processBinaryExpressionOperand(node.getRight(), leftType, node.getOperator()); return super.visitBinaryOperatorExpression(node, data); }
@Override public Void visitBinaryOperatorExpression(final BinaryOperatorExpression node, final Void data) { final int precedence = getPrecedence(node); if (_insertParenthesesForReadability && precedence < EQUALITY) { if (getBinaryOperatorType(node.getLeft()) == node.getOperator()) { parenthesizeIfRequired(node.getLeft(), precedence); } else { parenthesizeIfRequired(node.getLeft(), EQUALITY); } parenthesizeIfRequired(node.getRight(), EQUALITY); } else { parenthesizeIfRequired(node.getLeft(), precedence); parenthesizeIfRequired(node.getRight(), precedence + 1); } return super.visitBinaryOperatorExpression(node, data); }
@Override public Void visitBinaryOperatorExpression(final BinaryOperatorExpression node, final Void data) { final int precedence = getPrecedence(node); if (_insertParenthesesForReadability && precedence < EQUALITY) { if (getBinaryOperatorType(node.getLeft()) == node.getOperator()) { parenthesizeIfRequired(node.getLeft(), precedence); } else { parenthesizeIfRequired(node.getLeft(), EQUALITY); } parenthesizeIfRequired(node.getRight(), EQUALITY); } else { parenthesizeIfRequired(node.getLeft(), precedence); parenthesizeIfRequired(node.getRight(), precedence + 1); } return super.visitBinaryOperatorExpression(node, data); }
@Override public Void visitBinaryOperatorExpression(final BinaryOperatorExpression node, final Void data) { final int precedence = getPrecedence(node); if (_insertParenthesesForReadability && precedence < EQUALITY) { if (getBinaryOperatorType(node.getLeft()) == node.getOperator()) { parenthesizeIfRequired(node.getLeft(), precedence); } else { parenthesizeIfRequired(node.getLeft(), EQUALITY); } parenthesizeIfRequired(node.getRight(), EQUALITY); } else { parenthesizeIfRequired(node.getLeft(), precedence); parenthesizeIfRequired(node.getRight(), precedence + 1); } return super.visitBinaryOperatorExpression(node, data); }