#define MAXPAT 10 /* maximal number of patterns */
#define MAXCHARS 256 /* maximal number of characters */
                    /* caracters are coded as numbers 1,2,... */
#define MAXFRAG 10 /* maximal number of fragments in each pattern */
#define MAXSTR 256 /* maximal length of a fragment */

#define PRIMARY 'P'
#define SECONDARY 'S'
#define UNDEFINED NULL
#define DONTCARE '#'

#define YES 1
#define NO 0

#define ALREADY 'A'
#define NOT_YET 'B'

#define LET_TO_NUM(c)  ((unsigned char) c)
#define NUM_TO_LET(i)  ((char) i) 

typedef struct NODE {
   struct NODE *out[MAXCHARS];
   char type[MAXCHARS];
   struct NODE *suf_pointer;
   int depth;
   struct KWLIST *terminal;   /* list "terminal" */
   struct NODE *origin;
   int last_letter;
   int number_of_children;       /* comment: we can do without this attribut */
   struct NODE *child;           /* references to the "leftmost" child */
   struct NODE *left_neighbour;  /* "left neighbour" in the children list */
   struct NODE *right_neighbour; /* "right neighbour" in the children list */
   int prefix_degree;
   char visited;              /* auxiliary field; for printing */
   int number;                /* auxiliary field; for numbering */
} node;

typedef struct KWLIST {       /* element type of the list "terminal" */
   int kw;                    /* pattern for which the node is terminal */
   struct KWLIST *next;       /* next element in the list */
} kwlist;

typedef struct PAIR {         /* pair <state,length> */
   node *nod;
   int len;
} pair;


