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