This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [perl #40302] sigtrap(3pm) man page is vague
[perl5.git] / regnodes.h
CommitLineData
37442d52
RGS
1/* -*- buffer-read-only: t -*-
2 !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
885f9e59 3 This file is built by regcomp.pl from regcomp.sym.
d09b2d29
IZ
4 Any changes made here will be lost!
5*/
6
22c35a8c 7#define END 0 /* 0 End of program. */
d09b2d29
IZ
8#define SUCCEED 1 /* 0x1 Return from a subroutine, basically. */
9#define BOL 2 /* 0x2 Match "" at beginning of line. */
10#define MBOL 3 /* 0x3 Same, assuming multiline. */
11#define SBOL 4 /* 0x4 Same, assuming singleline. */
b85d18e9
IZ
12#define EOS 5 /* 0x5 Match "" at end of string. */
13#define EOL 6 /* 0x6 Match "" at end of line. */
14#define MEOL 7 /* 0x7 Same, assuming multiline. */
15#define SEOL 8 /* 0x8 Same, assuming singleline. */
16#define BOUND 9 /* 0x9 Match "" at any word boundary */
ffc61ed2
JH
17#define BOUNDL 10 /* 0xa Match "" at any word boundary */
18#define NBOUND 11 /* 0xb Match "" at any word non-boundary */
19#define NBOUNDL 12 /* 0xc Match "" at any word non-boundary */
20#define GPOS 13 /* 0xd Matches where last m//g left off. */
21#define REG_ANY 14 /* 0xe Match any one character (except newline). */
22#define SANY 15 /* 0xf Match any one character. */
f33976b4
DB
23#define CANY 16 /* 0x10 Match any one byte. */
24#define ANYOF 17 /* 0x11 Match character in (or not in) this class. */
25#define ALNUM 18 /* 0x12 Match any alphanumeric character */
26#define ALNUML 19 /* 0x13 Match any alphanumeric char in locale */
27#define NALNUM 20 /* 0x14 Match any non-alphanumeric character */
28#define NALNUML 21 /* 0x15 Match any non-alphanumeric char in locale */
29#define SPACE 22 /* 0x16 Match any whitespace character */
30#define SPACEL 23 /* 0x17 Match any whitespace char in locale */
31#define NSPACE 24 /* 0x18 Match any non-whitespace character */
32#define NSPACEL 25 /* 0x19 Match any non-whitespace char in locale */
33#define DIGIT 26 /* 0x1a Match any numeric character */
34#define DIGITL 27 /* 0x1b Match any numeric character in locale */
35#define NDIGIT 28 /* 0x1c Match any non-numeric character */
36#define NDIGITL 29 /* 0x1d Match any non-numeric character in locale */
37#define CLUMP 30 /* 0x1e Match any combining character sequence */
38#define BRANCH 31 /* 0x1f Match this alternative, or the next... */
39#define BACK 32 /* 0x20 Match "", "next" ptr points backward. */
40#define EXACT 33 /* 0x21 Match this string (preceded by length). */
41#define EXACTF 34 /* 0x22 Match this string, folded (prec. by length). */
42#define EXACTFL 35 /* 0x23 Match this string, folded in locale (w/len). */
ce5e9471
YO
43#define NOTHING 36 /* 0x24 Match empty string. */
44#define TAIL 37 /* 0x25 Match empty string. Can jump here from outside. */
45#define STAR 38 /* 0x26 Match this (simple) thing 0 or more times. */
46#define PLUS 39 /* 0x27 Match this (simple) thing 1 or more times. */
47#define CURLY 40 /* 0x28 Match this simple thing {n,m} times. */
48#define CURLYN 41 /* 0x29 Match next-after-this simple thing */
49#define CURLYM 42 /* 0x2a Match this medium-complex thing {n,m} times. */
50#define CURLYX 43 /* 0x2b Match this complex thing {n,m} times. */
51#define WHILEM 44 /* 0x2c Do curly processing and see if rest matches. */
52#define OPEN 45 /* 0x2d Mark this point in input as start of #n. */
53#define CLOSE 46 /* 0x2e Analogous to OPEN. */
54#define REF 47 /* 0x2f Match some already matched string */
55#define REFF 48 /* 0x30 Match already matched string, folded */
56#define REFFL 49 /* 0x31 Match already matched string, folded in loc. */
57#define IFMATCH 50 /* 0x32 Succeeds if the following matches. */
58#define UNLESSM 51 /* 0x33 Fails if the following matches. */
59#define SUSPEND 52 /* 0x34 "Independent" sub-RE. */
60#define IFTHEN 53 /* 0x35 Switch, should be preceeded by switcher . */
61#define GROUPP 54 /* 0x36 Whether the group matched. */
62#define LONGJMP 55 /* 0x37 Jump far away. */
63#define BRANCHJ 56 /* 0x38 BRANCH with long offset. */
64#define EVAL 57 /* 0x39 Execute some Perl code. */
65#define MINMOD 58 /* 0x3a Next operator is not greedy. */
66#define LOGICAL 59 /* 0x3b Next opcode should set the flag only. */
67#define RENUM 60 /* 0x3c Group with independently numbered parens. */
68#define OPTIMIZED 61 /* 0x3d Placeholder for dump. */
8e11feef 69#define TRIE 62 /* 0x3e Match many EXACT(FL?)? at once. flags==type */
786e8c11 70#define TRIEC 63 /* 0x3f Same as TRIE, but with embedded charclass data */
8e11feef 71#define PSEUDO 64 /* 0x40 Pseudo opcode for internal use. */
40a82448 72#define REGNODE_MAX 64
d09b2d29
IZ
73
74#ifndef DOINIT
22c35a8c 75EXTCONST U8 PL_regkind[];
d09b2d29 76#else
22c35a8c 77EXTCONST U8 PL_regkind[] = {
d09b2d29
IZ
78 END, /* END */
79 END, /* SUCCEED */
80 BOL, /* BOL */
81 BOL, /* MBOL */
82 BOL, /* SBOL */
b85d18e9 83 EOL, /* EOS */
d09b2d29
IZ
84 EOL, /* EOL */
85 EOL, /* MEOL */
86 EOL, /* SEOL */
87 BOUND, /* BOUND */
88 BOUND, /* BOUNDL */
89 NBOUND, /* NBOUND */
90 NBOUND, /* NBOUNDL */
91 GPOS, /* GPOS */
22c35a8c 92 REG_ANY, /* REG_ANY */
22c35a8c 93 REG_ANY, /* SANY */
f33976b4 94 REG_ANY, /* CANY */
d09b2d29
IZ
95 ANYOF, /* ANYOF */
96 ALNUM, /* ALNUM */
97 ALNUM, /* ALNUML */
98 NALNUM, /* NALNUM */
99 NALNUM, /* NALNUML */
100 SPACE, /* SPACE */
101 SPACE, /* SPACEL */
102 NSPACE, /* NSPACE */
103 NSPACE, /* NSPACEL */
104 DIGIT, /* DIGIT */
b8c5462f 105 DIGIT, /* DIGITL */
d09b2d29 106 NDIGIT, /* NDIGIT */
b8c5462f 107 NDIGIT, /* NDIGITL */
a0ed51b3 108 CLUMP, /* CLUMP */
d09b2d29
IZ
109 BRANCH, /* BRANCH */
110 BACK, /* BACK */
111 EXACT, /* EXACT */
112 EXACT, /* EXACTF */
113 EXACT, /* EXACTFL */
114 NOTHING, /* NOTHING */
115 NOTHING, /* TAIL */
116 STAR, /* STAR */
117 PLUS, /* PLUS */
118 CURLY, /* CURLY */
119 CURLY, /* CURLYN */
120 CURLY, /* CURLYM */
121 CURLY, /* CURLYX */
122 WHILEM, /* WHILEM */
123 OPEN, /* OPEN */
124 CLOSE, /* CLOSE */
125 REF, /* REF */
126 REF, /* REFF */
127 REF, /* REFFL */
128 BRANCHJ, /* IFMATCH */
129 BRANCHJ, /* UNLESSM */
130 BRANCHJ, /* SUSPEND */
131 BRANCHJ, /* IFTHEN */
132 GROUPP, /* GROUPP */
133 LONGJMP, /* LONGJMP */
134 BRANCHJ, /* BRANCHJ */
135 EVAL, /* EVAL */
136 MINMOD, /* MINMOD */
137 LOGICAL, /* LOGICAL */
138 BRANCHJ, /* RENUM */
139 NOTHING, /* OPTIMIZED */
ce5e9471 140 TRIE, /* TRIE */
8e11feef
RGS
141 TRIE, /* TRIEC */
142 PSEUDO, /* PSEUDO */
d09b2d29
IZ
143};
144#endif
145
146
147#ifdef REG_COMP_C
29de9391 148static const U8 regarglen[] = {
d09b2d29
IZ
149 0, /* END */
150 0, /* SUCCEED */
151 0, /* BOL */
152 0, /* MBOL */
153 0, /* SBOL */
b85d18e9 154 0, /* EOS */
d09b2d29
IZ
155 0, /* EOL */
156 0, /* MEOL */
157 0, /* SEOL */
158 0, /* BOUND */
159 0, /* BOUNDL */
160 0, /* NBOUND */
161 0, /* NBOUNDL */
162 0, /* GPOS */
22c35a8c 163 0, /* REG_ANY */
d09b2d29 164 0, /* SANY */
f33976b4 165 0, /* CANY */
d09b2d29
IZ
166 0, /* ANYOF */
167 0, /* ALNUM */
168 0, /* ALNUML */
169 0, /* NALNUM */
170 0, /* NALNUML */
171 0, /* SPACE */
172 0, /* SPACEL */
173 0, /* NSPACE */
174 0, /* NSPACEL */
175 0, /* DIGIT */
b8c5462f 176 0, /* DIGITL */
d09b2d29 177 0, /* NDIGIT */
b8c5462f 178 0, /* NDIGITL */
a0ed51b3 179 0, /* CLUMP */
d09b2d29
IZ
180 0, /* BRANCH */
181 0, /* BACK */
182 0, /* EXACT */
183 0, /* EXACTF */
184 0, /* EXACTFL */
185 0, /* NOTHING */
186 0, /* TAIL */
187 0, /* STAR */
188 0, /* PLUS */
189 EXTRA_SIZE(struct regnode_2), /* CURLY */
190 EXTRA_SIZE(struct regnode_2), /* CURLYN */
191 EXTRA_SIZE(struct regnode_2), /* CURLYM */
192 EXTRA_SIZE(struct regnode_2), /* CURLYX */
193 0, /* WHILEM */
194 EXTRA_SIZE(struct regnode_1), /* OPEN */
195 EXTRA_SIZE(struct regnode_1), /* CLOSE */
196 EXTRA_SIZE(struct regnode_1), /* REF */
197 EXTRA_SIZE(struct regnode_1), /* REFF */
198 EXTRA_SIZE(struct regnode_1), /* REFFL */
199 EXTRA_SIZE(struct regnode_1), /* IFMATCH */
200 EXTRA_SIZE(struct regnode_1), /* UNLESSM */
201 EXTRA_SIZE(struct regnode_1), /* SUSPEND */
202 EXTRA_SIZE(struct regnode_1), /* IFTHEN */
203 EXTRA_SIZE(struct regnode_1), /* GROUPP */
204 EXTRA_SIZE(struct regnode_1), /* LONGJMP */
205 EXTRA_SIZE(struct regnode_1), /* BRANCHJ */
206 EXTRA_SIZE(struct regnode_1), /* EVAL */
207 0, /* MINMOD */
208 0, /* LOGICAL */
209 EXTRA_SIZE(struct regnode_1), /* RENUM */
210 0, /* OPTIMIZED */
ce5e9471 211 EXTRA_SIZE(struct regnode_1), /* TRIE */
786e8c11 212 EXTRA_SIZE(struct regnode_charclass), /* TRIEC */
8e11feef 213 0, /* PSEUDO */
d09b2d29
IZ
214};
215
29de9391 216static const char reg_off_by_arg[] = {
d09b2d29
IZ
217 0, /* END */
218 0, /* SUCCEED */
219 0, /* BOL */
220 0, /* MBOL */
221 0, /* SBOL */
b85d18e9 222 0, /* EOS */
d09b2d29
IZ
223 0, /* EOL */
224 0, /* MEOL */
225 0, /* SEOL */
226 0, /* BOUND */
227 0, /* BOUNDL */
228 0, /* NBOUND */
229 0, /* NBOUNDL */
230 0, /* GPOS */
22c35a8c 231 0, /* REG_ANY */
d09b2d29 232 0, /* SANY */
f33976b4 233 0, /* CANY */
d09b2d29
IZ
234 0, /* ANYOF */
235 0, /* ALNUM */
236 0, /* ALNUML */
237 0, /* NALNUM */
238 0, /* NALNUML */
239 0, /* SPACE */
240 0, /* SPACEL */
241 0, /* NSPACE */
242 0, /* NSPACEL */
243 0, /* DIGIT */
b8c5462f 244 0, /* DIGITL */
d09b2d29 245 0, /* NDIGIT */
b8c5462f 246 0, /* NDIGITL */
a0ed51b3 247 0, /* CLUMP */
d09b2d29
IZ
248 0, /* BRANCH */
249 0, /* BACK */
250 0, /* EXACT */
251 0, /* EXACTF */
252 0, /* EXACTFL */
253 0, /* NOTHING */
254 0, /* TAIL */
255 0, /* STAR */
256 0, /* PLUS */
257 0, /* CURLY */
258 0, /* CURLYN */
259 0, /* CURLYM */
260 0, /* CURLYX */
261 0, /* WHILEM */
262 0, /* OPEN */
263 0, /* CLOSE */
264 0, /* REF */
265 0, /* REFF */
266 0, /* REFFL */
267 2, /* IFMATCH */
268 2, /* UNLESSM */
269 1, /* SUSPEND */
270 1, /* IFTHEN */
271 0, /* GROUPP */
272 1, /* LONGJMP */
273 1, /* BRANCHJ */
274 0, /* EVAL */
275 0, /* MINMOD */
276 0, /* LOGICAL */
277 1, /* RENUM */
278 0, /* OPTIMIZED */
ce5e9471 279 0, /* TRIE */
8e11feef
RGS
280 0, /* TRIEC */
281 0, /* PSEUDO */
d09b2d29 282};
885f9e59
GS
283
284#ifdef DEBUGGING
29de9391 285static const char * const reg_name[] = {
885f9e59
GS
286 "END", /* 0 */
287 "SUCCEED", /* 0x1 */
288 "BOL", /* 0x2 */
289 "MBOL", /* 0x3 */
290 "SBOL", /* 0x4 */
291 "EOS", /* 0x5 */
292 "EOL", /* 0x6 */
293 "MEOL", /* 0x7 */
294 "SEOL", /* 0x8 */
295 "BOUND", /* 0x9 */
ffc61ed2
JH
296 "BOUNDL", /* 0xa */
297 "NBOUND", /* 0xb */
298 "NBOUNDL", /* 0xc */
299 "GPOS", /* 0xd */
300 "REG_ANY", /* 0xe */
301 "SANY", /* 0xf */
f33976b4
DB
302 "CANY", /* 0x10 */
303 "ANYOF", /* 0x11 */
304 "ALNUM", /* 0x12 */
305 "ALNUML", /* 0x13 */
306 "NALNUM", /* 0x14 */
307 "NALNUML", /* 0x15 */
308 "SPACE", /* 0x16 */
309 "SPACEL", /* 0x17 */
310 "NSPACE", /* 0x18 */
311 "NSPACEL", /* 0x19 */
312 "DIGIT", /* 0x1a */
313 "DIGITL", /* 0x1b */
314 "NDIGIT", /* 0x1c */
315 "NDIGITL", /* 0x1d */
316 "CLUMP", /* 0x1e */
317 "BRANCH", /* 0x1f */
318 "BACK", /* 0x20 */
319 "EXACT", /* 0x21 */
320 "EXACTF", /* 0x22 */
321 "EXACTFL", /* 0x23 */
ce5e9471
YO
322 "NOTHING", /* 0x24 */
323 "TAIL", /* 0x25 */
324 "STAR", /* 0x26 */
325 "PLUS", /* 0x27 */
326 "CURLY", /* 0x28 */
327 "CURLYN", /* 0x29 */
328 "CURLYM", /* 0x2a */
329 "CURLYX", /* 0x2b */
330 "WHILEM", /* 0x2c */
331 "OPEN", /* 0x2d */
332 "CLOSE", /* 0x2e */
333 "REF", /* 0x2f */
334 "REFF", /* 0x30 */
335 "REFFL", /* 0x31 */
336 "IFMATCH", /* 0x32 */
337 "UNLESSM", /* 0x33 */
338 "SUSPEND", /* 0x34 */
339 "IFTHEN", /* 0x35 */
340 "GROUPP", /* 0x36 */
341 "LONGJMP", /* 0x37 */
342 "BRANCHJ", /* 0x38 */
343 "EVAL", /* 0x39 */
344 "MINMOD", /* 0x3a */
345 "LOGICAL", /* 0x3b */
346 "RENUM", /* 0x3c */
347 "OPTIMIZED", /* 0x3d */
348 "TRIE", /* 0x3e */
8e11feef
RGS
349 "TRIEC", /* 0x3f */
350 "PSEUDO", /* 0x40 */
885f9e59
GS
351};
352
a3621e74 353static const int reg_num = 65;
885f9e59
GS
354
355#endif /* DEBUGGING */
d09b2d29
IZ
356#endif /* REG_COMP_C */
357
37442d52 358/* ex: set ro: */