This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
As the backreferences AV doesn't hold references on its contents,
[perl5.git] / regnodes.h
CommitLineData
37442d52
RGS
1/* -*- buffer-read-only: t -*-
2 !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
885f9e59 3 This file is built by regcomp.pl from regcomp.sym.
d09b2d29
IZ
4 Any changes made here will be lost!
5*/
6
22c35a8c 7#define END 0 /* 0 End of program. */
d09b2d29
IZ
8#define SUCCEED 1 /* 0x1 Return from a subroutine, basically. */
9#define BOL 2 /* 0x2 Match "" at beginning of line. */
10#define MBOL 3 /* 0x3 Same, assuming multiline. */
11#define SBOL 4 /* 0x4 Same, assuming singleline. */
b85d18e9
IZ
12#define EOS 5 /* 0x5 Match "" at end of string. */
13#define EOL 6 /* 0x6 Match "" at end of line. */
14#define MEOL 7 /* 0x7 Same, assuming multiline. */
15#define SEOL 8 /* 0x8 Same, assuming singleline. */
16#define BOUND 9 /* 0x9 Match "" at any word boundary */
ffc61ed2
JH
17#define BOUNDL 10 /* 0xa Match "" at any word boundary */
18#define NBOUND 11 /* 0xb Match "" at any word non-boundary */
19#define NBOUNDL 12 /* 0xc Match "" at any word non-boundary */
20#define GPOS 13 /* 0xd Matches where last m//g left off. */
21#define REG_ANY 14 /* 0xe Match any one character (except newline). */
22#define SANY 15 /* 0xf Match any one character. */
f33976b4
DB
23#define CANY 16 /* 0x10 Match any one byte. */
24#define ANYOF 17 /* 0x11 Match character in (or not in) this class. */
25#define ALNUM 18 /* 0x12 Match any alphanumeric character */
26#define ALNUML 19 /* 0x13 Match any alphanumeric char in locale */
27#define NALNUM 20 /* 0x14 Match any non-alphanumeric character */
28#define NALNUML 21 /* 0x15 Match any non-alphanumeric char in locale */
29#define SPACE 22 /* 0x16 Match any whitespace character */
30#define SPACEL 23 /* 0x17 Match any whitespace char in locale */
31#define NSPACE 24 /* 0x18 Match any non-whitespace character */
32#define NSPACEL 25 /* 0x19 Match any non-whitespace char in locale */
33#define DIGIT 26 /* 0x1a Match any numeric character */
34#define DIGITL 27 /* 0x1b Match any numeric character in locale */
35#define NDIGIT 28 /* 0x1c Match any non-numeric character */
36#define NDIGITL 29 /* 0x1d Match any non-numeric character in locale */
37#define CLUMP 30 /* 0x1e Match any combining character sequence */
38#define BRANCH 31 /* 0x1f Match this alternative, or the next... */
39#define BACK 32 /* 0x20 Match "", "next" ptr points backward. */
40#define EXACT 33 /* 0x21 Match this string (preceded by length). */
41#define EXACTF 34 /* 0x22 Match this string, folded (prec. by length). */
42#define EXACTFL 35 /* 0x23 Match this string, folded in locale (w/len). */
a3621e74
YO
43#define TRIE 36 /* 0x24 Match one or more of many EXACT strings */
44#define TRIEF 37 /* 0x25 Match one or more of many EXACTF strings */
45#define TRIEFL 38 /* 0x26 Match one or more of many EXACTFL strings */
46#define NOTHING 39 /* 0x27 Match empty string. */
47#define TAIL 40 /* 0x28 Match empty string. Can jump here from outside. */
48#define STAR 41 /* 0x29 Match this (simple) thing 0 or more times. */
49#define PLUS 42 /* 0x2a Match this (simple) thing 1 or more times. */
50#define CURLY 43 /* 0x2b Match this simple thing {n,m} times. */
51#define CURLYN 44 /* 0x2c Match next-after-this simple thing */
52#define CURLYM 45 /* 0x2d Match this medium-complex thing {n,m} times. */
53#define CURLYX 46 /* 0x2e Match this complex thing {n,m} times. */
54#define WHILEM 47 /* 0x2f Do curly processing and see if rest matches. */
55#define OPEN 48 /* 0x30 Mark this point in input as start of #n. */
56#define CLOSE 49 /* 0x31 Analogous to OPEN. */
57#define REF 50 /* 0x32 Match some already matched string */
58#define REFF 51 /* 0x33 Match already matched string, folded */
59#define REFFL 52 /* 0x34 Match already matched string, folded in loc. */
60#define IFMATCH 53 /* 0x35 Succeeds if the following matches. */
61#define UNLESSM 54 /* 0x36 Fails if the following matches. */
62#define SUSPEND 55 /* 0x37 "Independent" sub-RE. */
63#define IFTHEN 56 /* 0x38 Switch, should be preceeded by switcher . */
64#define GROUPP 57 /* 0x39 Whether the group matched. */
65#define LONGJMP 58 /* 0x3a Jump far away. */
66#define BRANCHJ 59 /* 0x3b BRANCH with long offset. */
67#define EVAL 60 /* 0x3c Execute some Perl code. */
68#define MINMOD 61 /* 0x3d Next operator is not greedy. */
69#define LOGICAL 62 /* 0x3e Next opcode should set the flag only. */
70#define RENUM 63 /* 0x3f Group with independently numbered parens. */
71#define OPTIMIZED 64 /* 0x40 Placeholder for dump. */
d09b2d29
IZ
72
73#ifndef DOINIT
22c35a8c 74EXTCONST U8 PL_regkind[];
d09b2d29 75#else
22c35a8c 76EXTCONST U8 PL_regkind[] = {
d09b2d29
IZ
77 END, /* END */
78 END, /* SUCCEED */
79 BOL, /* BOL */
80 BOL, /* MBOL */
81 BOL, /* SBOL */
b85d18e9 82 EOL, /* EOS */
d09b2d29
IZ
83 EOL, /* EOL */
84 EOL, /* MEOL */
85 EOL, /* SEOL */
86 BOUND, /* BOUND */
87 BOUND, /* BOUNDL */
88 NBOUND, /* NBOUND */
89 NBOUND, /* NBOUNDL */
90 GPOS, /* GPOS */
22c35a8c 91 REG_ANY, /* REG_ANY */
22c35a8c 92 REG_ANY, /* SANY */
f33976b4 93 REG_ANY, /* CANY */
d09b2d29
IZ
94 ANYOF, /* ANYOF */
95 ALNUM, /* ALNUM */
96 ALNUM, /* ALNUML */
97 NALNUM, /* NALNUM */
98 NALNUM, /* NALNUML */
99 SPACE, /* SPACE */
100 SPACE, /* SPACEL */
101 NSPACE, /* NSPACE */
102 NSPACE, /* NSPACEL */
103 DIGIT, /* DIGIT */
b8c5462f 104 DIGIT, /* DIGITL */
d09b2d29 105 NDIGIT, /* NDIGIT */
b8c5462f 106 NDIGIT, /* NDIGITL */
a0ed51b3 107 CLUMP, /* CLUMP */
d09b2d29
IZ
108 BRANCH, /* BRANCH */
109 BACK, /* BACK */
110 EXACT, /* EXACT */
111 EXACT, /* EXACTF */
112 EXACT, /* EXACTFL */
a3621e74
YO
113 TRIE, /* TRIE */
114 TRIE, /* TRIEF */
115 TRIE, /* TRIEFL */
d09b2d29
IZ
116 NOTHING, /* NOTHING */
117 NOTHING, /* TAIL */
118 STAR, /* STAR */
119 PLUS, /* PLUS */
120 CURLY, /* CURLY */
121 CURLY, /* CURLYN */
122 CURLY, /* CURLYM */
123 CURLY, /* CURLYX */
124 WHILEM, /* WHILEM */
125 OPEN, /* OPEN */
126 CLOSE, /* CLOSE */
127 REF, /* REF */
128 REF, /* REFF */
129 REF, /* REFFL */
130 BRANCHJ, /* IFMATCH */
131 BRANCHJ, /* UNLESSM */
132 BRANCHJ, /* SUSPEND */
133 BRANCHJ, /* IFTHEN */
134 GROUPP, /* GROUPP */
135 LONGJMP, /* LONGJMP */
136 BRANCHJ, /* BRANCHJ */
137 EVAL, /* EVAL */
138 MINMOD, /* MINMOD */
139 LOGICAL, /* LOGICAL */
140 BRANCHJ, /* RENUM */
141 NOTHING, /* OPTIMIZED */
142};
143#endif
144
145
146#ifdef REG_COMP_C
29de9391 147static const U8 regarglen[] = {
d09b2d29
IZ
148 0, /* END */
149 0, /* SUCCEED */
150 0, /* BOL */
151 0, /* MBOL */
152 0, /* SBOL */
b85d18e9 153 0, /* EOS */
d09b2d29
IZ
154 0, /* EOL */
155 0, /* MEOL */
156 0, /* SEOL */
157 0, /* BOUND */
158 0, /* BOUNDL */
159 0, /* NBOUND */
160 0, /* NBOUNDL */
161 0, /* GPOS */
22c35a8c 162 0, /* REG_ANY */
d09b2d29 163 0, /* SANY */
f33976b4 164 0, /* CANY */
d09b2d29
IZ
165 0, /* ANYOF */
166 0, /* ALNUM */
167 0, /* ALNUML */
168 0, /* NALNUM */
169 0, /* NALNUML */
170 0, /* SPACE */
171 0, /* SPACEL */
172 0, /* NSPACE */
173 0, /* NSPACEL */
174 0, /* DIGIT */
b8c5462f 175 0, /* DIGITL */
d09b2d29 176 0, /* NDIGIT */
b8c5462f 177 0, /* NDIGITL */
a0ed51b3 178 0, /* CLUMP */
d09b2d29
IZ
179 0, /* BRANCH */
180 0, /* BACK */
181 0, /* EXACT */
182 0, /* EXACTF */
183 0, /* EXACTFL */
a3621e74
YO
184 EXTRA_SIZE(struct regnode_1), /* TRIE */
185 EXTRA_SIZE(struct regnode_1), /* TRIEF */
186 EXTRA_SIZE(struct regnode_1), /* TRIEFL */
d09b2d29
IZ
187 0, /* NOTHING */
188 0, /* TAIL */
189 0, /* STAR */
190 0, /* PLUS */
191 EXTRA_SIZE(struct regnode_2), /* CURLY */
192 EXTRA_SIZE(struct regnode_2), /* CURLYN */
193 EXTRA_SIZE(struct regnode_2), /* CURLYM */
194 EXTRA_SIZE(struct regnode_2), /* CURLYX */
195 0, /* WHILEM */
196 EXTRA_SIZE(struct regnode_1), /* OPEN */
197 EXTRA_SIZE(struct regnode_1), /* CLOSE */
198 EXTRA_SIZE(struct regnode_1), /* REF */
199 EXTRA_SIZE(struct regnode_1), /* REFF */
200 EXTRA_SIZE(struct regnode_1), /* REFFL */
201 EXTRA_SIZE(struct regnode_1), /* IFMATCH */
202 EXTRA_SIZE(struct regnode_1), /* UNLESSM */
203 EXTRA_SIZE(struct regnode_1), /* SUSPEND */
204 EXTRA_SIZE(struct regnode_1), /* IFTHEN */
205 EXTRA_SIZE(struct regnode_1), /* GROUPP */
206 EXTRA_SIZE(struct regnode_1), /* LONGJMP */
207 EXTRA_SIZE(struct regnode_1), /* BRANCHJ */
208 EXTRA_SIZE(struct regnode_1), /* EVAL */
209 0, /* MINMOD */
210 0, /* LOGICAL */
211 EXTRA_SIZE(struct regnode_1), /* RENUM */
212 0, /* OPTIMIZED */
213};
214
29de9391 215static const char reg_off_by_arg[] = {
d09b2d29
IZ
216 0, /* END */
217 0, /* SUCCEED */
218 0, /* BOL */
219 0, /* MBOL */
220 0, /* SBOL */
b85d18e9 221 0, /* EOS */
d09b2d29
IZ
222 0, /* EOL */
223 0, /* MEOL */
224 0, /* SEOL */
225 0, /* BOUND */
226 0, /* BOUNDL */
227 0, /* NBOUND */
228 0, /* NBOUNDL */
229 0, /* GPOS */
22c35a8c 230 0, /* REG_ANY */
d09b2d29 231 0, /* SANY */
f33976b4 232 0, /* CANY */
d09b2d29
IZ
233 0, /* ANYOF */
234 0, /* ALNUM */
235 0, /* ALNUML */
236 0, /* NALNUM */
237 0, /* NALNUML */
238 0, /* SPACE */
239 0, /* SPACEL */
240 0, /* NSPACE */
241 0, /* NSPACEL */
242 0, /* DIGIT */
b8c5462f 243 0, /* DIGITL */
d09b2d29 244 0, /* NDIGIT */
b8c5462f 245 0, /* NDIGITL */
a0ed51b3 246 0, /* CLUMP */
d09b2d29
IZ
247 0, /* BRANCH */
248 0, /* BACK */
249 0, /* EXACT */
250 0, /* EXACTF */
251 0, /* EXACTFL */
a3621e74
YO
252 0, /* TRIE */
253 0, /* TRIEF */
254 0, /* TRIEFL */
d09b2d29
IZ
255 0, /* NOTHING */
256 0, /* TAIL */
257 0, /* STAR */
258 0, /* PLUS */
259 0, /* CURLY */
260 0, /* CURLYN */
261 0, /* CURLYM */
262 0, /* CURLYX */
263 0, /* WHILEM */
264 0, /* OPEN */
265 0, /* CLOSE */
266 0, /* REF */
267 0, /* REFF */
268 0, /* REFFL */
269 2, /* IFMATCH */
270 2, /* UNLESSM */
271 1, /* SUSPEND */
272 1, /* IFTHEN */
273 0, /* GROUPP */
274 1, /* LONGJMP */
275 1, /* BRANCHJ */
276 0, /* EVAL */
277 0, /* MINMOD */
278 0, /* LOGICAL */
279 1, /* RENUM */
280 0, /* OPTIMIZED */
281};
885f9e59
GS
282
283#ifdef DEBUGGING
29de9391 284static const char * const reg_name[] = {
885f9e59
GS
285 "END", /* 0 */
286 "SUCCEED", /* 0x1 */
287 "BOL", /* 0x2 */
288 "MBOL", /* 0x3 */
289 "SBOL", /* 0x4 */
290 "EOS", /* 0x5 */
291 "EOL", /* 0x6 */
292 "MEOL", /* 0x7 */
293 "SEOL", /* 0x8 */
294 "BOUND", /* 0x9 */
ffc61ed2
JH
295 "BOUNDL", /* 0xa */
296 "NBOUND", /* 0xb */
297 "NBOUNDL", /* 0xc */
298 "GPOS", /* 0xd */
299 "REG_ANY", /* 0xe */
300 "SANY", /* 0xf */
f33976b4
DB
301 "CANY", /* 0x10 */
302 "ANYOF", /* 0x11 */
303 "ALNUM", /* 0x12 */
304 "ALNUML", /* 0x13 */
305 "NALNUM", /* 0x14 */
306 "NALNUML", /* 0x15 */
307 "SPACE", /* 0x16 */
308 "SPACEL", /* 0x17 */
309 "NSPACE", /* 0x18 */
310 "NSPACEL", /* 0x19 */
311 "DIGIT", /* 0x1a */
312 "DIGITL", /* 0x1b */
313 "NDIGIT", /* 0x1c */
314 "NDIGITL", /* 0x1d */
315 "CLUMP", /* 0x1e */
316 "BRANCH", /* 0x1f */
317 "BACK", /* 0x20 */
318 "EXACT", /* 0x21 */
319 "EXACTF", /* 0x22 */
320 "EXACTFL", /* 0x23 */
a3621e74
YO
321 "TRIE", /* 0x24 */
322 "TRIEF", /* 0x25 */
323 "TRIEFL", /* 0x26 */
324 "NOTHING", /* 0x27 */
325 "TAIL", /* 0x28 */
326 "STAR", /* 0x29 */
327 "PLUS", /* 0x2a */
328 "CURLY", /* 0x2b */
329 "CURLYN", /* 0x2c */
330 "CURLYM", /* 0x2d */
331 "CURLYX", /* 0x2e */
332 "WHILEM", /* 0x2f */
333 "OPEN", /* 0x30 */
334 "CLOSE", /* 0x31 */
335 "REF", /* 0x32 */
336 "REFF", /* 0x33 */
337 "REFFL", /* 0x34 */
338 "IFMATCH", /* 0x35 */
339 "UNLESSM", /* 0x36 */
340 "SUSPEND", /* 0x37 */
341 "IFTHEN", /* 0x38 */
342 "GROUPP", /* 0x39 */
343 "LONGJMP", /* 0x3a */
344 "BRANCHJ", /* 0x3b */
345 "EVAL", /* 0x3c */
346 "MINMOD", /* 0x3d */
347 "LOGICAL", /* 0x3e */
348 "RENUM", /* 0x3f */
349 "OPTIMIZED", /* 0x40 */
885f9e59
GS
350};
351
a3621e74 352static const int reg_num = 65;
885f9e59
GS
353
354#endif /* DEBUGGING */
d09b2d29
IZ
355#endif /* REG_COMP_C */
356
37442d52 357/* ex: set ro: */