// afn.c

// << Algorithmique du texte >>
// Maxime Crochemore, Christophe Hancart et Thierry Lecroq
// Vuibert, 2001.

#include <stdio.h>
#include "chl.h"
#include "cellule.h"
#include "liste.h"
#include "afn.h"

Etat nouvelEtat() {
   Etat etat;

   etat = (Etat)malloc(sizeof(struct _etat));
   if (etat == NULL)
      error("nouvelEtat");
   etat->numero = compteur++;
   etat->terminal = 0;
   etat->succ = listeVide();
   return(etat);
}

Automate nouvelAutomate() {
   Automate M;

   M = (Automate)malloc(sizeof(struct _automate));
   if (M == NULL)
      error("nouvelEtat");
   M->initial = nouvelEtat();
   return(M);
}