2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.5 1996-01-08 09:09:48 adam
8 * Function dfa_parse got 'const' string argument.
10 * Revision 1.4 1995/01/25 11:31:04 adam
11 * Simple error reporting when parsing regular expressions.
13 * Revision 1.3 1995/01/24 16:01:30 adam
14 * Added -ansi to CFLAGS.
15 * New functions and change of data structures.
17 * Revision 1.2 1994/09/26 16:31:23 adam
18 * Minor changes. xmalloc declares xcalloc now.
20 * Revision 1.1 1994/09/26 10:17:43 adam
21 * Dfa-module header files.
32 unsigned char ch[2]; /* transition on ch[0] <= c <= ch[1] to */
33 unsigned short to; /* this state */
37 struct DFA_trans *next; /* next DFA transition block */
38 struct DFA_tran *tran_block; /* pointer to transitions */
39 int ptr; /* index of next transition in tran_block */
40 int size; /* allocated size of tran_block */
44 struct DFA_state *next; /* next entry in free/unmarked/marked list */
45 struct DFA_state *link; /* link to next entry in hash chain */
46 struct DFA_tran *trans; /* transition list */
47 Set set; /* set of positions (important nfa states) */
48 short no; /* no of this state */
49 short tran_no; /* no of transitions to other states */
50 short rule_no; /* if non-zero, this holds accept rule no */
51 short rule_nno; /* accept rule no - except start rules */
56 struct DFA_state **states;
57 struct DFA_states *state_info;
58 struct DFA_parse *parse_info;
61 struct DFA *dfa_init (void);
62 int dfa_parse (struct DFA *, const char **);
63 void dfa_mkstate (struct DFA *);
64 void dfa_delete (struct DFA **);
66 void dfa_parse_cmap_clean (struct DFA *d);
67 void dfa_parse_cmap_new (struct DFA *d, const int *cmap);
68 void dfa_parse_cmap_del (struct DFA *d, int from);
69 void dfa_parse_cmap_add (struct DFA *d, int from, int to);
71 extern int debug_dfa_trav;
72 extern int debug_dfa_tran;
73 extern int debug_dfa_followpos;
74 extern int dfa_verbose;
94 #define DFA_ERR_SYNTAX 1