Home | History | Annotate | Download | only in lib

Lines Matching refs:str_idx

28 					  Idx str_idx, Idx from, Idx to)
30 static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
33 Idx str_idx) internal_function;
35 Idx node, Idx str_idx)
71 Idx str_idx, Idx dest_node, Idx nregs,
85 Idx node_idx, Idx str_idx, Idx max_str_idx)
92 re_sift_context_t *sctx, Idx str_idx,
97 Idx str_idx,
114 Idx node, Idx str_idx,
121 Idx str_idx) internal_function;
124 Idx str_idx, const re_node_set *candidates)
141 Idx str_idx) internal_function;
171 Idx str_idx,
1394 push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node,
1409 fs->stack[num].idx = str_idx;
1616 Rules: We throw away the Node `a' in the STATE_LOG[STR_IDX] if...
1617 STR_IDX == MATCH_LAST(the last index in the state_log):
1620 2. When 0 <= STR_IDX < MATCH_LAST and `a' accepts
1622 i. If 'b' isn't in the STATE_LOG[STR_IDX+strlen('s')], we throw
1624 ii. If 'b' is in the STATE_LOG[STR_IDX+strlen('s')] but 'b' is
1626 3. When 0 <= STR_IDX < MATCH_LAST and 'a' epsilon transit to 'b':
1627 i. If 'b' isn't in the STATE_LOG[STR_IDX], we throw away the
1629 ii. If 'b' is in the STATE_LOG[STR_IDX] but 'b' is thrown away,
1641 Idx str_idx = sctx->last_str_idx;
1645 assert (mctx->state_log != NULL && mctx->state_log[str_idx] != NULL);
1648 /* Build sifted state_log[str_idx]. It has the nodes which can epsilon
1653 err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
1658 while (str_idx > 0)
1661 null_cnt = (sctx->sifted_states[str_idx] == NULL) ? null_cnt + 1 : 0;
1665 sizeof (re_dfastate_t *) * str_idx);
1670 --str_idx;
1672 if (mctx->state_log[str_idx])
1674 err = build_sifted_states (mctx, sctx, str_idx, &cur_dest);
1683 err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
1696 Idx str_idx, re_node_set *cur_dest)
1699 const re_node_set *cur_src = &mctx->state_log[str_idx]->non_eps_nodes;
1704 `sifted_states[str_idx]' with `cur_dest'.
1706 `cur_dest' is the sifted state from `state_log[str_idx + 1]'.
1707 `cur_src' points the node_set of the old `state_log[str_idx]'
1723 str_idx, sctx->last_str_idx);
1729 && check_node_accept (mctx, dfa->nodes + prev_node, str_idx)
1730 && STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + 1],
1739 Idx to_idx = str_idx + naccepted;
1742 prev_node, str_idx))
1810 re_sift_context_t *sctx, Idx str_idx,
1816 candidates = ((mctx->state_log[str_idx] == NULL) ? NULL
1817 : &mctx->state_log[str_idx]->nodes);
1820 sctx->sifted_states[str_idx] = NULL;
1835 mctx->bkref_ents, str_idx);
1841 sctx->sifted_states[str_idx] = re_acquire_state (&err, dfa, dest_nodes);
1846 if (candidates && mctx->state_log[str_idx]->has_backref)
1848 err = sift_states_bkref (mctx, sctx, str_idx, candidates);
2050 Idx subexp_idx, Idx from_node, Idx str_idx,
2057 if (str_idx < lim->subexp_from)
2060 if (lim->subexp_to < str_idx)
2064 boundaries = (str_idx == lim->subexp_from);
2065 boundaries |= (str_idx == lim->subexp_to) << 1;
2081 struct re_backref_cache_entry *bkref_ents, Idx str_idx)
2092 if (str_idx <= ent->subexp_from || ent->str_idx < str_idx)
2096 if (ent->subexp_to == str_idx)
2113 /* Note that (ent->subexp_to = str_idx != ent->subexp_from). */
2142 else /* (ent->subexp_to != str_idx) */
2168 Idx str_idx, const re_node_set *candidates)
2174 Idx first_idx = search_cur_bkref_entry (mctx, str_idx);
2189 if (node == sctx->last_node && str_idx == sctx->last_str_idx)
2207 to_idx = str_idx + subexp_len;
2215 str_idx, dst_node, to_idx))
2226 local_sctx.last_str_idx = str_idx;
2233 cur_state = local_sctx.sifted_states[str_idx];
2241 str_idx + 1);
2245 local_sctx.sifted_states[str_idx] = cur_state;
2268 Idx node_idx, Idx str_idx, Idx max_str_idx)
2273 naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx);
2274 if (naccepted > 0 && str_idx + naccepted <= max_str_idx &&
2275 !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
2467 Idx str_idx)
2486 err = match_ctx_add_subtop (mctx, node, str_idx);
2655 if (bkref_ent->node != node_idx || bkref_ent->str_idx != cur_str_idx)
2754 sl_str = sub_top->str_idx;
2762 sl_str_diff = sub_last->str_idx - sl_str;
2809 sl_str_off = sl_str - sub_top->str_idx;
2841 sl_str - sub_top->str_idx + 1);
2848 sub_top->str_idx, cls_node, sl_str,
2881 sub_last->str_idx, bkref_node, bkref_str,
2885 err = match_ctx_add_entry (mctx, bkref_node, bkref_str, sub_top->str_idx,
2886 sub_last->str_idx);
2889 to_idx = bkref_str + sub_last->str_idx - sub_top->str_idx;
2930 Idx subexp_num, backup_cur_idx, str_idx, null_cnt;
2955 str_idx = path->next_idx ? path->next_idx : top_str;
2961 mctx->input.cur_idx = str_idx;
2964 context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags);
2965 if (str_idx == top_str)
2979 cur_state = mctx->state_log[str_idx];
2989 if (str_idx == top_str || (cur_state && cur_state->has_backref))
2993 err = expand_bkref_cache (mctx, &next_nodes, str_idx,
3007 mctx->state_log[str_idx] = cur_state;
3010 for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;)
3013 if (mctx->state_log[str_idx + 1])
3016 &mctx->state_log[str_idx + 1]->nodes);
3025 err = check_arrival_add_next_nodes (mctx, str_idx,
3034 ++str_idx;
3043 err = expand_bkref_cache (mctx, &next_nodes, str_idx,
3051 context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags);
3058 mctx->state_log[str_idx] = cur_state;
3064 path->next_idx = str_idx;
3079 /* Calculate the destination nodes of CUR_NODES at STR_IDX, and append them
3087 check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
3111 str_idx);
3116 Idx next_idx = str_idx + naccepted;
3146 || check_node_accept (mctx, dfa->nodes + cur_node, str_idx))
3775 STR_IDX is the current index of the input string.
3784 const re_string_t *input, Idx str_idx)
3792 unsigned char c = re_string_byte_at (input, str_idx), d;
3796 if (str_idx + 2 > input->len)
3799 d = re_string_byte_at (input, str_idx + 1);
3829 if (str_idx + char_len > input->len)
3834 d = re_string_byte_at (input, str_idx + i);
3841 str_idx);
3850 re_string_byte_at (input, str_idx) == '\n') ||
3852 re_string_byte_at (input, str_idx) == '\0'))
3857 elem_len = re_string_elem_size_at (input, str_idx);
3866 = ((const unsigned char *) re_string_get_buffer (input) + str_idx);
3872 ? re_string_wchar_at (input, str_idx) : 0);
4272 entry, and call with STR_IDX which isn't smaller than any existing entry.
4277 match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from,
4296 && mctx->bkref_ents[mctx->nbkref_ents - 1].str_idx == str_idx)
4300 mctx->bkref_ents[mctx->nbkref_ents].str_idx = str_idx;
4321 /* Return the first entry with the same str_idx, or REG_MISSING if none is
4322 found. Note that MCTX->BKREF_ENTS is already sorted by MCTX->STR_IDX. */
4326 search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
4333 if (mctx->bkref_ents[mid].str_idx < str_idx)
4338 if (left < last && mctx->bkref_ents[left].str_idx == str_idx)
4345 at STR_IDX. */
4349 match_ctx_add_subtop (re_match_context_t *mctx, Idx node, Idx str_idx)
4370 mctx->sub_tops[mctx->nsub_tops++]->str_idx = str_idx;
4375 at STR_IDX, whose corresponding OP_OPEN_SUBEXP is SUB_TOP. */
4379 match_ctx_add_sublast (re_sub_match_top_t *subtop, Idx node, Idx str_idx)
4398 new_entry->str_idx = str_idx;