X-Git-Url: https://pd.if.org/git/?p=pccts;a=blobdiff_plain;f=support%2Frexpr%2Frexpr.h;fp=support%2Frexpr%2Frexpr.h;h=336be2e400d40134573ca6863f0b64286158a07c;hp=0000000000000000000000000000000000000000;hb=56dd00148e59773742903ee71be791eaa49a8616;hpb=cb15b978c765a661bf3154d865fa3e2401d649f5 diff --git a/support/rexpr/rexpr.h b/support/rexpr/rexpr.h new file mode 100755 index 0000000..336be2e --- /dev/null +++ b/support/rexpr/rexpr.h @@ -0,0 +1,30 @@ +#define Atom 256 /* token Atom (an impossible char value) */ +#define Epsilon 257 /* epsilon arc (an impossible char value) */ + +/* track field must be same for all node types */ +typedef struct _a { + struct _a *track; /* track mem allocation */ + int label; + struct _a *next; + struct _n *target; + } Arc, *ArcPtr; + +typedef struct _n { + struct _n *track; + ArcPtr arcs, arctail; + } Node, *NodePtr; + +typedef struct { + NodePtr left, + right; + } Graph, *GraphPtr; + +#ifdef __STDC__ +int rexpr( char *expr, char *s ); +int match( NodePtr automaton, char *s ); +#else +int rexpr(); +int match(); +#endif + +