• Home
  • Raw
  • Download

Lines Matching refs:dfa

28 static reg_errcode_t init_dfa (re_dfa_t *dfa, size_t pat_len);
33 static reg_errcode_t create_initial_state (re_dfa_t *dfa);
35 static void optimize_utf8 (re_dfa_t *dfa);
51 static Idx duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint);
52 static Idx search_duplicated_node (const re_dfa_t *dfa, Idx org_node,
54 static reg_errcode_t calc_eclosure (re_dfa_t *dfa);
55 static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa,
57 static reg_errcode_t calc_inveclosure (re_dfa_t *dfa);
77 re_dfa_t *dfa, re_token_t *token,
79 static bin_tree_t *parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa,
85 re_dfa_t *dfa,
110 static bin_tree_t *build_charclass_op (re_dfa_t *dfa,
115 static bin_tree_t *create_tree (re_dfa_t *dfa,
118 static bin_tree_t *create_token_tree (re_dfa_t *dfa,
121 static bin_tree_t *duplicate_tree (const bin_tree_t *src, re_dfa_t *dfa);
279 re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; variable
283 re_compile_fastmap_iter (bufp, dfa->init_state, fastmap);
284 if (dfa->init_state != dfa->init_state_word)
285 re_compile_fastmap_iter (bufp, dfa->init_state_word, fastmap);
286 if (dfa->init_state != dfa->init_state_nl)
287 re_compile_fastmap_iter (bufp, dfa->init_state_nl, fastmap);
288 if (dfa->init_state != dfa->init_state_begbuf)
289 re_compile_fastmap_iter (bufp, dfa->init_state_begbuf, fastmap);
313 re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; in re_compile_fastmap_iter() local
315 bool icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE)); in re_compile_fastmap_iter()
319 re_token_type_t type = dfa->nodes[node].type; in re_compile_fastmap_iter()
323 re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c); in re_compile_fastmap_iter()
325 if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) in re_compile_fastmap_iter()
333 *p++ = dfa->nodes[node].opr.c; in re_compile_fastmap_iter()
334 while (++node < dfa->nodes_len in re_compile_fastmap_iter()
335 && dfa->nodes[node].type == CHARACTER in re_compile_fastmap_iter()
336 && dfa->nodes[node].mb_partial) in re_compile_fastmap_iter()
337 *p++ = dfa->nodes[node].opr.c; in re_compile_fastmap_iter()
353 bitset_word_t w = dfa->nodes[node].opr.sbcset[i]; in re_compile_fastmap_iter()
362 re_charset_t *cset = dfa->nodes[node].opr.mbcset; in re_compile_fastmap_iter()
387 if (dfa->mb_cur_max > 1 in re_compile_fastmap_iter()
415 if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) in re_compile_fastmap_iter()
610 free_dfa_content (re_dfa_t *dfa) in free_dfa_content() argument
614 if (dfa->nodes) in free_dfa_content()
615 for (i = 0; i < dfa->nodes_len; ++i) in free_dfa_content()
616 free_token (dfa->nodes + i); in free_dfa_content()
617 re_free (dfa->nexts); in free_dfa_content()
618 for (i = 0; i < dfa->nodes_len; ++i) in free_dfa_content()
620 if (dfa->eclosures != NULL) in free_dfa_content()
621 re_node_set_free (dfa->eclosures + i); in free_dfa_content()
622 if (dfa->inveclosures != NULL) in free_dfa_content()
623 re_node_set_free (dfa->inveclosures + i); in free_dfa_content()
624 if (dfa->edests != NULL) in free_dfa_content()
625 re_node_set_free (dfa->edests + i); in free_dfa_content()
627 re_free (dfa->edests); in free_dfa_content()
628 re_free (dfa->eclosures); in free_dfa_content()
629 re_free (dfa->inveclosures); in free_dfa_content()
630 re_free (dfa->nodes); in free_dfa_content()
632 if (dfa->state_table) in free_dfa_content()
633 for (i = 0; i <= dfa->state_hash_mask; ++i) in free_dfa_content()
635 struct re_state_table_entry *entry = dfa->state_table + i; in free_dfa_content()
643 re_free (dfa->state_table); in free_dfa_content()
645 if (dfa->sb_char != utf8_sb_map) in free_dfa_content()
646 re_free (dfa->sb_char); in free_dfa_content()
648 re_free (dfa->subexp_map); in free_dfa_content()
650 re_free (dfa->re_str); in free_dfa_content()
653 re_free (dfa); in free_dfa_content()
663 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; local
664 if (BE (dfa != NULL, 1))
665 free_dfa_content (dfa);
757 re_dfa_t *dfa; in re_compile_internal() local
770 dfa = (re_dfa_t *) preg->buffer; in re_compile_internal()
777 dfa = re_realloc (preg->buffer, re_dfa_t, 1); in re_compile_internal()
778 if (dfa == NULL) in re_compile_internal()
781 preg->buffer = (unsigned char *) dfa; in re_compile_internal()
785 err = init_dfa (dfa, length); in re_compile_internal()
788 free_dfa_content (dfa); in re_compile_internal()
795 dfa->re_str = re_malloc (char, length + 1); in re_compile_internal()
796 strncpy (dfa->re_str, pattern, length + 1); in re_compile_internal()
799 __libc_lock_init (dfa->lock); in re_compile_internal()
802 (syntax & RE_ICASE) != 0, dfa); in re_compile_internal()
808 free_dfa_content (dfa); in re_compile_internal()
816 dfa->str_tree = parse (&regexp, preg, syntax, &err); in re_compile_internal()
817 if (BE (dfa->str_tree == NULL, 0)) in re_compile_internal()
827 if (dfa->is_utf8 && !(syntax & RE_ICASE) && preg->translate == NULL) in re_compile_internal()
828 optimize_utf8 (dfa); in re_compile_internal()
832 err = create_initial_state (dfa); in re_compile_internal()
840 free_dfa_content (dfa); in re_compile_internal()
852 init_dfa (re_dfa_t *dfa, size_t pat_len) in init_dfa() argument
867 memset (dfa, '\0', sizeof (re_dfa_t)); in init_dfa()
870 dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE; in init_dfa()
879 dfa->nodes_alloc = pat_len + 1; in init_dfa()
880 dfa->nodes = re_malloc (re_token_t, dfa->nodes_alloc); in init_dfa()
887 dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size); in init_dfa()
888 dfa->state_hash_mask = table_size - 1; in init_dfa()
890 dfa->mb_cur_max = MB_CUR_MAX; in init_dfa()
892 if (dfa->mb_cur_max == 6 in init_dfa()
894 dfa->is_utf8 = 1; in init_dfa()
895 dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII) in init_dfa()
899 dfa->is_utf8 = 1; in init_dfa()
903 dfa->map_notascii = 0; in init_dfa()
907 if (dfa->mb_cur_max > 1) in init_dfa()
909 if (dfa->is_utf8) in init_dfa()
910 dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map; in init_dfa()
915 dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); in init_dfa()
916 if (BE (dfa->sb_char == NULL, 0)) in init_dfa()
925 dfa->sb_char[i] |= (bitset_word_t) 1 << j; in init_dfa()
928 dfa->map_notascii = 1; in init_dfa()
935 if (BE (dfa->nodes == NULL || dfa->state_table == NULL, 0)) in init_dfa()
946 init_word_char (re_dfa_t *dfa) in init_word_char() argument
949 dfa->word_ops_used = 1; in init_word_char()
953 dfa->word_char[i] |= (bitset_word_t) 1 << j; in init_word_char()
961 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; in free_workarea_compile() local
963 for (storage = dfa->str_tree_storage; storage; storage = next) in free_workarea_compile()
968 dfa->str_tree_storage = NULL; in free_workarea_compile()
969 dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE; in free_workarea_compile()
970 dfa->str_tree = NULL; in free_workarea_compile()
971 re_free (dfa->org_indices); in free_workarea_compile()
972 dfa->org_indices = NULL; in free_workarea_compile()
978 create_initial_state (re_dfa_t *dfa) in create_initial_state() argument
986 first = dfa->str_tree->first->node_idx; in create_initial_state()
987 dfa->init_node = first; in create_initial_state()
988 err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first); in create_initial_state()
996 if (dfa->nbackref > 0) in create_initial_state()
1000 re_token_type_t type = dfa->nodes[node_idx].type; in create_initial_state()
1008 clexp_node = dfa->nodes + init_nodes.elems[clexp_idx]; in create_initial_state()
1010 && clexp_node->opr.idx == dfa->nodes[node_idx].opr.idx) in create_initial_state()
1018 Idx dest_idx = dfa->edests[node_idx].elems[0]; in create_initial_state()
1021 re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx); in create_initial_state()
1028 dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0); in create_initial_state()
1030 if (BE (dfa->init_state == NULL, 0)) in create_initial_state()
1032 if (dfa->init_state->has_constraint) in create_initial_state()
1034 dfa->init_state_word = re_acquire_state_context (&err, dfa, &init_nodes, in create_initial_state()
1036 dfa->init_state_nl = re_acquire_state_context (&err, dfa, &init_nodes, in create_initial_state()
1038 dfa->init_state_begbuf = re_acquire_state_context (&err, dfa, in create_initial_state()
1042 if (BE (dfa->init_state_word == NULL || dfa->init_state_nl == NULL in create_initial_state()
1043 || dfa->init_state_begbuf == NULL, 0)) in create_initial_state()
1047 dfa->init_state_word = dfa->init_state_nl in create_initial_state()
1048 = dfa->init_state_begbuf = dfa->init_state; in create_initial_state()
1060 optimize_utf8 (re_dfa_t *dfa) in optimize_utf8() argument
1067 for (node = 0; node < dfa->nodes_len; ++node) in optimize_utf8()
1068 switch (dfa->nodes[node].type) in optimize_utf8()
1071 if (dfa->nodes[node].opr.c >= ASCII_CHARS) in optimize_utf8()
1075 switch (dfa->nodes[node].opr.ctx_type) in optimize_utf8()
1109 if (dfa->nodes[node].opr.sbcset[i] >> rshift != 0) in optimize_utf8()
1120 for (node = 0; node < dfa->nodes_len; ++node) in optimize_utf8()
1122 if (dfa->nodes[node].type == CHARACTER in optimize_utf8()
1123 && dfa->nodes[node].opr.c >= ASCII_CHARS) in optimize_utf8()
1124 dfa->nodes[node].mb_partial = 0; in optimize_utf8()
1125 else if (dfa->nodes[node].type == OP_PERIOD) in optimize_utf8()
1126 dfa->nodes[node].type = OP_UTF8_PERIOD; in optimize_utf8()
1130 dfa->mb_cur_max = 1; in optimize_utf8()
1131 dfa->is_utf8 = 0; in optimize_utf8()
1132 dfa->has_mb_node = dfa->nbackref > 0 || has_period; in optimize_utf8()
1142 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; in analyze() local
1146 dfa->nexts = re_malloc (Idx, dfa->nodes_alloc); in analyze()
1147 dfa->org_indices = re_malloc (Idx, dfa->nodes_alloc); in analyze()
1148 dfa->edests = re_malloc (re_node_set, dfa->nodes_alloc); in analyze()
1149 dfa->eclosures = re_malloc (re_node_set, dfa->nodes_alloc); in analyze()
1150 if (BE (dfa->nexts == NULL || dfa->org_indices == NULL || dfa->edests == NULL in analyze()
1151 || dfa->eclosures == NULL, 0)) in analyze()
1154 dfa->subexp_map = re_malloc (Idx, preg->re_nsub); in analyze()
1155 if (dfa->subexp_map != NULL) in analyze()
1159 dfa->subexp_map[i] = i; in analyze()
1160 preorder (dfa->str_tree, optimize_subexps, dfa); in analyze()
1162 if (dfa->subexp_map[i] != i) in analyze()
1166 free (dfa->subexp_map); in analyze()
1167 dfa->subexp_map = NULL; in analyze()
1171 ret = postorder (dfa->str_tree, lower_subexps, preg); in analyze()
1174 ret = postorder (dfa->str_tree, calc_first, dfa); in analyze()
1177 preorder (dfa->str_tree, calc_next, dfa); in analyze()
1178 ret = preorder (dfa->str_tree, link_nfa_nodes, dfa); in analyze()
1181 ret = calc_eclosure (dfa); in analyze()
1187 if ((!preg->no_sub && preg->re_nsub > 0 && dfa->has_plural_match) in analyze()
1188 || dfa->nbackref) in analyze()
1190 dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_len); in analyze()
1191 if (BE (dfa->inveclosures == NULL, 0)) in analyze()
1193 ret = calc_inveclosure (dfa); in analyze()
1270 re_dfa_t *dfa = (re_dfa_t *) extra; in optimize_subexps() local
1272 if (node->token.type == OP_BACK_REF && dfa->subexp_map) in optimize_subexps()
1275 node->token.opr.idx = dfa->subexp_map[idx]; in optimize_subexps()
1276 dfa->used_bkref_map |= 1 << node->token.opr.idx; in optimize_subexps()
1288 dfa->subexp_map[other_idx] = dfa->subexp_map[node->token.opr.idx]; in optimize_subexps()
1290 dfa->used_bkref_map &= ~((bitset_word_t) 1 << other_idx); in optimize_subexps()
1323 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; in lower_subexp() local
1334 || !(dfa->used_bkref_map in lower_subexp()
1340 op = create_tree (dfa, NULL, NULL, OP_OPEN_SUBEXP); in lower_subexp()
1341 cls = create_tree (dfa, NULL, NULL, OP_CLOSE_SUBEXP); in lower_subexp()
1342 tree1 = body ? create_tree (dfa, body, cls, CONCAT) : cls; in lower_subexp()
1343 tree = create_tree (dfa, op, tree1, CONCAT); in lower_subexp()
1360 re_dfa_t *dfa = (re_dfa_t *) extra; in calc_first() local
1369 node->node_idx = re_dfa_add_node (dfa, node->token); in calc_first()
1373 dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type; in calc_first()
1405 re_dfa_t *dfa = (re_dfa_t *) extra; in link_nfa_nodes() local
1422 dfa->has_plural_match = 1; in link_nfa_nodes()
1433 err = re_node_set_init_2 (dfa->edests + idx, left, right); in link_nfa_nodes()
1440 err = re_node_set_init_1 (dfa->edests + idx, node->next->node_idx); in link_nfa_nodes()
1444 dfa->nexts[idx] = node->next->node_idx; in link_nfa_nodes()
1446 re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]); in link_nfa_nodes()
1451 dfa->nexts[idx] = node->next->node_idx; in link_nfa_nodes()
1464 duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, in duplicate_node_closure() argument
1473 if (dfa->nodes[org_node].type == OP_BACK_REF) in duplicate_node_closure()
1479 org_dest = dfa->nexts[org_node]; in duplicate_node_closure()
1480 re_node_set_empty (dfa->edests + clone_node); in duplicate_node_closure()
1481 clone_dest = duplicate_node (dfa, org_dest, constraint); in duplicate_node_closure()
1484 dfa->nexts[clone_node] = dfa->nexts[org_node]; in duplicate_node_closure()
1485 ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); in duplicate_node_closure()
1489 else if (dfa->edests[org_node].nelem == 0) in duplicate_node_closure()
1494 dfa->nexts[clone_node] = dfa->nexts[org_node]; in duplicate_node_closure()
1497 else if (dfa->edests[org_node].nelem == 1) in duplicate_node_closure()
1501 org_dest = dfa->edests[org_node].elems[0]; in duplicate_node_closure()
1502 re_node_set_empty (dfa->edests + clone_node); in duplicate_node_closure()
1503 clone_dest = search_duplicated_node (dfa, org_dest, constraint); in duplicate_node_closure()
1508 ok = re_node_set_insert (dfa->edests + clone_node, org_dest); in duplicate_node_closure()
1514 constraint |= dfa->nodes[org_node].constraint; in duplicate_node_closure()
1515 clone_dest = duplicate_node (dfa, org_dest, constraint); in duplicate_node_closure()
1518 ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); in duplicate_node_closure()
1526 org_dest = dfa->edests[org_node].elems[0]; in duplicate_node_closure()
1527 re_node_set_empty (dfa->edests + clone_node); in duplicate_node_closure()
1529 clone_dest = search_duplicated_node (dfa, org_dest, constraint); in duplicate_node_closure()
1534 clone_dest = duplicate_node (dfa, org_dest, constraint); in duplicate_node_closure()
1537 ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); in duplicate_node_closure()
1540 err = duplicate_node_closure (dfa, org_dest, clone_dest, in duplicate_node_closure()
1549 ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); in duplicate_node_closure()
1554 org_dest = dfa->edests[org_node].elems[1]; in duplicate_node_closure()
1555 clone_dest = duplicate_node (dfa, org_dest, constraint); in duplicate_node_closure()
1558 ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); in duplicate_node_closure()
1572 search_duplicated_node (const re_dfa_t *dfa, Idx org_node, in search_duplicated_node() argument
1576 for (idx = dfa->nodes_len - 1; dfa->nodes[idx].duplicated && idx > 0; --idx) in search_duplicated_node()
1578 if (org_node == dfa->org_indices[idx] in search_duplicated_node()
1579 && constraint == dfa->nodes[idx].constraint) in search_duplicated_node()
1590 duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint) in duplicate_node() argument
1592 Idx dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx]); in duplicate_node()
1595 dfa->nodes[dup_idx].constraint = constraint; in duplicate_node()
1596 dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint; in duplicate_node()
1597 dfa->nodes[dup_idx].duplicated = 1; in duplicate_node()
1600 dfa->org_indices[dup_idx] = org_idx; in duplicate_node()
1606 calc_inveclosure (re_dfa_t *dfa) in calc_inveclosure() argument
1610 for (idx = 0; idx < dfa->nodes_len; ++idx) in calc_inveclosure()
1611 re_node_set_init_empty (dfa->inveclosures + idx); in calc_inveclosure()
1613 for (src = 0; src < dfa->nodes_len; ++src) in calc_inveclosure()
1615 Idx *elems = dfa->eclosures[src].elems; in calc_inveclosure()
1616 for (idx = 0; idx < dfa->eclosures[src].nelem; ++idx) in calc_inveclosure()
1618 ok = re_node_set_insert_last (dfa->inveclosures + elems[idx], src); in calc_inveclosure()
1630 calc_eclosure (re_dfa_t *dfa) in calc_eclosure() argument
1635 assert (dfa->nodes_len > 0); in calc_eclosure()
1643 if (node_idx == dfa->nodes_len) in calc_eclosure()
1652 assert (dfa->eclosures[node_idx].nelem != REG_MISSING); in calc_eclosure()
1656 if (dfa->eclosures[node_idx].nelem != 0) in calc_eclosure()
1659 err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, true); in calc_eclosure()
1663 if (dfa->eclosures[node_idx].nelem == 0) in calc_eclosure()
1675 calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) in calc_eclosure_iter() argument
1683 err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1); in calc_eclosure_iter()
1689 dfa->eclosures[node].nelem = REG_MISSING; in calc_eclosure_iter()
1693 if (dfa->nodes[node].constraint in calc_eclosure_iter()
1694 && dfa->edests[node].nelem in calc_eclosure_iter()
1695 && !dfa->nodes[dfa->edests[node].elems[0]].duplicated) in calc_eclosure_iter()
1697 err = duplicate_node_closure (dfa, node, node, node, in calc_eclosure_iter()
1698 dfa->nodes[node].constraint); in calc_eclosure_iter()
1704 if (IS_EPSILON_NODE(dfa->nodes[node].type)) in calc_eclosure_iter()
1705 for (i = 0; i < dfa->edests[node].nelem; ++i) in calc_eclosure_iter()
1708 Idx edest = dfa->edests[node].elems[i]; in calc_eclosure_iter()
1711 if (dfa->eclosures[edest].nelem == REG_MISSING) in calc_eclosure_iter()
1718 if (dfa->eclosures[edest].nelem == 0) in calc_eclosure_iter()
1720 err = calc_eclosure_iter (&eclosure_elem, dfa, edest, false); in calc_eclosure_iter()
1725 eclosure_elem = dfa->eclosures[edest]; in calc_eclosure_iter()
1730 if (dfa->eclosures[edest].nelem == 0) in calc_eclosure_iter()
1742 dfa->eclosures[node].nelem = 0; in calc_eclosure_iter()
1744 dfa->eclosures[node] = eclosure; in calc_eclosure_iter()
2104 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; in parse() local
2107 dfa->syntax = syntax; in parse()
2112 eor = create_tree (dfa, NULL, NULL, END_OF_RE); in parse()
2114 root = create_tree (dfa, tree, eor, CONCAT); in parse()
2138 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; in parse_reg_exp() local
2156 tree = create_tree (dfa, tree, branch, OP_ALT); in parse_reg_exp()
2180 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; in parse_branch() local
2195 tree = create_tree (dfa, tree, expr, CONCAT); in parse_branch()
2219 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; in parse_expression() local
2224 tree = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2231 if (dfa->mb_cur_max > 1) in parse_expression()
2238 mbc_remain = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2239 tree = create_tree (dfa, tree, mbc_remain, CONCAT); in parse_expression()
2255 tree = parse_bracket_exp (regexp, dfa, token, syntax, err); in parse_expression()
2260 if (!BE (dfa->completed_bkref_map & (1 << token->opr.idx), 1)) in parse_expression()
2265 dfa->used_bkref_map |= 1 << token->opr.idx; in parse_expression()
2266 tree = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2272 ++dfa->nbackref; in parse_expression()
2273 dfa->has_mb_node = 1; in parse_expression()
2311 tree = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2321 && dfa->word_ops_used == 0) in parse_expression()
2322 init_word_char (dfa); in parse_expression()
2330 tree_first = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2336 tree_first = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2339 tree_last = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2340 tree = create_tree (dfa, tree_first, tree_last, OP_ALT); in parse_expression()
2349 tree = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2363 tree = create_token_tree (dfa, NULL, NULL, token); in parse_expression()
2369 if (dfa->mb_cur_max > 1) in parse_expression()
2370 dfa->has_mb_node = 1; in parse_expression()
2374 tree = build_charclass_op (dfa, regexp->trans, in parse_expression()
2383 tree = build_charclass_op (dfa, regexp->trans, in parse_expression()
2408 tree = parse_dup_op (tree, regexp, dfa, token, syntax, err); in parse_expression()
2435 re_dfa_t *dfa = (re_dfa_t *) preg->buffer; in parse_sub_exp() local
2455 dfa->completed_bkref_map |= 1 << cur_nsub; in parse_sub_exp()
2457 tree = create_tree (dfa, tree, NULL, SUBEXP); in parse_sub_exp()
2470 parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, in parse_dup_op() argument
2549 elem = duplicate_tree (elem, dfa); in parse_dup_op()
2550 tree = create_tree (dfa, tree, elem, CONCAT); in parse_dup_op()
2559 elem = duplicate_tree (elem, dfa); in parse_dup_op()
2568 tree = create_tree (dfa, elem, NULL, in parse_dup_op()
2579 elem = duplicate_tree (elem, dfa); in parse_dup_op()
2580 tree = create_tree (dfa, tree, elem, CONCAT); in parse_dup_op()
2584 tree = create_tree (dfa, tree, NULL, OP_ALT); in parse_dup_op()
2590 tree = create_tree (dfa, old_tree, tree, CONCAT); in parse_dup_op()
2755 parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, in parse_bracket_exp() argument
2907 if (nrules > 0 || dfa->mb_cur_max > 1) in parse_bracket_exp()
3101 ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa, in parse_bracket_exp()
3145 dfa, syntax, true); in parse_bracket_exp()
3160 dfa->mb_cur_max > 1 ? mbcset : NULL, in parse_bracket_exp()
3244 if (dfa->mb_cur_max > 1) in parse_bracket_exp()
3245 bitset_mask (sbcset, dfa->sb_char); in parse_bracket_exp()
3248 || mbcset->nranges || (dfa->mb_cur_max > 1 && (mbcset->nchar_classes in parse_bracket_exp()
3254 dfa->has_mb_node = 1; in parse_bracket_exp()
3257 mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token); in parse_bracket_exp()
3270 work_tree = create_token_tree (dfa, NULL, NULL, &br_token); in parse_bracket_exp()
3275 work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT); in parse_bracket_exp()
3294 work_tree = create_token_tree (dfa, NULL, NULL, &br_token); in parse_bracket_exp()
3314 re_token_t *token, int token_len, re_dfa_t *dfa, in parse_bracket_element() argument
3575 build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans, in build_charclass_op() argument
3637 if (dfa->mb_cur_max > 1) in build_charclass_op()
3638 bitset_mask (sbcset, dfa->sb_char); in build_charclass_op()
3644 tree = create_token_tree (dfa, NULL, NULL, &br_token); in build_charclass_op()
3649 if (dfa->mb_cur_max > 1) in build_charclass_op()
3655 dfa->has_mb_node = 1; in build_charclass_op()
3656 mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token); in build_charclass_op()
3660 tree = create_tree (dfa, tree, mbc_tree, OP_ALT); in build_charclass_op()
3730 create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, in create_tree() argument
3735 return create_token_tree (dfa, left, right, &t); in create_tree()
3739 create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, in create_token_tree() argument
3743 if (BE (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE, 0)) in create_token_tree()
3749 storage->next = dfa->str_tree_storage; in create_token_tree()
3750 dfa->str_tree_storage = storage; in create_token_tree()
3751 dfa->str_tree_storage_idx = 0; in create_token_tree()
3753 tree = &dfa->str_tree_storage->data[dfa->str_tree_storage_idx++]; in create_token_tree()
3817 duplicate_tree (const bin_tree_t *root, re_dfa_t *dfa) in duplicate_tree() argument
3826 *p_new = create_token_tree (dfa, NULL, NULL, &node->token); in duplicate_tree()