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