Home | History | Annotate | Download | only in lib

Lines Matching refs:dfa

26 					const re_dfa_t *dfa) internal_function;
27 static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa,
30 static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
44 RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
50 if (init_len < dfa->mb_cur_max)
51 init_len = dfa->mb_cur_max;
53 re_string_construct_common (str, len, pstr, trans, icase, dfa);
59 pstr->word_char = dfa->word_char;
60 pstr->word_ops_used = dfa->word_ops_used;
62 pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len;
72 RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
76 re_string_construct_common (str, len, pstr, trans, icase, dfa);
89 if (dfa->mb_cur_max > 1)
98 if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max)
112 if (dfa->mb_cur_max > 1)
176 const re_dfa_t *dfa)
184 pstr->mb_cur_max = dfa->mb_cur_max;
185 pstr->is_utf8 = dfa->is_utf8;
186 pstr->map_notascii = dfa->map_notascii;
1406 /* Add the token TOKEN to dfa->nodes, and return the index of the token.
1411 re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
1413 if (BE (dfa->nodes_len >= dfa->nodes_alloc, 0))
1415 size_t new_nodes_alloc = dfa->nodes_alloc * 2;
1425 if (BE (SIZE_MAX / 2 / max_object_size < dfa->nodes_alloc, 0))
1428 new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);
1431 dfa->nodes = new_nodes;
1432 new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc);
1433 new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc);
1434 new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc);
1435 new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc);
1439 dfa->nexts = new_nexts;
1440 dfa->org_indices = new_indices;
1441 dfa->edests = new_edests;
1442 dfa->eclosures = new_eclosures;
1443 dfa->nodes_alloc = new_nodes_alloc;
1445 dfa->nodes[dfa->nodes_len] = token;
1446 dfa->nodes[dfa->nodes_len].constraint = 0;
1450 dfa->nodes[dfa->nodes_len].accept_mb =
1451 (type == OP_PERIOD && dfa->mb_cur_max > 1) || type == COMPLEX_BRACKET;
1454 dfa->nexts[dfa->nodes_len] = REG_MISSING;
1455 re_node_set_init_empty (dfa->edests + dfa->nodes_len);
1456 re_node_set_init_empty (dfa->eclosures + dfa->nodes_len);
1457 return dfa->nodes_len++;
1472 Return the pointer to the state, if we found it in the DFA.
1482 re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
1499 spot = dfa->state_table + (hash & dfa->state_hash_mask);
1510 /* There are no appropriate state in the dfa, create the new one. */
1511 new_state = create_ci_newstate (dfa, nodes, hash);
1520 Return the pointer to the state, if we found it in the DFA.
1530 re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa,
1547 spot = dfa->state_table + (hash & dfa->state_hash_mask);
1557 /* There are no appropriate state in `dfa', create the new one. */
1558 new_state = create_cd_newstate (dfa, nodes, context, hash);
1566 HASH put in the appropriate bucket of DFA's state table. Return value
1570 register_state (const re_dfa_t *dfa, re_dfastate_t *newstate,
1584 if (!IS_EPSILON_NODE (dfa->nodes[elem].type))
1589 spot = dfa->state_table + (hash & dfa->state_hash_mask);
1625 create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
1645 re_token_t *node = dfa->nodes + nodes->elems[i];
1661 err = register_state (dfa, newstate, hash);
1675 create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
1697 re_token_t *node = dfa->nodes + nodes->elems[i];
1735 err = register_state (dfa, newstate, hash);