54#ifndef OP_LISTS_DEFINED
56#define OP_LISTS_DEFINED
61#define OP_lengths PCRE2_SUFFIX(OP_lengths_)
62#define get_ucpname PCRE2_SUFFIX(get_ucpname_)
63#define pcre2_printint PCRE2_SUFFIX(pcre2_printint_)
64#define print_char PCRE2_SUFFIX(print_char_)
65#define print_custring PCRE2_SUFFIX(print_custring_)
66#define print_custring_bylen PCRE2_SUFFIX(print_custring_bylen_)
67#define print_prop PCRE2_SUFFIX(print_prop_)
95BOOL one_code_unit = !utf;
102#if PCRE2_CODE_UNIT_WIDTH == 8
103 one_code_unit = c < 0x80;
104#elif PCRE2_CODE_UNIT_WIDTH == 16
105 one_code_unit = (c & 0xfc00) != 0xd800;
107 one_code_unit = (c & 0xfffff800u) != 0xd800u;
116 if (PRINTABLE(c))
fprintf(f,
"%c", (
char)c);
117 else if (c < 0x80)
fprintf(f,
"\\x%02x", c);
118 else fprintf(f,
"\\x{%02x}", c);
126#ifndef SUPPORT_UNICODE
134#if PCRE2_CODE_UNIT_WIDTH == 8
135if ((c & 0xc0) != 0xc0)
143 int a =
PRIV(utf8_table4)[c & 0x3f];
145 c = (c &
PRIV(utf8_table3)[
a]) <<
s;
146 for (i = 1; i <=
a; i++)
148 if ((
ptr[i] & 0xc0) != 0x80)
154 c |= (
ptr[i] & 0x3f) <<
s;
164#if PCRE2_CODE_UNIT_WIDTH == 16
165if ((
ptr[1] & 0xfc00) != 0xdc00)
170c = (((c & 0x3ff) << 10) | (
ptr[1] & 0x3ff)) + 0x10000;
179#if PCRE2_CODE_UNIT_WIDTH == 32
210 if (PRINTABLE(c))
fprintf(f,
"%c", c);
else fprintf(f,
"\\x{%x}", c);
220 if (PRINTABLE(c))
fprintf(f,
"%c", c);
else fprintf(f,
"\\x{%x}", c);
242#ifdef SUPPORT_UNICODE
244const char *yield =
"??";
246unsigned int ptypex = (ptype ==
PT_SC)?
PT_SCX : ptype;
248for (
int i =
PRIV(utt_size) - 1; i >= 0; i--)
252 if ((ptype ==
u->type || ptypex ==
u->type) &&
pvalue ==
u->value)
254 const char *
s =
PRIV(utt_names) +
u->name_offset;
269 if (++
count >= 2)
break;
306 const char *sc = (code[1] ==
PT_SC)?
"script:" :
"";
308 fprintf(f,
"%s%s %s%c%s%s", before, OP_names[*code], sc, toupper(
s[0]),
s+1, after);
312 const uint32_t *
p =
PRIV(ucd_caseless_sets) + code[2];
313 fprintf (f,
"%s%sclist", before, (*code ==
OP_PROP)?
"" :
"not ");
341uint32_t nesize = re->name_entry_size;
345code = codestart = nametable + re->name_count * re->name_entry_size;
352 const char *flag =
" ";
353 unsigned int extra = 0;
356 fprintf(f,
"%3d ", (
int)(code - codestart));
377 fprintf(f,
" %s\n", OP_names[*code]);
378 fprintf(f,
"------------------------------------------------------------------\n");
407 if (print_lengths)
fprintf(f,
"%3d ",
GET(code, 1));
431 if (print_lengths)
fprintf(f,
"%3d ",
GET(code, 1));
433 fprintf(f,
"%s", OP_names[*code]);
437 if (print_lengths)
fprintf(f,
"%3d ",
GET2(code, 1));
439 fprintf(f,
"%s", OP_names[*code]);
443 if (print_lengths)
fprintf(f,
"%3d %d ",
GET2(code, 1),
446 fprintf(f,
"%s", OP_names[*code]);
450 fprintf(f,
" %s %d", OP_names[*code],
GET2(code, 1));
454 fprintf(f,
"%3d %s",
GET2(code,1), OP_names[*code]);
460 fprintf(f,
" %s Cond ref <", flag);
469 fprintf(f,
" Cond recurse any");
471 fprintf(f,
" Cond recurse %d", c);
477 fprintf(f,
" %s Cond recurse <", flag);
529 else fprintf(f,
"%s", OP_names[code[1]]);
532 fprintf(f,
"%s", OP_names[*code]);
603 fprintf(f,
"]%s", OP_names[*code]);
628 if (print_lengths)
fprintf(f,
"%3d ",
GET(code, 1));
630 fprintf(f,
"%s", OP_names[*code]);
639 goto CLASS_REF_REPEAT;
652 goto CLASS_REF_REPEAT;
661 fprintf(f,
" %s %c", OP_names[*code], c);
664 for (i = 0;
PRIV(callout_start_delims)[i] != 0; i++)
665 if (c ==
PRIV(callout_start_delims)[i])
667 c =
PRIV(callout_end_delims)[i];
687 BOOL printmap, invertmap;
697 extra =
GET(code, 1);
699 printmap = (*ccode &
XCL_MAP) != 0;
717 uint8_t inverted_map[32];
718 uint8_t *map = (uint8_t *)ccode;
723 for (i = 0; i < 32; i++) inverted_map[i] = 255 ^ map[i];
727 for (i = 0; i < 256; i++)
729 if ((map[i/8] & (1u << (i&7))) != 0)
732 for (
j = i+1;
j < 256;
j++)
733 if ((map[
j/8] & (1u << (
j&7))) == 0)
break;
734 if (i ==
'-' || i ==
']')
fprintf(f,
"\\");
735 if (PRINTABLE(i))
fprintf(f,
"%c", i);
740 if (
j ==
'-' ||
j ==
']')
fprintf(f,
"\\");
758 const char *notch =
"";
768 unsigned int ptype = *ccode++;
769 unsigned int pvalue = *ccode++;
775 fprintf(f,
"[:%sgraph:]", notch);
779 fprintf(f,
"[:%sprint:]", notch);
783 fprintf(f,
"[:%spunct:]", notch);
787 fprintf(f,
"[:%sxdigit:]", notch);
792 fprintf(f,
"\\%c{%c%s}", ((notch[0] ==
'^')?
'P':
'p'),
831 fprintf(f,
"%s", OP_names[*ccode]);
860 fprintf(f,
" %s ", OP_names[*code]);
866 fprintf(f,
" %s", OP_names[*code]);
877 fprintf(f,
" %s %s", flag, OP_names[*code]);
fprintf($stream, string $format, mixed ... $values)
count(Countable|array $value, int $mode=COUNT_NORMAL)
#define print_custring_bylen
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)