Lines Matching refs:node
179 unset_addr_list_add(UnsetAddrList* uslist, int offset, struct _Node* node) in unset_addr_list_add() argument
193 uslist->us[uslist->num].target = node; in unset_addr_list_add()
306 static int compile_length_tree(Node* node, regex_t* reg);
307 static int compile_tree(Node* node, regex_t* reg);
360 compile_tree_empty_check(Node* node, regex_t* reg, int empty_info) in compile_tree_empty_check() argument
373 r = compile_tree(node, reg); in compile_tree_empty_check()
392 compile_call(CallNode* node, regex_t* reg) in compile_call() argument
398 r = unset_addr_list_add(node->unset_addr_list, BBUF_GET_OFFSET_POS(reg), in compile_call()
399 node->target); in compile_call()
407 compile_tree_n_times(Node* node, int n, regex_t* reg) in compile_tree_n_times() argument
412 r = compile_tree(node, reg); in compile_tree_n_times()
458 compile_length_string_node(Node* node, regex_t* reg) in compile_length_string_node() argument
465 sn = NSTR(node); in compile_length_string_node()
469 ambig = NSTRING_IS_AMBIG(node); in compile_length_string_node()
506 compile_string_node(Node* node, regex_t* reg) in compile_string_node() argument
513 sn = NSTR(node); in compile_string_node()
518 ambig = NSTRING_IS_AMBIG(node); in compile_string_node()
1159 compile_length_option_node(EncloseNode* node, regex_t* reg) in compile_length_option_node() argument
1164 reg->options = node->option; in compile_length_option_node()
1165 tlen = compile_length_tree(node->target, reg); in compile_length_option_node()
1170 if (IS_DYNAMIC_OPTION(prev ^ node->option)) { in compile_length_option_node()
1179 compile_option_node(EncloseNode* node, regex_t* reg) in compile_option_node() argument
1184 if (IS_DYNAMIC_OPTION(prev ^ node->option)) { in compile_option_node()
1185 r = add_opcode_option(reg, OP_SET_OPTION_PUSH, node->option); in compile_option_node()
1193 reg->options = node->option; in compile_option_node()
1194 r = compile_tree(node->target, reg); in compile_option_node()
1197 if (IS_DYNAMIC_OPTION(prev ^ node->option)) { in compile_option_node()
1205 compile_length_enclose_node(EncloseNode* node, regex_t* reg) in compile_length_enclose_node() argument
1210 if (node->type == ENCLOSE_OPTION) in compile_length_enclose_node()
1211 return compile_length_option_node(node, reg); in compile_length_enclose_node()
1213 if (node->target) { in compile_length_enclose_node()
1214 tlen = compile_length_tree(node->target, reg); in compile_length_enclose_node()
1220 switch (node->type) { in compile_length_enclose_node()
1223 if (IS_ENCLOSE_CALLED(node)) { in compile_length_enclose_node()
1226 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_length_enclose_node()
1227 len += (IS_ENCLOSE_RECURSION(node) in compile_length_enclose_node()
1230 len += (IS_ENCLOSE_RECURSION(node) in compile_length_enclose_node()
1233 else if (IS_ENCLOSE_RECURSION(node)) { in compile_length_enclose_node()
1235 len += tlen + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum) in compile_length_enclose_node()
1241 if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) in compile_length_enclose_node()
1246 len += tlen + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum) in compile_length_enclose_node()
1252 if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) { in compile_length_enclose_node()
1253 QtfrNode* qn = NQTFR(node->target); in compile_length_enclose_node()
1273 static int get_char_length_tree(Node* node, regex_t* reg, int* len);
1276 compile_enclose_node(EncloseNode* node, regex_t* reg) in compile_enclose_node() argument
1280 if (node->type == ENCLOSE_OPTION) in compile_enclose_node()
1281 return compile_option_node(node, reg); in compile_enclose_node()
1283 switch (node->type) { in compile_enclose_node()
1286 if (IS_ENCLOSE_CALLED(node)) { in compile_enclose_node()
1289 node->call_addr = BBUF_GET_OFFSET_POS(reg) + SIZE_ABSADDR + SIZE_OP_JUMP; in compile_enclose_node()
1290 node->state |= NST_ADDR_FIXED; in compile_enclose_node()
1291 r = add_abs_addr(reg, (int )node->call_addr); in compile_enclose_node()
1293 len = compile_length_tree(node->target, reg); in compile_enclose_node()
1295 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_enclose_node()
1296 len += (IS_ENCLOSE_RECURSION(node) in compile_enclose_node()
1299 len += (IS_ENCLOSE_RECURSION(node) in compile_enclose_node()
1306 if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) in compile_enclose_node()
1311 r = add_mem_num(reg, node->regnum); in compile_enclose_node()
1313 r = compile_tree(node->target, reg); in compile_enclose_node()
1316 if (IS_ENCLOSE_CALLED(node)) { in compile_enclose_node()
1317 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_enclose_node()
1318 r = add_opcode(reg, (IS_ENCLOSE_RECURSION(node) in compile_enclose_node()
1321 r = add_opcode(reg, (IS_ENCLOSE_RECURSION(node) in compile_enclose_node()
1325 r = add_mem_num(reg, node->regnum); in compile_enclose_node()
1329 else if (IS_ENCLOSE_RECURSION(node)) { in compile_enclose_node()
1330 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_enclose_node()
1335 r = add_mem_num(reg, node->regnum); in compile_enclose_node()
1340 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_enclose_node()
1345 r = add_mem_num(reg, node->regnum); in compile_enclose_node()
1350 if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) { in compile_enclose_node()
1351 QtfrNode* qn = NQTFR(node->target); in compile_enclose_node()
1370 r = compile_tree(node->target, reg); in compile_enclose_node()
1385 compile_length_anchor_node(AnchorNode* node, regex_t* reg) in compile_length_anchor_node() argument
1390 if (node->target) { in compile_length_anchor_node()
1391 tlen = compile_length_tree(node->target, reg); in compile_length_anchor_node()
1395 switch (node->type) { in compile_length_anchor_node()
1418 compile_anchor_node(AnchorNode* node, regex_t* reg) in compile_anchor_node() argument
1422 switch (node->type) { in compile_anchor_node()
1440 r = compile_tree(node->target, reg); in compile_anchor_node()
1446 len = compile_length_tree(node->target, reg); in compile_anchor_node()
1450 r = compile_tree(node->target, reg); in compile_anchor_node()
1460 if (node->char_len < 0) { in compile_anchor_node()
1461 r = get_char_length_tree(node->target, reg, &n); in compile_anchor_node()
1465 n = node->char_len; in compile_anchor_node()
1469 r = compile_tree(node->target, reg); in compile_anchor_node()
1476 len = compile_length_tree(node->target, reg); in compile_anchor_node()
1480 if (node->char_len < 0) { in compile_anchor_node()
1481 r = get_char_length_tree(node->target, reg, &n); in compile_anchor_node()
1485 n = node->char_len; in compile_anchor_node()
1488 r = compile_tree(node->target, reg); in compile_anchor_node()
1503 compile_length_tree(Node* node, regex_t* reg) in compile_length_tree() argument
1507 type = NTYPE(node); in compile_length_tree()
1512 r = compile_length_tree(NCAR(node), reg); in compile_length_tree()
1515 } while (IS_NOT_NULL(node = NCDR(node))); in compile_length_tree()
1525 r += compile_length_tree(NCAR(node), reg); in compile_length_tree()
1527 } while (IS_NOT_NULL(node = NCDR(node))); in compile_length_tree()
1533 if (NSTRING_IS_RAW(node)) in compile_length_tree()
1534 r = compile_length_string_raw_node(NSTR(node), reg); in compile_length_tree()
1536 r = compile_length_string_node(node, reg); in compile_length_tree()
1540 r = compile_length_cclass_node(NCCLASS(node), reg); in compile_length_tree()
1550 BRefNode* br = NBREF(node); in compile_length_tree()
1576 r = compile_length_quantifier_node(NQTFR(node), reg); in compile_length_tree()
1580 r = compile_length_enclose_node(NENCLOSE(node), reg); in compile_length_tree()
1584 r = compile_length_anchor_node(NANCHOR(node), reg); in compile_length_tree()
1596 compile_tree(Node* node, regex_t* reg) in compile_tree() argument
1600 type = NTYPE(node); in compile_tree()
1604 r = compile_tree(NCAR(node), reg); in compile_tree()
1605 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in compile_tree()
1610 Node* x = node; in compile_tree()
1621 len = compile_length_tree(NCAR(node), reg); in compile_tree()
1622 if (IS_NOT_NULL(NCDR(node))) { in compile_tree()
1626 r = compile_tree(NCAR(node), reg); in compile_tree()
1628 if (IS_NOT_NULL(NCDR(node))) { in compile_tree()
1633 } while (IS_NOT_NULL(node = NCDR(node))); in compile_tree()
1638 if (NSTRING_IS_RAW(node)) in compile_tree()
1639 r = compile_string_raw_node(NSTR(node), reg); in compile_tree()
1641 r = compile_string_node(node, reg); in compile_tree()
1645 r = compile_cclass_node(NCCLASS(node), reg); in compile_tree()
1652 switch (NCTYPE(node)->ctype) { in compile_tree()
1654 if (NCTYPE(node)->not != 0) op = OP_NOT_WORD; in compile_tree()
1674 BRefNode* br = NBREF(node); in compile_tree()
1736 r = compile_call(NCALL(node), reg); in compile_tree()
1741 r = compile_quantifier_node(NQTFR(node), reg); in compile_tree()
1745 r = compile_enclose_node(NENCLOSE(node), reg); in compile_tree()
1749 r = compile_anchor_node(NANCHOR(node), reg); in compile_tree()
1754 fprintf(stderr, "compile_tree: undefined node type %d\n", NTYPE(node)); in compile_tree()
1768 Node* node = *plink; in noname_disable_map() local
1770 switch (NTYPE(node)) { in noname_disable_map()
1774 r = noname_disable_map(&(NCAR(node)), map, counter); in noname_disable_map()
1775 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in noname_disable_map()
1780 Node** ptarget = &(NQTFR(node)->target); in noname_disable_map()
1784 onig_reduce_nested_quantifier(node, *ptarget); in noname_disable_map()
1791 EncloseNode* en = NENCLOSE(node); in noname_disable_map()
1802 onig_node_free(node); in noname_disable_map()
1812 if (NANCHOR(node)->target) in noname_disable_map()
1813 r = noname_disable_map(&(NANCHOR(node)->target), map, counter); in noname_disable_map()
1824 renumber_node_backref(Node* node, GroupNumRemap* map) in renumber_node_backref() argument
1828 BRefNode* bn = NBREF(node); in renumber_node_backref()
1852 renumber_by_map(Node* node, GroupNumRemap* map) in renumber_by_map() argument
1856 switch (NTYPE(node)) { in renumber_by_map()
1860 r = renumber_by_map(NCAR(node), map); in renumber_by_map()
1861 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in renumber_by_map()
1864 r = renumber_by_map(NQTFR(node)->target, map); in renumber_by_map()
1867 r = renumber_by_map(NENCLOSE(node)->target, map); in renumber_by_map()
1871 r = renumber_node_backref(node, map); in renumber_by_map()
1875 if (NANCHOR(node)->target) in renumber_by_map()
1876 r = renumber_by_map(NANCHOR(node)->target, map); in renumber_by_map()
1887 numbered_ref_check(Node* node) in numbered_ref_check() argument
1891 switch (NTYPE(node)) { in numbered_ref_check()
1895 r = numbered_ref_check(NCAR(node)); in numbered_ref_check()
1896 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in numbered_ref_check()
1899 r = numbered_ref_check(NQTFR(node)->target); in numbered_ref_check()
1902 r = numbered_ref_check(NENCLOSE(node)->target); in numbered_ref_check()
1906 if (! IS_BACKREF_NAME_REF(NBREF(node))) in numbered_ref_check()
1911 if (NANCHOR(node)->target) in numbered_ref_check()
1912 r = numbered_ref_check(NANCHOR(node)->target); in numbered_ref_check()
1985 quantifiers_memory_node_info(Node* node) in quantifiers_memory_node_info() argument
1989 switch (NTYPE(node)) { in quantifiers_memory_node_info()
1995 v = quantifiers_memory_node_info(NCAR(node)); in quantifiers_memory_node_info()
1997 } while (v >= 0 && IS_NOT_NULL(node = NCDR(node))); in quantifiers_memory_node_info()
2003 if (IS_CALL_RECURSION(NCALL(node))) { in quantifiers_memory_node_info()
2007 r = quantifiers_memory_node_info(NCALL(node)->target); in quantifiers_memory_node_info()
2013 QtfrNode* qn = NQTFR(node); in quantifiers_memory_node_info()
2022 EncloseNode* en = NENCLOSE(node); in quantifiers_memory_node_info()
2058 get_char_length_tree1(Node* node, regex_t* reg, int* len, int level) in get_char_length_tree1() argument
2065 switch (NTYPE(node)) { in get_char_length_tree1()
2068 r = get_char_length_tree1(NCAR(node), reg, &tlen, level); in get_char_length_tree1()
2071 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in get_char_length_tree1()
2079 r = get_char_length_tree1(NCAR(node), reg, &tlen, level); in get_char_length_tree1()
2080 while (r == 0 && IS_NOT_NULL(node = NCDR(node))) { in get_char_length_tree1()
2081 r = get_char_length_tree1(NCAR(node), reg, &tlen2, level); in get_char_length_tree1()
2102 StrNode* sn = NSTR(node); in get_char_length_tree1()
2113 QtfrNode* qn = NQTFR(node); in get_char_length_tree1()
2126 if (! IS_CALL_RECURSION(NCALL(node))) in get_char_length_tree1()
2127 r = get_char_length_tree1(NCALL(node)->target, reg, len, level); in get_char_length_tree1()
2144 EncloseNode* en = NENCLOSE(node); in get_char_length_tree1()
2154 SET_ENCLOSE_STATUS(node, NST_CLEN_FIXED); in get_char_length_tree1()
2181 get_char_length_tree(Node* node, regex_t* reg, int* len) in get_char_length_tree() argument
2183 return get_char_length_tree1(node, reg, len, 0); in get_char_length_tree()
2364 get_head_value_node(Node* node, int exact, regex_t* reg) in get_head_value_node() argument
2368 switch (NTYPE(node)) { in get_head_value_node()
2380 n = node; in get_head_value_node()
2385 n = get_head_value_node(NCAR(node), exact, reg); in get_head_value_node()
2390 StrNode* sn = NSTR(node); in get_head_value_node()
2396 !NSTRING_IS_RAW(node) && IS_IGNORECASE(reg->options)) { in get_head_value_node()
2399 n = node; in get_head_value_node()
2406 QtfrNode* qn = NQTFR(node); in get_head_value_node()
2418 EncloseNode* en = NENCLOSE(node); in get_head_value_node()
2424 reg->options = NENCLOSE(node)->option; in get_head_value_node()
2425 n = get_head_value_node(NENCLOSE(node)->target, exact, reg); in get_head_value_node()
2439 if (NANCHOR(node)->type == ANCHOR_PREC_READ) in get_head_value_node()
2440 n = get_head_value_node(NANCHOR(node)->target, exact, reg); in get_head_value_node()
2451 check_type_tree(Node* node, int type_mask, int enclose_mask, int anchor_mask) in check_type_tree() argument
2455 type = NTYPE(node); in check_type_tree()
2463 r = check_type_tree(NCAR(node), type_mask, enclose_mask, in check_type_tree()
2465 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in check_type_tree()
2469 r = check_type_tree(NQTFR(node)->target, type_mask, enclose_mask, in check_type_tree()
2475 EncloseNode* en = NENCLOSE(node); in check_type_tree()
2484 type = NANCHOR(node)->type; in check_type_tree()
2488 if (NANCHOR(node)->target) in check_type_tree()
2489 r = check_type_tree(NANCHOR(node)->target, in check_type_tree()
2500 get_min_len(Node* node, OnigLen *min, ScanEnv* env) in get_min_len() argument
2506 switch (NTYPE(node)) { in get_min_len()
2512 BRefNode* br = NBREF(node); in get_min_len()
2530 if (IS_CALL_RECURSION(NCALL(node))) { in get_min_len()
2531 EncloseNode* en = NENCLOSE(NCALL(node)->target); in get_min_len()
2536 r = get_min_len(NCALL(node)->target, min, env); in get_min_len()
2542 r = get_min_len(NCAR(node), &tmin, env); in get_min_len()
2544 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in get_min_len()
2550 y = node; in get_min_len()
2555 if (y == node) *min = tmin; in get_min_len()
2563 StrNode* sn = NSTR(node); in get_min_len()
2579 QtfrNode* qn = NQTFR(node); in get_min_len()
2591 EncloseNode* en = NENCLOSE(node); in get_min_len()
2597 if (IS_ENCLOSE_MARK1(NENCLOSE(node))) in get_min_len()
2600 SET_ENCLOSE_STATUS(node, NST_MARK1); in get_min_len()
2602 CLEAR_ENCLOSE_STATUS(node, NST_MARK1); in get_min_len()
2605 SET_ENCLOSE_STATUS(node, NST_MIN_FIXED); in get_min_len()
2628 get_max_len(Node* node, OnigLen *max, ScanEnv* env) in get_max_len() argument
2634 switch (NTYPE(node)) { in get_max_len()
2637 r = get_max_len(NCAR(node), &tmax, env); in get_max_len()
2640 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in get_max_len()
2645 r = get_max_len(NCAR(node), &tmax, env); in get_max_len()
2647 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in get_max_len()
2652 StrNode* sn = NSTR(node); in get_max_len()
2671 BRefNode* br = NBREF(node); in get_max_len()
2688 if (! IS_CALL_RECURSION(NCALL(node))) in get_max_len()
2689 r = get_max_len(NCALL(node)->target, max, env); in get_max_len()
2697 QtfrNode* qn = NQTFR(node); in get_max_len()
2713 EncloseNode* en = NENCLOSE(node); in get_max_len()
2719 if (IS_ENCLOSE_MARK1(NENCLOSE(node))) in get_max_len()
2722 SET_ENCLOSE_STATUS(node, NST_MARK1); in get_max_len()
2724 CLEAR_ENCLOSE_STATUS(node, NST_MARK1); in get_max_len()
2727 SET_ENCLOSE_STATUS(node, NST_MAX_FIXED); in get_max_len()
2756 subexp_inf_recursive_check(Node* node, ScanEnv* env, int head) in subexp_inf_recursive_check() argument
2761 type = NTYPE(node); in subexp_inf_recursive_check()
2769 x = node; in subexp_inf_recursive_check()
2788 ret = subexp_inf_recursive_check(NCAR(node), env, head); in subexp_inf_recursive_check()
2791 } while (IS_NOT_NULL(node = NCDR(node))); in subexp_inf_recursive_check()
2796 r = subexp_inf_recursive_check(NQTFR(node)->target, env, head); in subexp_inf_recursive_check()
2798 if (NQTFR(node)->lower == 0) r = 0; in subexp_inf_recursive_check()
2804 AnchorNode* an = NANCHOR(node); in subexp_inf_recursive_check()
2817 r = subexp_inf_recursive_check(NCALL(node)->target, env, head); in subexp_inf_recursive_check()
2821 if (IS_ENCLOSE_MARK2(NENCLOSE(node))) in subexp_inf_recursive_check()
2823 else if (IS_ENCLOSE_MARK1(NENCLOSE(node))) in subexp_inf_recursive_check()
2826 SET_ENCLOSE_STATUS(node, NST_MARK2); in subexp_inf_recursive_check()
2827 r = subexp_inf_recursive_check(NENCLOSE(node)->target, env, head); in subexp_inf_recursive_check()
2828 CLEAR_ENCLOSE_STATUS(node, NST_MARK2); in subexp_inf_recursive_check()
2840 subexp_inf_recursive_check_trav(Node* node, ScanEnv* env) in subexp_inf_recursive_check_trav() argument
2845 type = NTYPE(node); in subexp_inf_recursive_check_trav()
2850 r = subexp_inf_recursive_check_trav(NCAR(node), env); in subexp_inf_recursive_check_trav()
2851 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in subexp_inf_recursive_check_trav()
2855 r = subexp_inf_recursive_check_trav(NQTFR(node)->target, env); in subexp_inf_recursive_check_trav()
2860 AnchorNode* an = NANCHOR(node); in subexp_inf_recursive_check_trav()
2874 EncloseNode* en = NENCLOSE(node); in subexp_inf_recursive_check_trav()
2877 SET_ENCLOSE_STATUS(node, NST_MARK1); in subexp_inf_recursive_check_trav()
2880 CLEAR_ENCLOSE_STATUS(node, NST_MARK1); in subexp_inf_recursive_check_trav()
2894 subexp_recursive_check(Node* node) in subexp_recursive_check() argument
2898 switch (NTYPE(node)) { in subexp_recursive_check()
2902 r |= subexp_recursive_check(NCAR(node)); in subexp_recursive_check()
2903 } while (IS_NOT_NULL(node = NCDR(node))); in subexp_recursive_check()
2907 r = subexp_recursive_check(NQTFR(node)->target); in subexp_recursive_check()
2912 AnchorNode* an = NANCHOR(node); in subexp_recursive_check()
2925 r = subexp_recursive_check(NCALL(node)->target); in subexp_recursive_check()
2926 if (r != 0) SET_CALL_RECURSION(node); in subexp_recursive_check()
2930 if (IS_ENCLOSE_MARK2(NENCLOSE(node))) in subexp_recursive_check()
2932 else if (IS_ENCLOSE_MARK1(NENCLOSE(node))) in subexp_recursive_check()
2935 SET_ENCLOSE_STATUS(node, NST_MARK2); in subexp_recursive_check()
2936 r = subexp_recursive_check(NENCLOSE(node)->target); in subexp_recursive_check()
2937 CLEAR_ENCLOSE_STATUS(node, NST_MARK2); in subexp_recursive_check()
2950 subexp_recursive_check_trav(Node* node, ScanEnv* env) in subexp_recursive_check_trav() argument
2957 type = NTYPE(node); in subexp_recursive_check_trav()
2964 ret = subexp_recursive_check_trav(NCAR(node), env); in subexp_recursive_check_trav()
2967 } while (IS_NOT_NULL(node = NCDR(node))); in subexp_recursive_check_trav()
2972 r = subexp_recursive_check_trav(NQTFR(node)->target, env); in subexp_recursive_check_trav()
2973 if (NQTFR(node)->upper == 0) { in subexp_recursive_check_trav()
2975 NQTFR(node)->is_refered = 1; in subexp_recursive_check_trav()
2981 AnchorNode* an = NANCHOR(node); in subexp_recursive_check_trav()
2995 EncloseNode* en = NENCLOSE(node); in subexp_recursive_check_trav()
2999 SET_ENCLOSE_STATUS(node, NST_MARK1); in subexp_recursive_check_trav()
3001 if (r != 0) SET_ENCLOSE_STATUS(node, NST_RECURSION); in subexp_recursive_check_trav()
3002 CLEAR_ENCLOSE_STATUS(node, NST_MARK1); in subexp_recursive_check_trav()
3019 setup_subexp_call(Node* node, ScanEnv* env) in setup_subexp_call() argument
3024 type = NTYPE(node); in setup_subexp_call()
3028 r = setup_subexp_call(NCAR(node), env); in setup_subexp_call()
3029 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in setup_subexp_call()
3034 r = setup_subexp_call(NCAR(node), env); in setup_subexp_call()
3035 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in setup_subexp_call()
3039 r = setup_subexp_call(NQTFR(node)->target, env); in setup_subexp_call()
3042 r = setup_subexp_call(NENCLOSE(node)->target, env); in setup_subexp_call()
3047 CallNode* cn = NCALL(node); in setup_subexp_call()
3106 AnchorNode* an = NANCHOR(node); in setup_subexp_call()
3132 divide_look_behind_alternatives(Node* node) in divide_look_behind_alternatives() argument
3135 AnchorNode* an = NANCHOR(node); in divide_look_behind_alternatives()
3142 swap_node(node, head); in divide_look_behind_alternatives()
3143 NCAR(node) = head; in divide_look_behind_alternatives()
3146 np = node; in divide_look_behind_alternatives()
3155 np = node; in divide_look_behind_alternatives()
3164 setup_look_behind(Node* node, regex_t* reg, ScanEnv* env) in setup_look_behind() argument
3167 AnchorNode* an = NANCHOR(node); in setup_look_behind()
3178 r = divide_look_behind_alternatives(node); in setup_look_behind()
3187 next_setup(Node* node, Node* next_node, regex_t* reg) in next_setup() argument
3192 type = NTYPE(node); in next_setup()
3194 QtfrNode* qn = NQTFR(node); in next_setup()
3215 swap_node(node, en); in next_setup()
3216 NENCLOSE(node)->target = en; in next_setup()
3224 EncloseNode* en = NENCLOSE(node); in next_setup()
3226 node = en->target; in next_setup()
3235 update_string_node_case_fold(regex_t* reg, Node *node) in update_string_node_case_fold() argument
3240 StrNode* sn = NSTR(node); in update_string_node_case_fold()
3265 r = onig_node_str_set(node, sbuf, sp); in update_string_node_case_fold()
3280 Node *node; in expand_case_fold_make_rem_string() local
3282 node = onig_node_new_str(s, end); in expand_case_fold_make_rem_string()
3283 if (IS_NULL(node)) return ONIGERR_MEMORY; in expand_case_fold_make_rem_string()
3285 r = update_string_node_case_fold(reg, node); in expand_case_fold_make_rem_string()
3287 onig_node_free(node); in expand_case_fold_make_rem_string()
3291 NSTRING_SET_AMBIG(node); in expand_case_fold_make_rem_string()
3292 NSTRING_SET_DONT_GET_OPT_INFO(node); in expand_case_fold_make_rem_string()
3293 *rnode = node; in expand_case_fold_make_rem_string()
3410 expand_case_fold_string(Node* node, regex_t* reg) in expand_case_fold_string() argument
3418 StrNode* sn = NSTR(node); in expand_case_fold_string()
3420 if (NSTRING_IS_AMBIG(node)) return 0; in expand_case_fold_string()
3533 swap_node(node, top_root); in expand_case_fold_string()
3556 setup_comb_exp_check(Node* node, int state, ScanEnv* env) in setup_comb_exp_check() argument
3561 type = NTYPE(node); in setup_comb_exp_check()
3567 r = setup_comb_exp_check(NCAR(node), r, env); in setup_comb_exp_check()
3568 prev = NCAR(node); in setup_comb_exp_check()
3569 } while (r >= 0 && IS_NOT_NULL(node = NCDR(node))); in setup_comb_exp_check()
3577 ret = setup_comb_exp_check(NCAR(node), state, env); in setup_comb_exp_check()
3579 } while (ret >= 0 && IS_NOT_NULL(node = NCDR(node))); in setup_comb_exp_check()
3587 QtfrNode* qn = NQTFR(node); in setup_comb_exp_check()
3650 EncloseNode* en = NENCLOSE(node); in setup_comb_exp_check()
3671 if (IS_CALL_RECURSION(NCALL(node))) in setup_comb_exp_check()
3674 r = setup_comb_exp_check(NCALL(node)->target, state, env); in setup_comb_exp_check()
3702 setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env) in setup_tree() argument
3707 type = NTYPE(node); in setup_tree()
3713 r = setup_tree(NCAR(node), reg, state, env); in setup_tree()
3715 r = next_setup(prev, NCAR(node), reg); in setup_tree()
3717 prev = NCAR(node); in setup_tree()
3718 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in setup_tree()
3724 r = setup_tree(NCAR(node), reg, (state | IN_ALT), env); in setup_tree()
3725 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in setup_tree()
3732 if (IS_IGNORECASE(reg->options) && !NSTRING_IS_RAW(node)) { in setup_tree()
3733 r = expand_case_fold_string(node, reg); in setup_tree()
3751 BRefNode* br = NBREF(node); in setup_tree()
3770 QtfrNode* qn = NQTFR(node); in setup_tree()
3819 onig_node_conv_to_str_node(node, NSTR(target)->flag); in setup_tree()
3821 r = onig_node_str_cat(node, sn->s, sn->end); in setup_tree()
3849 EncloseNode* en = NENCLOSE(node); in setup_tree()
3855 reg->options = NENCLOSE(node)->option; in setup_tree()
3856 r = setup_tree(NENCLOSE(node)->target, reg, state, env); in setup_tree()
3871 SET_CALL_RECURSION(node); in setup_tree()
3885 SET_ENCLOSE_STATUS(node, NST_STOP_BT_SIMPLE_REPEAT); in setup_tree()
3896 AnchorNode* an = NANCHOR(node); in setup_tree()
3928 r = setup_look_behind(node, reg, env); in setup_tree()
3940 r = setup_look_behind(node, reg, env); in setup_tree()
4595 optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) in optimize_node_left() argument
4603 type = NTYPE(node); in optimize_node_left()
4609 Node* nd = node; in optimize_node_left()
4625 Node* nd = node; in optimize_node_left()
4630 if (nd == node) copy_node_opt_info(opt, &nopt); in optimize_node_left()
4639 StrNode* sn = NSTR(node); in optimize_node_left()
4641 int is_raw = NSTRING_IS_RAW(node); in optimize_node_left()
4643 if (! NSTRING_IS_AMBIG(node)) { in optimize_node_left()
4645 NSTRING_IS_RAW(node), env->enc); in optimize_node_left()
4654 if (NSTRING_IS_DONT_GET_OPT_INFO(node)) { in optimize_node_left()
4683 CClassNode* cc = NCCLASS(node); in optimize_node_left()
4714 switch (NCTYPE(node)->ctype) { in optimize_node_left()
4716 if (NCTYPE(node)->not != 0) { in optimize_node_left()
4749 switch (NANCHOR(node)->type) { in optimize_node_left()
4758 add_opt_anc_info(&opt->anc, NANCHOR(node)->type); in optimize_node_left()
4765 r = optimize_node_left(NANCHOR(node)->target, &nopt, env); in optimize_node_left()
4791 BRefNode* br = NBREF(node); in optimize_node_left()
4816 if (IS_CALL_RECURSION(NCALL(node))) in optimize_node_left()
4820 env->options = NENCLOSE(NCALL(node)->target)->option; in optimize_node_left()
4821 r = optimize_node_left(NCALL(node)->target, opt, env); in optimize_node_left()
4832 QtfrNode* qn = NQTFR(node); in optimize_node_left()
4882 EncloseNode* en = NENCLOSE(node); in optimize_node_left()
4929 NTYPE(node)); in optimize_node_left()
5014 set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env) in set_optimize_info_from_tree() argument
5027 r = optimize_node_left(node, &opt, &env); in set_optimize_info_from_tree()
5285 static void print_tree P_((FILE* f, Node* node));
6118 print_indent_tree(FILE* f, Node* node, int indent) in print_indent_tree() argument
6125 if (IS_NULL(node)) { in print_indent_tree()
6130 type = NTYPE(node); in print_indent_tree()
6134 if (NTYPE(node) == NT_LIST) in print_indent_tree()
6135 fprintf(f, "<list:%p>\n", node); in print_indent_tree()
6137 fprintf(f, "<alt:%p>\n", node); in print_indent_tree()
6139 print_indent_tree(f, NCAR(node), indent + add); in print_indent_tree()
6140 while (IS_NOT_NULL(node = NCDR(node))) { in print_indent_tree()
6141 if (NTYPE(node) != type) { in print_indent_tree()
6142 fprintf(f, "ERROR: list/alt right is not a cons. %d\n", NTYPE(node)); in print_indent_tree()
6145 print_indent_tree(f, NCAR(node), indent + add); in print_indent_tree()
6151 (NSTRING_IS_RAW(node) ? "-raw" : ""), node); in print_indent_tree()
6152 for (p = NSTR(node)->s; p < NSTR(node)->end; p++) { in print_indent_tree()
6162 fprintf(f, "<cclass:%p>", node); in print_indent_tree()
6163 if (IS_NCCLASS_NOT(NCCLASS(node))) fputs(" not", f); in print_indent_tree()
6164 if (NCCLASS(node)->mbuf) { in print_indent_tree()
6165 BBuf* bbuf = NCCLASS(node)->mbuf; in print_indent_tree()
6174 fprintf(f, "<ctype:%p> ", node); in print_indent_tree()
6175 switch (NCTYPE(node)->ctype) { in print_indent_tree()
6177 if (NCTYPE(node)->not != 0) in print_indent_tree()
6190 fprintf(f, "<anychar:%p>", node); in print_indent_tree()
6194 fprintf(f, "<anchor:%p> ", node); in print_indent_tree()
6195 switch (NANCHOR(node)->type) { in print_indent_tree()
6211 print_indent_tree(f, NANCHOR(node)->target, indent + add); in print_indent_tree()
6215 print_indent_tree(f, NANCHOR(node)->target, indent + add); in print_indent_tree()
6219 print_indent_tree(f, NANCHOR(node)->target, indent + add); in print_indent_tree()
6223 print_indent_tree(f, NANCHOR(node)->target, indent + add); in print_indent_tree()
6235 BRefNode* br = NBREF(node); in print_indent_tree()
6237 fprintf(f, "<backref:%p>", node); in print_indent_tree()
6248 CallNode* cn = NCALL(node); in print_indent_tree()
6249 fprintf(f, "<call:%p>", node); in print_indent_tree()
6256 fprintf(f, "<quantifier:%p>{%d,%d}%s\n", node, in print_indent_tree()
6257 NQTFR(node)->lower, NQTFR(node)->upper, in print_indent_tree()
6258 (NQTFR(node)->greedy ? "" : "?")); in print_indent_tree()
6259 print_indent_tree(f, NQTFR(node)->target, indent + add); in print_indent_tree()
6263 fprintf(f, "<enclose:%p> ", node); in print_indent_tree()
6264 switch (NENCLOSE(node)->type) { in print_indent_tree()
6266 fprintf(f, "option:%d", NENCLOSE(node)->option); in print_indent_tree()
6269 fprintf(f, "memory:%d", NENCLOSE(node)->regnum); in print_indent_tree()
6279 print_indent_tree(f, NENCLOSE(node)->target, indent + add); in print_indent_tree()
6283 fprintf(f, "print_indent_tree: undefined node type %d\n", NTYPE(node)); in print_indent_tree()
6296 print_tree(FILE* f, Node* node) in print_tree() argument
6298 print_indent_tree(f, node, 0); in print_tree()