#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

#ifndef mon_include
#define mon_include

// Structures

enum typeEtat {TRANSITION, EPSILON1, EPSILON2, TERMINAL};
 
struct etatStruct {
	int numero;
	enum typeEtat type;
	union{
		struct transition {
			char lettre; struct etatStruct *etat;
		} transition;
		struct epsilon1 {
			struct etatStruct *etat1;
		} epsilon1;
		struct epsilon2 {
			struct etatStruct *etat1, *etat2;
		} epsilon2;
	} fonction;
};
typedef struct etatStruct etat;

struct automateStruct {
	int nbEtats;
	etat *etats;
	etat *etatInitial;
	etat *etatFinal;
};
typedef struct automateStruct automate;

// Fonctions

void         impAutomate(automate * autom, char * alphabet);

int          checkExpression(char * expression, char * alphabet);

automate*    lettre(char c);
automate*    somme(automate * a,automate * b);
automate*    produit(automate * a,automate * b);
automate*    etoile(automate * a);

automate*    construireAutomate(char * expression, char * alphabet);


#endif
