Lines Matching refs:pc
121 int i, j, ch, op, pc; in slre_dump() local
123 for (pc = 0; pc < r->code_size; pc++) { in slre_dump()
125 op = r->code[pc]; in slre_dump()
126 (void) fprintf(fp, "%3d %s ", pc, opcodes[op].name); in slre_dump()
131 (void) fprintf(fp, "%d ", r->code[pc + 1]); in slre_dump()
132 pc++; in slre_dump()
136 pc + r->code[pc + 1] - i); in slre_dump()
137 pc++; in slre_dump()
141 r->code[pc + 1], r->code[pc + 2]); in slre_dump()
142 pc += 2; in slre_dump()
146 for (j = 0; j < r->code[pc + 2]; j++) { in slre_dump()
147 ch = r->data[r->code[pc + 1] + j]; in slre_dump()
156 pc += 2; in slre_dump()
166 set_jump_offset(struct slre *r, int pc, int offset) in set_jump_offset() argument
173 r->code[pc] = (unsigned char) (r->code_size - offset); in set_jump_offset()
440 loop_greedy(const struct slre *r, int pc, const char *s, int len, int *ofs) in loop_greedy() argument
446 while (match(r, pc + 2, s, len, ofs, NULL)) { in loop_greedy()
448 if (match(r, pc + r->code[pc + 1], s, len, ofs, NULL)) in loop_greedy()
457 loop_non_greedy(const struct slre *r, int pc, const char *s, int len, int *ofs) in loop_non_greedy() argument
461 while (match(r, pc + 2, s, len, ofs, NULL)) { in loop_non_greedy()
463 if (match(r, pc + r->code[pc + 1], s, len, ofs, NULL)) in loop_non_greedy()
503 match(const struct slre *r, int pc, const char *s, int len, in match() argument
508 while (res && r->code[pc] != END) { in match()
510 assert(pc < r->code_size); in match()
511 assert(pc < (int) (sizeof(r->code) / sizeof(r->code[0]))); in match()
513 switch (r->code[pc]) { in match()
516 res = match(r, pc + 3, s, len, ofs, caps); in match()
519 res = match(r, pc + r->code[pc + 1], in match()
522 pc += r->code[pc + 2]; in match()
526 n = r->code[pc + 2]; /* String length */ in match()
528 r->code[pc + 1], n)) { in match()
532 pc += 3; in match()
537 if (!match(r, pc + 2, s, len, ofs, caps)) in match()
539 pc += r->code[pc + 1]; in match()
543 loop_greedy(r, pc, s, len, ofs); in match()
544 pc += r->code[pc + 1]; in match()
548 loop_non_greedy(r, pc, s, len, ofs); in match()
549 pc += r->code[pc + 1]; in match()
552 res = match(r, pc + 2, s, len, ofs, caps); in match()
556 loop_greedy(r, pc, s, len, ofs); in match()
557 pc += r->code[pc + 1]; in match()
560 res = match(r, pc + 2, s, len, ofs, caps); in match()
564 loop_non_greedy(r, pc, s, len, ofs); in match()
565 pc += r->code[pc + 1]; in match()
573 pc++; in match()
582 pc++; in match()
590 pc++; in match()
598 pc++; in match()
603 res = is_any_of(r->data + r->code[pc + 1], in match()
604 r->code[pc + 2], s, ofs); in match()
605 pc += 3; in match()
610 res = is_any_but(r->data + r->code[pc + 1], in match()
611 r->code[pc + 2], s, ofs); in match()
612 pc += 3; in match()
616 pc++; in match()
620 pc++; in match()
624 caps[r->code[pc + 1]].ptr = s + *ofs; in match()
625 pc += 2; in match()
629 caps[r->code[pc + 1]].len = (s + *ofs) - in match()
630 caps[r->code[pc + 1]].ptr; in match()
631 pc += 2; in match()
634 pc++; in match()
637 printf("unknown cmd (%d) at %d\n", r->code[pc], pc); in match()