perldelta - Add links for rt.perl.org bugs
[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             91
10 #define REGMATCH_STATE_MAX      131
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 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. */
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. */
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. */
106         /* ------------ States ------------- */
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 */
139 #define MARKPOINT_next          (REGNODE_MAX + 33)      /* state for MARKPOINT */
140 #define MARKPOINT_next_fail     (REGNODE_MAX + 34)      /* state for MARKPOINT */
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 */
145 #define KEEPS_next              (REGNODE_MAX + 39)      /* state for KEEPS */
146 #define KEEPS_next_fail         (REGNODE_MAX + 40)      /* state for KEEPS */
147
148 /* PL_regkind[] What type of regop or state is this. */
149
150 #ifndef DOINIT
151 EXTCONST U8 PL_regkind[];
152 #else
153 EXTCONST U8 PL_regkind[] = {
154         END,            /* END                    */
155         END,            /* SUCCEED                */
156         BOL,            /* SBOL                   */
157         BOL,            /* MBOL                   */
158         EOL,            /* SEOL                   */
159         EOL,            /* MEOL                   */
160         EOL,            /* EOS                    */
161         GPOS,           /* GPOS                   */
162         BOUND,          /* BOUND                  */
163         BOUND,          /* BOUNDL                 */
164         BOUND,          /* BOUNDU                 */
165         BOUND,          /* BOUNDA                 */
166         NBOUND,         /* NBOUND                 */
167         NBOUND,         /* NBOUNDL                */
168         NBOUND,         /* NBOUNDU                */
169         NBOUND,         /* NBOUNDA                */
170         REG_ANY,        /* REG_ANY                */
171         REG_ANY,        /* SANY                   */
172         REG_ANY,        /* CANY                   */
173         ANYOF,          /* ANYOF                  */
174         POSIXD,         /* POSIXD                 */
175         POSIXD,         /* POSIXL                 */
176         POSIXD,         /* POSIXU                 */
177         POSIXD,         /* POSIXA                 */
178         NPOSIXD,        /* NPOSIXD                */
179         NPOSIXD,        /* NPOSIXL                */
180         NPOSIXD,        /* NPOSIXU                */
181         NPOSIXD,        /* NPOSIXA                */
182         CLUMP,          /* CLUMP                  */
183         BRANCH,         /* BRANCH                 */
184         BACK,           /* BACK                   */
185         EXACT,          /* EXACT                  */
186         EXACT,          /* EXACTF                 */
187         EXACT,          /* EXACTFL                */
188         EXACT,          /* EXACTFU                */
189         EXACT,          /* EXACTFA                */
190         EXACT,          /* EXACTFU_SS             */
191         EXACT,          /* EXACTFA_NO_TRIE        */
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                  */
206         REF,            /* REFFU                  */
207         REF,            /* REFFA                  */
208         REF,            /* NREF                   */
209         REF,            /* NREFF                  */
210         REF,            /* NREFFL                 */
211         REF,            /* NREFFU                 */
212         REF,            /* NREFFA                 */
213         LONGJMP,        /* LONGJMP                */
214         BRANCHJ,        /* BRANCHJ                */
215         BRANCHJ,        /* IFMATCH                */
216         BRANCHJ,        /* UNLESSM                */
217         BRANCHJ,        /* SUSPEND                */
218         BRANCHJ,        /* IFTHEN                 */
219         GROUPP,         /* GROUPP                 */
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                */
230         NGROUPP,        /* NGROUPP                */
231         INSUBP,         /* INSUBP                 */
232         DEFINEP,        /* DEFINEP                */
233         ENDLIKE,        /* ENDLIKE                */
234         ENDLIKE,        /* OPFAIL                 */
235         ENDLIKE,        /* ACCEPT                 */
236         VERB,           /* VERB                   */
237         VERB,           /* PRUNE                  */
238         VERB,           /* MARKPOINT              */
239         VERB,           /* SKIP                   */
240         VERB,           /* COMMIT                 */
241         VERB,           /* CUTGROUP               */
242         KEEPS,          /* KEEPS                  */
243         LNBREAK,        /* LNBREAK                */
244         NOTHING,        /* OPTIMIZED              */
245         PSEUDO,         /* PSEUDO                 */
246         /* ------------ States ------------- */
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    */
281         SKIP,           /* SKIP_next              */
282         SKIP,           /* SKIP_next_fail         */
283         CUTGROUP,       /* CUTGROUP_next          */
284         CUTGROUP,       /* CUTGROUP_next_fail     */
285         KEEPS,          /* KEEPS_next             */
286         KEEPS,          /* KEEPS_next_fail        */
287 };
288 #endif
289
290 /* regarglen[] - How large is the argument part of the node (in regnodes) */
291
292 #ifdef REG_COMP_C
293 static const U8 regarglen[] = {
294         0,                                      /* END          */
295         0,                                      /* SUCCEED      */
296         0,                                      /* SBOL         */
297         0,                                      /* MBOL         */
298         0,                                      /* SEOL         */
299         0,                                      /* MEOL         */
300         0,                                      /* EOS          */
301         0,                                      /* GPOS         */
302         0,                                      /* BOUND        */
303         0,                                      /* BOUNDL       */
304         0,                                      /* BOUNDU       */
305         0,                                      /* BOUNDA       */
306         0,                                      /* NBOUND       */
307         0,                                      /* NBOUNDL      */
308         0,                                      /* NBOUNDU      */
309         0,                                      /* NBOUNDA      */
310         0,                                      /* REG_ANY      */
311         0,                                      /* SANY         */
312         0,                                      /* CANY         */
313         0,                                      /* ANYOF        */
314         0,                                      /* POSIXD       */
315         0,                                      /* POSIXL       */
316         0,                                      /* POSIXU       */
317         0,                                      /* POSIXA       */
318         0,                                      /* NPOSIXD      */
319         0,                                      /* NPOSIXL      */
320         0,                                      /* NPOSIXU      */
321         0,                                      /* NPOSIXA      */
322         0,                                      /* CLUMP        */
323         0,                                      /* BRANCH       */
324         0,                                      /* BACK         */
325         0,                                      /* EXACT        */
326         0,                                      /* EXACTF       */
327         0,                                      /* EXACTFL      */
328         0,                                      /* EXACTFU      */
329         0,                                      /* EXACTFA      */
330         0,                                      /* EXACTFU_SS   */
331         0,                                      /* EXACTFA_NO_TRIE */
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        */
346         EXTRA_SIZE(struct regnode_1),           /* REFFU        */
347         EXTRA_SIZE(struct regnode_1),           /* REFFA        */
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       */
352         EXTRA_SIZE(struct regnode_1),           /* NREFFA       */
353         EXTRA_SIZE(struct regnode_1),           /* LONGJMP      */
354         EXTRA_SIZE(struct regnode_1),           /* BRANCHJ      */
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       */
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 */
368         EXTRA_SIZE(struct regnode_2L),          /* GOSUB        */
369         0,                                      /* GOSTART      */
370         EXTRA_SIZE(struct regnode_1),           /* NGROUPP      */
371         EXTRA_SIZE(struct regnode_1),           /* INSUBP       */
372         EXTRA_SIZE(struct regnode_1),           /* DEFINEP      */
373         0,                                      /* ENDLIKE      */
374         0,                                      /* OPFAIL       */
375         EXTRA_SIZE(struct regnode_1),           /* ACCEPT       */
376         EXTRA_SIZE(struct regnode_1),           /* VERB         */
377         EXTRA_SIZE(struct regnode_1),           /* PRUNE        */
378         EXTRA_SIZE(struct regnode_1),           /* MARKPOINT    */
379         EXTRA_SIZE(struct regnode_1),           /* SKIP         */
380         EXTRA_SIZE(struct regnode_1),           /* COMMIT       */
381         EXTRA_SIZE(struct regnode_1),           /* CUTGROUP     */
382         0,                                      /* KEEPS        */
383         0,                                      /* LNBREAK      */
384         0,                                      /* OPTIMIZED    */
385         0,                                      /* PSEUDO       */
386 };
387
388 /* reg_off_by_arg[] - Which argument holds the offset to the next node */
389
390 static const char reg_off_by_arg[] = {
391         0,      /* END          */
392         0,      /* SUCCEED      */
393         0,      /* SBOL         */
394         0,      /* MBOL         */
395         0,      /* SEOL         */
396         0,      /* MEOL         */
397         0,      /* EOS          */
398         0,      /* GPOS         */
399         0,      /* BOUND        */
400         0,      /* BOUNDL       */
401         0,      /* BOUNDU       */
402         0,      /* BOUNDA       */
403         0,      /* NBOUND       */
404         0,      /* NBOUNDL      */
405         0,      /* NBOUNDU      */
406         0,      /* NBOUNDA      */
407         0,      /* REG_ANY      */
408         0,      /* SANY         */
409         0,      /* CANY         */
410         0,      /* ANYOF        */
411         0,      /* POSIXD       */
412         0,      /* POSIXL       */
413         0,      /* POSIXU       */
414         0,      /* POSIXA       */
415         0,      /* NPOSIXD      */
416         0,      /* NPOSIXL      */
417         0,      /* NPOSIXU      */
418         0,      /* NPOSIXA      */
419         0,      /* CLUMP        */
420         0,      /* BRANCH       */
421         0,      /* BACK         */
422         0,      /* EXACT        */
423         0,      /* EXACTF       */
424         0,      /* EXACTFL      */
425         0,      /* EXACTFU      */
426         0,      /* EXACTFA      */
427         0,      /* EXACTFU_SS   */
428         0,      /* EXACTFA_NO_TRIE */
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        */
443         0,      /* REFFU        */
444         0,      /* REFFA        */
445         0,      /* NREF         */
446         0,      /* NREFF        */
447         0,      /* NREFFL       */
448         0,      /* NREFFU       */
449         0,      /* NREFFA       */
450         1,      /* LONGJMP      */
451         1,      /* BRANCHJ      */
452         2,      /* IFMATCH      */
453         2,      /* UNLESSM      */
454         1,      /* SUSPEND      */
455         1,      /* IFTHEN       */
456         0,      /* GROUPP       */
457         0,      /* EVAL         */
458         0,      /* MINMOD       */
459         0,      /* LOGICAL      */
460         1,      /* RENUM        */
461         0,      /* TRIE         */
462         0,      /* TRIEC        */
463         0,      /* AHOCORASICK  */
464         0,      /* AHOCORASICKC */
465         0,      /* GOSUB        */
466         0,      /* GOSTART      */
467         0,      /* NGROUPP      */
468         0,      /* INSUBP       */
469         0,      /* DEFINEP      */
470         0,      /* ENDLIKE      */
471         0,      /* OPFAIL       */
472         0,      /* ACCEPT       */
473         0,      /* VERB         */
474         0,      /* PRUNE        */
475         0,      /* MARKPOINT    */
476         0,      /* SKIP         */
477         0,      /* COMMIT       */
478         0,      /* CUTGROUP     */
479         0,      /* KEEPS        */
480         0,      /* LNBREAK      */
481         0,      /* OPTIMIZED    */
482         0,      /* PSEUDO       */
483 };
484
485 #endif /* REG_COMP_C */
486
487 /* reg_name[] - Opcode/state names in string form, for debugging */
488
489 #ifndef DOINIT
490 EXTCONST char * PL_reg_name[];
491 #else
492 EXTCONST char * const PL_reg_name[] = {
493         "END",                          /* 0000 */
494         "SUCCEED",                      /* 0x01 */
495         "SBOL",                         /* 0x02 */
496         "MBOL",                         /* 0x03 */
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 */
554         "IFMATCH",                      /* 0x3d */
555         "UNLESSM",                      /* 0x3e */
556         "SUSPEND",                      /* 0x3f */
557         "IFTHEN",                       /* 0x40 */
558         "GROUPP",                       /* 0x41 */
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 */
585         /* ------------ States ------------- */
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 */
618         "MARKPOINT_next",               /* REGNODE_MAX +0x21 */
619         "MARKPOINT_next_fail",          /* REGNODE_MAX +0x22 */
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 */
624         "KEEPS_next",                   /* REGNODE_MAX +0x27 */
625         "KEEPS_next_fail",              /* REGNODE_MAX +0x28 */
626 };
627 #endif /* DOINIT */
628
629 /* PL_reg_extflags_name[] - Opcode/state names in string form, for debugging */
630
631 #ifndef DOINIT
632 EXTCONST char * PL_reg_extflags_name[];
633 #else
634 EXTCONST char * const PL_reg_extflags_name[] = {
635         /* Bits in extflags defined: 11111110111111111111111111111111 */
636         "MULTILINE",        /* 0x00000001 */
637         "SINGLELINE",       /* 0x00000002 */
638         "FOLD",             /* 0x00000004 */
639         "EXTENDED",         /* 0x00000008 */
640         "KEEPCOPY",         /* 0x00000010 */
641         "CHARSET0",         /* 0x00000020 : "CHARSET" - 0x000000e0 */
642         "CHARSET1",         /* 0x00000040 : "CHARSET" - 0x000000e0 */
643         "CHARSET2",         /* 0x00000080 : "CHARSET" - 0x000000e0 */
644         "SPLIT",            /* 0x00000100 */
645         "IS_ANCHORED",      /* 0x00000200 */
646         "UNUSED1",          /* 0x00000400 */
647         "UNUSED2",          /* 0x00000800 */
648         "UNUSED3",          /* 0x00001000 */
649         "UNUSED4",          /* 0x00002000 */
650         "UNUSED5",          /* 0x00004000 */
651         "NO_INPLACE_SUBST", /* 0x00008000 */
652         "EVAL_SEEN",        /* 0x00010000 */
653         "UNUSED8",          /* 0x00020000 */
654         "UNBOUNDED_QUANTIFIER_SEEN",/* 0x00040000 */
655         "CHECK_ALL",        /* 0x00080000 */
656         "MATCH_UTF8",       /* 0x00100000 */
657         "USE_INTUIT_NOML",  /* 0x00200000 */
658         "USE_INTUIT_ML",    /* 0x00400000 */
659         "INTUIT_TAIL",      /* 0x00800000 */
660         "UNUSED_BIT_24",    /* 0x01000000 */
661         "COPY_DONE",        /* 0x02000000 */
662         "TAINTED_SEEN",     /* 0x04000000 */
663         "TAINTED",          /* 0x08000000 */
664         "START_ONLY",       /* 0x10000000 */
665         "SKIPWHITE",        /* 0x20000000 */
666         "WHITE",            /* 0x40000000 */
667         "NULL",             /* 0x80000000 */
668 };
669 #endif /* DOINIT */
670
671 #ifdef DEBUGGING
672 #  define REG_EXTFLAGS_NAME_SIZE 32
673 #endif
674
675 /* PL_reg_intflags_name[] - Opcode/state names in string form, for debugging */
676
677 #ifndef DOINIT
678 EXTCONST char * PL_reg_intflags_name[];
679 #else
680 EXTCONST char * const PL_reg_intflags_name[] = {
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'"  */
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 */
691         "ANCH_MBOL",                  /* 0x00000400 - PREGf_ANCH_MBOL */
692         "ANCH_SBOL",                  /* 0x00000800 - PREGf_ANCH_SBOL */
693         "ANCH_GPOS",                  /* 0x00001000 - PREGf_ANCH_GPOS */
694 };
695 #endif /* DOINIT */
696
697 #ifdef DEBUGGING
698 #  define REG_INTFLAGS_NAME_SIZE 13
699 #endif
700
701 /* The following have no fixed length. U8 so we can do strchr() on it. */
702 #define REGNODE_VARIES(node) (PL_varies_bitmask[(node) >> 3] & (1 << ((node) & 7)))
703
704 #ifndef DOINIT
705 EXTCONST U8 PL_varies[] __attribute__deprecated__;
706 #else
707 EXTCONST U8 PL_varies[] __attribute__deprecated__ = {
708     CLUMP, BRANCH, BACK, STAR, PLUS, CURLY, CURLYN, CURLYM, CURLYX, WHILEM,
709     REF, REFF, REFFL, REFFU, REFFA, NREF, NREFF, NREFFL, NREFFU, NREFFA,
710     BRANCHJ, SUSPEND, IFTHEN,
711     0
712 };
713 #endif /* DOINIT */
714
715 #ifndef DOINIT
716 EXTCONST U8 PL_varies_bitmask[];
717 #else
718 EXTCONST U8 PL_varies_bitmask[] = {
719     0x00, 0x00, 0x00, 0x70, 0x00, 0x7F, 0xFE, 0x97, 0x01, 0x00, 0x00, 0x00
720 };
721 #endif /* DOINIT */
722
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".) */
725 #define REGNODE_SIMPLE(node) (PL_simple_bitmask[(node) >> 3] & (1 << ((node) & 7)))
726
727 #ifndef DOINIT
728 EXTCONST U8 PL_simple[] __attribute__deprecated__;
729 #else
730 EXTCONST U8 PL_simple[] __attribute__deprecated__ = {
731     REG_ANY, SANY, CANY, ANYOF, POSIXD, POSIXL, POSIXU, POSIXA, NPOSIXD,
732     NPOSIXL, NPOSIXU, NPOSIXA,
733     0
734 };
735 #endif /* DOINIT */
736
737 #ifndef DOINIT
738 EXTCONST U8 PL_simple_bitmask[];
739 #else
740 EXTCONST U8 PL_simple_bitmask[] = {
741     0x00, 0x00, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
742 };
743 #endif /* DOINIT */
744
745 /* ex: set ro: */