Examples of IfStatement


Examples of anvil.script.statements.IfStatement

  }

  final public void StatementModifier(Statement stmt) throws ParseException {
  Token t;
  Expression expr;
  IfStatement ifStmt;
    Statement context = flowPeek();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case IF:
      t = jj_consume_token(IF);
      Expression();
      jj_consume_token(SEMICOLON);
      ifStmt = new IfStatement(context, toLocation(t), (Expression)pop());
      ifStmt.setChildStatement(stmt);
      stmt.setParentStatement(ifStmt);
      context.setChildStatement(ifStmt);
      break;
    case WHILE:
      t = jj_consume_token(WHILE);
View Full Code Here

Examples of anvil.script.statements.IfStatement

    StatementModifier(stmt);
  }

  final public void IfStatement() throws ParseException {
  Token t;
  IfStatement stmt;
    t = jj_consume_token(IF);
    jj_consume_token(OPEN);
    Expression();
    jj_consume_token(CLOSE);
      stmt = new IfStatement(flowPeek(), toLocation(t), (Expression)pop());
      flowPushChild(stmt);
    Statement();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ELSE:
      jj_consume_token(ELSE);
      stmt.onElse();
      Statement();
      break;
    default:
      jj_la1[62] = jj_gen;
      ;
View Full Code Here

Examples of anvil.script.statements.IfStatement

  Statement stmt = null;
    t = jj_consume_token(IF);
    jj_consume_token(OPEN);
    Expression();
    jj_consume_token(CLOSE);
    stmt = new IfStatement(parent, toLocation(t), (Expression)pop());
    parent.setChildStatement(stmt);
    Comprehension(compr, root, stmt);
  }
View Full Code Here

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

    return forStatement;
  }

  protected IfStatement processIfStatement(StatementContext context) {
    IfStatement ifStatement = createNode(context, IfStatement.class);

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

    List<StatementContext> statementContexts = getChildren(context, StatementContext.class);
    if (statementContexts.size() > 0) {
      ifStatement.setThenStatement(
          getAdapter(StatementAdapter.class).adapt(statementContexts.get(0)));
    }

    if (statementContexts.size() > 1) {
      ifStatement.setElseStatement(
          getAdapter(StatementAdapter.class).adapt(statementContexts.get(1)));
    }

    return ifStatement;
  }
View Full Code Here

Examples of com.dragome.compiler.ast.IfStatement

    {
      block.appendChild(node.block);

      if (node.isBranch())
      {
        IfStatement ifStmt= new IfStatement();
        ConditionalEdge cEdge= node.getConditionalEdge(true);
        ifStmt.setExpression(cEdge.getBooleanExpression().getExpression());
        ifStmt.setIfBlock(new Block());
        Block targetBlock= cEdge.target.block;
        ifStmt.getIfBlock().appendChild(new BreakStatement(targetBlock));
        ifStmt.setElseBlock(new Block());
        targetBlock= node.getConditionalEdge(false).target.block;
        ifStmt.getElseBlock().appendChild(new BreakStatement(targetBlock));
        block.appendChild(ifStmt);
      }
      else
      {
        for (Edge e : node.getOutEdges())
View Full Code Here

Examples of com.facebook.presto.byteCode.control.IfStatement

                    .invokeVirtual(BlockBuilder.class, "appendNull", BlockBuilder.class)
                    .pop();

            projectionMethod.getBody()
                    .comment("if the result was null, appendNull; otherwise append the value")
                    .append(new IfStatement(context, new Block(context).getVariable("wasNull"), nullBlock, notNullBlock))
                    .ret();
        }
        else {
            projectionMethod
                    .getBody()
View Full Code Here

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

    if (nextToken == Token.KEYWORD_ELSE) {
      readToken(Token.KEYWORD_ELSE);
      falseStatement = parseStatement();
    }

    return new IfStatement(expression, trueStatement, falseStatement);
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.IfStatement

    finished();
  }

  @Override
  public void beginIfStatement() {
    Node node = new IfStatement();
    parent.addChild(node);
    pushBuilder(new StatementBuilder(node));
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.IfStatement

  }

  public void testIfStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { if (true); }");
    FunctionDefinition functionFoo = unit.getChild(0);
    IfStatement ifStatement = functionFoo.getChild(0);
    assertNotNull(ifStatement);
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.IfStatement

  }

  public void testIfElseStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { if (true); else; }");
    FunctionDefinition functionFoo = unit.getChild(0);
    IfStatement ifStatement = functionFoo.getChild(0);
    assertNotNull(ifStatement);
    ElseStatement elseStatement = functionFoo.getChild(1);
    assertNotNull(elseStatement);
  }
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.