Examples of ForStatement


Examples of org.codehaus.groovy.ast.stmt.ForStatement

                    newMCE
            );
            add.setImplicitThis(false);
            add.setMethodTarget(StaticCompilationVisitor.ARRAYLIST_ADD_METHOD);
            // for (e in receiver) { result.add(e?.method(arguments) }
            ForStatement stmt = new ForStatement(
                    iterator,
                    receiver,
                    new ExpressionStatement(add)
            );
            stmt.visit(controller.getAcg());
            // else { empty list }
            mv.visitLabel(ifnull);

            // end of if/else
            // return result list
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.ForStatement

                "add",
                assignment
        );
        add.setMethodTarget(ARRAYLIST_ADD_METHOD);
        // for (e in receiver) { result.add(e?.method(arguments) }
        ForStatement stmt = new ForStatement(
                iterator,
                receiver,
                new ExpressionStatement(add)
        );
        stmt.visit(controller.getAcg());
        // else { empty list }
        mv.visitLabel(ifnull);

        // end of if/else
        // return result list
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ForStatement

     * @param post post-loop expression (optional third part of 'for', <code>null</code> if none)
     * @param block statement body block
     */
    private void addForStatement(String name, Type type, Expression init, Expression test, Expression post,
        BlockBuilder block) {
        ForStatement stmt = m_ast.newForStatement();
        VariableDeclarationFragment declfrag = m_ast.newVariableDeclarationFragment();
        declfrag.setName(m_ast.newSimpleName(name));
        declfrag.setInitializer(init);
        VariableDeclarationExpression varexpr = m_ast.newVariableDeclarationExpression(declfrag);
        varexpr.setType(type);
        stmt.initializers().add(varexpr);
        stmt.setExpression(test);
        if (post != null) {
            stmt.updaters().add(post);
        }
        stmt.setBody(block.getStatement());
        m_block.statements().add(stmt);
    }
View Full Code Here

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

        0,
        length);
    }
  }
  pushOnAstStack(
    new ForStatement(
      inits,
      cond,
      updates,
      statement,
      scope,
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.nodes.ForStatement

  public void testDeleteForComponent1() throws Exception {
    String str = "<?php for ($i = 1; $i <= 10; $i++) {  echo $i; } ?>";
    String expected = "<?php for (;;) {  echo $i; } ?>";
    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        ForStatement statement = (ForStatement) program.statements()
            .get(0);
        statement.initializers().remove(0);
        statement.conditions().remove(0);
        statement.updaters().remove(0);
      }
    });
  }
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.