Package org.eclipse.jdt.core.dom

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


     * index has not been set previously.
     *
     * @param operand
     */
    protected void addOperand(Expression operand) {
        Expression index = m_arrayAccess.getIndex();
        if (index == null) {
            m_arrayAccess.setIndex(operand);
        } else {
            throw new IllegalStateException("Internal error: attempt to set index expression more than once");
        }
View Full Code Here


  @SuppressWarnings("unchecked")
  private void setReturnStatement(final MethodDeclaration stub, final IMethodBinding methodToOverride,
      final ITypeBinding declaringType, final AST ast, final ASTRewrite rewrite)
          throws JavaModelException, CoreException
          {
    Expression expression= ASTNodeFactory.newDefaultExpression(ast,
        stub.getReturnType2(), stub.getExtraDimensions());

    if (expression != null)
    {
      ReturnStatement returnStatement= ast.newReturnStatement();
View Full Code Here

  public boolean visit(ArrayCreation node) {
    IValue type = visitChild(node.getType().getElementType());
 
    IValueList dimensions = new IValueList(values);
    for (Iterator it = node.dimensions().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      dimensions.add(visitChild(e));
    }
 
    IValue initializer = node.getInitializer() == null ? null : visitChild(node.getInitializer());
   
View Full Code Here

  }
 
  public boolean visit(ArrayInitializer node) {
    IValueList expressions = new IValueList(values);
    for (Iterator it = node.expressions().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      expressions.add(visitChild(e));
    }
   
    ownValue = constructExpressionNode("arrayInitializer", expressions.asList());
   
View Full Code Here

      }
    }
 
    IValueList arguments = new IValueList(values);
    for (Iterator it = node.arguments().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      arguments.add(visitChild(e));
    }
 
    IValue anonymousClassDeclaration = node.getAnonymousClassDeclaration() == null ? null : visitChild(node.getAnonymousClassDeclaration());
   
View Full Code Here

      }
    }
 
    IValueList arguments = new IValueList(values);
    for (Iterator it = node.arguments().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      arguments.add(visitChild(e));
    }
   
    ownValue = constructStatementNode("constructorCall", values.bool(false),  arguments.asList());
    setAnnotation("typeParameters", types);
View Full Code Here

    IValue name = values.string(node.getName().getFullyQualifiedName());
 
    IValueList arguments = new IValueList(values);
    if (!node.arguments().isEmpty()) {
      for (Iterator it = node.arguments().iterator(); it.hasNext();) {
        Expression e = (Expression) it.next();
        arguments.add(visitChild(e));
      }
    }
 
    IValue anonymousClassDeclaration = node.getAnonymousClassDeclaration() == null ? null : visitChild(node.getAnonymousClassDeclaration());
View Full Code Here

 
  public boolean visit(ForStatement node) {
   
    IValueList initializers = new IValueList(values);
    for (Iterator it = node.initializers().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      initializers.add(visitChild(e));
    }
 
    IValue booleanExpression = node.getExpression() == null ? null : visitChild(node.getExpression());
 
    IValueList updaters = new IValueList(values);
    for (Iterator it = node.updaters().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      updaters.add(visitChild(e));
    }
 
    IValue body = visitChild(node.getBody());
 
View Full Code Here

    IValue leftSide = visitChild(node.getLeftOperand());
    IValue rightSide = visitChild(node.getRightOperand());
   
    IValue intermediateExpression = constructExpressionNode("infix", leftSide, operator, rightSide);
    for (Iterator it = node.extendedOperands().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      intermediateExpression = constructExpressionNode("infix", intermediateExpression, operator, visitChild(e));
    }
   
    ownValue = intermediateExpression;
   
View Full Code Here

 
    IValue name = values.string(node.getName().getFullyQualifiedName());
 
    IValueList arguments = new IValueList(values);
    for (Iterator it = node.arguments().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      arguments.add(visitChild(e));
    }   
   
    ownValue = constructExpressionNode("methodCall", values.bool(false), expression, name, arguments.asList());
    setAnnotation("typeParameters", genericTypes);
View Full Code Here

TOP

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

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.