Package com.dragome.compiler.ast

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


    if (edge instanceof ConditionalEdge)
    {
      ConditionalEdge condEdge= (ConditionalEdge) edge;
      BooleanExpression condExpr= condEdge.getBooleanExpression();
      Expression expr= Optimizer.simplifyBooleanExpression(condExpr.getExpression(), condEdge.isNegate());
      IfStatement ifStmt= new IfStatement();
      ifStmt.setExpression(expr);
      referer.block.appendChild(ifStmt);
      Block ifBlock= new Block();
      ifStmt.setIfBlock(ifBlock);
      breakBlock= ifBlock;
    }
    else
    {
      breakBlock= referer.block;
View Full Code Here

TOP

Related Classes of com.dragome.compiler.ast.IfStatement

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.