This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow trie use for /iaa 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
098b07d5
KW
9#define REGNODE_MAX 95
10#define REGMATCH_STATE_MAX 135
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 */
954a2af6 34#define ANYOF_WARN_SUPER 22 /* 0x16 Match character in (or not in) this class, warn (if enabled) upon matching a char above Unicode max; */
9aa1e39f
KW
35#define ANYOF_SYNTHETIC 23 /* 0x17 Synthetic start class */
36#define POSIXD 24 /* 0x18 Some [[:class:]] under /d; the FLAGS field gives which one */
37#define POSIXL 25 /* 0x19 Some [[:class:]] under /l; the FLAGS field gives which one */
38#define POSIXU 26 /* 0x1a Some [[:class:]] under /u; the FLAGS field gives which one */
39#define POSIXA 27 /* 0x1b Some [[:class:]] under /a; the FLAGS field gives which one */
40#define NPOSIXD 28 /* 0x1c complement of POSIXD, [[:^class:]] */
41#define NPOSIXL 29 /* 0x1d complement of POSIXL, [[:^class:]] */
42#define NPOSIXU 30 /* 0x1e complement of POSIXU, [[:^class:]] */
43#define NPOSIXA 31 /* 0x1f complement of POSIXA, [[:^class:]] */
44#define CLUMP 32 /* 0x20 Match any extended grapheme cluster sequence */
45#define BRANCH 33 /* 0x21 Match this alternative, or the next... */
46#define BACK 34 /* 0x22 Match "", "next" ptr points backward. */
47#define EXACT 35 /* 0x23 Match this string (preceded by length). */
48#define EXACTF 36 /* 0x24 Match this non-UTF-8 string (not guaranteed to be folded) using /id rules (w/len). */
49#define EXACTFL 37 /* 0x25 Match this string (not guaranteed to be folded) using /il rules (w/len). */
50#define EXACTFU 38 /* 0x26 Match this string (folded iff in UTF-8, length in folding doesn't change if not in UTF-8) using /iu rules (w/len). */
51#define EXACTFA 39 /* 0x27 Match this string (not guaranteed to be folded) using /iaa rules (w/len). */
52#define EXACTFU_SS 40 /* 0x28 Match this string (folded iff in UTF-8, length in folding may change even if not in UTF-8) using /iu rules (w/len). */
098b07d5
KW
53#define EXACTFA_NO_TRIE 41 /* 0x29 Match this string (which is not trie-able; not guaranteed to be folded) using /iaa rules (w/len). */
54#define NOTHING 42 /* 0x2a Match empty string. */
55#define TAIL 43 /* 0x2b Match empty string. Can jump here from outside. */
56#define STAR 44 /* 0x2c Match this (simple) thing 0 or more times. */
57#define PLUS 45 /* 0x2d Match this (simple) thing 1 or more times. */
58#define CURLY 46 /* 0x2e Match this simple thing {n,m} times. */
59#define CURLYN 47 /* 0x2f Capture next-after-this simple thing */
60#define CURLYM 48 /* 0x30 Capture this medium-complex thing {n,m} times. */
61#define CURLYX 49 /* 0x31 Match this complex thing {n,m} times. */
62#define WHILEM 50 /* 0x32 Do curly processing and see if rest matches. */
63#define OPEN 51 /* 0x33 Mark this point in input as start of #n. */
64#define CLOSE 52 /* 0x34 Analogous to OPEN. */
65#define REF 53 /* 0x35 Match some already matched string */
66#define REFF 54 /* 0x36 Match already matched string, folded using native charset semantics for non-utf8 */
67#define REFFL 55 /* 0x37 Match already matched string, folded in loc. */
68#define REFFU 56 /* 0x38 Match already matched string, folded using unicode semantics for non-utf8 */
69#define REFFA 57 /* 0x39 Match already matched string, folded using unicode semantics for non-utf8, no mixing ASCII, non-ASCII */
70#define NREF 58 /* 0x3a Match some already matched string */
71#define NREFF 59 /* 0x3b Match already matched string, folded using native charset semantics for non-utf8 */
72#define NREFFL 60 /* 0x3c Match already matched string, folded in loc. */
73#define NREFFU 61 /* 0x3d Match already matched string, folded using unicode semantics for non-utf8 */
74#define NREFFA 62 /* 0x3e Match already matched string, folded using unicode semantics for non-utf8, no mixing ASCII, non-ASCII */
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[ALU]?)? 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 OPTIMIZED 94 /* 0x5e Placeholder for dump. */
107#define PSEUDO 95 /* 0x5f Pseudo opcode for internal use. */
03363afd 108 /* ------------ States ------------- */
24b23f37
YO
109#define TRIE_next (REGNODE_MAX + 1) /* state for TRIE */
110#define TRIE_next_fail (REGNODE_MAX + 2) /* state for TRIE */
111#define EVAL_AB (REGNODE_MAX + 3) /* state for EVAL */
112#define EVAL_AB_fail (REGNODE_MAX + 4) /* state for EVAL */
113#define CURLYX_end (REGNODE_MAX + 5) /* state for CURLYX */
114#define CURLYX_end_fail (REGNODE_MAX + 6) /* state for CURLYX */
115#define WHILEM_A_pre (REGNODE_MAX + 7) /* state for WHILEM */
116#define WHILEM_A_pre_fail (REGNODE_MAX + 8) /* state for WHILEM */
117#define WHILEM_A_min (REGNODE_MAX + 9) /* state for WHILEM */
118#define WHILEM_A_min_fail (REGNODE_MAX + 10) /* state for WHILEM */
119#define WHILEM_A_max (REGNODE_MAX + 11) /* state for WHILEM */
120#define WHILEM_A_max_fail (REGNODE_MAX + 12) /* state for WHILEM */
121#define WHILEM_B_min (REGNODE_MAX + 13) /* state for WHILEM */
122#define WHILEM_B_min_fail (REGNODE_MAX + 14) /* state for WHILEM */
123#define WHILEM_B_max (REGNODE_MAX + 15) /* state for WHILEM */
124#define WHILEM_B_max_fail (REGNODE_MAX + 16) /* state for WHILEM */
125#define BRANCH_next (REGNODE_MAX + 17) /* state for BRANCH */
126#define BRANCH_next_fail (REGNODE_MAX + 18) /* state for BRANCH */
127#define CURLYM_A (REGNODE_MAX + 19) /* state for CURLYM */
128#define CURLYM_A_fail (REGNODE_MAX + 20) /* state for CURLYM */
129#define CURLYM_B (REGNODE_MAX + 21) /* state for CURLYM */
130#define CURLYM_B_fail (REGNODE_MAX + 22) /* state for CURLYM */
131#define IFMATCH_A (REGNODE_MAX + 23) /* state for IFMATCH */
132#define IFMATCH_A_fail (REGNODE_MAX + 24) /* state for IFMATCH */
133#define CURLY_B_min_known (REGNODE_MAX + 25) /* state for CURLY */
134#define CURLY_B_min_known_fail (REGNODE_MAX + 26) /* state for CURLY */
135#define CURLY_B_min (REGNODE_MAX + 27) /* state for CURLY */
136#define CURLY_B_min_fail (REGNODE_MAX + 28) /* state for CURLY */
137#define CURLY_B_max (REGNODE_MAX + 29) /* state for CURLY */
138#define CURLY_B_max_fail (REGNODE_MAX + 30) /* state for CURLY */
139#define COMMIT_next (REGNODE_MAX + 31) /* state for COMMIT */
140#define COMMIT_next_fail (REGNODE_MAX + 32) /* state for COMMIT */
e2e6a0f1
YO
141#define MARKPOINT_next (REGNODE_MAX + 33) /* state for MARKPOINT */
142#define MARKPOINT_next_fail (REGNODE_MAX + 34) /* state for MARKPOINT */
5d458dd8
YO
143#define SKIP_next (REGNODE_MAX + 35) /* state for SKIP */
144#define SKIP_next_fail (REGNODE_MAX + 36) /* state for SKIP */
145#define CUTGROUP_next (REGNODE_MAX + 37) /* state for CUTGROUP */
146#define CUTGROUP_next_fail (REGNODE_MAX + 38) /* state for CUTGROUP */
ee9b8eae
YO
147#define KEEPS_next (REGNODE_MAX + 39) /* state for KEEPS */
148#define KEEPS_next_fail (REGNODE_MAX + 40) /* state for KEEPS */
03363afd 149
6bda09f9 150/* PL_regkind[] What type of regop or state is this. */
d09b2d29
IZ
151
152#ifndef DOINIT
22c35a8c 153EXTCONST U8 PL_regkind[];
d09b2d29 154#else
22c35a8c 155EXTCONST U8 PL_regkind[] = {
e2e6a0f1
YO
156 END, /* END */
157 END, /* SUCCEED */
158 BOL, /* BOL */
159 BOL, /* MBOL */
160 BOL, /* SBOL */
161 EOL, /* EOS */
162 EOL, /* EOL */
163 EOL, /* MEOL */
164 EOL, /* SEOL */
165 BOUND, /* BOUND */
166 BOUND, /* BOUNDL */
1e355c70 167 BOUND, /* BOUNDU */
0c6e81eb 168 BOUND, /* BOUNDA */
e2e6a0f1
YO
169 NBOUND, /* NBOUND */
170 NBOUND, /* NBOUNDL */
1e355c70 171 NBOUND, /* NBOUNDU */
0c6e81eb 172 NBOUND, /* NBOUNDA */
e2e6a0f1
YO
173 GPOS, /* GPOS */
174 REG_ANY, /* REG_ANY */
175 REG_ANY, /* SANY */
176 REG_ANY, /* CANY */
177 ANYOF, /* ANYOF */
954a2af6 178 ANYOF, /* ANYOF_WARN_SUPER */
9aa1e39f 179 ANYOF, /* ANYOF_SYNTHETIC */
3615ea58
KW
180 POSIXD, /* POSIXD */
181 POSIXD, /* POSIXL */
182 POSIXD, /* POSIXU */
183 POSIXD, /* POSIXA */
9e84774b
KW
184 NPOSIXD, /* NPOSIXD */
185 NPOSIXD, /* NPOSIXL */
186 NPOSIXD, /* NPOSIXU */
187 NPOSIXD, /* NPOSIXA */
e2e6a0f1
YO
188 CLUMP, /* CLUMP */
189 BRANCH, /* BRANCH */
190 BACK, /* BACK */
191 EXACT, /* EXACT */
192 EXACT, /* EXACTF */
193 EXACT, /* EXACTFL */
01f98ec2 194 EXACT, /* EXACTFU */
8c1182fd 195 EXACT, /* EXACTFA */
3c760661 196 EXACT, /* EXACTFU_SS */
098b07d5 197 EXACT, /* EXACTFA_NO_TRIE */
e2e6a0f1
YO
198 NOTHING, /* NOTHING */
199 NOTHING, /* TAIL */
200 STAR, /* STAR */
201 PLUS, /* PLUS */
202 CURLY, /* CURLY */
203 CURLY, /* CURLYN */
204 CURLY, /* CURLYM */
205 CURLY, /* CURLYX */
206 WHILEM, /* WHILEM */
207 OPEN, /* OPEN */
208 CLOSE, /* CLOSE */
209 REF, /* REF */
210 REF, /* REFF */
211 REF, /* REFFL */
01f98ec2 212 REF, /* REFFU */
781aab5c 213 REF, /* REFFA */
01f98ec2
KW
214 REF, /* NREF */
215 REF, /* NREFF */
216 REF, /* NREFFL */
217 REF, /* NREFFU */
781aab5c 218 REF, /* NREFFA */
e2e6a0f1
YO
219 BRANCHJ, /* IFMATCH */
220 BRANCHJ, /* UNLESSM */
221 BRANCHJ, /* SUSPEND */
222 BRANCHJ, /* IFTHEN */
223 GROUPP, /* GROUPP */
224 LONGJMP, /* LONGJMP */
225 BRANCHJ, /* BRANCHJ */
226 EVAL, /* EVAL */
227 MINMOD, /* MINMOD */
228 LOGICAL, /* LOGICAL */
229 BRANCHJ, /* RENUM */
230 TRIE, /* TRIE */
231 TRIE, /* TRIEC */
232 TRIE, /* AHOCORASICK */
233 TRIE, /* AHOCORASICKC */
234 GOSUB, /* GOSUB */
235 GOSTART, /* GOSTART */
e2e6a0f1
YO
236 NGROUPP, /* NGROUPP */
237 INSUBP, /* INSUBP */
238 DEFINEP, /* DEFINEP */
239 ENDLIKE, /* ENDLIKE */
240 ENDLIKE, /* OPFAIL */
241 ENDLIKE, /* ACCEPT */
242 VERB, /* VERB */
5d458dd8 243 VERB, /* PRUNE */
e2e6a0f1 244 VERB, /* MARKPOINT */
5d458dd8 245 VERB, /* SKIP */
e2e6a0f1 246 VERB, /* COMMIT */
5d458dd8 247 VERB, /* CUTGROUP */
ee9b8eae 248 KEEPS, /* KEEPS */
e1d1eefb 249 LNBREAK, /* LNBREAK */
e2e6a0f1
YO
250 NOTHING, /* OPTIMIZED */
251 PSEUDO, /* PSEUDO */
03363afd 252 /* ------------ States ------------- */
e2e6a0f1
YO
253 TRIE, /* TRIE_next */
254 TRIE, /* TRIE_next_fail */
255 EVAL, /* EVAL_AB */
256 EVAL, /* EVAL_AB_fail */
257 CURLYX, /* CURLYX_end */
258 CURLYX, /* CURLYX_end_fail */
259 WHILEM, /* WHILEM_A_pre */
260 WHILEM, /* WHILEM_A_pre_fail */
261 WHILEM, /* WHILEM_A_min */
262 WHILEM, /* WHILEM_A_min_fail */
263 WHILEM, /* WHILEM_A_max */
264 WHILEM, /* WHILEM_A_max_fail */
265 WHILEM, /* WHILEM_B_min */
266 WHILEM, /* WHILEM_B_min_fail */
267 WHILEM, /* WHILEM_B_max */
268 WHILEM, /* WHILEM_B_max_fail */
269 BRANCH, /* BRANCH_next */
270 BRANCH, /* BRANCH_next_fail */
271 CURLYM, /* CURLYM_A */
272 CURLYM, /* CURLYM_A_fail */
273 CURLYM, /* CURLYM_B */
274 CURLYM, /* CURLYM_B_fail */
275 IFMATCH, /* IFMATCH_A */
276 IFMATCH, /* IFMATCH_A_fail */
277 CURLY, /* CURLY_B_min_known */
278 CURLY, /* CURLY_B_min_known_fail */
279 CURLY, /* CURLY_B_min */
280 CURLY, /* CURLY_B_min_fail */
281 CURLY, /* CURLY_B_max */
282 CURLY, /* CURLY_B_max_fail */
283 COMMIT, /* COMMIT_next */
284 COMMIT, /* COMMIT_next_fail */
285 MARKPOINT, /* MARKPOINT_next */
286 MARKPOINT, /* MARKPOINT_next_fail */
5d458dd8
YO
287 SKIP, /* SKIP_next */
288 SKIP, /* SKIP_next_fail */
289 CUTGROUP, /* CUTGROUP_next */
290 CUTGROUP, /* CUTGROUP_next_fail */
ee9b8eae
YO
291 KEEPS, /* KEEPS_next */
292 KEEPS, /* KEEPS_next_fail */
d09b2d29
IZ
293};
294#endif
295
6bda09f9 296/* regarglen[] - How large is the argument part of the node (in regnodes) */
d09b2d29
IZ
297
298#ifdef REG_COMP_C
29de9391 299static const U8 regarglen[] = {
03363afd
YO
300 0, /* END */
301 0, /* SUCCEED */
302 0, /* BOL */
303 0, /* MBOL */
304 0, /* SBOL */
305 0, /* EOS */
306 0, /* EOL */
307 0, /* MEOL */
308 0, /* SEOL */
309 0, /* BOUND */
310 0, /* BOUNDL */
1e355c70 311 0, /* BOUNDU */
0c6e81eb 312 0, /* BOUNDA */
03363afd
YO
313 0, /* NBOUND */
314 0, /* NBOUNDL */
1e355c70 315 0, /* NBOUNDU */
0c6e81eb 316 0, /* NBOUNDA */
03363afd
YO
317 0, /* GPOS */
318 0, /* REG_ANY */
319 0, /* SANY */
320 0, /* CANY */
321 0, /* ANYOF */
954a2af6 322 0, /* ANYOF_WARN_SUPER */
9aa1e39f 323 0, /* ANYOF_SYNTHETIC */
3615ea58
KW
324 0, /* POSIXD */
325 0, /* POSIXL */
326 0, /* POSIXU */
327 0, /* POSIXA */
328 0, /* NPOSIXD */
329 0, /* NPOSIXL */
330 0, /* NPOSIXU */
331 0, /* NPOSIXA */
03363afd
YO
332 0, /* CLUMP */
333 0, /* BRANCH */
334 0, /* BACK */
335 0, /* EXACT */
336 0, /* EXACTF */
337 0, /* EXACTFL */
01f98ec2 338 0, /* EXACTFU */
8c1182fd 339 0, /* EXACTFA */
3c760661 340 0, /* EXACTFU_SS */
098b07d5 341 0, /* EXACTFA_NO_TRIE */
03363afd
YO
342 0, /* NOTHING */
343 0, /* TAIL */
344 0, /* STAR */
345 0, /* PLUS */
346 EXTRA_SIZE(struct regnode_2), /* CURLY */
347 EXTRA_SIZE(struct regnode_2), /* CURLYN */
348 EXTRA_SIZE(struct regnode_2), /* CURLYM */
349 EXTRA_SIZE(struct regnode_2), /* CURLYX */
350 0, /* WHILEM */
351 EXTRA_SIZE(struct regnode_1), /* OPEN */
352 EXTRA_SIZE(struct regnode_1), /* CLOSE */
353 EXTRA_SIZE(struct regnode_1), /* REF */
354 EXTRA_SIZE(struct regnode_1), /* REFF */
355 EXTRA_SIZE(struct regnode_1), /* REFFL */
01f98ec2 356 EXTRA_SIZE(struct regnode_1), /* REFFU */
781aab5c 357 EXTRA_SIZE(struct regnode_1), /* REFFA */
01f98ec2
KW
358 EXTRA_SIZE(struct regnode_1), /* NREF */
359 EXTRA_SIZE(struct regnode_1), /* NREFF */
360 EXTRA_SIZE(struct regnode_1), /* NREFFL */
361 EXTRA_SIZE(struct regnode_1), /* NREFFU */
781aab5c 362 EXTRA_SIZE(struct regnode_1), /* NREFFA */
03363afd
YO
363 EXTRA_SIZE(struct regnode_1), /* IFMATCH */
364 EXTRA_SIZE(struct regnode_1), /* UNLESSM */
365 EXTRA_SIZE(struct regnode_1), /* SUSPEND */
366 EXTRA_SIZE(struct regnode_1), /* IFTHEN */
367 EXTRA_SIZE(struct regnode_1), /* GROUPP */
368 EXTRA_SIZE(struct regnode_1), /* LONGJMP */
369 EXTRA_SIZE(struct regnode_1), /* BRANCHJ */
370 EXTRA_SIZE(struct regnode_1), /* EVAL */
371 0, /* MINMOD */
372 0, /* LOGICAL */
373 EXTRA_SIZE(struct regnode_1), /* RENUM */
374 EXTRA_SIZE(struct regnode_1), /* TRIE */
375 EXTRA_SIZE(struct regnode_charclass), /* TRIEC */
376 EXTRA_SIZE(struct regnode_1), /* AHOCORASICK */
377 EXTRA_SIZE(struct regnode_charclass), /* AHOCORASICKC */
1a147d38
YO
378 EXTRA_SIZE(struct regnode_2L), /* GOSUB */
379 0, /* GOSTART */
0a4db386 380 EXTRA_SIZE(struct regnode_1), /* NGROUPP */
1a147d38 381 EXTRA_SIZE(struct regnode_1), /* INSUBP */
0a4db386 382 EXTRA_SIZE(struct regnode_1), /* DEFINEP */
e2e6a0f1 383 0, /* ENDLIKE */
7f69552c 384 0, /* OPFAIL */
e2e6a0f1 385 EXTRA_SIZE(struct regnode_1), /* ACCEPT */
20832bc5 386 EXTRA_SIZE(struct regnode_1), /* VERB */
5d458dd8 387 EXTRA_SIZE(struct regnode_1), /* PRUNE */
e2e6a0f1 388 EXTRA_SIZE(struct regnode_1), /* MARKPOINT */
5d458dd8 389 EXTRA_SIZE(struct regnode_1), /* SKIP */
e2e6a0f1 390 EXTRA_SIZE(struct regnode_1), /* COMMIT */
5d458dd8 391 EXTRA_SIZE(struct regnode_1), /* CUTGROUP */
ee9b8eae 392 0, /* KEEPS */
e1d1eefb 393 0, /* LNBREAK */
03363afd
YO
394 0, /* OPTIMIZED */
395 0, /* PSEUDO */
d09b2d29
IZ
396};
397
6bda09f9
YO
398/* reg_off_by_arg[] - Which argument holds the offset to the next node */
399
29de9391 400static const char reg_off_by_arg[] = {
03363afd
YO
401 0, /* END */
402 0, /* SUCCEED */
403 0, /* BOL */
404 0, /* MBOL */
405 0, /* SBOL */
406 0, /* EOS */
407 0, /* EOL */
408 0, /* MEOL */
409 0, /* SEOL */
410 0, /* BOUND */
411 0, /* BOUNDL */
1e355c70 412 0, /* BOUNDU */
0c6e81eb 413 0, /* BOUNDA */
03363afd
YO
414 0, /* NBOUND */
415 0, /* NBOUNDL */
1e355c70 416 0, /* NBOUNDU */
0c6e81eb 417 0, /* NBOUNDA */
03363afd
YO
418 0, /* GPOS */
419 0, /* REG_ANY */
420 0, /* SANY */
421 0, /* CANY */
422 0, /* ANYOF */
954a2af6 423 0, /* ANYOF_WARN_SUPER */
9aa1e39f 424 0, /* ANYOF_SYNTHETIC */
3615ea58
KW
425 0, /* POSIXD */
426 0, /* POSIXL */
427 0, /* POSIXU */
428 0, /* POSIXA */
429 0, /* NPOSIXD */
430 0, /* NPOSIXL */
431 0, /* NPOSIXU */
432 0, /* NPOSIXA */
03363afd
YO
433 0, /* CLUMP */
434 0, /* BRANCH */
435 0, /* BACK */
436 0, /* EXACT */
437 0, /* EXACTF */
438 0, /* EXACTFL */
01f98ec2 439 0, /* EXACTFU */
8c1182fd 440 0, /* EXACTFA */
3c760661 441 0, /* EXACTFU_SS */
098b07d5 442 0, /* EXACTFA_NO_TRIE */
03363afd
YO
443 0, /* NOTHING */
444 0, /* TAIL */
445 0, /* STAR */
446 0, /* PLUS */
447 0, /* CURLY */
448 0, /* CURLYN */
449 0, /* CURLYM */
450 0, /* CURLYX */
451 0, /* WHILEM */
452 0, /* OPEN */
453 0, /* CLOSE */
454 0, /* REF */
455 0, /* REFF */
456 0, /* REFFL */
01f98ec2 457 0, /* REFFU */
781aab5c 458 0, /* REFFA */
01f98ec2
KW
459 0, /* NREF */
460 0, /* NREFF */
461 0, /* NREFFL */
462 0, /* NREFFU */
781aab5c 463 0, /* NREFFA */
03363afd
YO
464 2, /* IFMATCH */
465 2, /* UNLESSM */
466 1, /* SUSPEND */
467 1, /* IFTHEN */
468 0, /* GROUPP */
469 1, /* LONGJMP */
470 1, /* BRANCHJ */
471 0, /* EVAL */
472 0, /* MINMOD */
473 0, /* LOGICAL */
474 1, /* RENUM */
475 0, /* TRIE */
476 0, /* TRIEC */
477 0, /* AHOCORASICK */
478 0, /* AHOCORASICKC */
1a147d38
YO
479 0, /* GOSUB */
480 0, /* GOSTART */
0a4db386 481 0, /* NGROUPP */
1a147d38 482 0, /* INSUBP */
0a4db386 483 0, /* DEFINEP */
e2e6a0f1 484 0, /* ENDLIKE */
7f69552c 485 0, /* OPFAIL */
e2e6a0f1
YO
486 0, /* ACCEPT */
487 0, /* VERB */
5d458dd8 488 0, /* PRUNE */
e2e6a0f1 489 0, /* MARKPOINT */
5d458dd8 490 0, /* SKIP */
e2e6a0f1 491 0, /* COMMIT */
5d458dd8 492 0, /* CUTGROUP */
ee9b8eae 493 0, /* KEEPS */
e1d1eefb 494 0, /* LNBREAK */
03363afd
YO
495 0, /* OPTIMIZED */
496 0, /* PSEUDO */
d09b2d29 497};
885f9e59 498
13d6edb4
NC
499#endif /* REG_COMP_C */
500
6bda09f9
YO
501/* reg_name[] - Opcode/state names in string form, for debugging */
502
22429478 503#ifndef DOINIT
13d6edb4 504EXTCONST char * PL_reg_name[];
22429478 505#else
4764e399 506EXTCONST char * const PL_reg_name[] = {
03363afd
YO
507 "END", /* 0000 */
508 "SUCCEED", /* 0x01 */
509 "BOL", /* 0x02 */
510 "MBOL", /* 0x03 */
511 "SBOL", /* 0x04 */
512 "EOS", /* 0x05 */
513 "EOL", /* 0x06 */
514 "MEOL", /* 0x07 */
515 "SEOL", /* 0x08 */
516 "BOUND", /* 0x09 */
517 "BOUNDL", /* 0x0a */
1e355c70 518 "BOUNDU", /* 0x0b */
0c6e81eb
KW
519 "BOUNDA", /* 0x0c */
520 "NBOUND", /* 0x0d */
521 "NBOUNDL", /* 0x0e */
522 "NBOUNDU", /* 0x0f */
523 "NBOUNDA", /* 0x10 */
524 "GPOS", /* 0x11 */
525 "REG_ANY", /* 0x12 */
526 "SANY", /* 0x13 */
527 "CANY", /* 0x14 */
528 "ANYOF", /* 0x15 */
954a2af6 529 "ANYOF_WARN_SUPER", /* 0x16 */
9aa1e39f
KW
530 "ANYOF_SYNTHETIC", /* 0x17 */
531 "POSIXD", /* 0x18 */
532 "POSIXL", /* 0x19 */
533 "POSIXU", /* 0x1a */
534 "POSIXA", /* 0x1b */
535 "NPOSIXD", /* 0x1c */
536 "NPOSIXL", /* 0x1d */
537 "NPOSIXU", /* 0x1e */
538 "NPOSIXA", /* 0x1f */
539 "CLUMP", /* 0x20 */
540 "BRANCH", /* 0x21 */
541 "BACK", /* 0x22 */
542 "EXACT", /* 0x23 */
543 "EXACTF", /* 0x24 */
544 "EXACTFL", /* 0x25 */
545 "EXACTFU", /* 0x26 */
546 "EXACTFA", /* 0x27 */
547 "EXACTFU_SS", /* 0x28 */
098b07d5
KW
548 "EXACTFA_NO_TRIE", /* 0x29 */
549 "NOTHING", /* 0x2a */
550 "TAIL", /* 0x2b */
551 "STAR", /* 0x2c */
552 "PLUS", /* 0x2d */
553 "CURLY", /* 0x2e */
554 "CURLYN", /* 0x2f */
555 "CURLYM", /* 0x30 */
556 "CURLYX", /* 0x31 */
557 "WHILEM", /* 0x32 */
558 "OPEN", /* 0x33 */
559 "CLOSE", /* 0x34 */
560 "REF", /* 0x35 */
561 "REFF", /* 0x36 */
562 "REFFL", /* 0x37 */
563 "REFFU", /* 0x38 */
564 "REFFA", /* 0x39 */
565 "NREF", /* 0x3a */
566 "NREFF", /* 0x3b */
567 "NREFFL", /* 0x3c */
568 "NREFFU", /* 0x3d */
569 "NREFFA", /* 0x3e */
570 "IFMATCH", /* 0x3f */
571 "UNLESSM", /* 0x40 */
572 "SUSPEND", /* 0x41 */
573 "IFTHEN", /* 0x42 */
574 "GROUPP", /* 0x43 */
575 "LONGJMP", /* 0x44 */
576 "BRANCHJ", /* 0x45 */
577 "EVAL", /* 0x46 */
578 "MINMOD", /* 0x47 */
579 "LOGICAL", /* 0x48 */
580 "RENUM", /* 0x49 */
581 "TRIE", /* 0x4a */
582 "TRIEC", /* 0x4b */
583 "AHOCORASICK", /* 0x4c */
584 "AHOCORASICKC", /* 0x4d */
585 "GOSUB", /* 0x4e */
586 "GOSTART", /* 0x4f */
587 "NGROUPP", /* 0x50 */
588 "INSUBP", /* 0x51 */
589 "DEFINEP", /* 0x52 */
590 "ENDLIKE", /* 0x53 */
591 "OPFAIL", /* 0x54 */
592 "ACCEPT", /* 0x55 */
593 "VERB", /* 0x56 */
594 "PRUNE", /* 0x57 */
595 "MARKPOINT", /* 0x58 */
596 "SKIP", /* 0x59 */
597 "COMMIT", /* 0x5a */
598 "CUTGROUP", /* 0x5b */
599 "KEEPS", /* 0x5c */
600 "LNBREAK", /* 0x5d */
601 "OPTIMIZED", /* 0x5e */
602 "PSEUDO", /* 0x5f */
03363afd 603 /* ------------ States ------------- */
24b23f37
YO
604 "TRIE_next", /* REGNODE_MAX +0x01 */
605 "TRIE_next_fail", /* REGNODE_MAX +0x02 */
606 "EVAL_AB", /* REGNODE_MAX +0x03 */
607 "EVAL_AB_fail", /* REGNODE_MAX +0x04 */
608 "CURLYX_end", /* REGNODE_MAX +0x05 */
609 "CURLYX_end_fail", /* REGNODE_MAX +0x06 */
610 "WHILEM_A_pre", /* REGNODE_MAX +0x07 */
611 "WHILEM_A_pre_fail", /* REGNODE_MAX +0x08 */
612 "WHILEM_A_min", /* REGNODE_MAX +0x09 */
613 "WHILEM_A_min_fail", /* REGNODE_MAX +0x0a */
614 "WHILEM_A_max", /* REGNODE_MAX +0x0b */
615 "WHILEM_A_max_fail", /* REGNODE_MAX +0x0c */
616 "WHILEM_B_min", /* REGNODE_MAX +0x0d */
617 "WHILEM_B_min_fail", /* REGNODE_MAX +0x0e */
618 "WHILEM_B_max", /* REGNODE_MAX +0x0f */
619 "WHILEM_B_max_fail", /* REGNODE_MAX +0x10 */
620 "BRANCH_next", /* REGNODE_MAX +0x11 */
621 "BRANCH_next_fail", /* REGNODE_MAX +0x12 */
622 "CURLYM_A", /* REGNODE_MAX +0x13 */
623 "CURLYM_A_fail", /* REGNODE_MAX +0x14 */
624 "CURLYM_B", /* REGNODE_MAX +0x15 */
625 "CURLYM_B_fail", /* REGNODE_MAX +0x16 */
626 "IFMATCH_A", /* REGNODE_MAX +0x17 */
627 "IFMATCH_A_fail", /* REGNODE_MAX +0x18 */
628 "CURLY_B_min_known", /* REGNODE_MAX +0x19 */
629 "CURLY_B_min_known_fail", /* REGNODE_MAX +0x1a */
630 "CURLY_B_min", /* REGNODE_MAX +0x1b */
631 "CURLY_B_min_fail", /* REGNODE_MAX +0x1c */
632 "CURLY_B_max", /* REGNODE_MAX +0x1d */
633 "CURLY_B_max_fail", /* REGNODE_MAX +0x1e */
634 "COMMIT_next", /* REGNODE_MAX +0x1f */
635 "COMMIT_next_fail", /* REGNODE_MAX +0x20 */
e2e6a0f1
YO
636 "MARKPOINT_next", /* REGNODE_MAX +0x21 */
637 "MARKPOINT_next_fail", /* REGNODE_MAX +0x22 */
5d458dd8
YO
638 "SKIP_next", /* REGNODE_MAX +0x23 */
639 "SKIP_next_fail", /* REGNODE_MAX +0x24 */
640 "CUTGROUP_next", /* REGNODE_MAX +0x25 */
641 "CUTGROUP_next_fail", /* REGNODE_MAX +0x26 */
ee9b8eae
YO
642 "KEEPS_next", /* REGNODE_MAX +0x27 */
643 "KEEPS_next_fail", /* REGNODE_MAX +0x28 */
885f9e59 644};
22429478 645#endif /* DOINIT */
d09b2d29 646
f7819f85
A
647/* PL_reg_extflags_name[] - Opcode/state names in string form, for debugging */
648
649#ifndef DOINIT
650EXTCONST char * PL_reg_extflags_name[];
651#else
652EXTCONST char * const PL_reg_extflags_name[] = {
dbc200c5 653 /* Bits in extflags defined: 11111110111111111111111111111111 */
52d81aa8
NC
654 "MULTILINE", /* 0x00000001 */
655 "SINGLELINE", /* 0x00000002 */
656 "FOLD", /* 0x00000004 */
657 "EXTENDED", /* 0x00000008 */
658 "KEEPCOPY", /* 0x00000010 */
6976c986
YO
659 "CHARSET0", /* 0x00000020 : "CHARSET" - 0x000000e0 */
660 "CHARSET1", /* 0x00000040 : "CHARSET" - 0x000000e0 */
661 "CHARSET2", /* 0x00000080 : "CHARSET" - 0x000000e0 */
dbc200c5 662 "SPLIT", /* 0x00000100 */
e795e964
KW
663 "ANCH_BOL", /* 0x00000200 */
664 "ANCH_MBOL", /* 0x00000400 */
665 "ANCH_SBOL", /* 0x00000800 */
666 "ANCH_GPOS", /* 0x00001000 */
667 "GPOS_SEEN", /* 0x00002000 */
668 "GPOS_FLOAT", /* 0x00004000 */
dbc200c5 669 "NO_INPLACE_SUBST", /* 0x00008000 */
e795e964
KW
670 "EVAL_SEEN", /* 0x00010000 */
671 "CANY_SEEN", /* 0x00020000 */
672 "NOSCAN", /* 0x00040000 */
673 "CHECK_ALL", /* 0x00080000 */
52d81aa8
NC
674 "MATCH_UTF8", /* 0x00100000 */
675 "USE_INTUIT_NOML", /* 0x00200000 */
676 "USE_INTUIT_ML", /* 0x00400000 */
677 "INTUIT_TAIL", /* 0x00800000 */
dbc200c5 678 "UNUSED_BIT_24", /* 0x01000000 */
52d81aa8
NC
679 "COPY_DONE", /* 0x02000000 */
680 "TAINTED_SEEN", /* 0x04000000 */
681 "TAINTED", /* 0x08000000 */
682 "START_ONLY", /* 0x10000000 */
dbc200c5 683 "SKIPWHITE", /* 0x20000000 */
52d81aa8
NC
684 "WHITE", /* 0x40000000 */
685 "NULL", /* 0x80000000 */
f7819f85
A
686};
687#endif /* DOINIT */
688
337ff307
YO
689/* PL_reg_intflags_name[] - Opcode/state names in string form, for debugging */
690
691#ifndef DOINIT
692EXTCONST char * PL_reg_intflags_name[];
693#else
694EXTCONST char * const PL_reg_intflags_name[] = {
b8f6efdd
YO
695 "SKIP", /* 0x00000001 - PREGf_SKIP */
696 "IMPLICIT", /* 0x00000002 - PREGf_IMPLICIT - Converted .* to ^.* */
697 "NAUGHTY", /* 0x00000004 - PREGf_NAUGHTY - how exponential is this pattern? */
698 "VERBARG_SEEN", /* 0x00000008 - PREGf_VERBARG_SEEN */
699 "CUTGROUP_SEEN", /* 0x00000010 - PREGf_CUTGROUP_SEEN */
700 "USE_RE_EVAL", /* 0x00000020 - PREGf_USE_RE_EVAL - compiled with "use re 'eval'" */
337ff307
YO
701};
702#endif /* DOINIT */
703
f9ef50a7 704/* The following have no fixed length. U8 so we can do strchr() on it. */
ded4dd2a 705#define REGNODE_VARIES(node) (PL_varies_bitmask[(node) >> 3] & (1 << ((node) & 7)))
e52fc539 706
f9ef50a7 707#ifndef DOINIT
ded4dd2a 708EXTCONST U8 PL_varies[] __attribute__deprecated__;
f9ef50a7 709#else
ded4dd2a 710EXTCONST U8 PL_varies[] __attribute__deprecated__ = {
e0193e47
KW
711 CLUMP, BRANCH, BACK, STAR, PLUS, CURLY, CURLYN, CURLYM, CURLYX, WHILEM,
712 REF, REFF, REFFL, REFFU, REFFA, NREF, NREFF, NREFFL, NREFFU, NREFFA,
713 SUSPEND, IFTHEN, BRANCHJ,
f9ef50a7
NC
714 0
715};
716#endif /* DOINIT */
717
ded4dd2a
NC
718#ifndef DOINIT
719EXTCONST U8 PL_varies_bitmask[];
720#else
721EXTCONST U8 PL_varies_bitmask[] = {
098b07d5 722 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0xE7, 0x7F, 0x26, 0x00, 0x00, 0x00
ded4dd2a
NC
723};
724#endif /* DOINIT */
725
f9ef50a7
NC
726/* The following always have a length of 1. U8 we can do strchr() on it. */
727/* (Note that length 1 means "one character" under UTF8, not "one octet".) */
ded4dd2a 728#define REGNODE_SIMPLE(node) (PL_simple_bitmask[(node) >> 3] & (1 << ((node) & 7)))
e52fc539 729
f9ef50a7 730#ifndef DOINIT
ded4dd2a 731EXTCONST U8 PL_simple[] __attribute__deprecated__;
f9ef50a7 732#else
ded4dd2a 733EXTCONST U8 PL_simple[] __attribute__deprecated__ = {
9aa1e39f
KW
734 REG_ANY, SANY, CANY, ANYOF, ANYOF_WARN_SUPER, ANYOF_SYNTHETIC, POSIXD,
735 POSIXL, POSIXU, POSIXA, NPOSIXD, NPOSIXL, NPOSIXU, NPOSIXA,
f9ef50a7
NC
736 0
737};
738#endif /* DOINIT */
739
ded4dd2a
NC
740#ifndef DOINIT
741EXTCONST U8 PL_simple_bitmask[];
742#else
743EXTCONST U8 PL_simple_bitmask[] = {
9aa1e39f 744 0x00, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
ded4dd2a
NC
745};
746#endif /* DOINIT */
747
37442d52 748/* ex: set ro: */