-} DFA_state;
-
-typedef struct DFA_stateb_ {
- struct DFA_stateb_ *next;
- DFA_state *state_block;
-} DFA_stateb;
-
-typedef struct {
- DFA_state *freelist; /* chain of unused (but allocated) DFA states */
- DFA_state *unmarked; /* chain of unmarked DFA states */
- DFA_state *marked; /* chain of marked DFA states */
- DFA_stateb *statemem; /* state memory */
- int no; /* no of states (unmarked+marked) */
- SetType st; /* Position set type */
- int hash; /* no hash entries in hasharray */
- DFA_state **hasharray; /* hash pointers */
- DFA_state **sortarray; /* sorted DFA states */
- DFA_trans *transmem; /* transition memory */
-} DFA_states;
-
-DFA * init_dfa (void);
-void rm_dfa (DFA **dfap);
-int parse_dfa (DFA *, char **, const unsigned short *);
-DFA_states* mk_dfas (DFA *, int poset_chunk);
-void rm_dfas (DFA_states **dfas);
-
-Tnode * mk_Tnode (void);
-Tnode * mk_Tnode_cset (BSet charset);
-void term_Tnode (void);
-
-int init_DFA_states (DFA_states **dfasp, SetType st, int hash);
-int rm_DFA_states (DFA_states **dfasp);
-int add_DFA_state (DFA_states *dfas, Set *s, DFA_state **sp);
-DFA_state *get_DFA_state (DFA_states *dfas);
-void sort_DFA_states (DFA_states *dfas);
-void add_DFA_tran (DFA_states *, DFA_state *, int, int, int);
+ short rule_nno; /* accept rule no - except start rules */
+};
+
+struct DFA {
+ int no_states;
+ struct DFA_state **states;
+ struct DFA_states *state_info;
+ struct DFA_parse *parse_info;
+};
+
+struct DFA *dfa_init (void);
+void dfa_set_cmap (struct DFA *dfa, void *vp,
+ const char **(*cmap)(void *vp, const char **from, int len));
+int dfa_parse (struct DFA *, const char **);
+void dfa_mkstate (struct DFA *);
+void dfa_delete (struct DFA **);
+
+void dfa_parse_cmap_clean (struct DFA *d);
+void dfa_parse_cmap_new (struct DFA *d, const int *cmap);
+void dfa_parse_cmap_del (struct DFA *d, int from);
+void dfa_parse_cmap_add (struct DFA *d, int from, int to);