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