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