Examples of InfixExpression


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

  public static Collection extractLegalInfixExpressionsInNeedOfTransformation(
      Collection col) {
    final Collection ret = new LinkedHashSet();
    for (final Iterator it = col.iterator(); it.hasNext();) {
      final InfixExpression ie = (InfixExpression) it.next();
      if (inNeedOfTransformation(ie.getOperator()))
        ret.add(ie);
    }
    return ret;
  }
View Full Code Here

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

        ConditionalExpression conditionalExpression = workingUnit.getAST().newConditionalExpression();
        conditionalExpression.setElseExpression(castRet);
        conditionalExpression.setThenExpression(workingUnit.getAST().newNullLiteral() );

        InfixExpression nullTest = workingUnit.getAST().newInfixExpression();
        nullTest.setOperator(InfixExpression.Operator.EQUALS);
        nullTest.setRightOperand(workingUnit.getAST().newNullLiteral());
        Expression initialLoad = (SimpleName) ASTNode.copySubtree(cloneInvoke.getAST(), original);
        nullTest.setLeftOperand(initialLoad);

        conditionalExpression.setExpression(nullTest);

        rewrite.replace(original, conditionalExpression, null);
View Full Code Here

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

    protected InfixExpression createCorrectOddnessCheck(ASTRewrite rewrite, Expression numberExpression) {
        assert rewrite != null;
        assert numberExpression != null;

        final AST ast = rewrite.getAST();
        InfixExpression correctOddnessCheck = ast.newInfixExpression();
        InfixExpression remainderExp = ast.newInfixExpression();

        correctOddnessCheck.setLeftOperand(remainderExp);
        correctOddnessCheck.setOperator(NOT_EQUALS);
        correctOddnessCheck.setRightOperand(ast.newNumberLiteral("0"));

        remainderExp.setLeftOperand((Expression) rewrite.createMoveTarget(numberExpression));
        remainderExp.setOperator(REMAINDER);
        remainderExp.setRightOperand(ast.newNumberLiteral("2"));

        return correctOddnessCheck;
    }
View Full Code Here

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

          new StatementTarget(method, true));
    }

    private boolean isThisCondition(Expression condition) {
      if (condition instanceof InfixExpression) {
        InfixExpression infixExpression = (InfixExpression) condition;
        Expression rightOperand = infixExpression.getRightOperand();
        if (infixExpression.getOperator() == InfixExpression.Operator.EQUALS
            && AstNodeUtils.isMethodInvocation(rightOperand, "getItemByItemId(java.lang.String)")) {
          Expression idExpression = DomGenerics.arguments(rightOperand).get(0);
          String idSource = getEditor().getSource(idExpression);
          if (m_id.getName().equals(idSource)) {
            return true;
View Full Code Here

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

    if (parent instanceof ReturnStatement) {
      return false;
    }

    if (parent instanceof InfixExpression) {
      InfixExpression ie = (InfixExpression) parent;
      Operator op = ie.getOperator();
      if (op.equals(InfixExpression.Operator.EQUALS)
          || op.equals(InfixExpression.Operator.GREATER)
          || op.equals(InfixExpression.Operator.GREATER_EQUALS)
          || op.equals(InfixExpression.Operator.LESS)
          || op.equals(InfixExpression.Operator.LESS_EQUALS)
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.nodes.InfixExpression

    Program program = createAndParse(str);

    ExpressionStatement statement = (ExpressionStatement) program
        .statements().get(0);
    Assignment assignment = (Assignment) statement.getExpression();
    InfixExpression infixExpression = (InfixExpression) assignment
        .getRightHandSide();

    ITypeBinding expressionBinding = infixExpression.resolveTypeBinding();

    Assert.assertTrue(expressionBinding.getKind() == IBinding.TYPE);
    // TODO
  }
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.InfixExpression

    super(goal);
  }

  public IGoal[] init() {
    ExpressionTypeGoal typedGoal = (ExpressionTypeGoal) goal;
    InfixExpression infixExpression = (InfixExpression) typedGoal
        .getExpression();
    int operator = infixExpression.getOperatorType();
    switch (operator) {
    case InfixExpression.OP_IS_IDENTICAL:
    case InfixExpression.OP_IS_NOT_IDENTICAL:
    case InfixExpression.OP_IS_EQUAL:
    case InfixExpression.OP_IS_NOT_EQUAL:
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.InfixExpression

 
  private void resolveNamespace(ArrayElement element) {
   
    if (element.getValue() instanceof InfixExpression) {
     
      InfixExpression infix = (InfixExpression) element.getValue();
     
      try {

        if (!(infix.getLeft() instanceof Scalar) || !(infix.getRight() instanceof Scalar)) {
          return;
        }
       
        Scalar left = (Scalar) infix.getLeft();       
        Scalar right = (Scalar) infix.getRight();
       
        if ("__DIR__".equals(left.getValue())) {
                   
          String rightPath = right.getValue().replace("'", "").replace("\"", "").replaceFirst("/", "");
          paths.add(path.append(rightPath));
View Full Code Here

Examples of org.mozilla.javascript.ast.InfixExpression

      return new EmptyExpression();
    }
    if (Iterables.size(operands) == 1) {
      return operands.iterator().next();
    }
    InfixExpression list = new InfixExpression();
    list.setOperator(operator.getJavaScript());
    Iterator<AstNode> it = operands.iterator();
    list.setLeft(it.next());
    list.setRight(it.next());
    while (it.hasNext()) {
      InfixExpression tmpIncrements = new InfixExpression();
      tmpIncrements.setOperator(operator.getJavaScript());
      tmpIncrements.setLeft(list);
      tmpIncrements.setRight(it.next());
      list = tmpIncrements;
    }
    return list;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.