use of com.strobel.decompiler.languages.java.ast.AssignmentExpression in project j2objc by google.
the class MethodTranslator method visitAssignmentExpression.
@Override
public TreeNode visitAssignmentExpression(AssignmentExpression node, Void data) {
Expression leftExpr = (Expression) node.getLeft().acceptVisitor(this, null);
Expression rightExpr = (Expression) node.getRight().acceptVisitor(this, null);
Assignment assignment = new Assignment(leftExpr, rightExpr);
switch(node.getOperator()) {
case ASSIGN:
assignment.setOperator(Assignment.Operator.ASSIGN);
break;
case ADD:
assignment.setOperator(Assignment.Operator.PLUS_ASSIGN);
break;
case SUBTRACT:
assignment.setOperator(Assignment.Operator.MINUS_ASSIGN);
break;
case MULTIPLY:
assignment.setOperator(Assignment.Operator.TIMES_ASSIGN);
break;
case DIVIDE:
assignment.setOperator(Assignment.Operator.DIVIDE_ASSIGN);
break;
case MODULUS:
assignment.setOperator(Assignment.Operator.REMAINDER_ASSIGN);
break;
case SHIFT_LEFT:
assignment.setOperator(Assignment.Operator.LEFT_SHIFT_ASSIGN);
break;
case SHIFT_RIGHT:
assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN);
break;
case UNSIGNED_SHIFT_RIGHT:
assignment.setOperator(Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN);
break;
case BITWISE_AND:
assignment.setOperator(Assignment.Operator.BIT_AND_ASSIGN);
break;
case BITWISE_OR:
assignment.setOperator(Assignment.Operator.BIT_OR_ASSIGN);
break;
case EXCLUSIVE_OR:
assignment.setOperator(Assignment.Operator.BIT_XOR_ASSIGN);
break;
default:
throw new AssertionError("Unsupported assignment operator: " + node.getOperator());
}
return assignment;
}
Aggregations