]> pd.if.org Git - pccts/blob - support/rexpr/rexpr.h
auto commit for import
[pccts] / support / rexpr / rexpr.h
1 #define Atom    256             /* token Atom (an impossible char value) */
2 #define Epsilon 257             /* epsilon arc (an impossible char value) */
3
4 /* track field must be same for all node types */
5 typedef struct _a {
6                                         struct _a *track;       /* track mem allocation */
7                                         int label;
8                                         struct _a *next;
9                                         struct _n *target;
10                                 } Arc, *ArcPtr;
11
12 typedef struct _n {
13                                         struct _n *track;
14                                         ArcPtr arcs, arctail;
15                                 } Node, *NodePtr;
16
17 typedef struct  {
18                                         NodePtr left,
19                                                         right;
20                                 } Graph, *GraphPtr;
21
22 #ifdef __STDC__
23 int rexpr( char *expr, char *s );
24 int match( NodePtr automaton, char *s );
25 #else
26 int rexpr();
27 int match();
28 #endif
29
30