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