Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression


  }
  TypeBinding missingType = (TypeBinding) missingTypes.get(0);
  int start = location.sourceStart;
  int end = location.sourceEnd;
  if (location instanceof QualifiedAllocationExpression) {
    QualifiedAllocationExpression qualifiedAllocation = (QualifiedAllocationExpression) location;
    if (qualifiedAllocation.anonymousType != null) {
      start = qualifiedAllocation.anonymousType.sourceStart;
      end = qualifiedAllocation.anonymousType.sourceEnd;
    }
  }
View Full Code Here


    superInterfacesLength = superInterfaces.length;
    interfaceNames = new char[superInterfacesLength][];
  } else {
    if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {
      // see PR 3442
      QualifiedAllocationExpression alloc = typeDeclaration.allocation;
      if (alloc != null && alloc.type != null) {
        superInterfaces = new TypeReference[] { alloc.type};
        superInterfacesLength = 1;
        interfaceNames = new char[1][];
      }
View Full Code Here

  this.sourceEnds = null;
}
private int sourceEnd(TypeDeclaration typeDeclaration) {
  if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {
    QualifiedAllocationExpression allocation = typeDeclaration.allocation;
    if (allocation.enumConstant != null) // case of enum constant body
      return allocation.enumConstant.sourceEnd;
    return allocation.type.sourceEnd;
  } else {
    return typeDeclaration.sourceEnd;
View Full Code Here

  }
  TypeBinding missingType = (TypeBinding) missingTypes.get(0);
  int start = location.sourceStart;
  int end = location.sourceEnd;
  if (location instanceof QualifiedAllocationExpression) {
    QualifiedAllocationExpression qualifiedAllocation = (QualifiedAllocationExpression) location;
    if (qualifiedAllocation.anonymousType != null) {
      start = qualifiedAllocation.anonymousType.sourceStart;
      end = qualifiedAllocation.anonymousType.sourceEnd;
    }
  }
View Full Code Here

  }

  TypeDeclaration updatedType = updatedTypeDeclaration(depth + 1, knownTypes);
  if (updatedType != null && (updatedType.bits & ASTNode.IsAnonymousType) != 0){
    /* in presence of an anonymous type, we want the full allocation expression */
    QualifiedAllocationExpression allocation = updatedType.allocation;

    if (allocation.statementEnd == -1) {
      allocation.statementEnd = updatedType.declarationSourceEnd;
    }
    return allocation;
View Full Code Here

  }
  TypeBinding missingType = (TypeBinding) missingTypes.get(0);
  int start = location.sourceStart;
  int end = location.sourceEnd;
  if (location instanceof QualifiedAllocationExpression) {
    QualifiedAllocationExpression qualifiedAllocation = (QualifiedAllocationExpression) location;
    if (qualifiedAllocation.anonymousType != null) {
      start = qualifiedAllocation.anonymousType.sourceStart;
      end = qualifiedAllocation.anonymousType.sourceEnd;
    }
  }
View Full Code Here

  if (((length = this.astLengthStack[this.astLengthPtr--]) == 1)
    && (this.astStack[this.astPtr] == null)) {
    //NO ClassBody
    this.astPtr--;
    if (isQualified) {
      alloc = new QualifiedAllocationExpression();
    } else {
      alloc = new AllocationExpression();
    }
    alloc.sourceEnd = this.endPosition; //the position has been stored explicitly
View Full Code Here

    anonymousType.name = CharOperation.NO_CHAR;
    anonymousType.bits |= (ASTNode.IsAnonymousType|ASTNode.IsLocalType);
    anonymousType.sourceStart = this.intStack[this.intPtr--];
    anonymousType.declarationSourceStart = anonymousType.sourceStart;
    anonymousType.sourceEnd = this.rParenPos; // closing parenthesis
    QualifiedAllocationExpression alloc = new QualifiedAllocationExpression(anonymousType);
    alloc.type = getTypeReference(0);
    alloc.sourceStart = anonymousType.sourceStart;
    alloc.sourceEnd = anonymousType.sourceEnd ;
    this.lastCheckPoint = anonymousType.bodyStart = this.scanner.currentPosition;
    this.currentElement = this.currentElement.add(anonymousType, 0);
View Full Code Here

protected void consumeClassInstanceCreationExpressionQualified() {
  // ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
  // ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
  classInstanceCreation(true);

  QualifiedAllocationExpression qae =
    (QualifiedAllocationExpression) this.expressionStack[this.expressionPtr];
 
  if (qae.anonymousType == null) {
    this.expressionLengthPtr--;
    this.expressionPtr--;
View Full Code Here

}
protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() {
  // ClassInstanceCreationExpression ::= Primary '.' 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt
  // ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt

  QualifiedAllocationExpression alloc;
  int length;
  if (((length = this.astLengthStack[this.astLengthPtr--]) == 1) && (this.astStack[this.astPtr] == null)) {
    //NO ClassBody
    this.astPtr--;
    alloc = new QualifiedAllocationExpression();
    alloc.sourceEnd = this.endPosition; //the position has been stored explicitly

    if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
      this.expressionPtr -= length;
      System.arraycopy(
        this.expressionStack,
        this.expressionPtr + 1,
        alloc.arguments = new Expression[length],
        0,
        length);
    }
    alloc.type = getTypeReference(0);
    checkForDiamond(alloc.type);
    length = this.genericsLengthStack[this.genericsLengthPtr--];
    this.genericsPtr -= length;
    System.arraycopy(this.genericsStack, this.genericsPtr + 1, alloc.typeArguments = new TypeReference[length], 0, length);
    this.intPtr--;

    //the default constructor with the correct number of argument
    //will be created and added by the TC (see createsInternalConstructorWithBinding)
    alloc.sourceStart = this.intStack[this.intPtr--];
    pushOnExpressionStack(alloc);
  } else {
    dispatchDeclarationInto(length);
    TypeDeclaration anonymousTypeDeclaration = (TypeDeclaration)this.astStack[this.astPtr];
    anonymousTypeDeclaration.declarationSourceEnd = this.endStatementPosition;
    anonymousTypeDeclaration.bodyEnd = this.endStatementPosition;
    if (length == 0 && !containsComment(anonymousTypeDeclaration.bodyStart, anonymousTypeDeclaration.bodyEnd)) {
      anonymousTypeDeclaration.bits |= ASTNode.UndocumentedEmptyBlock;
    }
    this.astPtr--;
    this.astLengthPtr--;

    QualifiedAllocationExpression allocationExpression = anonymousTypeDeclaration.allocation;
    if (allocationExpression != null) {
      allocationExpression.sourceEnd = this.endStatementPosition;
      // handle type arguments
      length = this.genericsLengthStack[this.genericsLengthPtr--];
      this.genericsPtr -= length;
      System.arraycopy(this.genericsStack, this.genericsPtr + 1, allocationExpression.typeArguments = new TypeReference[length], 0, length);
      allocationExpression.sourceStart = this.intStack[this.intPtr--];
      checkForDiamond(allocationExpression.type);
    }
  }
 
  QualifiedAllocationExpression qae =
    (QualifiedAllocationExpression) this.expressionStack[this.expressionPtr];
 
  if (qae.anonymousType == null) {
    this.expressionLengthPtr--;
    this.expressionPtr--;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression

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.