4 #define uchar __reuchar
5 typedef unsigned char uchar;
6 #define nelem(x) (sizeof(x)/sizeof((x)[0]))
9 typedef struct Resublist Resublist;
16 * Actions and Tokens (Reinst types)
18 * 02xx are operators, value == precedence
19 * 03xx are tokens, i.e. operands for operators
22 #define OPERATOR 0200 /* Bitmask of all operators */
23 #define START 0200 /* Start, used for marker on stack */
24 #define RBRA 0201 /* Right bracket, ) */
25 #define LBRA 0202 /* Left bracket, ( */
26 #define OR 0203 /* Alternation, | */
27 #define CAT 0204 /* Concatentation, implicit operator */
28 #define STAR 0205 /* Closure, * */
29 #define PLUS 0206 /* a+ == aa* */
30 #define QUEST 0207 /* a? == a|nothing, i.e. 0 or 1 a's */
31 #define ANY 0300 /* Any character except newline, . */
32 #define ANYNL 0301 /* Any character including newline, . */
33 #define NOP 0302 /* No operation, internal use only */
34 #define BOL 0303 /* Beginning of line, ^ */
35 #define EOL 0304 /* End of line, $ */
36 #define CCLASS 0305 /* Character class, [] */
37 #define NCCLASS 0306 /* Negated character class, [] */
38 #define END 0377 /* Terminate: match found */
41 * regexec execution lists
44 #define BIGLISTSIZE (25*LISTSIZE)
45 typedef struct Relist Relist;
48 Reinst* inst; /* Reinstruction of the thread */
49 Resublist se; /* matched subexpressions in this thread */
51 typedef struct Reljunk Reljunk;
64 extern Relist* _renewthread(Relist*, Reinst*, int, Resublist*);
65 extern void _renewmatch(Resub*, int, Resublist*);
66 extern Relist* _renewemptythread(Relist*, Reinst*, int, char*);
67 extern Relist* _rrenewemptythread(Relist*, Reinst*, int, Rune*);