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

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


        bracketBalance = 1; // pretend the brace was already there
    }
  } 
  // might be an initializer
  if (this.bracketBalance == 1){
    Block block = new Block(0);
    Parser parser = this.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 (methodBody == null){
    Block block = new Block(0);
    block.sourceStart = 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 (methodBody == null){
    Block block = new Block(0);
    block.sourceStart = 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 || this.parser().methodRecoveryActivated || this.parser().statementRecoveryActivated){
    if (methodBody == null){
      Block block = new Block(0);
      block.sourceStart = methodDeclaration.bodyStart;
      this.add(block, 1);
    }
    return methodBody.add(typeDeclaration, bracketBalanceValue, true)
  }
View Full Code Here

  this.methodDeclaration.bodyStart = bodyStart;
}
public AbstractMethodDeclaration updatedMethodDeclaration(){

  if (methodBody != null){
    Block block = methodBody.updatedBlock();
    if (block != null){
      methodDeclaration.statements = block.statements;

      /* first statement might be an explict constructor call destinated to a special slot */
      if (methodDeclaration.isConstructor()) {
View Full Code Here

  if (this.parent == null) return this; // ignore
  this.updateSourceEndIfNecessary(this.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

    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

* in which case the bodyStart is updated.
*/
public RecoveredElement updateOnOpeningBrace(int braceStart, int braceEnd){

  // create a nested block
  Block block = new Block(0);
  block.sourceStart = parser().scanner.startPosition;
  return this.add(block, 1);
}
View Full Code Here

      && localDeclaration.declarationSourceStart > fieldDeclaration.declarationSourceEnd){
    if (parent == null) return this; // ignore
    return this.parent.add(localDeclaration, bracketBalanceValue);
  }
  /* method body should have been created */
  Block block = new Block(0);
  block.sourceStart = ((Initializer)fieldDeclaration).sourceStart;
  RecoveredElement element = this.add(block, 1);
  return element.add(localDeclaration, bracketBalanceValue)
}
View Full Code Here

      && statement.sourceStart > fieldDeclaration.declarationSourceEnd){
    if (parent == null) return this; // ignore
    return this.parent.add(statement, bracketBalanceValue);
  }
  /* initializer body should have been created */
  Block block = new Block(0);
  block.sourceStart = ((Initializer)fieldDeclaration).sourceStart;
  RecoveredElement element = this.add(block, 1);
  return element.add(statement, bracketBalanceValue)
}
View Full Code Here

TOP

Related Classes of org.aspectj.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.