2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1995-01-25 11:30:50 adam
8 * Simple error reporting when parsing regular expressions.
9 * Memory usage reduced.
11 * Revision 1.1 1995/01/24 16:02:53 adam
12 * New private header file in dfa module (dfap.h).
13 * Module no longer uses yacc to parse regular expressions.
23 struct Tnode *root; /* root of regular syntax tree */
24 int position; /* no of positions so far */
25 int rule; /* no of rules so far */
26 BSetHandle *charset; /* character set type */
27 BSet anyset; /* character recognized by `.' */
28 int use_Tnode; /* used Tnodes */
29 int max_Tnode; /* allocated Tnodes */
30 struct Tblock *start; /* start block of Tnodes */
31 struct Tblock *end; /* end block of Tnodes */
34 typedef struct DFA_stateb_ {
35 struct DFA_stateb_ *next;
36 struct DFA_state *state_block;
40 struct DFA_state *freelist; /* chain of unused (but allocated) states */
41 struct DFA_state *unmarked; /* chain of unmarked DFA states */
42 struct DFA_state *marked; /* chain of marked DFA states */
43 DFA_stateb *statemem; /* state memory */
44 int no; /* no of states (unmarked+marked) */
45 SetType st; /* Position set type */
46 int hash; /* no hash entries in hasharray */
47 struct DFA_state **hasharray; /* hash pointers */
48 struct DFA_state **sortarray; /* sorted DFA states */
49 struct DFA_trans *transmem; /* transition memory */
52 int init_DFA_states (struct DFA_states **dfasp, SetType st, int hash);
53 int rm_DFA_states (struct DFA_states **dfasp);
54 int add_DFA_state (struct DFA_states *dfas, Set *s,
55 struct DFA_state **sp);
56 struct DFA_state *get_DFA_state (struct DFA_states *dfas);
57 void sort_DFA_states (struct DFA_states *dfas);
58 void add_DFA_tran (struct DFA_states *, struct DFA_state *,