/**
   * Construye la sintaxis adecuada para generar el gráfico por medio de la aplicación "dot" del
   * toolkit de GraphViz. <br>
   * <br>
   * De acuerdo a ciertos criterios del entorno de simulación, establece los colores y otras
   * características del grafo. <br>
   * <br>
   * El estado inicial y los finales también tienen un formato especial <br>
   * <br>
   * La sintaxis de GraphViz (El lenguaje DOT) se define aquí
   * <href="http://www.graphviz.org/doc/info/lang.html">DOT Language</href>
   *
   * @return String Cadena completa formateada del automata en versión grapviz
   */
  public String getDotSyntax() {

    String result_header = "Digraph AFN {\n" + "\trankdir=LR;\n\toverlap=scale;\n";

    String result_nodes = "\tnode [shape = circle];\n";
    String result_edges = "";

    ListaEstados estados = this.automata.getEstados();

    for (Estado e : estados) {
      boolean mark = false;
      if (this.enSimulacion) {
        mark = (e.getId() == this.EstadoActual.getId());

        if (!mark && this.EstadoSiguiente != null) {
          mark = (e.getId() == this.EstadoSiguiente.getId());
        }
      }

      String EstadoStyle = this.getColorEstado(e, mark);
      result_nodes += "\t" + e.getId() + " " + EstadoStyle + "\n";

      for (Arco enlace : e.getEnlaces()) {

        Estado orig = enlace.getOrigen();
        Estado dest = enlace.getDestino();
        String label = enlace.getEtiqueta();

        mark =
            ((label.compareTo(this.CaracterActual) == 0)
                && (orig.getId() == this.EstadoActual.getId()));

        String EnlaceStyle = this.getEnlaceStyle(enlace, label, mark);
        result_edges += "\t" + orig.getId() + " -> " + dest.getId() + " " + EnlaceStyle + "\n";
      }
    }
    String result = result_header + result_nodes + result_edges + "}";
    return result;
  }