Пример #1
0
  public void toString(UnitPrinter up) {
    label_toString(up);

    up.literal("switch");
    up.literal(" ");
    up.literal("(");
    keyBox.toString(up);
    up.literal(")");
    up.newline();

    up.literal("{");
    up.newline();

    Iterator<Object> it = indexList.iterator();
    while (it.hasNext()) {

      Object index = it.next();

      up.incIndent();

      if (index instanceof String) up.literal("default");
      else {
        up.literal("case");
        up.literal(" ");
        up.literal(index.toString());
      }

      up.literal(":");
      up.newline();

      List<Object> subBody = index2BodyList.get(index);

      if (subBody != null) {
        up.incIndent();
        body_toString(up, subBody);

        if (it.hasNext()) up.newline();
        up.decIndent();
      }
      up.decIndent();
    }

    up.literal("}");
    up.newline();
  }
Пример #2
0
 public Value get_Key() {
   return keyBox.getValue();
 }