Changeset 27420 in webkit for trunk/JavaScriptCore/pcre/pcre_internal.h
- Timestamp:
- Nov 3, 2007, 11:18:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/pcre/pcre_internal.h
r27419 r27420 336 336 #define TRUE 1 337 337 338 /* Escape items that are just an encoding of a particular data value. Note that339 ESC_n is defined as yet another macro, which is set in config.h to either \n340 (the default) or \r (which some people want). */341 342 #ifndef ESC_e343 #define ESC_e 27344 #endif345 346 #ifndef ESC_f347 #define ESC_f '\f'348 #endif349 350 #ifndef ESC_n351 #define ESC_n '\n'352 #endif353 354 #ifndef ESC_r355 #define ESC_r '\r'356 #endif357 358 /* We can't officially use ESC_t because it is a POSIX reserved identifier359 (presumably because of all the others like size_t). */360 361 #ifndef ESC_tee362 #define ESC_tee '\t'363 #endif364 365 #ifndef ESC_v366 #define ESC_v '\v'367 #endif368 369 /* Codes for different types of Unicode property */370 371 #define PT_ANY 0 /* Any property - matches all chars */372 #define PT_LAMP 1 /* L& - the union of Lu, Ll, Lt */373 #define PT_GC 2 /* General characteristic (e.g. L) */374 #define PT_PC 3 /* Particular characteristic (e.g. Lu) */375 #define PT_SC 4 /* Script (e.g. Han) */376 377 338 /* Flag bits and data types for the extended class (OP_XCLASS) for classes that 378 339 contain UTF-8 characters with values greater than 255. */ … … 384 345 #define XCL_SINGLE 1 /* Single item (one multibyte char) follows */ 385 346 #define XCL_RANGE 2 /* A range (two multibyte chars) follows */ 386 #define XCL_PROP 3 /* Unicode property (2-byte property code follows) */387 #define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */388 347 389 348 /* These are escaped items that aren't just an encoding of a particular data … … 398 357 character, that code will have to change. */ 399 358 400 enum { ESC_A = 1, ESC_G, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W, 401 ESC_w, ESC_dum1, ESC_C, ESC_P, ESC_p, ESC_X, ESC_Z, ESC_z, ESC_E, 402 ESC_Q, ESC_REF }; 359 enum { ESC_B = 1, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W, ESC_w, ESC_REF }; 403 360 404 361 /* Opcode table: OP_BRA must be last, as all values >= it are used for brackets … … 413 370 /* Values corresponding to backslashed metacharacters */ 414 371 415 xOP_SOD, /* 1 Start of data: \A */416 xOP_SOM, /* 2 Start of match (subject + offset): \G */417 372 OP_NOT_WORD_BOUNDARY, /* 3 \B */ 418 373 OP_WORD_BOUNDARY, /* 4 \b */ … … 423 378 OP_NOT_WORDCHAR, /* 9 \W */ 424 379 OP_WORDCHAR, /* 10 \w */ 380 425 381 OP_ANY, /* 11 Match any character */ 426 xOP_ANYBYTE, /* 12 Match any byte (\C); different to OP_ANY for UTF-8 */ 427 xOP_NOTPROP, /* 13 \P (not Unicode property) */ 428 xOP_PROP, /* 14 \p (Unicode property) */ 429 xOP_EXTUNI, /* 15 \X (extended Unicode sequence */ 430 xOP_EODN, /* 16 End of data or \n at end of data: \Z. */ 431 xOP_EOD, /* 17 End of data: \z */ 432 433 xOP_OPT, /* 18 Set runtime options */ 382 434 383 OP_CIRC, /* 19 Start of line - varies with multiline switch */ 435 384 OP_DOLL, /* 20 End of line - varies with multiline switch */ … … 486 435 487 436 OP_REF, /* 62 Match a back reference */ 488 xOP_RECURSE, /* 63 Match a numbered subpattern (possibly recursive) */489 xOP_CALLOUT, /* 64 Call out to external function if provided */490 437 491 438 OP_ALT, /* 65 Start of alternation */ … … 498 445 OP_ASSERT, /* 69 Positive lookahead */ 499 446 OP_ASSERT_NOT, /* 70 Negative lookahead */ 500 xOP_ASSERTBACK, /* 71 Positive lookbehind */501 xOP_ASSERTBACK_NOT, /* 72 Negative lookbehind */502 xOP_REVERSE, /* 73 Move pointer back - used in lookbehind assertions */503 447 504 448 /* ONCE and COND must come after the assertions, with ONCE first, as there's … … 506 450 507 451 OP_ONCE, /* 74 Once matched, don't back up into the subpattern */ 508 xOP_COND, /* 75 Conditional group */509 xOP_CREF, /* 76 Used to hold an extraction string number (cond ref) */510 452 511 453 OP_BRAZERO, /* 77 These two must remain together and in this */ … … 533 475 534 476 535 /* This macro defines textual names for all the opcodes. These are used only536 for debugging. The macro is referenced only in pcre_printint.c. */537 538 #define OP_NAME_LIST \539 "End", "\\A", "\\G", "\\B", "\\b", "\\D", "\\d", \540 "\\S", "\\s", "\\W", "\\w", "Any", "Anybyte", \541 "notprop", "prop", "extuni", \542 "\\Z", "\\z", \543 "Opt", "^", "$", "char", "charnc", "not", \544 "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \545 "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \546 "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \547 "*", "*?", "+", "+?", "?", "??", "{", "{", \548 "class", "nclass", "xclass", "Ref", "Recurse", "Callout", \549 "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", \550 "AssertB", "AssertB not", "Reverse", "Once", "Cond", "Cond ref",\551 "Brazero", "Braminzero", "Branumber", "Bra"552 553 554 477 /* This macro defines the length of fixed length operations in the compiled 555 478 regex. The lengths are used when searching for specific things, and also in the … … 563 486 #define OP_LENGTHS \ 564 487 1, /* End */ \ 565 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* \A, \G, \B, \B, \D, \d, \S, \s, \W, \w */ \ 566 1, 1, /* Any, Anybyte */ \ 567 3, 3, 1, /* NOTPROP, PROP, EXTUNI */ \ 568 1, 1, 2, 1, 1, /* \Z, \z, Opt, ^, $ */ \ 488 1, 1, 1, 1, 1, 1, 1, 1, /* \B, \b, \D, \d, \S, \s, \W, \w */ \ 489 1, /* Any */ \ 490 1, 1, /* ^, $ */ \ 569 491 2, /* Char - the minimum length */ \ 570 492 2, /* Charnc - the minimum length */ \ … … 586 508 0, /* XCLASS - variable length */ \ 587 509 3, /* REF */ \ 588 1+LINK_SIZE, /* RECURSE */ \589 2+2*LINK_SIZE, /* CALLOUT */ \590 510 1+LINK_SIZE, /* Alt */ \ 591 511 1+LINK_SIZE, /* Ket */ \ … … 594 514 1+LINK_SIZE, /* Assert */ \ 595 515 1+LINK_SIZE, /* Assert not */ \ 596 1+LINK_SIZE, /* Assert behind */ \597 1+LINK_SIZE, /* Assert behind not */ \598 1+LINK_SIZE, /* Reverse */ \599 516 1+LINK_SIZE, /* Once */ \ 600 1+LINK_SIZE, /* COND */ \601 3, /* CREF */ \602 517 1, 1, /* BRAZERO, BRAMINZERO */ \ 603 518 3, /* BRANUMBER */ \ 604 519 1+LINK_SIZE /* BRA */ \ 605 520 606 607 /* A magic value for OP_CREF to indicate the "in recursion" condition. */608 609 #define CREF_RECURSE 0xffff610 521 611 522 /* Error code numbers. They are given names so that they can more easily be … … 643 554 pcre_uint16 first_byte; 644 555 pcre_uint16 req_byte; 645 pcre_uint16 name_table_offset; /* Offset to name table that follows */646 pcre_uint16 name_entry_size; /* Size of any name items */647 pcre_uint16 name_count; /* Number of name items */648 pcre_uint16 ref_count; /* Reference count */649 650 const unsigned char *tables; /* Pointer to tables or NULL for std */651 const unsigned char *nullpad; /* NULL padding */652 556 } real_pcre; 653 654 /* The format of the block used to store data from pcre_study(). The same655 remark (see NOTE above) about extending this structure applies. */656 657 typedef struct pcre_study_data {658 pcre_uint32 size; /* Total that was malloced */659 pcre_uint32 options;660 uschar start_bits[32];661 } pcre_study_data;662 557 663 558 /* Structure for passing "static" information around between the functions … … 671 566 const uschar *start_code; /* The start of the compiled code */ 672 567 const pcre_uchar *start_pattern; /* The start of the pattern */ 673 uschar *name_table; /* The name/number table */674 int names_found; /* Number of entries so far */675 int name_entry_size; /* Size of each entry */676 568 int top_backref; /* Maximum back reference */ 677 569 unsigned int backref_map; /* Bitmap of low back refs */ 678 570 int req_varyopt; /* "After variable item" flag for reqbyte */ 679 571 } compile_data; 680 681 /* Structure for maintaining a chain of pointers to the currently incomplete682 branches, for testing for left recursion. */683 684 typedef struct branch_chain {685 struct branch_chain *outer;686 uschar *current;687 } branch_chain;688 572 689 573 /* When compiling in a mode that doesn't use recursive calls to match(), … … 713 597 USPTR end_match_ptr; /* Subject position at end match */ 714 598 int end_offset_top; /* Highwater mark at end of match */ 715 struct heapframe *thisframe; /* Used only when compiling for no recursion */716 599 BOOL multiline; 717 600 BOOL caseless;
Note:
See TracChangeset
for help on using the changeset viewer.