/************************************************************************ * * * copyright Richard Bornat 1981 * * * ************************************************************************/ /* amount of space that can be taken up by a single string */ #define RESIZE 256 /* number of brackets, plus one */ #define BRLIM 10 /* direction of search */ #define FORWARD 1 #define BACKWARD (-1) /* types of node in an RE structure */ #define p_CHAR 1 #define p_FIN 2 #define p_ANY 3 #define p_BOL 4 #define p_EOL 5 #define p_ONESTAR 6 #define p_TWOSTAR 7 #define p_ONEPLUS 8 #define p_TWOPLUS 9 #define p_QUERY 10 #define p_INSET 11 #define p_OUTSET 12 #define p_ONEOF 13 #define p_SEP 14 #define p_BRA 15 #define p_KET 16 /* special not-nodes */ #define p_nBOL 20 /* states of match process */ #define BEGLINE 0 #define MIDLINE 1 #define ENDLINE 2 #define LBREAK 4 /* the regular expression itself */ extern char RE[]; /* variables to signal end of match */ extern int g_fline; extern char *g_bufp; extern int g_state; /* recording the matching of brackets */ struct BR { int bsline, bfline; int bscol, bfcol; }; extern struct BR br_note[]; extern int br_count; /* information about a successful match */ extern int ms_line, ms_col, mf_line, mf_col; /* information about range over which match should be tried */ extern int mt_line, mt_col; /* place to abandon a match or a substitution */ extern int ab_line, ab_col; /* declarations of procedure types */ extern char *build_re(); extern char *cachebuf();