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

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


      return;
    }
  }

  // ConstructorHeaderName ::=  Modifiersopt 'Identifier' '('
  ConstructorDeclaration cd = new ConstructorDeclaration(this.compilationUnit.compilationResult);

  //name -- this is not really revelant but we do .....
  cd.selector = this.identifierStack[this.identifierPtr];
  long selectorSource = this.identifierPositionStack[this.identifierPtr--];
  this.identifierLengthPtr--;
View Full Code Here


      return;
    }
  }

  // ConstructorHeaderName ::=  Modifiersopt TypeParameters 'Identifier' '('
  ConstructorDeclaration cd = new ConstructorDeclaration(this.compilationUnit.compilationResult);

  //name -- this is not really revelant but we do .....
  cd.selector = this.identifierStack[this.identifierPtr];
  long selectorSource = this.identifierPositionStack[this.identifierPtr--];
  this.identifierLengthPtr--;
View Full Code Here

  concatNodeLists();
}
protected void consumeInvalidConstructorDeclaration() {
  // ConstructorDeclaration ::= ConstructorHeader ';'
  // now we know that the top of stack is a constructorDeclaration
  ConstructorDeclaration cd = (ConstructorDeclaration) this.astStack[this.astPtr];

  cd.bodyEnd = this.endPosition; // position just before the trailing semi-colon
  cd.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition);
  // report the problem and continue the parsing - narrowing the problem onto the method
View Full Code Here

  int length;
  if (hasBody && ((length = this.astLengthStack[this.astLengthPtr--]) != 0)) {
    this.astPtr -= length;
  }
  ConstructorDeclaration constructorDeclaration = (ConstructorDeclaration) this.astStack[this.astPtr];
  constructorDeclaration.bodyEnd = this.endStatementPosition;
  constructorDeclaration.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition);
  if (!hasBody) {
    constructorDeclaration.modifiers |= ExtraCompilerModifiers.AccSemicolonBody;
  }
View Full Code Here

        this.methodDeclaration.bodyEnd = block.sourceEnd;
      }

      /* first statement might be an explict constructor call destinated to a special slot */
      if (this.methodDeclaration.isConstructor()) {
        ConstructorDeclaration constructor = (ConstructorDeclaration)this.methodDeclaration;
        if (this.methodDeclaration.statements != null
          && this.methodDeclaration.statements[0] instanceof ExplicitConstructorCall){
          constructor.constructorCall = (ExplicitConstructorCall)this.methodDeclaration.statements[0];
          int length = this.methodDeclaration.statements.length;
          System.arraycopy(
View Full Code Here

        compilerOptions.defaultEncoding);

    final CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);
    CompilationUnitDeclaration compilationUnitDeclaration = new CompilationUnitDeclaration(problemReporter, compilationResult, length);

    ConstructorDeclaration constructorDeclaration = new ConstructorDeclaration(compilationResult);
    constructorDeclaration.sourceEnd  = -1;
    constructorDeclaration.declarationSourceEnd = offset + length - 1;
    constructorDeclaration.bodyStart = offset;
    constructorDeclaration.bodyEnd = offset + length - 1;
View Full Code Here

    // super interface (if extending an interface)
    if (this.anonymousType.binding != null) {
      LocalTypeBinding localType = (LocalTypeBinding) this.anonymousType.binding;
      if (localType.superInterfaces == Binding.NO_SUPERINTERFACES) {
        // find the constructor binding inside the super constructor call
        ConstructorDeclaration constructor = (ConstructorDeclaration) this.anonymousType.declarationOf(this.binding.original());
        if (constructor != null) {
          throw new SelectionNodeFound(constructor.constructorCall.binding);
        }
        throw new SelectionNodeFound(this.binding);
      }
View Full Code Here

    }
    return internalFormatExpression(source, indentationLevel, lineSeparator, expression, regions, includeComments);
  }

  private TextEdit formatStatements(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) {
    ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false);

    if (constructorDeclaration.statements == null) {
      // a problem occured while parsing the source
      return null;
    }
View Full Code Here

    if (bodyDeclarations != null) {
      return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, regions, includeComments);
    }

    // probe for statements
    ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false);
    if (constructorDeclaration.statements != null) {
      return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, regions, includeComments);
    }

    // this has to be a compilation unit
View Full Code Here

TOP

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

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.