LLVM: lib/Support/regex2.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38#ifndef LLVM_SUPPORT_REGEX2_H
39#define LLVM_SUPPORT_REGEX2_H
40
42#include <stddef.h>
43
44
45
46
47#define MAGIC1 ((('r'^0200)<<8) | 'e')
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
70#define OPRMASK 0xf8000000LU
71#define OPDMASK 0x07ffffffLU
72#define OPSHIFT ((unsigned)27)
73#define OP(n) ((n)&OPRMASK)
74#define OPND(n) ((n)&OPDMASK)
75#define SOP(op, opnd) ((op)|(opnd))
76
77
78#define OEND (1LU<<OPSHIFT)
79#define OCHAR (2LU<<OPSHIFT)
80#define OBOL (3LU<<OPSHIFT)
81#define OEOL (4LU<<OPSHIFT)
82#define OANY (5LU<<OPSHIFT)
83#define OANYOF (6LU<<OPSHIFT)
84#define OBACK_ (7LU<<OPSHIFT)
85#define O_BACK (8LU<<OPSHIFT)
86#define OPLUS_ (9LU<<OPSHIFT)
87#define O_PLUS (10LU<<OPSHIFT)
88#define OQUEST_ (11LU<<OPSHIFT)
89#define O_QUEST (12LU<<OPSHIFT)
90#define OLPAREN (13LU<<OPSHIFT)
91#define ORPAREN (14LU<<OPSHIFT)
92#define OCH_ (15LU<<OPSHIFT)
93#define OOR1 (16LU<<OPSHIFT)
94#define OOR2 (17LU<<OPSHIFT)
95#define O_CH (18LU<<OPSHIFT)
96#define OBOW (19LU<<OPSHIFT)
97#define OEOW (20LU<<OPSHIFT)
98
99
100
101
102
103
104
105
106
107
108
109
110
118
119#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c))
120#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c))
121#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask)
122#define MCadd(p, cs, cp) mcadd(p, cs, cp)
123#define MCsub(p, cs, cp) mcsub(p, cs, cp)
124#define MCin(p, cs, cp) mcin(p, cs, cp)
125
126
128
129
130
131
160
161
162#define OUT (CHAR_MAX+1)
163#define ISWORD(c) (isalnum(c&0xff) || (c) == '_')
164
165#endif
unsigned long sop
Definition regex2.h:68
long sopno
Definition regex2.h:69
unsigned char cat_t
Definition regex2.h:127
uch hash
Definition regex2.h:114
char * multis
Definition regex2.h:116
uch mask
Definition regex2.h:113
uch * ptr
Definition regex2.h:112
size_t smultis
Definition regex2.h:115
int cflags
Definition regex2.h:140
uch * setbits
Definition regex2.h:139
int iflags
Definition regex2.h:144
char * must
Definition regex2.h:152
cat_t * categories
Definition regex2.h:151
int neol
Definition regex2.h:149
sopno firststate
Definition regex2.h:142
int csetsize
Definition regex2.h:136
int backrefs
Definition regex2.h:155
int nbol
Definition regex2.h:148
sop * strip
Definition regex2.h:135
int ncategories
Definition regex2.h:150
sopno nplus
Definition regex2.h:156
sopno laststate
Definition regex2.h:143
cset * sets
Definition regex2.h:138
sopno nstates
Definition regex2.h:141
int magic
Definition regex2.h:133
size_t nsub
Definition regex2.h:154
int ncsets
Definition regex2.h:137
cat_t catspace[1]
Definition regex2.h:158
int mlen
Definition regex2.h:153