use of org.codehaus.groovy.ast.expr.BinaryExpression in project groovy by apache.
the class EqualsAndHashCodeASTTransformation method differentSelfRecursiveFieldX.
private static BinaryExpression differentSelfRecursiveFieldX(FieldNode fNode, Expression other) {
final Expression fieldExpr = varX(fNode);
final Expression otherExpr = propX(other, fNode.getName());
return orX(andX(sameX(fieldExpr, varX("this")), notX(sameX(otherExpr, other))), andX(notX(sameX(fieldExpr, varX("this"))), sameX(otherExpr, other)));
}
use of org.codehaus.groovy.ast.expr.BinaryExpression in project groovy by apache.
the class FieldASTTransformation method visitExpressionStatement.
@Override
public void visitExpressionStatement(ExpressionStatement es) {
Expression exp = es.getExpression();
if (exp instanceof BinaryExpression) {
exp.visit(this);
}
super.visitExpressionStatement(es);
}
use of org.codehaus.groovy.ast.expr.BinaryExpression in project gcontracts by andresteingress.
the class Assertion method and.
public void and(T other) {
Validate.notNull(other);
BooleanExpression newBooleanExpression = new BooleanExpression(new BinaryExpression(booleanExpression(), Token.newSymbol(Types.LOGICAL_AND, -1, -1), other.booleanExpression()));
newBooleanExpression.setSourcePosition(booleanExpression());
renew(newBooleanExpression);
}
Aggregations