Lines Matching refs:tnfa
47 const tre_tnfa_t *tnfa, regoff_t *tags, regoff_t match_eo);
82 #define CHECK_CHAR_CLASSES(trans_i, tnfa, eflags) \
84 && !(tnfa->cflags & REG_ICASE) \
87 && (tnfa->cflags & REG_ICASE) \
92 tnfa->cflags & REG_ICASE)))
170 tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string,
184 int reg_newline = tnfa->cflags & REG_NEWLINE;
206 num_tags = tnfa->num_tags;
217 if (num_tags > SIZE_MAX/(8 * sizeof(regoff_t) * tnfa->num_states))
221 if (tnfa->num_states+1 > SIZE_MAX/(8 * sizeof(*reach_next)))
225 if (tnfa->num_states > SIZE_MAX/(8 * sizeof(*reach_pos)))
230 rbytes = sizeof(*reach_next) * (tnfa->num_states + 1);
231 pbytes = sizeof(*reach_pos) * tnfa->num_states;
235 + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes;
255 for (i = 0; i < tnfa->num_states; i++)
264 for (i = 0; i < tnfa->num_states; i++)
276 trans_i = tnfa->initial;
299 if (reach_next_i->state == tnfa->final)
333 if (tnfa->num_minimals && new_match)
340 for (i = 0; tnfa->minimal_tags[i] >= 0; i += 2)
342 int end = tnfa->minimal_tags[i];
343 int start = tnfa->minimal_tags[i + 1];
387 || CHECK_CHAR_CLASSES(trans_i, tnfa, eflags)))
414 if (reach_next_i->state == tnfa->final
433 if (tre_tag_order(num_tags, tnfa->tag_directions,
440 if (trans_i->state == tnfa->final)
545 sizeof(*tags) * tnfa->num_tags); \
567 for (i = 0; i < tnfa->num_tags; i++) \
582 for (i = 0; i < tnfa->num_tags; i++) \
593 tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
606 int reg_newline = tnfa->cflags & REG_NEWLINE;
652 if (tnfa->num_tags)
654 tags = xmalloc(sizeof(*tags) * tnfa->num_tags);
661 if (tnfa->num_submatches)
663 pmatch = xmalloc(sizeof(*pmatch) * tnfa->num_submatches);
670 if (tnfa->num_states)
672 states_seen = xmalloc(sizeof(*states_seen) * tnfa->num_states);
683 for (i = 0; i < tnfa->num_tags; i++)
689 for (i = 0; i < tnfa->num_states; i++)
705 for (trans_i = tnfa->initial; trans_i->state; trans_i++)
744 if (state == tnfa->final)
749 && tre_tag_order(tnfa->num_tags, tnfa->tag_directions,
756 for (i = 0; i < tnfa->num_tags; i++)
779 tre_fill_pmatch(bt + 1, pmatch, tnfa->cflags & ~REG_NOSUB,
780 tnfa, tags, pos);
829 || CHECK_CHAR_CLASSES(trans_i, tnfa, eflags)))
931 const tre_tnfa_t *tnfa, regoff_t *tags, regoff_t match_eo)
941 submatch_data = tnfa->submatch_data;
942 while (i < tnfa->num_submatches && i < nmatch)
944 if (submatch_data[i].so_tag == tnfa->end_tag)
949 if (submatch_data[i].eo_tag == tnfa->end_tag)
964 while (i < tnfa->num_submatches && i < nmatch)
999 tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD;
1002 if (tnfa->cflags & REG_NOSUB) nmatch = 0;
1003 if (tnfa->num_tags > 0 && nmatch > 0)
1005 tags = xmalloc(sizeof(*tags) * tnfa->num_tags);
1011 if (tnfa->have_backrefs)
1014 status = tre_tnfa_run_backtrack(tnfa, string, tags, eflags, &eo);
1019 status = tre_tnfa_run_parallel(tnfa, string, tags, eflags, &eo);
1024 tre_fill_pmatch(nmatch, pmatch, tnfa->cflags, tnfa, tags, eo);