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