private void doEnum(TextScanner sc, Writer output) throws IOException {

    
    parseHeaderArgs(sc);

    StringBuilder cs = null;
    int csc = 0;
    if (combinedStringsLabel != null) {
      cs = new StringBuilder();
      cs.append("    ");
      cs.append(vis());
      cs.append("static final String ");
      cs.append(combinedStringsLabel);
      cs.append(" = \"");
    }

    output.write("\n");

    int count = 0;
    while (!sc.eof()) {
      String name = sc.read(J_ID).text().toUpperCase();
      int size = 1;
      Token t = sc.peek();
      if (t.id(J_INTCONST)) {
        size = Integer.parseInt(t.text());
        sc.read();
      }
      if (!name.equals("_")) {
        if (cs != null) {
          if (cs.length() > csc + 60) {
            cs.append("\"+ ");
            cs.append(END_LINE);
            csc = cs.length();
            cs.append("    \"");
          }
          if (count > 0)
            cs.append(' ');
          cs.append(name);
        }

        {
          lb.setLength(0);
          lb.append("    ");
          lb.append(vis());
          lb.append("static final int ");
          int c = lb.length();
          lb.append(prefix);
          lb.append(name);

          Tools.tab(lb, c + 16);
          lb.append(" = ");
          lb.append(offset);
          lb.append(';');
          Tools.tab(lb, c + 24);
          lb.append(END_LINE);
        }

        output.write(lb.toString());

        if (withLengths) {
          {
            lb.setLength(0);
            lb.append("    ");
            lb.append(vis());
            lb.append("static final int ");
            int c = lb.length();
            lb.append(prefix);
            lb.append(name);
            lb.append("_LEN");
            Tools.tab(lb, c + 16);
            lb.append(" = ");
            lb.append(size);
            lb.append(';');
            Tools.tab(lb, c + 24);
            lb.append(END_LINE);
          }

          output.write(lb.toString());
        }
        count++;
      }
      offset += size;
    }
    if (cs != null) {
      cs.append("\"; ");
      output.write(cs.toString());
    }
//    output.write(END_LINE2);
  }