Lines Matching refs:code
9 Original API code Copyright (c) 1997-2012 University of Cambridge
10 New API code Copyright (c) 2016 University of Cambridge
16 * Redistributions of source code must retain the above copyright notice,
45 code unit width, with PCRE2_SUFFIX set appropriately, just like the functions
50 /* Tables of operator names. The same 8-bit table is used for all code unit
81 /* In UTF mode the character may occupy more than one code unit.
85 ptr pointer to first code unit of the character
88 Returns: number of additional code units used
97 /* If UTF is supported and requested, check for a valid single code unit. */
112 /* Handle a valid one-code-unit character at any width. */
122 /* Code for invalid UTF code units and multi-unit UTF characters is different
175 /* For UTF-32 we get here only for a malformed code unit, which should only
189 * Print string as a list of code units *
192 /* These take no account of UTF as they always print each individual code unit.
233 into the main code, however, we just put one into this function. */
264 code pointer in the compiled code
272 print_prop(FILE *f, PCRE2_SPTR code, const char *before, const char *after)
274 if (code[1] != PT_CLIST)
276 fprintf(f, "%s%s %s%s", before, OP_names[*code], get_ucpname(code[1],
277 code[2]), after);
281 const char *not = (*code == OP_PROP)? "" : "not ";
282 const uint32_t *p = PRIV(ucd_caseless_sets) + code[2];
310 PCRE2_SPTR codestart, nametable, code;
315 code = codestart = nametable + re->name_count * re->name_entry_size;
326 fprintf(f, "%3d ", (int)(code - codestart));
330 switch(*code)
347 fprintf(f, " %s\n", OP_names[*code]);
355 code++;
356 code += 1 + print_char(f, code, utf);
358 while (*code == OP_CHAR);
366 code++;
367 code += 1 + print_char(f, code, utf);
369 while (*code == OP_CHARI);
377 if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
379 fprintf(f, "%s %d", OP_names[*code], GET2(code, 1+LINK_SIZE));
400 if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
402 fprintf(f, "%s", OP_names[*code]);
406 fprintf(f, " %s %d", OP_names[*code], GET2(code, 1));
410 fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]);
415 PCRE2_SPTR entry = nametable + (GET2(code, 1) * nesize) + IMM2_SIZE;
418 fprintf(f, ">%d", GET2(code, 1 + IMM2_SIZE));
423 c = GET2(code, 1);
432 PCRE2_SPTR entry = nametable + (GET2(code, 1) * nesize) + IMM2_SIZE;
435 fprintf(f, ">%d", GET2(code, 1 + IMM2_SIZE));
478 if (*code >= OP_TYPESTAR)
480 if (code[1] == OP_PROP || code[1] == OP_NOTPROP)
482 print_prop(f, code + 1, "", " ");
485 else fprintf(f, "%s", OP_names[code[1]]);
487 else extra = print_char(f, code+1, utf);
488 fprintf(f, "%s", OP_names[*code]);
502 extra = print_char(f, code + 1 + IMM2_SIZE, utf);
504 if (*code != OP_EXACT && *code != OP_EXACTI) fprintf(f, "0,");
505 fprintf(f, "%d}", GET2(code,1));
506 if (*code == OP_MINUPTO || *code == OP_MINUPTOI) fprintf(f, "?");
507 else if (*code == OP_POSUPTO || *code == OP_POSUPTOI) fprintf(f, "+");
514 if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
516 print_prop(f, code + IMM2_SIZE + 1, " ", " ");
519 else fprintf(f, " %s", OP_names[code[1 + IMM2_SIZE]]);
521 if (*code != OP_TYPEEXACT) fprintf(f, "0,");
522 fprintf(f, "%d}", GET2(code,1));
523 if (*code == OP_TYPEMINUPTO) fprintf(f, "?");
524 else if (*code == OP_TYPEPOSUPTO) fprintf(f, "+");
532 extra = print_char(f, code + 1, utf);
558 extra = print_char(f, code + 1, utf);
559 fprintf(f, "]%s", OP_names[*code]);
574 extra = print_char(f, code + 1 + IMM2_SIZE, utf);
576 if (*code != OP_NOTEXACT && *code != OP_NOTEXACTI) fprintf(f, "0,");
577 fprintf(f, "%d}", GET2(code,1));
578 if (*code == OP_NOTMINUPTO || *code == OP_NOTMINUPTOI) fprintf(f, "?");
580 if (*code == OP_NOTPOSUPTO || *code == OP_NOTPOSUPTOI) fprintf(f, "+");
584 if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
586 fprintf(f, "%s", OP_names[*code]);
593 fprintf(f, " %s \\%d", flag, GET2(code,1));
594 ccode = code + OP_lengths[*code];
602 PCRE2_SPTR entry = nametable + (GET2(code, 1) * nesize) + IMM2_SIZE;
605 fprintf(f, ">%d", GET2(code, 1 + IMM2_SIZE));
607 ccode = code + OP_lengths[*code];
611 fprintf(f, " %s %d %d %d", OP_names[*code], code[1 + 2*LINK_SIZE],
612 GET(code, 1), GET(code, 1 + LINK_SIZE));
616 c = code[1 + 4*LINK_SIZE];
617 fprintf(f, " %s %c", OP_names[*code], c);
618 extra = GET(code, 1 + 2*LINK_SIZE);
619 print_custring_bylen(f, code + 2 + 4*LINK_SIZE, extra - 3 - 4*LINK_SIZE);
626 fprintf(f, "%c %d %d %d", c, GET(code, 1 + 3*LINK_SIZE), GET(code, 1),
627 GET(code, 1 + LINK_SIZE));
632 print_prop(f, code, " ", "");
636 in having this code always here, and it makes it less messy without all
651 if (*code == OP_XCLASS)
653 extra = GET(code, 1);
654 ccode = code + LINK_SIZE + 1;
666 ccode = code + 1;
705 if (*code == OP_XCLASS)
761 fprintf(f, "]%s", (*code == OP_NCLASS)? " (neg)" : "");
793 /* Do nothing if it's not a repeat; this code stops picky compilers
794 warning about the lack of a default code path. */
806 fprintf(f, " %s ", OP_names[*code]);
807 print_custring_bylen(f, code + 2, code[1]);
808 extra += code[1];
812 fprintf(f, " %s", OP_names[*code]);
823 fprintf(f, " %s %s", flag, OP_names[*code]);
827 code += OP_lengths[*code] + extra;