1 /* -*- buffer-read-only: t -*-
2 !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
3 This file is built by regcomp.pl from regcomp.sym.
4 Any changes made here will be lost!
7 /* Regops and State definitions */
10 #define REGMATCH_STATE_MAX 124
12 #define END 0 /* 0000 End of program. */
13 #define SUCCEED 1 /* 0x01 Return from a subroutine, basically. */
14 #define BOL 2 /* 0x02 Match "" at beginning of line. */
15 #define MBOL 3 /* 0x03 Same, assuming multiline. */
16 #define SBOL 4 /* 0x04 Same, assuming singleline. */
17 #define EOS 5 /* 0x05 Match "" at end of string. */
18 #define EOL 6 /* 0x06 Match "" at end of line. */
19 #define MEOL 7 /* 0x07 Same, assuming multiline. */
20 #define SEOL 8 /* 0x08 Same, assuming singleline. */
21 #define BOUND 9 /* 0x09 Match "" at any word boundary */
22 #define BOUNDL 10 /* 0x0a Match "" at any word boundary */
23 #define NBOUND 11 /* 0x0b Match "" at any word non-boundary */
24 #define NBOUNDL 12 /* 0x0c Match "" at any word non-boundary */
25 #define GPOS 13 /* 0x0d Matches where last m//g left off. */
26 #define REG_ANY 14 /* 0x0e Match any one character (except newline). */
27 #define SANY 15 /* 0x0f Match any one character. */
28 #define CANY 16 /* 0x10 Match any one byte. */
29 #define ANYOF 17 /* 0x11 Match character in (or not in) this class. */
30 #define ALNUM 18 /* 0x12 Match any alphanumeric character */
31 #define ALNUML 19 /* 0x13 Match any alphanumeric char in locale */
32 #define NALNUM 20 /* 0x14 Match any non-alphanumeric character */
33 #define NALNUML 21 /* 0x15 Match any non-alphanumeric char in locale */
34 #define SPACE 22 /* 0x16 Match any whitespace character */
35 #define SPACEL 23 /* 0x17 Match any whitespace char in locale */
36 #define NSPACE 24 /* 0x18 Match any non-whitespace character */
37 #define NSPACEL 25 /* 0x19 Match any non-whitespace char in locale */
38 #define DIGIT 26 /* 0x1a Match any numeric character */
39 #define DIGITL 27 /* 0x1b Match any numeric character in locale */
40 #define NDIGIT 28 /* 0x1c Match any non-numeric character */
41 #define NDIGITL 29 /* 0x1d Match any non-numeric character in locale */
42 #define CLUMP 30 /* 0x1e Match any combining character sequence */
43 #define BRANCH 31 /* 0x1f Match this alternative, or the next... */
44 #define BACK 32 /* 0x20 Match "", "next" ptr points backward. */
45 #define EXACT 33 /* 0x21 Match this string (preceded by length). */
46 #define EXACTF 34 /* 0x22 Match this string, folded (prec. by length). */
47 #define EXACTFL 35 /* 0x23 Match this string, folded in locale (w/len). */
48 #define NOTHING 36 /* 0x24 Match empty string. */
49 #define TAIL 37 /* 0x25 Match empty string. Can jump here from outside. */
50 #define STAR 38 /* 0x26 Match this (simple) thing 0 or more times. */
51 #define PLUS 39 /* 0x27 Match this (simple) thing 1 or more times. */
52 #define CURLY 40 /* 0x28 Match this simple thing {n,m} times. */
53 #define CURLYN 41 /* 0x29 Capture next-after-this simple thing */
54 #define CURLYM 42 /* 0x2a Capture this medium-complex thing {n,m} times. */
55 #define CURLYX 43 /* 0x2b Match this complex thing {n,m} times. */
56 #define WHILEM 44 /* 0x2c Do curly processing and see if rest matches. */
57 #define OPEN 45 /* 0x2d Mark this point in input as start of */
58 #define CLOSE 46 /* 0x2e Analogous to OPEN. */
59 #define REF 47 /* 0x2f Match some already matched string */
60 #define REFF 48 /* 0x30 Match already matched string, folded */
61 #define REFFL 49 /* 0x31 Match already matched string, folded in loc. */
62 #define IFMATCH 50 /* 0x32 Succeeds if the following matches. */
63 #define UNLESSM 51 /* 0x33 Fails if the following matches. */
64 #define SUSPEND 52 /* 0x34 "Independent" sub-RE. */
65 #define IFTHEN 53 /* 0x35 Switch, should be preceeded by switcher . */
66 #define GROUPP 54 /* 0x36 Whether the group matched. */
67 #define LONGJMP 55 /* 0x37 Jump far away. */
68 #define BRANCHJ 56 /* 0x38 BRANCH with long offset. */
69 #define EVAL 57 /* 0x39 Execute some Perl code. */
70 #define MINMOD 58 /* 0x3a Next operator is not greedy. */
71 #define LOGICAL 59 /* 0x3b Next opcode should set the flag only. */
72 #define RENUM 60 /* 0x3c Group with independently numbered parens. */
73 #define TRIE 61 /* 0x3d Match many EXACT(FL?)? at once. flags==type */
74 #define TRIEC 62 /* 0x3e Same as TRIE, but with embedded charclass data */
75 #define AHOCORASICK 63 /* 0x3f Aho Corasick stclass. flags==type */
76 #define AHOCORASICKC 64 /* 0x40 Same as AHOCORASICK, but with embedded charclass data */
77 #define GOSUB 65 /* 0x41 recurse to paren arg1 at (signed) ofs arg2 */
78 #define GOSTART 66 /* 0x42 recurse to start of pattern */
79 #define NREF 67 /* 0x43 Match some already matched string */
80 #define NREFF 68 /* 0x44 Match already matched string, folded */
81 #define NREFFL 69 /* 0x45 Match already matched string, folded in loc. */
82 #define NGROUPP 70 /* 0x46 Whether the group matched. */
83 #define INSUBP 71 /* 0x47 Whether we are in a specific recurse. */
84 #define DEFINEP 72 /* 0x48 Never execute directly. */
85 #define ENDLIKE 73 /* 0x49 Used only for the type field of verbs */
86 #define OPFAIL 74 /* 0x4a Same as (?!) */
87 #define ACCEPT 75 /* 0x4b Accepts the current matched string. */
88 #define VERB 76 /* 0x4c no-sv 1 Used only for the type field of verbs */
89 #define PRUNE 77 /* 0x4d Pattern fails at this startpoint if no-backtracking through this */
90 #define MARKPOINT 78 /* 0x4e Push the current location for rollback by cut. */
91 #define SKIP 79 /* 0x4f On failure skip forward (to the mark) before retrying */
92 #define COMMIT 80 /* 0x50 Pattern fails outright if backtracking through this */
93 #define CUTGROUP 81 /* 0x51 On failure go to the next alternation in the group */
94 #define KEEPS 82 /* 0x52 $& begins here. */
95 #define OPTIMIZED 83 /* 0x53 Placeholder for dump. */
96 #define PSEUDO 84 /* 0x54 Pseudo opcode for internal use. */
97 /* ------------ States ------------- */
98 #define TRIE_next (REGNODE_MAX + 1) /* state for TRIE */
99 #define TRIE_next_fail (REGNODE_MAX + 2) /* state for TRIE */
100 #define EVAL_AB (REGNODE_MAX + 3) /* state for EVAL */
101 #define EVAL_AB_fail (REGNODE_MAX + 4) /* state for EVAL */
102 #define CURLYX_end (REGNODE_MAX + 5) /* state for CURLYX */
103 #define CURLYX_end_fail (REGNODE_MAX + 6) /* state for CURLYX */
104 #define WHILEM_A_pre (REGNODE_MAX + 7) /* state for WHILEM */
105 #define WHILEM_A_pre_fail (REGNODE_MAX + 8) /* state for WHILEM */
106 #define WHILEM_A_min (REGNODE_MAX + 9) /* state for WHILEM */
107 #define WHILEM_A_min_fail (REGNODE_MAX + 10) /* state for WHILEM */
108 #define WHILEM_A_max (REGNODE_MAX + 11) /* state for WHILEM */
109 #define WHILEM_A_max_fail (REGNODE_MAX + 12) /* state for WHILEM */
110 #define WHILEM_B_min (REGNODE_MAX + 13) /* state for WHILEM */
111 #define WHILEM_B_min_fail (REGNODE_MAX + 14) /* state for WHILEM */
112 #define WHILEM_B_max (REGNODE_MAX + 15) /* state for WHILEM */
113 #define WHILEM_B_max_fail (REGNODE_MAX + 16) /* state for WHILEM */
114 #define BRANCH_next (REGNODE_MAX + 17) /* state for BRANCH */
115 #define BRANCH_next_fail (REGNODE_MAX + 18) /* state for BRANCH */
116 #define CURLYM_A (REGNODE_MAX + 19) /* state for CURLYM */
117 #define CURLYM_A_fail (REGNODE_MAX + 20) /* state for CURLYM */
118 #define CURLYM_B (REGNODE_MAX + 21) /* state for CURLYM */
119 #define CURLYM_B_fail (REGNODE_MAX + 22) /* state for CURLYM */
120 #define IFMATCH_A (REGNODE_MAX + 23) /* state for IFMATCH */
121 #define IFMATCH_A_fail (REGNODE_MAX + 24) /* state for IFMATCH */
122 #define CURLY_B_min_known (REGNODE_MAX + 25) /* state for CURLY */
123 #define CURLY_B_min_known_fail (REGNODE_MAX + 26) /* state for CURLY */
124 #define CURLY_B_min (REGNODE_MAX + 27) /* state for CURLY */
125 #define CURLY_B_min_fail (REGNODE_MAX + 28) /* state for CURLY */
126 #define CURLY_B_max (REGNODE_MAX + 29) /* state for CURLY */
127 #define CURLY_B_max_fail (REGNODE_MAX + 30) /* state for CURLY */
128 #define COMMIT_next (REGNODE_MAX + 31) /* state for COMMIT */
129 #define COMMIT_next_fail (REGNODE_MAX + 32) /* state for COMMIT */
130 #define MARKPOINT_next (REGNODE_MAX + 33) /* state for MARKPOINT */
131 #define MARKPOINT_next_fail (REGNODE_MAX + 34) /* state for MARKPOINT */
132 #define SKIP_next (REGNODE_MAX + 35) /* state for SKIP */
133 #define SKIP_next_fail (REGNODE_MAX + 36) /* state for SKIP */
134 #define CUTGROUP_next (REGNODE_MAX + 37) /* state for CUTGROUP */
135 #define CUTGROUP_next_fail (REGNODE_MAX + 38) /* state for CUTGROUP */
136 #define KEEPS_next (REGNODE_MAX + 39) /* state for KEEPS */
137 #define KEEPS_next_fail (REGNODE_MAX + 40) /* state for KEEPS */
139 /* PL_regkind[] What type of regop or state is this. */
142 EXTCONST U8 PL_regkind[];
144 EXTCONST U8 PL_regkind[] = {
157 NBOUND, /* NBOUNDL */
159 REG_ANY, /* REG_ANY */
166 NALNUM, /* NALNUML */
170 NSPACE, /* NSPACEL */
174 NDIGIT, /* NDIGITL */
181 NOTHING, /* NOTHING */
195 BRANCHJ, /* IFMATCH */
196 BRANCHJ, /* UNLESSM */
197 BRANCHJ, /* SUSPEND */
198 BRANCHJ, /* IFTHEN */
200 LONGJMP, /* LONGJMP */
201 BRANCHJ, /* BRANCHJ */
204 LOGICAL, /* LOGICAL */
208 TRIE, /* AHOCORASICK */
209 TRIE, /* AHOCORASICKC */
211 GOSTART, /* GOSTART */
215 NGROUPP, /* NGROUPP */
217 DEFINEP, /* DEFINEP */
218 ENDLIKE, /* ENDLIKE */
219 ENDLIKE, /* OPFAIL */
220 ENDLIKE, /* ACCEPT */
223 VERB, /* MARKPOINT */
228 NOTHING, /* OPTIMIZED */
230 /* ------------ States ------------- */
231 TRIE, /* TRIE_next */
232 TRIE, /* TRIE_next_fail */
234 EVAL, /* EVAL_AB_fail */
235 CURLYX, /* CURLYX_end */
236 CURLYX, /* CURLYX_end_fail */
237 WHILEM, /* WHILEM_A_pre */
238 WHILEM, /* WHILEM_A_pre_fail */
239 WHILEM, /* WHILEM_A_min */
240 WHILEM, /* WHILEM_A_min_fail */
241 WHILEM, /* WHILEM_A_max */
242 WHILEM, /* WHILEM_A_max_fail */
243 WHILEM, /* WHILEM_B_min */
244 WHILEM, /* WHILEM_B_min_fail */
245 WHILEM, /* WHILEM_B_max */
246 WHILEM, /* WHILEM_B_max_fail */
247 BRANCH, /* BRANCH_next */
248 BRANCH, /* BRANCH_next_fail */
249 CURLYM, /* CURLYM_A */
250 CURLYM, /* CURLYM_A_fail */
251 CURLYM, /* CURLYM_B */
252 CURLYM, /* CURLYM_B_fail */
253 IFMATCH, /* IFMATCH_A */
254 IFMATCH, /* IFMATCH_A_fail */
255 CURLY, /* CURLY_B_min_known */
256 CURLY, /* CURLY_B_min_known_fail */
257 CURLY, /* CURLY_B_min */
258 CURLY, /* CURLY_B_min_fail */
259 CURLY, /* CURLY_B_max */
260 CURLY, /* CURLY_B_max_fail */
261 COMMIT, /* COMMIT_next */
262 COMMIT, /* COMMIT_next_fail */
263 MARKPOINT, /* MARKPOINT_next */
264 MARKPOINT, /* MARKPOINT_next_fail */
265 SKIP, /* SKIP_next */
266 SKIP, /* SKIP_next_fail */
267 CUTGROUP, /* CUTGROUP_next */
268 CUTGROUP, /* CUTGROUP_next_fail */
269 KEEPS, /* KEEPS_next */
270 KEEPS, /* KEEPS_next_fail */
274 /* regarglen[] - How large is the argument part of the node (in regnodes) */
277 static const U8 regarglen[] = {
318 EXTRA_SIZE(struct regnode_2), /* CURLY */
319 EXTRA_SIZE(struct regnode_2), /* CURLYN */
320 EXTRA_SIZE(struct regnode_2), /* CURLYM */
321 EXTRA_SIZE(struct regnode_2), /* CURLYX */
323 EXTRA_SIZE(struct regnode_1), /* OPEN */
324 EXTRA_SIZE(struct regnode_1), /* CLOSE */
325 EXTRA_SIZE(struct regnode_1), /* REF */
326 EXTRA_SIZE(struct regnode_1), /* REFF */
327 EXTRA_SIZE(struct regnode_1), /* REFFL */
328 EXTRA_SIZE(struct regnode_1), /* IFMATCH */
329 EXTRA_SIZE(struct regnode_1), /* UNLESSM */
330 EXTRA_SIZE(struct regnode_1), /* SUSPEND */
331 EXTRA_SIZE(struct regnode_1), /* IFTHEN */
332 EXTRA_SIZE(struct regnode_1), /* GROUPP */
333 EXTRA_SIZE(struct regnode_1), /* LONGJMP */
334 EXTRA_SIZE(struct regnode_1), /* BRANCHJ */
335 EXTRA_SIZE(struct regnode_1), /* EVAL */
338 EXTRA_SIZE(struct regnode_1), /* RENUM */
339 EXTRA_SIZE(struct regnode_1), /* TRIE */
340 EXTRA_SIZE(struct regnode_charclass), /* TRIEC */
341 EXTRA_SIZE(struct regnode_1), /* AHOCORASICK */
342 EXTRA_SIZE(struct regnode_charclass), /* AHOCORASICKC */
343 EXTRA_SIZE(struct regnode_2L), /* GOSUB */
345 EXTRA_SIZE(struct regnode_1), /* NREF */
346 EXTRA_SIZE(struct regnode_1), /* NREFF */
347 EXTRA_SIZE(struct regnode_1), /* NREFFL */
348 EXTRA_SIZE(struct regnode_1), /* NGROUPP */
349 EXTRA_SIZE(struct regnode_1), /* INSUBP */
350 EXTRA_SIZE(struct regnode_1), /* DEFINEP */
353 EXTRA_SIZE(struct regnode_1), /* ACCEPT */
355 EXTRA_SIZE(struct regnode_1), /* PRUNE */
356 EXTRA_SIZE(struct regnode_1), /* MARKPOINT */
357 EXTRA_SIZE(struct regnode_1), /* SKIP */
358 EXTRA_SIZE(struct regnode_1), /* COMMIT */
359 EXTRA_SIZE(struct regnode_1), /* CUTGROUP */
365 /* reg_off_by_arg[] - Which argument holds the offset to the next node */
367 static const char reg_off_by_arg[] = {
432 0, /* AHOCORASICKC */
455 /* reg_name[] - Opcode/state names in string form, for debugging */
458 const char * reg_name[] = {
460 "SUCCEED", /* 0x01 */
471 "NBOUNDL", /* 0x0c */
473 "REG_ANY", /* 0x0e */
480 "NALNUML", /* 0x15 */
484 "NSPACEL", /* 0x19 */
488 "NDIGITL", /* 0x1d */
494 "EXACTFL", /* 0x23 */
495 "NOTHING", /* 0x24 */
509 "IFMATCH", /* 0x32 */
510 "UNLESSM", /* 0x33 */
511 "SUSPEND", /* 0x34 */
514 "LONGJMP", /* 0x37 */
515 "BRANCHJ", /* 0x38 */
518 "LOGICAL", /* 0x3b */
522 "AHOCORASICK", /* 0x3f */
523 "AHOCORASICKC", /* 0x40 */
525 "GOSTART", /* 0x42 */
529 "NGROUPP", /* 0x46 */
531 "DEFINEP", /* 0x48 */
532 "ENDLIKE", /* 0x49 */
537 "MARKPOINT", /* 0x4e */
540 "CUTGROUP", /* 0x51 */
542 "OPTIMIZED", /* 0x53 */
544 /* ------------ States ------------- */
545 "TRIE_next", /* REGNODE_MAX +0x01 */
546 "TRIE_next_fail", /* REGNODE_MAX +0x02 */
547 "EVAL_AB", /* REGNODE_MAX +0x03 */
548 "EVAL_AB_fail", /* REGNODE_MAX +0x04 */
549 "CURLYX_end", /* REGNODE_MAX +0x05 */
550 "CURLYX_end_fail", /* REGNODE_MAX +0x06 */
551 "WHILEM_A_pre", /* REGNODE_MAX +0x07 */
552 "WHILEM_A_pre_fail", /* REGNODE_MAX +0x08 */
553 "WHILEM_A_min", /* REGNODE_MAX +0x09 */
554 "WHILEM_A_min_fail", /* REGNODE_MAX +0x0a */
555 "WHILEM_A_max", /* REGNODE_MAX +0x0b */
556 "WHILEM_A_max_fail", /* REGNODE_MAX +0x0c */
557 "WHILEM_B_min", /* REGNODE_MAX +0x0d */
558 "WHILEM_B_min_fail", /* REGNODE_MAX +0x0e */
559 "WHILEM_B_max", /* REGNODE_MAX +0x0f */
560 "WHILEM_B_max_fail", /* REGNODE_MAX +0x10 */
561 "BRANCH_next", /* REGNODE_MAX +0x11 */
562 "BRANCH_next_fail", /* REGNODE_MAX +0x12 */
563 "CURLYM_A", /* REGNODE_MAX +0x13 */
564 "CURLYM_A_fail", /* REGNODE_MAX +0x14 */
565 "CURLYM_B", /* REGNODE_MAX +0x15 */
566 "CURLYM_B_fail", /* REGNODE_MAX +0x16 */
567 "IFMATCH_A", /* REGNODE_MAX +0x17 */
568 "IFMATCH_A_fail", /* REGNODE_MAX +0x18 */
569 "CURLY_B_min_known", /* REGNODE_MAX +0x19 */
570 "CURLY_B_min_known_fail", /* REGNODE_MAX +0x1a */
571 "CURLY_B_min", /* REGNODE_MAX +0x1b */
572 "CURLY_B_min_fail", /* REGNODE_MAX +0x1c */
573 "CURLY_B_max", /* REGNODE_MAX +0x1d */
574 "CURLY_B_max_fail", /* REGNODE_MAX +0x1e */
575 "COMMIT_next", /* REGNODE_MAX +0x1f */
576 "COMMIT_next_fail", /* REGNODE_MAX +0x20 */
577 "MARKPOINT_next", /* REGNODE_MAX +0x21 */
578 "MARKPOINT_next_fail", /* REGNODE_MAX +0x22 */
579 "SKIP_next", /* REGNODE_MAX +0x23 */
580 "SKIP_next_fail", /* REGNODE_MAX +0x24 */
581 "CUTGROUP_next", /* REGNODE_MAX +0x25 */
582 "CUTGROUP_next_fail", /* REGNODE_MAX +0x26 */
583 "KEEPS_next", /* REGNODE_MAX +0x27 */
584 "KEEPS_next_fail", /* REGNODE_MAX +0x28 */
586 #endif /* DEBUGGING */
589 extern const char * reg_name[];
591 #endif /* REG_COMP_C */