Examples of QualifiedAllocationExpression


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

}
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

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

      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;
View Full Code Here

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

  TypeDeclaration anonymousType = new TypeDeclaration(this.compilationUnit.compilationResult);
  anonymousType.name = CharOperation.NO_CHAR;
  anonymousType.bits |= (ASTNode.IsAnonymousType|ASTNode.IsLocalType);
  anonymousType.bits |= (typeReference.bits & ASTNode.HasTypeAnnotations);
  QualifiedAllocationExpression alloc = new QualifiedAllocationExpression(anonymousType);
  markEnclosingMemberWithLocalType();
  pushOnAstStack(anonymousType);

  alloc.sourceEnd = this.rParenPos; //the position has been stored explicitly
  int argumentLength;
View Full Code Here

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

      anonymousType.bodyStart = this.scanner.currentPosition;
      markEnclosingMemberWithLocalType();
      consumeNestedType();
      this.variablesCounter[this.nestedType]++;
      pushOnAstStack(anonymousType);
      QualifiedAllocationExpression allocationExpression = new QualifiedAllocationExpression(anonymousType);
      allocationExpression.enumConstant = enumConstant;

      // fill arguments if needed
      int length;
      if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
View Full Code Here

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

    } else if(this.identifierLengthPtr > -1 &&
          (this.identifierLengthStack[this.identifierLengthPtr] - 1) != index) {
      super.classInstanceCreation(hasClassBody);
      return;
    }
    QualifiedAllocationExpression alloc;
    this.astPtr--;
    this.astLengthPtr--;
    alloc = new SelectionOnQualifiedAllocationExpression();
    alloc.sourceEnd = this.endPosition; //the position has been stored explicitly
View Full Code Here

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

}
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)) {

    if (this.indexOfAssistIdentifier() < 0) {
      super.consumeClassInstanceCreationExpressionQualifiedWithTypeArguments();
      return;
    }

    //NO ClassBody
    this.astPtr--;
    this.astLengthPtr--;
    alloc = new SelectionOnQualifiedAllocationExpression();
    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);
    }

    // trick to avoid creating a selection on type reference
    char [] oldIdent = assistIdentifier();
    setAssistIdentifier(null);
    alloc.type = getTypeReference(0);
    checkForDiamond(alloc.type);

    setAssistIdentifier(oldIdent);

    length = this.genericsLengthStack[this.genericsLengthPtr--];
    this.genericsPtr -= length;
    System.arraycopy(this.genericsStack, this.genericsPtr + 1, alloc.typeArguments = new TypeReference[length], 0, length);
    this.intPtr--; // remove the position of the '<'

    //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);

    this.assistNode = alloc;
    this.lastCheckPoint = alloc.sourceEnd + 1;
    if (!this.diet){
      this.restartRecovery  = true// force to restart in recovery mode
      this.lastIgnoredToken = -1;
    }
    this.isOrphanCompletionNode = true;
  } else {
    super.consumeClassInstanceCreationExpressionQualifiedWithTypeArguments();
  }

  this.expressionLengthPtr--;
  QualifiedAllocationExpression qae =
    (QualifiedAllocationExpression) this.expressionStack[this.expressionPtr--];
  qae.enclosingInstance = this.expressionStack[this.expressionPtr];
  this.expressionStack[this.expressionPtr] = qae;
  qae.sourceStart = qae.enclosingInstance.sourceStart;
}
View Full Code Here

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

  setAssistIdentifier(oldIdent);

  TypeDeclaration anonymousType = new TypeDeclaration(this.compilationUnit.compilationResult);
  anonymousType.name = CharOperation.NO_CHAR;
  anonymousType.bits |= (ASTNode.IsAnonymousType|ASTNode.IsLocalType);
  QualifiedAllocationExpression alloc = new SelectionOnQualifiedAllocationExpression(anonymousType);
  markEnclosingMemberWithLocalType();
  pushOnAstStack(anonymousType);

  alloc.sourceEnd = this.rParenPos; //the position has been stored explicitly
  int argumentLength;
View Full Code Here

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

      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
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.