Examples of WhileStatement


Examples of anvil.script.statements.WhileStatement

      break;
    case WHILE:
      t = jj_consume_token(WHILE);
      Expression();
      jj_consume_token(SEMICOLON);
      WhileStatement whileStmt = new WhileStatement(context, toLocation(t), (Expression)pop(), null);
      whileStmt.setChildStatement(stmt);
      stmt.setParentStatement(whileStmt);
      context.setChildStatement(whileStmt);
      break;
    case SEMICOLON:
      t = jj_consume_token(SEMICOLON);
View Full Code Here

Examples of anvil.script.statements.WhileStatement

  Token t;
    t = jj_consume_token(WHILE);
    jj_consume_token(OPEN);
    Expression();
    jj_consume_token(CLOSE);
      flowPushChild(new WhileStatement(flowPeek(), toLocation(t), (Expression)pop(), label));
    Statement();
      flowPop();
  }
View Full Code Here

Examples of com.bacoder.parser.java.api.WhileStatement

    return tryStatement;
  }

  protected WhileStatement processWhileStatement(StatementContext context) {
    WhileStatement whileStatement = createNode(context, WhileStatement.class);

    ParExpressionContext parExpressionContext = getChild(context, ParExpressionContext.class);
    whileStatement.setCondition(processParExpression(parExpressionContext));

    StatementContext statementContext = getChild(context, StatementContext.class);
    if (statementContext != null) {
      whileStatement.setStatement(getAdapter(StatementAdapter.class).adapt(statementContext));
    }

    return whileStatement;
  }
View Full Code Here

Examples of com.dragome.compiler.ast.WhileStatement

    selfEdges= graph.removeSelfEdges(header);
  }

  void rollOut_(Block block)
  {
    WhileStatement loopStmt= new WhileStatement();
    Block loopBody= new Block();
    loopStmt.setBlock(loopBody);
    loopStmt.setExpression(new BooleanLiteral(true));

    block.appendChild(loopStmt);

    Iterator iter= selfEdges.iterator();
    while (iter.hasNext())
    {
      Edge edge= (Edge) iter.next();
      if (!edge.isGlobal())
        continue;
      loopStmt.isLabeled();
      produceJump(edge, loopStmt);
    }

    graph.rollOut(header, loopBody);
  }
View Full Code Here

Examples of com.google.minijoe.compiler.ast.WhileStatement

    readToken(Token.OPERATOR_OPENPAREN);
    expression = parseExpression(true);
    readToken(Token.OPERATOR_CLOSEPAREN);
    statement = parseStatement();

    return new WhileStatement(expression, statement);
  }
View Full Code Here

Examples of com.google.minijoe.compiler.ast.WhileStatement

    assertParserOutput(
        new LabelledStatement(
            new Identifier("foo"),
            new LabelledStatement(
                new Identifier("bar"),
                new WhileStatement(
                    new BooleanLiteral(true),
                    new BlockStatement(
                        new Statement[] {
                            new ExpressionStatement(
                                new Identifier("baz")
View Full Code Here

Examples of com.google.minijoe.compiler.ast.WhileStatement

    super(name);
  }

  public void testWhileStatement() throws CompilerException {
    assertParserOutput(
        new WhileStatement(
            new BooleanLiteral(true),
            new ExpressionStatement(
                new Identifier("something")
            )
        ),
        "while (true) something;"
    );
    assertParserOutput(
        new WhileStatement(
            new BooleanLiteral(true),
            new BlockStatement(
                new Statement[] {
                    new ExpressionStatement(
                        new Identifier("something")
View Full Code Here

Examples of org.allspice.structured.statement.WhileStatement

      test = new ConstExpr(Boolean.TRUE,range) ;
    }
    else {
        test = term ;
    }
    Statement whileState = new WhileStatement(test,whilebody,range) ;
    if (init == null) {
      return new FIFO<Statement>(whileState) ;
    }
    if (init instanceof ExprForInit) {
        Expr e = ((ExprForInit)init).e ;
View Full Code Here

Examples of org.allspice.structured.statement.WhileStatement

    WhileTest obj = makeObject(WhileTest.class,new DeclareStatement(
        new FIFO<VarDecl>(new VarDecl("int","i"),new VarDecl("int","total")),
        new FIFO<Statement>(
        new ExprStatement(new SetValueExpr(I,new ConstExpr(Integer.valueOf(0),null),null),null),
        new ExprStatement(new SetValueExpr(TOTAL,new ConstExpr(Integer.valueOf(0),null),null),null),
        new WhileStatement(
            new LTExpr(I,ARG0,null),
            new FIFO<Statement>(
            new ExprStatement(new AddInPlaceExpr(I,new ConstExpr(Integer.valueOf(1),null),null),null),
            new ExprStatement(new AddInPlaceExpr(TOTAL,new ConstExpr(Integer.valueOf(2),null),null),null)),null),
        new ReturnStatement(TOTAL,null)
View Full Code Here

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

  // WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf

  this.expressionLengthPtr--;
  Statement statement = (Statement) this.astStack[this.astPtr];
  this.astStack[this.astPtr] =
    new WhileStatement(
      this.expressionStack[this.expressionPtr--],
      statement,
      this.intStack[this.intPtr--],
      this.endStatementPosition);
}
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.