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

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


        this.bracketBalance = 1; // pretend the brace was already there
    }
  }
  // might be an initializer
  if (this.bracketBalance == 1){
    Block block = new Block(0);
    Parser parser = parser();
    block.sourceStart = parser.scanner.startPosition;
    Initializer init;
    if (parser.recoveredStaticInitializerStart == 0){
      init = new Initializer(block, ClassFileConstants.AccDefault);
View Full Code Here


  if (this.parent == null) return this; // ignore
  this.updateSourceEndIfNecessary(previousAvailableLineEnd(typeDeclaration.declarationSourceStart - 1));
  return this.parent.add(typeDeclaration, bracketBalanceValue);
}
protected void addBlockStatement(RecoveredBlock recoveredBlock) {
  Block block = recoveredBlock.blockDeclaration;
  if(block.statements != null) {
    Statement[] statements = block.statements;
    for (int i = 0; i < statements.length; i++) {
      recoveredBlock.add(statements[i], 0);
    }
View Full Code Here

        }
    }

    private void visitCatchClauses(TryStatement node, BlockScope scope) {
        if ((node.catchBlocks != null) && (node.catchBlocks.length > 0)) {
            Block lastCatchBlock = node.catchBlocks[node.catchBlocks.length - 1];
            push(JavaEntityType.CATCH_CLAUSES, "", node.tryBlock.sourceEnd + 1, lastCatchBlock.sourceEnd);
            int start = node.tryBlock.sourceEnd();
            for (int i = 0; i < node.catchArguments.length; i++) {
                int catchClauseSourceStart = retrieveStartingCatchPosition(start, node.catchArguments[i].sourceStart);
                push(
View Full Code Here

        this.bracketBalance = 1; // pretend the brace was already there
    }
  }
  // might be an initializer
  if (this.bracketBalance == 1){
    Block block = new Block(0);
    Parser parser = parser();
    block.sourceStart = parser.scanner.startPosition;
    Initializer init;
    if (parser.recoveredStaticInitializerStart == 0){
      init = new Initializer(block, ClassFileConstants.AccDefault);
View Full Code Here

    } else {
      return this.parent.add(localDeclaration, bracketBalanceValue);
    }
  }
  if (this.methodBody == null){
    Block block = new Block(0);
    block.sourceStart = this.methodDeclaration.bodyStart;
    RecoveredElement currentBlock = this.add(block, 1);
    if (this.bracketBalance > 0){
      for (int i = 0; i < this.bracketBalance - 1; i++){
        currentBlock = currentBlock.add(new Block(0), 1);
      }
      this.bracketBalance = 1;
    }
    return currentBlock.add(localDeclaration, bracketBalanceValue);
  }
View Full Code Here

    } else {
      return this.parent.add(statement, bracketBalanceValue);
    }
  }
  if (this.methodBody == null){
    Block block = new Block(0);
    block.sourceStart = this.methodDeclaration.bodyStart;
    RecoveredElement currentBlock = this.add(block, 1);
    if (this.bracketBalance > 0){
      for (int i = 0; i < this.bracketBalance - 1; i++){
        currentBlock = currentBlock.add(new Block(0), 1);
      }
      this.bracketBalance = 1;
    }
    return currentBlock.add(statement, bracketBalanceValue);
  }
View Full Code Here

    }
    return this.parent.add(typeDeclaration, bracketBalanceValue);
  }
  if ((typeDeclaration.bits & ASTNode.IsLocalType) != 0 || parser().methodRecoveryActivated || parser().statementRecoveryActivated){
    if (this.methodBody == null){
      Block block = new Block(0);
      block.sourceStart = this.methodDeclaration.bodyStart;
      this.add(block, 1);
    }
    this.methodBody.attachPendingModifiers(
        this.pendingAnnotations,
View Full Code Here

      this.methodDeclaration.declarationSourceStart = start;
    }
  }

  if (this.methodBody != null){
    Block block = this.methodBody.updatedBlock(depth, knownTypes);
    if (block != null){
      this.methodDeclaration.statements = block.statements;

      if (this.methodDeclaration.declarationSourceEnd == 0) {
        this.methodDeclaration.declarationSourceEnd = block.sourceEnd;
View Full Code Here

    if(start > 0 &&
        start < end &&
        kind != TypeDeclaration.INTERFACE_DECL &&
        kind != TypeDeclaration.ANNOTATION_TYPE_DECL) {
      // the } of the last type can be considered as the end of an initializer
      Initializer initializer = new Initializer(new Block(0), 0);
      initializer.bodyStart = end;
      initializer.bodyEnd = end;
      initializer.declarationSourceStart = end;
      initializer.declarationSourceEnd = end;
      initializer.sourceStart = end;
View Full Code Here

  if (this.parent == null) return this; // ignore
  this.updateSourceEndIfNecessary(previousAvailableLineEnd(typeDeclaration.declarationSourceStart - 1));
  return this.parent.add(typeDeclaration, bracketBalanceValue);
}
protected void addBlockStatement(RecoveredBlock recoveredBlock) {
  Block block = recoveredBlock.blockDeclaration;
  if(block.statements != null) {
    Statement[] statements = block.statements;
    for (int i = 0; i < statements.length; i++) {
      recoveredBlock.add(statements[i], 0);
    }
View Full Code Here

TOP

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

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.