Package com.google.gwt.dev.jjs.ast

Examples of com.google.gwt.dev.jjs.ast.JIfStatement


    // no simplification made
    if (original != null) {
      return original;
    }
    return new JIfStatement(condExpr.getSourceInfo(), condExpr, thenStmt,
        elseStmt);
  }
View Full Code Here


          JBinaryOperation compareOperation = new JBinaryOperation(x.getSourceInfo(),
              program.getTypePrimitiveBoolean(), JBinaryOperator.EQ,
              x.getExpr(), caseStatement.getExpr());
          JBlock block = new JBlock(x.getSourceInfo());
          block.addStmt(statement);
          JIfStatement ifStatement = new JIfStatement(x.getSourceInfo(),
              compareOperation, block, null);
          ctx.replaceMe(ifStatement);
        } else {
          // All we have is a default case; convert to a JBlock.
          JBlock block = new JBlock(x.getSourceInfo());
View Full Code Here

      JExpression expr = dispProcessExpression(x.condition);
      JStatement thenStmt = removeThen ? null
          : dispProcessStatement(x.thenStatement);
      JStatement elseStmt = removeElse ? null
          : dispProcessStatement(x.elseStatement);
      JIfStatement ifStmt = new JIfStatement(info, expr, thenStmt, elseStmt);
      return ifStmt;
    }
View Full Code Here

          JBinaryOperation compareOperation = new JBinaryOperation(x.getSourceInfo(),
              program.getTypePrimitiveBoolean(), JBinaryOperator.EQ,
              x.getExpr(), caseStatement.getExpr());
          JBlock block = new JBlock(x.getSourceInfo());
          block.addStmt(statement);
          JIfStatement ifStatement = new JIfStatement(x.getSourceInfo(),
              compareOperation, block, null);
          ctx.replaceMe(ifStatement);
        } else {
          // All we have is a default case; convert to a JBlock.
          JBlock block = new JBlock(x.getSourceInfo());
View Full Code Here

    // no simplification made
    if (original != null) {
      return original;
    }
    return new JIfStatement(condExpr.getSourceInfo(), condExpr, thenStmt,
        elseStmt);
  }
View Full Code Here

      JExpression expr = dispProcessExpression(x.condition);
      JStatement thenStmt = removeThen ? null
          : dispProcessStatement(x.thenStatement);
      JStatement elseStmt = removeElse ? null
          : dispProcessStatement(x.elseStatement);
      JIfStatement ifStmt = new JIfStatement(info, expr, thenStmt, elseStmt);
      return ifStmt;
    }
View Full Code Here

        if (!block.getStatements().isEmpty()) {
          // Only bother adding the assignment if the block is non-empty
          block.addStmt(0, declaration);
        }
        // nest the previous as an else for me
        cur = new JIfStatement(catchInfo, ifTest, block, cur);
      }

      newCatchBlock.addStmt(cur);
      x.getCatchArgs().clear();
      x.getCatchArgs().add(new JLocalRef(newCatchBlock.getSourceInfo(), exVar));
View Full Code Here

        if (!block.statements.isEmpty()) {
          // Only bother adding the assingment if the block is non-empty
          block.statements.add(0, asg);
        }
        // nest the previous as an else for me
        cur = new JIfStatement(program, catchInfo, ifTest, block, cur);
      }

      newCatchBlock.statements.add(cur);
      x.getCatchArgs().clear();
      x.getCatchArgs().add(exRef);
View Full Code Here

      JExpression expr = dispProcessExpression(x.condition);
      JStatement thenStmt = removeThen ? null
          : dispProcessStatement(x.thenStatement);
      JStatement elseStmt = removeElse ? null
          : dispProcessStatement(x.elseStatement);
      JIfStatement ifStmt = new JIfStatement(program, info, expr, thenStmt,
          elseStmt);
      return ifStmt;
    }
View Full Code Here

        if (unflipped != null) {
          // Force sub-parts to blocks, otherwise we break else-if chains.
          // TODO: this goes away when we normalize the Java AST properly.
          thenStmt = ensureBlock(thenStmt);
          elseStmt = ensureBlock(elseStmt);
          ctx.replaceMe(new JIfStatement(program, x.getSourceInfo(), unflipped,
              elseStmt, thenStmt));
          return;
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.jjs.ast.JIfStatement

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.