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