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