2 * Copyright (C) 1994-1999, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.9 1999-02-02 14:50:31 adam
8 * Updated WIN32 code specific sections. Changed header.
10 * Revision 1.8 1997/09/18 08:59:18 adam
11 * Extra generic handle for the character mapping routines.
13 * Revision 1.7 1997/09/05 15:29:59 adam
14 * Changed prototype for chr_map_input - added const.
15 * Added support for C++, headers uses extern "C" for public definitions.
17 * Revision 1.6 1996/06/04 10:20:10 adam
18 * Added support for character mapping.
20 * Revision 1.5 1996/01/08 09:09:48 adam
21 * Function dfa_parse got 'const' string argument.
23 * Revision 1.4 1995/01/25 11:31:04 adam
24 * Simple error reporting when parsing regular expressions.
26 * Revision 1.3 1995/01/24 16:01:30 adam
27 * Added -ansi to CFLAGS.
28 * New functions and change of data structures.
30 * Revision 1.2 1994/09/26 16:31:23 adam
31 * Minor changes. xmalloc declares xcalloc now.
33 * Revision 1.1 1994/09/26 10:17:43 adam
34 * Dfa-module header files.
49 unsigned char ch[2]; /* transition on ch[0] <= c <= ch[1] to */
50 unsigned short to; /* this state */
54 struct DFA_trans *next; /* next DFA transition block */
55 struct DFA_tran *tran_block; /* pointer to transitions */
56 int ptr; /* index of next transition in tran_block */
57 int size; /* allocated size of tran_block */
61 struct DFA_state *next; /* next entry in free/unmarked/marked list */
62 struct DFA_state *link; /* link to next entry in hash chain */
63 struct DFA_tran *trans; /* transition list */
64 Set set; /* set of positions (important nfa states) */
65 short no; /* no of this state */
66 short tran_no; /* no of transitions to other states */
67 short rule_no; /* if non-zero, this holds accept rule no */
68 short rule_nno; /* accept rule no - except start rules */
73 struct DFA_state **states;
74 struct DFA_states *state_info;
75 struct DFA_parse *parse_info;
78 struct DFA *dfa_init (void);
79 void dfa_set_cmap (struct DFA *dfa, void *vp,
80 const char **(*cmap)(void *vp, const char **from, int len));
81 int dfa_parse (struct DFA *, const char **);
82 void dfa_mkstate (struct DFA *);
83 void dfa_delete (struct DFA **);
85 void dfa_parse_cmap_clean (struct DFA *d);
86 void dfa_parse_cmap_new (struct DFA *d, const int *cmap);
87 void dfa_parse_cmap_del (struct DFA *d, int from);
88 void dfa_parse_cmap_add (struct DFA *d, int from, int to);
90 extern int debug_dfa_trav;
91 extern int debug_dfa_tran;
92 extern int debug_dfa_followpos;
93 extern int dfa_verbose;
113 #define DFA_ERR_SYNTAX 1