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