Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.Assignment


            testNewCheckpointBody.statements().add(
                    ast.newExpressionStatement(pushStates));
            thenBranch.statements().add(testNewCheckpoint);

            // Assign the new checkpoint.
            Assignment assignment = ast.newAssignment();
            assignment.setLeftHandSide(ast.newSimpleName(CHECKPOINT_NAME));
            assignment.setRightHandSide(ast.newSimpleName("checkpoint"));

            ExpressionStatement statement = ast
                    .newExpressionStatement(assignment);
            thenBranch.statements().add(statement);
View Full Code Here


    public CallOn(SimpleName name) {
      this.name = name;
    }

    public void andAssignTo(FieldInfo fieldInfo) {
      Assignment assignment = ast.newAssignment();

      ExpressionStatement statement = ast.newExpressionStatement(assignment);
      block.statements().add(statement);

      MethodInvocation invocation = getterInfo.toMethodInvocation(ast, name);
      assignment.setRightHandSide(invocation);
      assignment.setOperator(Operator.ASSIGN);

      SimpleName assignTo = fieldInfo.toSimpleName(ast);
      assignment.setLeftHandSide(assignTo);
    }
View Full Code Here

      }
      break;
    }

    case ASTNode.ASSIGNMENT: {
      final Assignment assignment = (Assignment) node;
      if (assignment.getOperator() == Assignment.Operator.ASSIGN) {
        this.processExpression(assignment.getLeftHandSide());
        this.processExpression(assignment.getRightHandSide());
      }

      else if (!Util.isSuspiciousAssignmentOperator(assignment
          .getOperator()))
        throw new DefinitelyNotEnumerizableOperationException(
            Messages.ASTNodeProcessor_IllegalAssignmentExpression, assignment
                .getOperator(), node);
      else
        throw new NonEnumerizableOperationException(
            Messages.ASTNodeProcessor_IllegalAssignmentExpression, assignment
                .getOperator(), node);
      break;
    }

    case ASTNode.CONDITIONAL_EXPRESSION: {
View Full Code Here

        this.process(node.getParent());
      break;
    }

    case ASTNode.ASSIGNMENT: {
      final Assignment assignment = (Assignment) node;
      if (assignment.getOperator() == Assignment.Operator.ASSIGN) {
        this.processExpression(assignment.getLeftHandSide());
        this.processExpression(assignment.getRightHandSide());
      }

      else if (!Util.isSuspiciousAssignmentOperator(assignment
          .getOperator()))
        throw new DefinitelyNotEnumerizableOperationException(
            Messages.ASTNodeProcessor_IllegalAssignmentExpression, assignment
                .getOperator(), node);
      else
        throw new NonEnumerizableASTException(
            Messages.ASTNodeProcessor_IllegalAssignmentExpression, node);
      break;
View Full Code Here

      fieldAccess.setExpression(thisExpression);

      // Right expression
      SimpleName parameter = ast.newSimpleName(property.getName());

      Assignment assignment = ast.newAssignment();
      assignment
          .setOperator(org.eclipse.jdt.core.dom.Assignment.Operator.ASSIGN);
      assignment.setLeftHandSide(fieldAccess);
      assignment.setRightHandSide(parameter);

      // Expression
      ExpressionStatement expressionStatement = ast
          .newExpressionStatement(assignment);
View Full Code Here

  }

  protected boolean isLeftHandSide(Expression expr) {
    ASTNode parent = expr.getParent();
    if (parent instanceof Assignment) {
      Assignment assignment = (Assignment) parent;
      if (expr == assignment.getLeftHandSide()) {
        return true;
      }
    }

    if (parent instanceof QualifiedName) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.Assignment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.