Examples of ParenthesizedExpression


Examples of com.google.dart.engine.ast.ParenthesizedExpression

    if (libraryElement != null && !libraryElement.isDartCore()) {
      return false;
    }
    // Report error if the (x/y) has toInt() invoked on it
    if (node.getParent() instanceof ParenthesizedExpression) {
      ParenthesizedExpression parenthesizedExpression = wrapParenthesizedExpression((ParenthesizedExpression) node.getParent());
      if (parenthesizedExpression.getParent() instanceof MethodInvocation) {
        MethodInvocation methodInvocation = (MethodInvocation) parenthesizedExpression.getParent();
        if (TO_INT_METHOD_NAME.equals(methodInvocation.getMethodName().getName())
            && methodInvocation.getArgumentList().getArguments().isEmpty()) {
          errorReporter.reportErrorForNode(HintCode.DIVISION_OPTIMIZATION, methodInvocation);
          return true;
        }
View Full Code Here

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

        assert rewrite != null;
        assert numberExpression != null;

        final AST ast = rewrite.getAST();
        InfixExpression andOddnessCheck = ast.newInfixExpression();
        ParenthesizedExpression parenthesizedExpression = ast.newParenthesizedExpression();
        InfixExpression andExpression = ast.newInfixExpression();

        andExpression.setLeftOperand((Expression) rewrite.createMoveTarget(numberExpression));
        andExpression.setOperator(AND);
        andExpression.setRightOperand(ast.newNumberLiteral("1"));
        parenthesizedExpression.setExpression(andExpression);
        andOddnessCheck.setLeftOperand(parenthesizedExpression);
        andOddnessCheck.setOperator(EQUALS);
        andOddnessCheck.setRightOperand(ast.newNumberLiteral("1"));

        return andOddnessCheck;
View Full Code Here

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

            }
        }
      }
    }
    else if(e instanceof ParenthesizedExpression){
      ParenthesizedExpression ex=(ParenthesizedExpression)e;
      processExpression(parent, ex.getExpression(), cu, resource, stack, monitor, HistoryDefinitionLocation.UNDEFINED,false);
    }
    else if(e instanceof CastExpression){
      CastExpression cex=(CastExpression)e;
      processExpression(parent, cex.getExpression(), cu, resource, stack, monitor, HistoryDefinitionLocation.UNDEFINED,false);
    }
View Full Code Here

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

      }
      break;
    }

    case ASTNode.PARENTHESIZED_EXPRESSION: {
      final ParenthesizedExpression pe = (ParenthesizedExpression) node;
      this.processExpression(pe.getExpression());
      break;
    }

    case ASTNode.SUPER_FIELD_ACCESS: {
      final SuperFieldAccess superFieldAccess = (SuperFieldAccess) node;
View Full Code Here

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

  public static boolean isNullLiteral(Expression e) {
    if (e instanceof NullLiteral)
      return true;
    if (e instanceof ParenthesizedExpression) {
      ParenthesizedExpression pe = (ParenthesizedExpression) e;
      return isNullLiteral(pe.getExpression());
    }
    return false;
  }
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.ParenthesizedExpression

    }

    protected ParenthesizedExpression parseParenthesizedExpr( TokenStream tokens ) {
        tokens.consume('(');
        if (tokens.canConsume(')')) {
            return new ParenthesizedExpression();
        }
        Component expr = collapse(parseExpr(tokens));
        tokens.consume(')');
        return new ParenthesizedExpression(expr);
    }
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.ParenthesizedExpression

                    throw new InvalidQueryException(query,
                                                    "A function call is not supported in the primary path expression; therefore '"
                                                    + primary + "' is not valid");
                } else if (primary instanceof ParenthesizedExpression) {
                    // This can be used to define an OR-ed set of expressions defining select columns ...
                    ParenthesizedExpression paren = (ParenthesizedExpression)primary;
                    Component wrapped = paren.getWrapped().collapse();
                    if (wrapped instanceof AttributeNameTest) {
                        AttributeNameTest attributeName = (AttributeNameTest)wrapped;
                        builder.select(nameFrom(attributeName.getNameTest()));
                    } else if (wrapped instanceof BinaryComponent) {
                        for (AttributeNameTest attributeName : extractAttributeNames((BinaryComponent)wrapped)) {
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.ParenthesizedExpression

                                         String tableName,
                                         ConstraintBuilder where ) {
        predicate = predicate.collapse();
        assert tableName != null;
        if (predicate instanceof ParenthesizedExpression) {
            ParenthesizedExpression paren = (ParenthesizedExpression)predicate;
            where = where.openParen();
            translatePredicate(paren.getWrapped(), tableName, where);
            where.closeParen();
        } else if (predicate instanceof And) {
            And and = (And)predicate;
            where = where.openParen();
            translatePredicate(and.getLeft(), tableName, where);
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.ParenthesizedExpression

                FilterStep filter = (FilterStep)step;
                Component primary = filter.getPrimaryExpression();
                if (primary instanceof ContextItem) {
                    continue; // ignore this '.'
                } else if (primary instanceof ParenthesizedExpression) {
                    ParenthesizedExpression paren = (ParenthesizedExpression)primary;
                    Component wrapped = paren.getWrapped().collapse();
                    if (wrapped instanceof AttributeNameTest) {
                        // ignore this; handled earlier ...
                    } else if (wrapped instanceof BinaryComponent) {
                        List<NameTest> names = extractElementNames((BinaryComponent)wrapped);
                        if (names.size() >= 1) {
View Full Code Here

Examples of org.jboss.dna.jcr.xpath.XPath.ParenthesizedExpression

    protected List<Component> predicates( Component... predicates ) {
        return Arrays.asList(predicates);
    }

    protected ParenthesizedExpression paren( Component value ) {
        return new ParenthesizedExpression(value);
    }
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.