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