public String dotFormat()

in jflex/src/main/java/jflex/core/NFA.java [486:523]


  public String dotFormat() {
    StringBuilder result = new StringBuilder();

    result.append("digraph NFA {").append(Out.NL);
    result.append("rankdir = LR").append(Out.NL);

    for (int i = 0; i < numStates; i++) {
      if (isFinal[i]) {
        result.append(i);
        result.append(" [shape = doublecircle]");
        result.append(Out.NL);
      }
    }

    for (int i = 0; i < numStates; i++) {
      for (int input = 0; input < numInput; input++) {
        if (table[i][input] != null) {
          for (int s : table[i][input]) {
            result.append(i).append(" -> ").append(s);
            result
                .append(" [label=\"")
                .append(classes.toString(input))
                .append("\"]")
                .append(Out.NL);
          }
        }
      }
      if (epsilon[i] != null) {
        for (int s : epsilon[i]) {
          result.append(i).append(" -> ").append(s).append(" [style=dotted]").append(Out.NL);
        }
      }
    }

    result.append("}").append(Out.NL);

    return result.toString();
  }