@Override public boolean matches(CompoundAssignmentTree compoundAssignmentTree, VisitorState state) { if (!operators.contains(compoundAssignmentTree.getKind())) { return false; } return receiverMatcher.matches(compoundAssignmentTree.getVariable(), state) && expressionMatcher.matches(compoundAssignmentTree.getExpression(), state); }
@Override public UAssignOp visitCompoundAssignment(CompoundAssignmentTree tree, Void v) { return UAssignOp.create( template(tree.getVariable()), tree.getKind(), template(tree.getExpression())); }
Type expressionType = getType(tree.getExpression()); Types types = state.getTypes(); switch (tree.getKind()) { case LEFT_SHIFT_ASSIGNMENT: case RIGHT_SHIFT_ASSIGNMENT:
@Override public Choice<Unifier> visitCompoundAssignment(CompoundAssignmentTree assignOp, Unifier unifier) { return Choice.condition(getKind() == assignOp.getKind(), unifier) .thenChoose(unifications(getVariable(), assignOp.getVariable())) .thenChoose(unifications(getExpression(), assignOp.getExpression())); } }
@Override public boolean matches(CompoundAssignmentTree compoundAssignmentTree, VisitorState state) { if (!operators.contains(compoundAssignmentTree.getKind())) { return false; } return receiverMatcher.matches(compoundAssignmentTree.getVariable(), state) && expressionMatcher.matches(compoundAssignmentTree.getExpression(), state); }
@Override public UAssignOp visitCompoundAssignment(CompoundAssignmentTree tree, Void v) { return UAssignOp.create( template(tree.getVariable()), tree.getKind(), template(tree.getExpression())); }
@Override public Tree visitCompoundAssignment(CompoundAssignmentTree tree, Void p) { CompoundAssignmentTree n = make.CompoundAssignment(tree.getKind(), tree.getVariable(), tree.getExpression()); model.setType(n, model.getType(tree)); comments.copyComments(tree, n); model.setPos(n, model.getPos(tree)); return n; }
@Override public JExpression visitCompoundAssignment(CompoundAssignmentTree ct, Void __) { return $b.invoke(opName(ct.getKind())) .arg(loc(ct)) .arg(visit(ct.getVariable())) .arg(visit(ct.getExpression())); }
@Override public Choice<Unifier> visitCompoundAssignment(CompoundAssignmentTree assignOp, Unifier unifier) { return Choice.condition(getKind() == assignOp.getKind(), unifier) .thenChoose(unifications(getVariable(), assignOp.getVariable())) .thenChoose(unifications(getExpression(), assignOp.getExpression())); } }
protected final CompoundAssignmentTree rewriteChildren(CompoundAssignmentTree tree) { ExpressionTree lhs = (ExpressionTree)translate(tree.getVariable()); ExpressionTree rhs = (ExpressionTree)translate(tree.getExpression()); if (lhs!=tree.getVariable() || rhs!=tree.getExpression()) { CompoundAssignmentTree n = make.CompoundAssignment(tree.getKind(), lhs, rhs); model.setType(n, model.getType(tree)); copyCommentTo(tree,n); copyPosTo(tree,n); tree = n; } return tree; }
Type expressionType = getType(tree.getExpression()); Types types = state.getTypes(); switch (tree.getKind()) { case LEFT_SHIFT_ASSIGNMENT: case RIGHT_SHIFT_ASSIGNMENT:
Tree.Kind kind = tree.getKind(); switch (kind) { case DIVIDE_ASSIGNMENT: