Package org.eclipse.php.internal.core.ast.nodes

Examples of org.eclipse.php.internal.core.ast.nodes.Block.statements()


      ListRewrite lrw;
           
      if(parent instanceof Block) {
       
        if(!createdMethodBody) {
          extractedMethodBody.statements().addAll(ASTNode.copySubtrees(ast, selectedNodeOccurence));
          addReturnStatement(ast, extractedMethodBody, fReturnStatement);
          createdMethodBody = true;
        }
       
        lrw = rewriter.getListRewrite(parent, Block.STATEMENTS_PROPERTY);
View Full Code Here


        .getFormatterCommonPrferences().getIndentationChar(document);
    String indent = String.valueOf(indentChar);
   
    ClassDeclaration clazz = (ClassDeclaration) node;
    Block body = clazz.getBody();
    List<Statement> bodyStatements = body.statements();
       

    int end = bodyStatements.get(bodyStatements.size()-1).getEnd();
   
    if (insertFirst) {
View Full Code Here

    List<TryStatement> statements = getAllOfType(program,
        TryStatement.class);
    Assert.assertTrue("Unexpected list size.", statements.size() == 1);
    Block newBlock = ast.newBlock();
    newBlock.statements().add(
        ast.newEchoStatement(ast.newScalar("'Hello'")));
    statements
        .get(0)
        .catchClauses()
        .add(ast.newCatchClause(ast.newIdentifier("Boobo"),
View Full Code Here

    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        IfStatement statement = (IfStatement) program.statements().get(
            0);
        Block block = (Block) statement.getTrueStatement();
        block.statements().remove(0);
      }
    });
  }

  public void testDeleteBlockMiddle() throws Exception {
View Full Code Here

    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        IfStatement statement = (IfStatement) program.statements().get(
            0);
        Block block = (Block) statement.getTrueStatement();
        block.statements().remove(1);
      }
    });
  }

  public void testDeleteBlockLast() throws Exception {
View Full Code Here

    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        IfStatement statement = (IfStatement) program.statements().get(
            0);
        Block block = (Block) statement.getTrueStatement();
        block.statements().remove(2);
      }
    });
  }

  public void testDeleteForComponent1() throws Exception {
View Full Code Here

    List<TryStatement> statements = getAllOfType(program,
        TryStatement.class);
    Assert.assertTrue("Unexpected list size.", statements.size() == 1);
    Block newBlock = ast.newBlock();
    newBlock.statements().add(
        ast.newEchoStatement(ast.newScalar("'Hello'")));
    statements
        .get(0)
        .catchClauses()
        .add(ast.newCatchClause(ast.newIdentifier("Boobo"),
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.