@Override public boolean matches(final INode other, final Match match) { if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression otherExpression = (BinaryOperatorExpression) other; return !otherExpression.isNull() && (otherExpression._operator == _operator || _operator == BinaryOperatorType.ANY || otherExpression._operator == BinaryOperatorType.ANY) && getLeft().matches(otherExpression.getLeft(), match) && getRight().matches(otherExpression.getRight(), match); } return false; }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression otherExpression = (BinaryOperatorExpression) other; return !otherExpression.isNull() && (otherExpression._operator == _operator || _operator == BinaryOperatorType.ANY || otherExpression._operator == BinaryOperatorType.ANY) && getLeft().matches(otherExpression.getLeft(), match) && getRight().matches(otherExpression.getRight(), match); } return false; }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression otherExpression = (BinaryOperatorExpression) other; return !otherExpression.isNull() && (otherExpression._operator == _operator || _operator == BinaryOperatorType.ANY || otherExpression._operator == BinaryOperatorType.ANY) && getLeft().matches(otherExpression.getLeft(), match) && getRight().matches(otherExpression.getRight(), match); } return false; }
@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); }
@Override public boolean matches(final INode other, final Match match) { if (_pattern.matches(other, match)) { return true; } if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression binary = (BinaryOperatorExpression) other; if (_operator != BinaryOperatorType.ANY && binary.getOperator() != _operator) { return false; } final int checkPoint = match.getCheckPoint(); if (matches(binary.getLeft(), match) && matches(binary.getRight(), match)) { return true; } match.restoreCheckPoint(checkPoint); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (_pattern.matches(other, match)) { return true; } if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression binary = (BinaryOperatorExpression) other; if (_operator != BinaryOperatorType.ANY && binary.getOperator() != _operator) { return false; } final int checkPoint = match.getCheckPoint(); if (matches(binary.getLeft(), match) && matches(binary.getRight(), match)) { return true; } match.restoreCheckPoint(checkPoint); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (_pattern.matches(other, match)) { return true; } if (other instanceof BinaryOperatorExpression) { final BinaryOperatorExpression binary = (BinaryOperatorExpression) other; if (_operator != BinaryOperatorType.ANY && binary.getOperator() != _operator) { return false; } final int checkPoint = match.getCheckPoint(); if (matches(binary.getLeft(), match) && matches(binary.getRight(), match)) { return true; } match.restoreCheckPoint(checkPoint); } return false; } }
if (node != null) { final BinaryOperatorExpression binary = (BinaryOperatorExpression) parent; final AstNode comparand = node == binary.getLeft() ? binary.getRight() : binary.getLeft();
if (node != null) { final BinaryOperatorExpression binary = (BinaryOperatorExpression) parent; final AstNode comparand = node == binary.getLeft() ? binary.getRight() : binary.getLeft();
writeToken(BinaryOperatorExpression.getOperatorRole(node.getOperator())); space(spacePolicy); node.getRight().acceptVisitor(this, ignored); endNode(node); return null;
final Expression right = node.getRight();
final Expression right = node.getRight();
final Expression right = node.getRight();