Example #1
0
  //
  // Satisfy IStmt
  //
  public String toStmtText() {
    StringBuilder sb = new StringBuilder("for (");
    if (m_initializers != null) {
      sb.append(m_initializers.toText());
    }
    sb.append(";");
    if (m_condition != null) {
      sb.append(m_condition.toBoolExprText());
    }
    sb.append(";");
    for (int i = 0; i < m_updaters.size(); i++) {
      IExpr updater = m_updaters.get(i);
      sb.append(updater.toExprText());
      if (i < m_updaters.size() - 1) {
        sb.append(",");
      }
    }
    sb.append(")");
    sb.append(getBody().toBlockText());

    return sb.toString();
  }