This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Remove unnecessary cBOOLs
[perl5.git] / regnodes.h
CommitLineData
37442d52
RGS
1/* -*- buffer-read-only: t -*-
2 !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
eb2624c9 3 This file is built by regen/regcomp.pl from regcomp.sym.
d09b2d29
IZ
4 Any changes made here will be lost!
5*/
6
6bda09f9
YO
7/* Regops and State definitions */
8
fdf48794
KW
9#define REGNODE_MAX 100
10#define REGMATCH_STATE_MAX 140
03363afd 11
f9f4320a
YO
12#define END 0 /* 0000 End of program. */
13#define SUCCEED 1 /* 0x01 Return from a subroutine, basically. */
14#define BOL 2 /* 0x02 Match "" at beginning of line. */
15#define MBOL 3 /* 0x03 Same, assuming multiline. */
16#define SBOL 4 /* 0x04 Same, assuming singleline. */
17#define EOS 5 /* 0x05 Match "" at end of string. */
18#define EOL 6 /* 0x06 Match "" at end of line. */
19#define MEOL 7 /* 0x07 Same, assuming multiline. */
20#define SEOL 8 /* 0x08 Same, assuming singleline. */
21#define BOUND 9 /* 0x09 Match "" at any word boundary */
f2284805 22#define BOUNDL 10 /* 0x0a Match "" at any locale word boundary */
f9f4320a 23#define NBOUND 11 /* 0x0b Match "" at any word non-boundary */
f2284805 24#define NBOUNDL 12 /* 0x0c Match "" at any locale word non-boundary */
f9f4320a
YO
25#define GPOS 13 /* 0x0d Matches where last m//g left off. */
26#define REG_ANY 14 /* 0x0e Match any one character (except newline). */
27#define SANY 15 /* 0x0f Match any one character. */
28#define CANY 16 /* 0x10 Match any one byte. */
0e019ad6
KW
29#define ANYOF 17 /* 0x11 Match character in (or not in) this class, single char match only */
30#define ANYOFV 18 /* 0x12 Match character in (or not in) this class, can match-multiple chars */
fdf48794 31#define ALNUM 19 /* 0x13 Match any alphanumeric character using native charset semantics for non-utf8 */
0e019ad6 32#define ALNUML 20 /* 0x14 Match any alphanumeric char in locale */
fdf48794
KW
33#define ALNUMU 21 /* 0x15 Match any alphanumeric char using Unicode semantics */
34#define NALNUM 22 /* 0x16 Match any non-alphanumeric character using native charset semantics for non-utf8 */
35#define NALNUML 23 /* 0x17 Match any non-alphanumeric char in locale */
36#define NALNUMU 24 /* 0x18 Match any non-alphanumeric char using Unicode semantics */
37#define SPACE 25 /* 0x19 Match any whitespace character using native charset semantics for non-utf8 */
38#define SPACEL 26 /* 0x1a Match any whitespace char in locale */
39#define SPACEU 27 /* 0x1b Match any whitespace char using Unicode semantics */
40#define NSPACE 28 /* 0x1c Match any non-whitespace character using native charset semantics for non-utf8 */
41#define NSPACEL 29 /* 0x1d Match any non-whitespace char in locale */
42#define NSPACEU 30 /* 0x1e Match any non-whitespace char using Unicode semantics */
43#define DIGIT 31 /* 0x1f Match any numeric character using native charset semantics for non-utf8 */
44#define DIGITL 32 /* 0x20 Match any numeric character in locale */
45#define DIGITU 33 /* 0x21 Match any numeric character using Unicode semantics */
46#define NDIGIT 34 /* 0x22 Match any non-numeric character using native charset semantics for non-utf8 */
47#define NDIGITL 35 /* 0x23 Match any non-numeric character in locale */
48#define NDIGITU 36 /* 0x24 Match any non-numeric character using Unicode semantics */
49#define CLUMP 37 /* 0x25 Match any extended grapheme cluster sequence */
50#define BRANCH 38 /* 0x26 Match this alternative, or the next... */
51#define BACK 39 /* 0x27 Match "", "next" ptr points backward. */
52#define EXACT 40 /* 0x28 Match this string (preceded by length). */
53#define EXACTF 41 /* 0x29 Match this string, folded, native charset semantics for non-utf8 (prec. by length). */
54#define EXACTFL 42 /* 0x2a Match this string, folded in locale (w/len). */
55#define EXACTFU 43 /* 0x2b Match this string, folded, Unicode semantics for non-utf8 (prec. by length). */
56#define NOTHING 44 /* 0x2c Match empty string. */
57#define TAIL 45 /* 0x2d Match empty string. Can jump here from outside. */
58#define STAR 46 /* 0x2e Match this (simple) thing 0 or more times. */
59#define PLUS 47 /* 0x2f Match this (simple) thing 1 or more times. */
60#define CURLY 48 /* 0x30 Match this simple thing {n,m} times. */
61#define CURLYN 49 /* 0x31 Capture next-after-this simple thing */
62#define CURLYM 50 /* 0x32 Capture this medium-complex thing {n,m} times. */
63#define CURLYX 51 /* 0x33 Match this complex thing {n,m} times. */
64#define WHILEM 52 /* 0x34 Do curly processing and see if rest matches. */
65#define OPEN 53 /* 0x35 Mark this point in input as start of */
66#define CLOSE 54 /* 0x36 Analogous to OPEN. */
67#define REF 55 /* 0x37 Match some already matched string */
68#define REFF 56 /* 0x38 Match already matched string, folded using native charset semantics for non-utf8 */
69#define REFFL 57 /* 0x39 Match already matched string, folded in loc. */
70#define REFFU 58 /* 0x3a Match already matched string, folded using unicode semantics for non-utf8 */
71#define NREF 59 /* 0x3b Match some already matched string */
72#define NREFF 60 /* 0x3c Match already matched string, folded using native charset semantics for non-utf8 */
73#define NREFFL 61 /* 0x3d Match already matched string, folded in loc. */
74#define NREFFU 62 /* 0x3e Match already matched string, folded using unicode semantics for non-utf8 */
75#define IFMATCH 63 /* 0x3f Succeeds if the following matches. */
76#define UNLESSM 64 /* 0x40 Fails if the following matches. */
77#define SUSPEND 65 /* 0x41 "Independent" sub-RE. */
78#define IFTHEN 66 /* 0x42 Switch, should be preceded by switcher . */
79#define GROUPP 67 /* 0x43 Whether the group matched. */
80#define LONGJMP 68 /* 0x44 Jump far away. */
81#define BRANCHJ 69 /* 0x45 BRANCH with long offset. */
82#define EVAL 70 /* 0x46 Execute some Perl code. */
83#define MINMOD 71 /* 0x47 Next operator is not greedy. */
84#define LOGICAL 72 /* 0x48 Next opcode should set the flag only. */
85#define RENUM 73 /* 0x49 Group with independently numbered parens. */
86#define TRIE 74 /* 0x4a Match many EXACT(F[LU]?)? at once. flags==type */
87#define TRIEC 75 /* 0x4b Same as TRIE, but with embedded charclass data */
88#define AHOCORASICK 76 /* 0x4c Aho Corasick stclass. flags==type */
89#define AHOCORASICKC 77 /* 0x4d Same as AHOCORASICK, but with embedded charclass data */
90#define GOSUB 78 /* 0x4e recurse to paren arg1 at (signed) ofs arg2 */
91#define GOSTART 79 /* 0x4f recurse to start of pattern */
92#define NGROUPP 80 /* 0x50 Whether the group matched. */
93#define INSUBP 81 /* 0x51 Whether we are in a specific recurse. */
94#define DEFINEP 82 /* 0x52 Never execute directly. */
95#define ENDLIKE 83 /* 0x53 Used only for the type field of verbs */
96#define OPFAIL 84 /* 0x54 Same as (?!) */
97#define ACCEPT 85 /* 0x55 Accepts the current matched string. */
98#define VERB 86 /* 0x56 Used only for the type field of verbs */
99#define PRUNE 87 /* 0x57 Pattern fails at this startpoint if no-backtracking through this */
100#define MARKPOINT 88 /* 0x58 Push the current location for rollback by cut. */
101#define SKIP 89 /* 0x59 On failure skip forward (to the mark) before retrying */
102#define COMMIT 90 /* 0x5a Pattern fails outright if backtracking through this */
103#define CUTGROUP 91 /* 0x5b On failure go to the next alternation in the group */
104#define KEEPS 92 /* 0x5c $& begins here. */
105#define LNBREAK 93 /* 0x5d generic newline pattern */
106#define VERTWS 94 /* 0x5e vertical whitespace (Perl 6) */
107#define NVERTWS 95 /* 0x5f not vertical whitespace (Perl 6) */
108#define HORIZWS 96 /* 0x60 horizontal whitespace (Perl 6) */
109#define NHORIZWS 97 /* 0x61 not horizontal whitespace (Perl 6) */
110#define FOLDCHAR 98 /* 0x62 codepoint with tricky case folding properties. */
111#define OPTIMIZED 99 /* 0x63 Placeholder for dump. */
112#define PSEUDO 100 /* 0x64 Pseudo opcode for internal use. */
03363afd 113 /* ------------ States ------------- */
24b23f37
YO
114#define TRIE_next (REGNODE_MAX + 1) /* state for TRIE */
115#define TRIE_next_fail (REGNODE_MAX + 2) /* state for TRIE */
116#define EVAL_AB (REGNODE_MAX + 3) /* state for EVAL */
117#define EVAL_AB_fail (REGNODE_MAX + 4) /* state for EVAL */
118#define CURLYX_end (REGNODE_MAX + 5) /* state for CURLYX */
119#define CURLYX_end_fail (REGNODE_MAX + 6) /* state for CURLYX */
120#define WHILEM_A_pre (REGNODE_MAX + 7) /* state for WHILEM */
121#define WHILEM_A_pre_fail (REGNODE_MAX + 8) /* state for WHILEM */
122#define WHILEM_A_min (REGNODE_MAX + 9) /* state for WHILEM */
123#define WHILEM_A_min_fail (REGNODE_MAX + 10) /* state for WHILEM */
124#define WHILEM_A_max (REGNODE_MAX + 11) /* state for WHILEM */
125#define WHILEM_A_max_fail (REGNODE_MAX + 12) /* state for WHILEM */
126#define WHILEM_B_min (REGNODE_MAX + 13) /* state for WHILEM */
127#define WHILEM_B_min_fail (REGNODE_MAX + 14) /* state for WHILEM */
128#define WHILEM_B_max (REGNODE_MAX + 15) /* state for WHILEM */
129#define WHILEM_B_max_fail (REGNODE_MAX + 16) /* state for WHILEM */
130#define BRANCH_next (REGNODE_MAX + 17) /* state for BRANCH */
131#define BRANCH_next_fail (REGNODE_MAX + 18) /* state for BRANCH */
132#define CURLYM_A (REGNODE_MAX + 19) /* state for CURLYM */
133#define CURLYM_A_fail (REGNODE_MAX + 20) /* state for CURLYM */
134#define CURLYM_B (REGNODE_MAX + 21) /* state for CURLYM */
135#define CURLYM_B_fail (REGNODE_MAX + 22) /* state for CURLYM */
136#define IFMATCH_A (REGNODE_MAX + 23) /* state for IFMATCH */
137#define IFMATCH_A_fail (REGNODE_MAX + 24) /* state for IFMATCH */
138#define CURLY_B_min_known (REGNODE_MAX + 25) /* state for CURLY */
139#define CURLY_B_min_known_fail (REGNODE_MAX + 26) /* state for CURLY */
140#define CURLY_B_min (REGNODE_MAX + 27) /* state for CURLY */
141#define CURLY_B_min_fail (REGNODE_MAX + 28) /* state for CURLY */
142#define CURLY_B_max (REGNODE_MAX + 29) /* state for CURLY */
143#define CURLY_B_max_fail (REGNODE_MAX + 30) /* state for CURLY */
144#define COMMIT_next (REGNODE_MAX + 31) /* state for COMMIT */
145#define COMMIT_next_fail (REGNODE_MAX + 32) /* state for COMMIT */
e2e6a0f1
YO
146#define MARKPOINT_next (REGNODE_MAX + 33) /* state for MARKPOINT */
147#define MARKPOINT_next_fail (REGNODE_MAX + 34) /* state for MARKPOINT */
5d458dd8
YO
148#define SKIP_next (REGNODE_MAX + 35) /* state for SKIP */
149#define SKIP_next_fail (REGNODE_MAX + 36) /* state for SKIP */
150#define CUTGROUP_next (REGNODE_MAX + 37) /* state for CUTGROUP */
151#define CUTGROUP_next_fail (REGNODE_MAX + 38) /* state for CUTGROUP */
ee9b8eae
YO
152#define KEEPS_next (REGNODE_MAX + 39) /* state for KEEPS */
153#define KEEPS_next_fail (REGNODE_MAX + 40) /* state for KEEPS */
03363afd 154
6bda09f9 155/* PL_regkind[] What type of regop or state is this. */
d09b2d29
IZ
156
157#ifndef DOINIT
22c35a8c 158EXTCONST U8 PL_regkind[];
d09b2d29 159#else
22c35a8c 160EXTCONST U8 PL_regkind[] = {
e2e6a0f1
YO
161 END, /* END */
162 END, /* SUCCEED */
163 BOL, /* BOL */
164 BOL, /* MBOL */
165 BOL, /* SBOL */
166 EOL, /* EOS */
167 EOL, /* EOL */
168 EOL, /* MEOL */
169 EOL, /* SEOL */
170 BOUND, /* BOUND */
171 BOUND, /* BOUNDL */
172 NBOUND, /* NBOUND */
173 NBOUND, /* NBOUNDL */
174 GPOS, /* GPOS */
175 REG_ANY, /* REG_ANY */
176 REG_ANY, /* SANY */
177 REG_ANY, /* CANY */
178 ANYOF, /* ANYOF */
0e019ad6 179 ANYOF, /* ANYOFV */
e2e6a0f1
YO
180 ALNUM, /* ALNUM */
181 ALNUM, /* ALNUML */
fdf48794 182 ALNUM, /* ALNUMU */
e2e6a0f1
YO
183 NALNUM, /* NALNUM */
184 NALNUM, /* NALNUML */
fdf48794 185 NALNUM, /* NALNUMU */
e2e6a0f1
YO
186 SPACE, /* SPACE */
187 SPACE, /* SPACEL */
fdf48794 188 SPACE, /* SPACEU */
e2e6a0f1
YO
189 NSPACE, /* NSPACE */
190 NSPACE, /* NSPACEL */
fdf48794 191 NSPACE, /* NSPACEU */
e2e6a0f1
YO
192 DIGIT, /* DIGIT */
193 DIGIT, /* DIGITL */
fdf48794 194 DIGIT, /* DIGITU */
e2e6a0f1
YO
195 NDIGIT, /* NDIGIT */
196 NDIGIT, /* NDIGITL */
fdf48794 197 NDIGIT, /* NDIGITU */
e2e6a0f1
YO
198 CLUMP, /* CLUMP */
199 BRANCH, /* BRANCH */
200 BACK, /* BACK */
201 EXACT, /* EXACT */
202 EXACT, /* EXACTF */
203 EXACT, /* EXACTFL */
01f98ec2 204 EXACT, /* EXACTFU */
e2e6a0f1
YO
205 NOTHING, /* NOTHING */
206 NOTHING, /* TAIL */
207 STAR, /* STAR */
208 PLUS, /* PLUS */
209 CURLY, /* CURLY */
210 CURLY, /* CURLYN */
211 CURLY, /* CURLYM */
212 CURLY, /* CURLYX */
213 WHILEM, /* WHILEM */
214 OPEN, /* OPEN */
215 CLOSE, /* CLOSE */
216 REF, /* REF */
217 REF, /* REFF */
218 REF, /* REFFL */
01f98ec2
KW
219 REF, /* REFFU */
220 REF, /* NREF */
221 REF, /* NREFF */
222 REF, /* NREFFL */
223 REF, /* NREFFU */
e2e6a0f1
YO
224 BRANCHJ, /* IFMATCH */
225 BRANCHJ, /* UNLESSM */
226 BRANCHJ, /* SUSPEND */
227 BRANCHJ, /* IFTHEN */
228 GROUPP, /* GROUPP */
229 LONGJMP, /* LONGJMP */
230 BRANCHJ, /* BRANCHJ */
231 EVAL, /* EVAL */
232 MINMOD, /* MINMOD */
233 LOGICAL, /* LOGICAL */
234 BRANCHJ, /* RENUM */
235 TRIE, /* TRIE */
236 TRIE, /* TRIEC */
237 TRIE, /* AHOCORASICK */
238 TRIE, /* AHOCORASICKC */
239 GOSUB, /* GOSUB */
240 GOSTART, /* GOSTART */
e2e6a0f1
YO
241 NGROUPP, /* NGROUPP */
242 INSUBP, /* INSUBP */
243 DEFINEP, /* DEFINEP */
244 ENDLIKE, /* ENDLIKE */
245 ENDLIKE, /* OPFAIL */
246 ENDLIKE, /* ACCEPT */
247 VERB, /* VERB */
5d458dd8 248 VERB, /* PRUNE */
e2e6a0f1 249 VERB, /* MARKPOINT */
5d458dd8 250 VERB, /* SKIP */
e2e6a0f1 251 VERB, /* COMMIT */
5d458dd8 252 VERB, /* CUTGROUP */
ee9b8eae 253 KEEPS, /* KEEPS */
e1d1eefb
YO
254 LNBREAK, /* LNBREAK */
255 VERTWS, /* VERTWS */
256 NVERTWS, /* NVERTWS */
257 HORIZWS, /* HORIZWS */
258 NHORIZWS, /* NHORIZWS */
32e6a07c 259 FOLDCHAR, /* FOLDCHAR */
e2e6a0f1
YO
260 NOTHING, /* OPTIMIZED */
261 PSEUDO, /* PSEUDO */
03363afd 262 /* ------------ States ------------- */
e2e6a0f1
YO
263 TRIE, /* TRIE_next */
264 TRIE, /* TRIE_next_fail */
265 EVAL, /* EVAL_AB */
266 EVAL, /* EVAL_AB_fail */
267 CURLYX, /* CURLYX_end */
268 CURLYX, /* CURLYX_end_fail */
269 WHILEM, /* WHILEM_A_pre */
270 WHILEM, /* WHILEM_A_pre_fail */
271 WHILEM, /* WHILEM_A_min */
272 WHILEM, /* WHILEM_A_min_fail */
273 WHILEM, /* WHILEM_A_max */
274 WHILEM, /* WHILEM_A_max_fail */
275 WHILEM, /* WHILEM_B_min */
276 WHILEM, /* WHILEM_B_min_fail */
277 WHILEM, /* WHILEM_B_max */
278 WHILEM, /* WHILEM_B_max_fail */
279 BRANCH, /* BRANCH_next */
280 BRANCH, /* BRANCH_next_fail */
281 CURLYM, /* CURLYM_A */
282 CURLYM, /* CURLYM_A_fail */
283 CURLYM, /* CURLYM_B */
284 CURLYM, /* CURLYM_B_fail */
285 IFMATCH, /* IFMATCH_A */
286 IFMATCH, /* IFMATCH_A_fail */
287 CURLY, /* CURLY_B_min_known */
288 CURLY, /* CURLY_B_min_known_fail */
289 CURLY, /* CURLY_B_min */
290 CURLY, /* CURLY_B_min_fail */
291 CURLY, /* CURLY_B_max */
292 CURLY, /* CURLY_B_max_fail */
293 COMMIT, /* COMMIT_next */
294 COMMIT, /* COMMIT_next_fail */
295 MARKPOINT, /* MARKPOINT_next */
296 MARKPOINT, /* MARKPOINT_next_fail */
5d458dd8
YO
297 SKIP, /* SKIP_next */
298 SKIP, /* SKIP_next_fail */
299 CUTGROUP, /* CUTGROUP_next */
300 CUTGROUP, /* CUTGROUP_next_fail */
ee9b8eae
YO
301 KEEPS, /* KEEPS_next */
302 KEEPS, /* KEEPS_next_fail */
d09b2d29
IZ
303};
304#endif
305
6bda09f9 306/* regarglen[] - How large is the argument part of the node (in regnodes) */
d09b2d29
IZ
307
308#ifdef REG_COMP_C
29de9391 309static const U8 regarglen[] = {
03363afd
YO
310 0, /* END */
311 0, /* SUCCEED */
312 0, /* BOL */
313 0, /* MBOL */
314 0, /* SBOL */
315 0, /* EOS */
316 0, /* EOL */
317 0, /* MEOL */
318 0, /* SEOL */
319 0, /* BOUND */
320 0, /* BOUNDL */
321 0, /* NBOUND */
322 0, /* NBOUNDL */
323 0, /* GPOS */
324 0, /* REG_ANY */
325 0, /* SANY */
326 0, /* CANY */
327 0, /* ANYOF */
0e019ad6 328 0, /* ANYOFV */
03363afd
YO
329 0, /* ALNUM */
330 0, /* ALNUML */
fdf48794 331 0, /* ALNUMU */
03363afd
YO
332 0, /* NALNUM */
333 0, /* NALNUML */
fdf48794 334 0, /* NALNUMU */
03363afd
YO
335 0, /* SPACE */
336 0, /* SPACEL */
fdf48794 337 0, /* SPACEU */
03363afd
YO
338 0, /* NSPACE */
339 0, /* NSPACEL */
fdf48794 340 0, /* NSPACEU */
03363afd
YO
341 0, /* DIGIT */
342 0, /* DIGITL */
fdf48794 343 0, /* DIGITU */
03363afd
YO
344 0, /* NDIGIT */
345 0, /* NDIGITL */
fdf48794 346 0, /* NDIGITU */
03363afd
YO
347 0, /* CLUMP */
348 0, /* BRANCH */
349 0, /* BACK */
350 0, /* EXACT */
351 0, /* EXACTF */
352 0, /* EXACTFL */
01f98ec2 353 0, /* EXACTFU */
03363afd
YO
354 0, /* NOTHING */
355 0, /* TAIL */
356 0, /* STAR */
357 0, /* PLUS */
358 EXTRA_SIZE(struct regnode_2), /* CURLY */
359 EXTRA_SIZE(struct regnode_2), /* CURLYN */
360 EXTRA_SIZE(struct regnode_2), /* CURLYM */
361 EXTRA_SIZE(struct regnode_2), /* CURLYX */
362 0, /* WHILEM */
363 EXTRA_SIZE(struct regnode_1), /* OPEN */
364 EXTRA_SIZE(struct regnode_1), /* CLOSE */
365 EXTRA_SIZE(struct regnode_1), /* REF */
366 EXTRA_SIZE(struct regnode_1), /* REFF */
367 EXTRA_SIZE(struct regnode_1), /* REFFL */
01f98ec2
KW
368 EXTRA_SIZE(struct regnode_1), /* REFFU */
369 EXTRA_SIZE(struct regnode_1), /* NREF */
370 EXTRA_SIZE(struct regnode_1), /* NREFF */
371 EXTRA_SIZE(struct regnode_1), /* NREFFL */
372 EXTRA_SIZE(struct regnode_1), /* NREFFU */
03363afd
YO
373 EXTRA_SIZE(struct regnode_1), /* IFMATCH */
374 EXTRA_SIZE(struct regnode_1), /* UNLESSM */
375 EXTRA_SIZE(struct regnode_1), /* SUSPEND */
376 EXTRA_SIZE(struct regnode_1), /* IFTHEN */
377 EXTRA_SIZE(struct regnode_1), /* GROUPP */
378 EXTRA_SIZE(struct regnode_1), /* LONGJMP */
379 EXTRA_SIZE(struct regnode_1), /* BRANCHJ */
380 EXTRA_SIZE(struct regnode_1), /* EVAL */
381 0, /* MINMOD */
382 0, /* LOGICAL */
383 EXTRA_SIZE(struct regnode_1), /* RENUM */
384 EXTRA_SIZE(struct regnode_1), /* TRIE */
385 EXTRA_SIZE(struct regnode_charclass), /* TRIEC */
386 EXTRA_SIZE(struct regnode_1), /* AHOCORASICK */
387 EXTRA_SIZE(struct regnode_charclass), /* AHOCORASICKC */
1a147d38
YO
388 EXTRA_SIZE(struct regnode_2L), /* GOSUB */
389 0, /* GOSTART */
0a4db386 390 EXTRA_SIZE(struct regnode_1), /* NGROUPP */
1a147d38 391 EXTRA_SIZE(struct regnode_1), /* INSUBP */
0a4db386 392 EXTRA_SIZE(struct regnode_1), /* DEFINEP */
e2e6a0f1 393 0, /* ENDLIKE */
7f69552c 394 0, /* OPFAIL */
e2e6a0f1 395 EXTRA_SIZE(struct regnode_1), /* ACCEPT */
20832bc5 396 EXTRA_SIZE(struct regnode_1), /* VERB */
5d458dd8 397 EXTRA_SIZE(struct regnode_1), /* PRUNE */
e2e6a0f1 398 EXTRA_SIZE(struct regnode_1), /* MARKPOINT */
5d458dd8 399 EXTRA_SIZE(struct regnode_1), /* SKIP */
e2e6a0f1 400 EXTRA_SIZE(struct regnode_1), /* COMMIT */
5d458dd8 401 EXTRA_SIZE(struct regnode_1), /* CUTGROUP */
ee9b8eae 402 0, /* KEEPS */
e1d1eefb
YO
403 0, /* LNBREAK */
404 0, /* VERTWS */
405 0, /* NVERTWS */
406 0, /* HORIZWS */
407 0, /* NHORIZWS */
32e6a07c 408 EXTRA_SIZE(struct regnode_1), /* FOLDCHAR */
03363afd
YO
409 0, /* OPTIMIZED */
410 0, /* PSEUDO */
d09b2d29
IZ
411};
412
6bda09f9
YO
413/* reg_off_by_arg[] - Which argument holds the offset to the next node */
414
29de9391 415static const char reg_off_by_arg[] = {
03363afd
YO
416 0, /* END */
417 0, /* SUCCEED */
418 0, /* BOL */
419 0, /* MBOL */
420 0, /* SBOL */
421 0, /* EOS */
422 0, /* EOL */
423 0, /* MEOL */
424 0, /* SEOL */
425 0, /* BOUND */
426 0, /* BOUNDL */
427 0, /* NBOUND */
428 0, /* NBOUNDL */
429 0, /* GPOS */
430 0, /* REG_ANY */
431 0, /* SANY */
432 0, /* CANY */
433 0, /* ANYOF */
0e019ad6 434 0, /* ANYOFV */
03363afd
YO
435 0, /* ALNUM */
436 0, /* ALNUML */
fdf48794 437 0, /* ALNUMU */
03363afd
YO
438 0, /* NALNUM */
439 0, /* NALNUML */
fdf48794 440 0, /* NALNUMU */
03363afd
YO
441 0, /* SPACE */
442 0, /* SPACEL */
fdf48794 443 0, /* SPACEU */
03363afd
YO
444 0, /* NSPACE */
445 0, /* NSPACEL */
fdf48794 446 0, /* NSPACEU */
03363afd
YO
447 0, /* DIGIT */
448 0, /* DIGITL */
fdf48794 449 0, /* DIGITU */
03363afd
YO
450 0, /* NDIGIT */
451 0, /* NDIGITL */
fdf48794 452 0, /* NDIGITU */
03363afd
YO
453 0, /* CLUMP */
454 0, /* BRANCH */
455 0, /* BACK */
456 0, /* EXACT */
457 0, /* EXACTF */
458 0, /* EXACTFL */
01f98ec2 459 0, /* EXACTFU */
03363afd
YO
460 0, /* NOTHING */
461 0, /* TAIL */
462 0, /* STAR */
463 0, /* PLUS */
464 0, /* CURLY */
465 0, /* CURLYN */
466 0, /* CURLYM */
467 0, /* CURLYX */
468 0, /* WHILEM */
469 0, /* OPEN */
470 0, /* CLOSE */
471 0, /* REF */
472 0, /* REFF */
473 0, /* REFFL */
01f98ec2
KW
474 0, /* REFFU */
475 0, /* NREF */
476 0, /* NREFF */
477 0, /* NREFFL */
478 0, /* NREFFU */
03363afd
YO
479 2, /* IFMATCH */
480 2, /* UNLESSM */
481 1, /* SUSPEND */
482 1, /* IFTHEN */
483 0, /* GROUPP */
484 1, /* LONGJMP */
485 1, /* BRANCHJ */
486 0, /* EVAL */
487 0, /* MINMOD */
488 0, /* LOGICAL */
489 1, /* RENUM */
490 0, /* TRIE */
491 0, /* TRIEC */
492 0, /* AHOCORASICK */
493 0, /* AHOCORASICKC */
1a147d38
YO
494 0, /* GOSUB */
495 0, /* GOSTART */
0a4db386 496 0, /* NGROUPP */
1a147d38 497 0, /* INSUBP */
0a4db386 498 0, /* DEFINEP */
e2e6a0f1 499 0, /* ENDLIKE */
7f69552c 500 0, /* OPFAIL */
e2e6a0f1
YO
501 0, /* ACCEPT */
502 0, /* VERB */
5d458dd8 503 0, /* PRUNE */
e2e6a0f1 504 0, /* MARKPOINT */
5d458dd8 505 0, /* SKIP */
e2e6a0f1 506 0, /* COMMIT */
5d458dd8 507 0, /* CUTGROUP */
ee9b8eae 508 0, /* KEEPS */
e1d1eefb
YO
509 0, /* LNBREAK */
510 0, /* VERTWS */
511 0, /* NVERTWS */
512 0, /* HORIZWS */
513 0, /* NHORIZWS */
32e6a07c 514 0, /* FOLDCHAR */
03363afd
YO
515 0, /* OPTIMIZED */
516 0, /* PSEUDO */
d09b2d29 517};
885f9e59 518
13d6edb4
NC
519#endif /* REG_COMP_C */
520
6bda09f9
YO
521/* reg_name[] - Opcode/state names in string form, for debugging */
522
22429478 523#ifndef DOINIT
13d6edb4 524EXTCONST char * PL_reg_name[];
22429478 525#else
4764e399 526EXTCONST char * const PL_reg_name[] = {
03363afd
YO
527 "END", /* 0000 */
528 "SUCCEED", /* 0x01 */
529 "BOL", /* 0x02 */
530 "MBOL", /* 0x03 */
531 "SBOL", /* 0x04 */
532 "EOS", /* 0x05 */
533 "EOL", /* 0x06 */
534 "MEOL", /* 0x07 */
535 "SEOL", /* 0x08 */
536 "BOUND", /* 0x09 */
537 "BOUNDL", /* 0x0a */
538 "NBOUND", /* 0x0b */
539 "NBOUNDL", /* 0x0c */
540 "GPOS", /* 0x0d */
541 "REG_ANY", /* 0x0e */
542 "SANY", /* 0x0f */
543 "CANY", /* 0x10 */
544 "ANYOF", /* 0x11 */
0e019ad6
KW
545 "ANYOFV", /* 0x12 */
546 "ALNUM", /* 0x13 */
547 "ALNUML", /* 0x14 */
fdf48794
KW
548 "ALNUMU", /* 0x15 */
549 "NALNUM", /* 0x16 */
550 "NALNUML", /* 0x17 */
551 "NALNUMU", /* 0x18 */
552 "SPACE", /* 0x19 */
553 "SPACEL", /* 0x1a */
554 "SPACEU", /* 0x1b */
555 "NSPACE", /* 0x1c */
556 "NSPACEL", /* 0x1d */
557 "NSPACEU", /* 0x1e */
558 "DIGIT", /* 0x1f */
559 "DIGITL", /* 0x20 */
560 "DIGITU", /* 0x21 */
561 "NDIGIT", /* 0x22 */
562 "NDIGITL", /* 0x23 */
563 "NDIGITU", /* 0x24 */
564 "CLUMP", /* 0x25 */
565 "BRANCH", /* 0x26 */
566 "BACK", /* 0x27 */
567 "EXACT", /* 0x28 */
568 "EXACTF", /* 0x29 */
569 "EXACTFL", /* 0x2a */
570 "EXACTFU", /* 0x2b */
571 "NOTHING", /* 0x2c */
572 "TAIL", /* 0x2d */
573 "STAR", /* 0x2e */
574 "PLUS", /* 0x2f */
575 "CURLY", /* 0x30 */
576 "CURLYN", /* 0x31 */
577 "CURLYM", /* 0x32 */
578 "CURLYX", /* 0x33 */
579 "WHILEM", /* 0x34 */
580 "OPEN", /* 0x35 */
581 "CLOSE", /* 0x36 */
582 "REF", /* 0x37 */
583 "REFF", /* 0x38 */
584 "REFFL", /* 0x39 */
585 "REFFU", /* 0x3a */
586 "NREF", /* 0x3b */
587 "NREFF", /* 0x3c */
588 "NREFFL", /* 0x3d */
589 "NREFFU", /* 0x3e */
590 "IFMATCH", /* 0x3f */
591 "UNLESSM", /* 0x40 */
592 "SUSPEND", /* 0x41 */
593 "IFTHEN", /* 0x42 */
594 "GROUPP", /* 0x43 */
595 "LONGJMP", /* 0x44 */
596 "BRANCHJ", /* 0x45 */
597 "EVAL", /* 0x46 */
598 "MINMOD", /* 0x47 */
599 "LOGICAL", /* 0x48 */
600 "RENUM", /* 0x49 */
601 "TRIE", /* 0x4a */
602 "TRIEC", /* 0x4b */
603 "AHOCORASICK", /* 0x4c */
604 "AHOCORASICKC", /* 0x4d */
605 "GOSUB", /* 0x4e */
606 "GOSTART", /* 0x4f */
607 "NGROUPP", /* 0x50 */
608 "INSUBP", /* 0x51 */
609 "DEFINEP", /* 0x52 */
610 "ENDLIKE", /* 0x53 */
611 "OPFAIL", /* 0x54 */
612 "ACCEPT", /* 0x55 */
613 "VERB", /* 0x56 */
614 "PRUNE", /* 0x57 */
615 "MARKPOINT", /* 0x58 */
616 "SKIP", /* 0x59 */
617 "COMMIT", /* 0x5a */
618 "CUTGROUP", /* 0x5b */
619 "KEEPS", /* 0x5c */
620 "LNBREAK", /* 0x5d */
621 "VERTWS", /* 0x5e */
622 "NVERTWS", /* 0x5f */
623 "HORIZWS", /* 0x60 */
624 "NHORIZWS", /* 0x61 */
625 "FOLDCHAR", /* 0x62 */
626 "OPTIMIZED", /* 0x63 */
627 "PSEUDO", /* 0x64 */
03363afd 628 /* ------------ States ------------- */
24b23f37
YO
629 "TRIE_next", /* REGNODE_MAX +0x01 */
630 "TRIE_next_fail", /* REGNODE_MAX +0x02 */
631 "EVAL_AB", /* REGNODE_MAX +0x03 */
632 "EVAL_AB_fail", /* REGNODE_MAX +0x04 */
633 "CURLYX_end", /* REGNODE_MAX +0x05 */
634 "CURLYX_end_fail", /* REGNODE_MAX +0x06 */
635 "WHILEM_A_pre", /* REGNODE_MAX +0x07 */
636 "WHILEM_A_pre_fail", /* REGNODE_MAX +0x08 */
637 "WHILEM_A_min", /* REGNODE_MAX +0x09 */
638 "WHILEM_A_min_fail", /* REGNODE_MAX +0x0a */
639 "WHILEM_A_max", /* REGNODE_MAX +0x0b */
640 "WHILEM_A_max_fail", /* REGNODE_MAX +0x0c */
641 "WHILEM_B_min", /* REGNODE_MAX +0x0d */
642 "WHILEM_B_min_fail", /* REGNODE_MAX +0x0e */
643 "WHILEM_B_max", /* REGNODE_MAX +0x0f */
644 "WHILEM_B_max_fail", /* REGNODE_MAX +0x10 */
645 "BRANCH_next", /* REGNODE_MAX +0x11 */
646 "BRANCH_next_fail", /* REGNODE_MAX +0x12 */
647 "CURLYM_A", /* REGNODE_MAX +0x13 */
648 "CURLYM_A_fail", /* REGNODE_MAX +0x14 */
649 "CURLYM_B", /* REGNODE_MAX +0x15 */
650 "CURLYM_B_fail", /* REGNODE_MAX +0x16 */
651 "IFMATCH_A", /* REGNODE_MAX +0x17 */
652 "IFMATCH_A_fail", /* REGNODE_MAX +0x18 */
653 "CURLY_B_min_known", /* REGNODE_MAX +0x19 */
654 "CURLY_B_min_known_fail", /* REGNODE_MAX +0x1a */
655 "CURLY_B_min", /* REGNODE_MAX +0x1b */
656 "CURLY_B_min_fail", /* REGNODE_MAX +0x1c */
657 "CURLY_B_max", /* REGNODE_MAX +0x1d */
658 "CURLY_B_max_fail", /* REGNODE_MAX +0x1e */
659 "COMMIT_next", /* REGNODE_MAX +0x1f */
660 "COMMIT_next_fail", /* REGNODE_MAX +0x20 */
e2e6a0f1
YO
661 "MARKPOINT_next", /* REGNODE_MAX +0x21 */
662 "MARKPOINT_next_fail", /* REGNODE_MAX +0x22 */
5d458dd8
YO
663 "SKIP_next", /* REGNODE_MAX +0x23 */
664 "SKIP_next_fail", /* REGNODE_MAX +0x24 */
665 "CUTGROUP_next", /* REGNODE_MAX +0x25 */
666 "CUTGROUP_next_fail", /* REGNODE_MAX +0x26 */
ee9b8eae
YO
667 "KEEPS_next", /* REGNODE_MAX +0x27 */
668 "KEEPS_next_fail", /* REGNODE_MAX +0x28 */
885f9e59 669};
22429478 670#endif /* DOINIT */
d09b2d29 671
f7819f85
A
672/* PL_reg_extflags_name[] - Opcode/state names in string form, for debugging */
673
674#ifndef DOINIT
675EXTCONST char * PL_reg_extflags_name[];
676#else
677EXTCONST char * const PL_reg_extflags_name[] = {
9de15fec 678 /* Bits in extflags defined: 11111111111111111111111001111111 */
52d81aa8
NC
679 "MULTILINE", /* 0x00000001 */
680 "SINGLELINE", /* 0x00000002 */
681 "FOLD", /* 0x00000004 */
682 "EXTENDED", /* 0x00000008 */
683 "KEEPCOPY", /* 0x00000010 */
a62b1201
KW
684 "CHARSET", /* 0x00000060 */
685 "CHARSET", /* 0x00000060 */
f7819f85 686 "UNUSED_BIT_7", /* 0x00000080 */
e795e964
KW
687 "UNUSED_BIT_8", /* 0x00000100 */
688 "ANCH_BOL", /* 0x00000200 */
689 "ANCH_MBOL", /* 0x00000400 */
690 "ANCH_SBOL", /* 0x00000800 */
691 "ANCH_GPOS", /* 0x00001000 */
692 "GPOS_SEEN", /* 0x00002000 */
693 "GPOS_FLOAT", /* 0x00004000 */
694 "LOOKBEHIND_SEEN", /* 0x00008000 */
695 "EVAL_SEEN", /* 0x00010000 */
696 "CANY_SEEN", /* 0x00020000 */
697 "NOSCAN", /* 0x00040000 */
698 "CHECK_ALL", /* 0x00080000 */
52d81aa8
NC
699 "MATCH_UTF8", /* 0x00100000 */
700 "USE_INTUIT_NOML", /* 0x00200000 */
701 "USE_INTUIT_ML", /* 0x00400000 */
702 "INTUIT_TAIL", /* 0x00800000 */
703 "SPLIT", /* 0x01000000 */
704 "COPY_DONE", /* 0x02000000 */
705 "TAINTED_SEEN", /* 0x04000000 */
706 "TAINTED", /* 0x08000000 */
707 "START_ONLY", /* 0x10000000 */
708 "SKIPWHITE", /* 0x20000000 */
709 "WHITE", /* 0x40000000 */
710 "NULL", /* 0x80000000 */
f7819f85
A
711};
712#endif /* DOINIT */
713
f9ef50a7 714/* The following have no fixed length. U8 so we can do strchr() on it. */
ded4dd2a 715#define REGNODE_VARIES(node) (PL_varies_bitmask[(node) >> 3] & (1 << ((node) & 7)))
e52fc539 716
f9ef50a7 717#ifndef DOINIT
ded4dd2a 718EXTCONST U8 PL_varies[] __attribute__deprecated__;
f9ef50a7 719#else
ded4dd2a 720EXTCONST U8 PL_varies[] __attribute__deprecated__ = {
0e019ad6
KW
721 ANYOFV, CLUMP, BRANCH, BACK, STAR, PLUS, CURLY, CURLYN, CURLYM, CURLYX,
722 WHILEM, REF, REFF, REFFL, REFFU, NREF, NREFF, NREFFL, NREFFU, SUSPEND,
723 IFTHEN, BRANCHJ,
f9ef50a7
NC
724 0
725};
726#endif /* DOINIT */
727
ded4dd2a
NC
728#ifndef DOINIT
729EXTCONST U8 PL_varies_bitmask[];
730#else
731EXTCONST U8 PL_varies_bitmask[] = {
fdf48794 732 0x00, 0x00, 0x04, 0x00, 0xE0, 0xC0, 0x9F, 0x7F, 0x26, 0x00, 0x00, 0x00, 0x00
ded4dd2a
NC
733};
734#endif /* DOINIT */
735
f9ef50a7
NC
736/* The following always have a length of 1. U8 we can do strchr() on it. */
737/* (Note that length 1 means "one character" under UTF8, not "one octet".) */
ded4dd2a 738#define REGNODE_SIMPLE(node) (PL_simple_bitmask[(node) >> 3] & (1 << ((node) & 7)))
e52fc539 739
f9ef50a7 740#ifndef DOINIT
ded4dd2a 741EXTCONST U8 PL_simple[] __attribute__deprecated__;
f9ef50a7 742#else
ded4dd2a 743EXTCONST U8 PL_simple[] __attribute__deprecated__ = {
fdf48794
KW
744 REG_ANY, SANY, CANY, ANYOF, ALNUM, ALNUML, ALNUMU, NALNUM, NALNUML,
745 NALNUMU, SPACE, SPACEL, SPACEU, NSPACE, NSPACEL, NSPACEU, DIGIT,
746 DIGITL, DIGITU, NDIGIT, NDIGITL, NDIGITU, VERTWS, NVERTWS, HORIZWS,
747 NHORIZWS,
f9ef50a7
NC
748 0
749};
750#endif /* DOINIT */
751
ded4dd2a
NC
752#ifndef DOINIT
753EXTCONST U8 PL_simple_bitmask[];
754#else
755EXTCONST U8 PL_simple_bitmask[] = {
fdf48794 756 0x00, 0xC0, 0xFB, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03
ded4dd2a
NC
757};
758#endif /* DOINIT */
759
37442d52 760/* ex: set ro: */