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