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