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()
1236 if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) in compile_length_enclose_node()
1241 len += tlen + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum) in compile_length_enclose_node()
1247 if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) { in compile_length_enclose_node()
1248 QtfrNode* qn = NQTFR(node->target); in compile_length_enclose_node()
1268 static int get_char_length_tree(Node* node, regex_t* reg, int* len);
1271 compile_enclose_node(EncloseNode* node, regex_t* reg) in compile_enclose_node() argument
1275 if (node->type == ENCLOSE_OPTION) in compile_enclose_node()
1276 return compile_option_node(node, reg); in compile_enclose_node()
1278 switch (node->type) { in compile_enclose_node()
1281 if (IS_ENCLOSE_CALLED(node)) { in compile_enclose_node()
1284 node->call_addr = BBUF_GET_OFFSET_POS(reg) + SIZE_ABSADDR + SIZE_OP_JUMP; in compile_enclose_node()
1285 node->state |= NST_ADDR_FIXED; in compile_enclose_node()
1286 r = add_abs_addr(reg, (int )node->call_addr); in compile_enclose_node()
1288 len = compile_length_tree(node->target, reg); in compile_enclose_node()
1290 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_enclose_node()
1291 len += (IS_ENCLOSE_RECURSION(node) in compile_enclose_node()
1294 len += (IS_ENCLOSE_RECURSION(node) in compile_enclose_node()
1301 if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) in compile_enclose_node()
1306 r = add_mem_num(reg, node->regnum); in compile_enclose_node()
1308 r = compile_tree(node->target, reg); in compile_enclose_node()
1311 if (IS_ENCLOSE_CALLED(node)) { in compile_enclose_node()
1312 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_enclose_node()
1313 r = add_opcode(reg, (IS_ENCLOSE_RECURSION(node) in compile_enclose_node()
1316 r = add_opcode(reg, (IS_ENCLOSE_RECURSION(node) in compile_enclose_node()
1320 r = add_mem_num(reg, node->regnum); in compile_enclose_node()
1327 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_enclose_node()
1332 r = add_mem_num(reg, node->regnum); in compile_enclose_node()
1337 if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) { in compile_enclose_node()
1338 QtfrNode* qn = NQTFR(node->target); in compile_enclose_node()
1357 r = compile_tree(node->target, reg); in compile_enclose_node()
1372 compile_length_anchor_node(AnchorNode* node, regex_t* reg) in compile_length_anchor_node() argument
1377 if (node->target) { in compile_length_anchor_node()
1378 tlen = compile_length_tree(node->target, reg); in compile_length_anchor_node()
1382 switch (node->type) { in compile_length_anchor_node()
1405 compile_anchor_node(AnchorNode* node, regex_t* reg) in compile_anchor_node() argument
1409 switch (node->type) { in compile_anchor_node()
1427 r = compile_tree(node->target, reg); in compile_anchor_node()
1433 len = compile_length_tree(node->target, reg); in compile_anchor_node()
1437 r = compile_tree(node->target, reg); in compile_anchor_node()
1447 if (node->char_len < 0) { in compile_anchor_node()
1448 r = get_char_length_tree(node->target, reg, &n); in compile_anchor_node()
1452 n = node->char_len; in compile_anchor_node()
1455 r = compile_tree(node->target, reg); in compile_anchor_node()
1462 len = compile_length_tree(node->target, reg); in compile_anchor_node()
1466 if (node->char_len < 0) { in compile_anchor_node()
1467 r = get_char_length_tree(node->target, reg, &n); in compile_anchor_node()
1471 n = node->char_len; in compile_anchor_node()
1474 r = compile_tree(node->target, reg); in compile_anchor_node()
1489 compile_length_tree(Node* node, regex_t* reg) in compile_length_tree() argument
1493 type = NTYPE(node); in compile_length_tree()
1498 r = compile_length_tree(NCAR(node), reg); in compile_length_tree()
1501 } while (IS_NOT_NULL(node = NCDR(node))); in compile_length_tree()
1511 r += compile_length_tree(NCAR(node), reg); in compile_length_tree()
1513 } while (IS_NOT_NULL(node = NCDR(node))); in compile_length_tree()
1519 if (NSTRING_IS_RAW(node)) in compile_length_tree()
1520 r = compile_length_string_raw_node(NSTR(node), reg); in compile_length_tree()
1522 r = compile_length_string_node(node, reg); in compile_length_tree()
1526 r = compile_length_cclass_node(NCCLASS(node), reg); in compile_length_tree()
1536 BRefNode* br = NBREF(node); in compile_length_tree()
1562 r = compile_length_quantifier_node(NQTFR(node), reg); in compile_length_tree()
1566 r = compile_length_enclose_node(NENCLOSE(node), reg); in compile_length_tree()
1570 r = compile_length_anchor_node(NANCHOR(node), reg); in compile_length_tree()
1582 compile_tree(Node* node, regex_t* reg) in compile_tree() argument
1586 type = NTYPE(node); in compile_tree()
1590 r = compile_tree(NCAR(node), reg); in compile_tree()
1591 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in compile_tree()
1596 Node* x = node; in compile_tree()
1607 len = compile_length_tree(NCAR(node), reg); in compile_tree()
1608 if (IS_NOT_NULL(NCDR(node))) { in compile_tree()
1612 r = compile_tree(NCAR(node), reg); in compile_tree()
1614 if (IS_NOT_NULL(NCDR(node))) { in compile_tree()
1619 } while (IS_NOT_NULL(node = NCDR(node))); in compile_tree()
1624 if (NSTRING_IS_RAW(node)) in compile_tree()
1625 r = compile_string_raw_node(NSTR(node), reg); in compile_tree()
1627 r = compile_string_node(node, reg); in compile_tree()
1631 r = compile_cclass_node(NCCLASS(node), reg); in compile_tree()
1638 switch (NCTYPE(node)->ctype) { in compile_tree()
1640 if (NCTYPE(node)->not != 0) op = OP_NOT_WORD; in compile_tree()
1660 BRefNode* br = NBREF(node); in compile_tree()
1722 r = compile_call(NCALL(node), reg); in compile_tree()
1727 r = compile_quantifier_node(NQTFR(node), reg); in compile_tree()
1731 r = compile_enclose_node(NENCLOSE(node), reg); in compile_tree()
1735 r = compile_anchor_node(NANCHOR(node), reg); in compile_tree()
1740 fprintf(stderr, "compile_tree: undefined node type %d\n", NTYPE(node)); in compile_tree()
1754 Node* node = *plink; in noname_disable_map() local
1756 switch (NTYPE(node)) { in noname_disable_map()
1760 r = noname_disable_map(&(NCAR(node)), map, counter); in noname_disable_map()
1761 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in noname_disable_map()
1766 Node** ptarget = &(NQTFR(node)->target); in noname_disable_map()
1770 onig_reduce_nested_quantifier(node, *ptarget); in noname_disable_map()
1777 EncloseNode* en = NENCLOSE(node); in noname_disable_map()
1788 onig_node_free(node); in noname_disable_map()
1805 renumber_node_backref(Node* node, GroupNumRemap* map) in renumber_node_backref() argument
1809 BRefNode* bn = NBREF(node); in renumber_node_backref()
1833 renumber_by_map(Node* node, GroupNumRemap* map) in renumber_by_map() argument
1837 switch (NTYPE(node)) { in renumber_by_map()
1841 r = renumber_by_map(NCAR(node), map); in renumber_by_map()
1842 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in renumber_by_map()
1845 r = renumber_by_map(NQTFR(node)->target, map); in renumber_by_map()
1848 r = renumber_by_map(NENCLOSE(node)->target, map); in renumber_by_map()
1852 r = renumber_node_backref(node, map); in renumber_by_map()
1863 numbered_ref_check(Node* node) in numbered_ref_check() argument
1867 switch (NTYPE(node)) { in numbered_ref_check()
1871 r = numbered_ref_check(NCAR(node)); in numbered_ref_check()
1872 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in numbered_ref_check()
1875 r = numbered_ref_check(NQTFR(node)->target); in numbered_ref_check()
1878 r = numbered_ref_check(NENCLOSE(node)->target); in numbered_ref_check()
1882 if (! IS_BACKREF_NAME_REF(NBREF(node))) in numbered_ref_check()
1956 quantifiers_memory_node_info(Node* node) in quantifiers_memory_node_info() argument
1960 switch (NTYPE(node)) { in quantifiers_memory_node_info()
1966 v = quantifiers_memory_node_info(NCAR(node)); in quantifiers_memory_node_info()
1968 } while (v >= 0 && IS_NOT_NULL(node = NCDR(node))); in quantifiers_memory_node_info()
1974 if (IS_CALL_RECURSION(NCALL(node))) { in quantifiers_memory_node_info()
1978 r = quantifiers_memory_node_info(NCALL(node)->target); in quantifiers_memory_node_info()
1984 QtfrNode* qn = NQTFR(node); in quantifiers_memory_node_info()
1993 EncloseNode* en = NENCLOSE(node); in quantifiers_memory_node_info()
2024 get_min_match_length(Node* node, OnigDistance *min, ScanEnv* env) in get_min_match_length() argument
2030 switch (NTYPE(node)) { in get_min_match_length()
2036 BRefNode* br = NBREF(node); in get_min_match_length()
2054 if (IS_CALL_RECURSION(NCALL(node))) { in get_min_match_length()
2055 EncloseNode* en = NENCLOSE(NCALL(node)->target); in get_min_match_length()
2060 r = get_min_match_length(NCALL(node)->target, min, env); in get_min_match_length()
2066 r = get_min_match_length(NCAR(node), &tmin, env); in get_min_match_length()
2068 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in get_min_match_length()
2074 y = node; in get_min_match_length()
2079 if (y == node) *min = tmin; in get_min_match_length()
2087 StrNode* sn = NSTR(node); in get_min_match_length()
2103 QtfrNode* qn = NQTFR(node); in get_min_match_length()
2115 EncloseNode* en = NENCLOSE(node); in get_min_match_length()
2125 SET_ENCLOSE_STATUS(node, NST_MIN_FIXED); in get_min_match_length()
2147 get_max_match_length(Node* node, OnigDistance *max, ScanEnv* env) in get_max_match_length() argument
2153 switch (NTYPE(node)) { in get_max_match_length()
2156 r = get_max_match_length(NCAR(node), &tmax, env); in get_max_match_length()
2159 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in get_max_match_length()
2164 r = get_max_match_length(NCAR(node), &tmax, env); in get_max_match_length()
2166 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in get_max_match_length()
2171 StrNode* sn = NSTR(node); in get_max_match_length()
2190 BRefNode* br = NBREF(node); in get_max_match_length()
2207 if (! IS_CALL_RECURSION(NCALL(node))) in get_max_match_length()
2208 r = get_max_match_length(NCALL(node)->target, max, env); in get_max_match_length()
2216 QtfrNode* qn = NQTFR(node); in get_max_match_length()
2232 EncloseNode* en = NENCLOSE(node); in get_max_match_length()
2242 SET_ENCLOSE_STATUS(node, NST_MAX_FIXED); in get_max_match_length()
2268 get_char_length_tree1(Node* node, regex_t* reg, int* len, int level) in get_char_length_tree1() argument
2275 switch (NTYPE(node)) { in get_char_length_tree1()
2278 r = get_char_length_tree1(NCAR(node), reg, &tlen, level); in get_char_length_tree1()
2281 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in get_char_length_tree1()
2289 r = get_char_length_tree1(NCAR(node), reg, &tlen, level); in get_char_length_tree1()
2290 while (r == 0 && IS_NOT_NULL(node = NCDR(node))) { in get_char_length_tree1()
2291 r = get_char_length_tree1(NCAR(node), reg, &tlen2, level); in get_char_length_tree1()
2312 StrNode* sn = NSTR(node); in get_char_length_tree1()
2323 QtfrNode* qn = NQTFR(node); in get_char_length_tree1()
2336 if (! IS_CALL_RECURSION(NCALL(node))) in get_char_length_tree1()
2337 r = get_char_length_tree1(NCALL(node)->target, reg, len, level); in get_char_length_tree1()
2354 EncloseNode* en = NENCLOSE(node); in get_char_length_tree1()
2364 SET_ENCLOSE_STATUS(node, NST_CLEN_FIXED); in get_char_length_tree1()
2391 get_char_length_tree(Node* node, regex_t* reg, int* len) in get_char_length_tree() argument
2393 return get_char_length_tree1(node, reg, len, 0); in get_char_length_tree()
2573 get_head_value_node(Node* node, int exact, regex_t* reg) in get_head_value_node() argument
2577 switch (NTYPE(node)) { in get_head_value_node()
2589 n = node; in get_head_value_node()
2594 n = get_head_value_node(NCAR(node), exact, reg); in get_head_value_node()
2599 StrNode* sn = NSTR(node); in get_head_value_node()
2605 !NSTRING_IS_RAW(node) && IS_IGNORECASE(reg->options)) { in get_head_value_node()
2608 n = node; in get_head_value_node()
2615 QtfrNode* qn = NQTFR(node); in get_head_value_node()
2627 EncloseNode* en = NENCLOSE(node); in get_head_value_node()
2633 reg->options = NENCLOSE(node)->option; in get_head_value_node()
2634 n = get_head_value_node(NENCLOSE(node)->target, exact, reg); in get_head_value_node()
2648 if (NANCHOR(node)->type == ANCHOR_PREC_READ) in get_head_value_node()
2649 n = get_head_value_node(NANCHOR(node)->target, exact, reg); in get_head_value_node()
2660 check_type_tree(Node* node, int type_mask, int enclose_mask, int anchor_mask) in check_type_tree() argument
2664 type = NTYPE(node); in check_type_tree()
2672 r = check_type_tree(NCAR(node), type_mask, enclose_mask, in check_type_tree()
2674 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in check_type_tree()
2678 r = check_type_tree(NQTFR(node)->target, type_mask, enclose_mask, in check_type_tree()
2684 EncloseNode* en = NENCLOSE(node); in check_type_tree()
2693 type = NANCHOR(node)->type; in check_type_tree()
2697 if (NANCHOR(node)->target) in check_type_tree()
2698 r = check_type_tree(NANCHOR(node)->target, in check_type_tree()
2714 subexp_inf_recursive_check(Node* node, ScanEnv* env, int head) in subexp_inf_recursive_check() argument
2719 type = NTYPE(node); in subexp_inf_recursive_check()
2727 x = node; in subexp_inf_recursive_check()
2746 ret = subexp_inf_recursive_check(NCAR(node), env, head); in subexp_inf_recursive_check()
2749 } while (IS_NOT_NULL(node = NCDR(node))); in subexp_inf_recursive_check()
2754 r = subexp_inf_recursive_check(NQTFR(node)->target, env, head); in subexp_inf_recursive_check()
2756 if (NQTFR(node)->lower == 0) r = 0; in subexp_inf_recursive_check()
2762 AnchorNode* an = NANCHOR(node); in subexp_inf_recursive_check()
2775 r = subexp_inf_recursive_check(NCALL(node)->target, env, head); in subexp_inf_recursive_check()
2779 if (IS_ENCLOSE_MARK2(NENCLOSE(node))) in subexp_inf_recursive_check()
2781 else if (IS_ENCLOSE_MARK1(NENCLOSE(node))) in subexp_inf_recursive_check()
2784 SET_ENCLOSE_STATUS(node, NST_MARK2); in subexp_inf_recursive_check()
2785 r = subexp_inf_recursive_check(NENCLOSE(node)->target, env, head); in subexp_inf_recursive_check()
2786 CLEAR_ENCLOSE_STATUS(node, NST_MARK2); in subexp_inf_recursive_check()
2798 subexp_inf_recursive_check_trav(Node* node, ScanEnv* env) in subexp_inf_recursive_check_trav() argument
2803 type = NTYPE(node); in subexp_inf_recursive_check_trav()
2808 r = subexp_inf_recursive_check_trav(NCAR(node), env); in subexp_inf_recursive_check_trav()
2809 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in subexp_inf_recursive_check_trav()
2813 r = subexp_inf_recursive_check_trav(NQTFR(node)->target, env); in subexp_inf_recursive_check_trav()
2818 AnchorNode* an = NANCHOR(node); in subexp_inf_recursive_check_trav()
2832 EncloseNode* en = NENCLOSE(node); in subexp_inf_recursive_check_trav()
2835 SET_ENCLOSE_STATUS(node, NST_MARK1); in subexp_inf_recursive_check_trav()
2838 CLEAR_ENCLOSE_STATUS(node, NST_MARK1); in subexp_inf_recursive_check_trav()
2853 subexp_recursive_check(Node* node) in subexp_recursive_check() argument
2857 switch (NTYPE(node)) { in subexp_recursive_check()
2861 r |= subexp_recursive_check(NCAR(node)); in subexp_recursive_check()
2862 } while (IS_NOT_NULL(node = NCDR(node))); in subexp_recursive_check()
2866 r = subexp_recursive_check(NQTFR(node)->target); in subexp_recursive_check()
2871 AnchorNode* an = NANCHOR(node); in subexp_recursive_check()
2884 r = subexp_recursive_check(NCALL(node)->target); in subexp_recursive_check()
2885 if (r != 0) SET_CALL_RECURSION(node); in subexp_recursive_check()
2889 if (IS_ENCLOSE_MARK2(NENCLOSE(node))) in subexp_recursive_check()
2891 else if (IS_ENCLOSE_MARK1(NENCLOSE(node))) in subexp_recursive_check()
2894 SET_ENCLOSE_STATUS(node, NST_MARK2); in subexp_recursive_check()
2895 r = subexp_recursive_check(NENCLOSE(node)->target); in subexp_recursive_check()
2896 CLEAR_ENCLOSE_STATUS(node, NST_MARK2); in subexp_recursive_check()
2909 subexp_recursive_check_trav(Node* node, ScanEnv* env) in subexp_recursive_check_trav() argument
2916 type = NTYPE(node); in subexp_recursive_check_trav()
2923 ret = subexp_recursive_check_trav(NCAR(node), env); in subexp_recursive_check_trav()
2926 } while (IS_NOT_NULL(node = NCDR(node))); in subexp_recursive_check_trav()
2931 r = subexp_recursive_check_trav(NQTFR(node)->target, env); in subexp_recursive_check_trav()
2932 if (NQTFR(node)->upper == 0) { in subexp_recursive_check_trav()
2934 NQTFR(node)->is_refered = 1; in subexp_recursive_check_trav()
2940 AnchorNode* an = NANCHOR(node); in subexp_recursive_check_trav()
2954 EncloseNode* en = NENCLOSE(node); in subexp_recursive_check_trav()
2958 SET_ENCLOSE_STATUS(node, NST_MARK1); in subexp_recursive_check_trav()
2960 if (r != 0) SET_ENCLOSE_STATUS(node, NST_RECURSION); in subexp_recursive_check_trav()
2961 CLEAR_ENCLOSE_STATUS(node, NST_MARK1); in subexp_recursive_check_trav()
2978 setup_subexp_call(Node* node, ScanEnv* env) in setup_subexp_call() argument
2983 type = NTYPE(node); in setup_subexp_call()
2987 r = setup_subexp_call(NCAR(node), env); in setup_subexp_call()
2988 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in setup_subexp_call()
2993 r = setup_subexp_call(NCAR(node), env); in setup_subexp_call()
2994 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in setup_subexp_call()
2998 r = setup_subexp_call(NQTFR(node)->target, env); in setup_subexp_call()
3001 r = setup_subexp_call(NENCLOSE(node)->target, env); in setup_subexp_call()
3006 CallNode* cn = NCALL(node); in setup_subexp_call()
3065 AnchorNode* an = NANCHOR(node); in setup_subexp_call()
3091 divide_look_behind_alternatives(Node* node) in divide_look_behind_alternatives() argument
3094 AnchorNode* an = NANCHOR(node); in divide_look_behind_alternatives()
3099 swap_node(node, head); in divide_look_behind_alternatives()
3100 NCAR(node) = head; in divide_look_behind_alternatives()
3103 np = node; in divide_look_behind_alternatives()
3112 np = node; in divide_look_behind_alternatives()
3121 setup_look_behind(Node* node, regex_t* reg, ScanEnv* env) in setup_look_behind() argument
3124 AnchorNode* an = NANCHOR(node); in setup_look_behind()
3133 r = divide_look_behind_alternatives(node); in setup_look_behind()
3142 next_setup(Node* node, Node* next_node, regex_t* reg) in next_setup() argument
3147 type = NTYPE(node); in next_setup()
3149 QtfrNode* qn = NQTFR(node); in next_setup()
3170 swap_node(node, en); in next_setup()
3171 NENCLOSE(node)->target = en; in next_setup()
3179 EncloseNode* en = NENCLOSE(node); in next_setup()
3181 node = en->target; in next_setup()
3190 update_string_node_case_fold(regex_t* reg, Node *node) in update_string_node_case_fold() argument
3195 StrNode* sn = NSTR(node); in update_string_node_case_fold()
3220 r = onig_node_str_set(node, sbuf, sp); in update_string_node_case_fold()
3235 Node *node; in expand_case_fold_make_rem_string() local
3237 node = onig_node_new_str(s, end); in expand_case_fold_make_rem_string()
3238 if (IS_NULL(node)) return ONIGERR_MEMORY; in expand_case_fold_make_rem_string()
3240 r = update_string_node_case_fold(reg, node); in expand_case_fold_make_rem_string()
3242 onig_node_free(node); in expand_case_fold_make_rem_string()
3246 NSTRING_SET_AMBIG(node); in expand_case_fold_make_rem_string()
3247 NSTRING_SET_DONT_GET_OPT_INFO(node); in expand_case_fold_make_rem_string()
3248 *rnode = node; in expand_case_fold_make_rem_string()
3365 expand_case_fold_string(Node* node, regex_t* reg) in expand_case_fold_string() argument
3373 StrNode* sn = NSTR(node); in expand_case_fold_string()
3375 if (NSTRING_IS_AMBIG(node)) return 0; in expand_case_fold_string()
3488 swap_node(node, top_root); in expand_case_fold_string()
3511 setup_comb_exp_check(Node* node, int state, ScanEnv* env) in setup_comb_exp_check() argument
3516 type = NTYPE(node); in setup_comb_exp_check()
3522 r = setup_comb_exp_check(NCAR(node), r, env); in setup_comb_exp_check()
3523 prev = NCAR(node); in setup_comb_exp_check()
3524 } while (r >= 0 && IS_NOT_NULL(node = NCDR(node))); in setup_comb_exp_check()
3532 ret = setup_comb_exp_check(NCAR(node), state, env); in setup_comb_exp_check()
3534 } while (ret >= 0 && IS_NOT_NULL(node = NCDR(node))); in setup_comb_exp_check()
3542 QtfrNode* qn = NQTFR(node); in setup_comb_exp_check()
3605 EncloseNode* en = NENCLOSE(node); in setup_comb_exp_check()
3626 if (IS_CALL_RECURSION(NCALL(node))) in setup_comb_exp_check()
3629 r = setup_comb_exp_check(NCALL(node)->target, state, env); in setup_comb_exp_check()
3655 setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env) in setup_tree() argument
3660 type = NTYPE(node); in setup_tree()
3666 r = setup_tree(NCAR(node), reg, state, env); in setup_tree()
3668 r = next_setup(prev, NCAR(node), reg); in setup_tree()
3670 prev = NCAR(node); in setup_tree()
3671 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in setup_tree()
3677 r = setup_tree(NCAR(node), reg, (state | IN_ALT), env); in setup_tree()
3678 } while (r == 0 && IS_NOT_NULL(node = NCDR(node))); in setup_tree()
3685 if (IS_IGNORECASE(reg->options) && !NSTRING_IS_RAW(node)) { in setup_tree()
3686 r = expand_case_fold_string(node, reg); in setup_tree()
3704 BRefNode* br = NBREF(node); in setup_tree()
3723 QtfrNode* qn = NQTFR(node); in setup_tree()
3772 onig_node_conv_to_str_node(node, NSTR(target)->flag); in setup_tree()
3774 r = onig_node_str_cat(node, sn->s, sn->end); in setup_tree()
3802 EncloseNode* en = NENCLOSE(node); in setup_tree()
3808 reg->options = NENCLOSE(node)->option; in setup_tree()
3809 r = setup_tree(NENCLOSE(node)->target, reg, state, env); in setup_tree()
3832 SET_ENCLOSE_STATUS(node, NST_STOP_BT_SIMPLE_REPEAT); in setup_tree()
3843 AnchorNode* an = NANCHOR(node); in setup_tree()
3872 r = setup_look_behind(node, reg, env); in setup_tree()
3884 r = setup_look_behind(node, reg, env); in setup_tree()
4538 optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) in optimize_node_left() argument
4546 type = NTYPE(node); in optimize_node_left()
4552 Node* nd = node; in optimize_node_left()
4568 Node* nd = node; in optimize_node_left()
4573 if (nd == node) copy_node_opt_info(opt, &nopt); in optimize_node_left()
4582 StrNode* sn = NSTR(node); in optimize_node_left()
4584 int is_raw = NSTRING_IS_RAW(node); in optimize_node_left()
4586 if (! NSTRING_IS_AMBIG(node)) { in optimize_node_left()
4588 NSTRING_IS_RAW(node), env->enc); in optimize_node_left()
4597 if (NSTRING_IS_DONT_GET_OPT_INFO(node)) { in optimize_node_left()
4626 CClassNode* cc = NCCLASS(node); in optimize_node_left()
4657 switch (NCTYPE(node)->ctype) { in optimize_node_left()
4659 if (NCTYPE(node)->not != 0) { in optimize_node_left()
4692 switch (NANCHOR(node)->type) { in optimize_node_left()
4699 add_opt_anc_info(&opt->anc, NANCHOR(node)->type); in optimize_node_left()
4706 r = optimize_node_left(NANCHOR(node)->target, &nopt, env); in optimize_node_left()
4734 BRefNode* br = NBREF(node); in optimize_node_left()
4759 if (IS_CALL_RECURSION(NCALL(node))) in optimize_node_left()
4763 env->options = NENCLOSE(NCALL(node)->target)->option; in optimize_node_left()
4764 r = optimize_node_left(NCALL(node)->target, opt, env); in optimize_node_left()
4775 QtfrNode* qn = NQTFR(node); in optimize_node_left()
4825 EncloseNode* en = NENCLOSE(node); in optimize_node_left()
4872 NTYPE(node)); in optimize_node_left()
4957 set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env) in set_optimize_info_from_tree() argument
4970 r = optimize_node_left(node, &opt, &env); in set_optimize_info_from_tree()
5258 static void print_tree P_((FILE* f, Node* node));
6115 print_indent_tree(FILE* f, Node* node, int indent) in print_indent_tree() argument
6122 if (IS_NULL(node)) { in print_indent_tree()
6127 type = NTYPE(node); in print_indent_tree()
6131 if (NTYPE(node) == NT_LIST) in print_indent_tree()
6132 fprintf(f, "<list:%x>\n", (int )node); in print_indent_tree()
6134 fprintf(f, "<alt:%x>\n", (int )node); in print_indent_tree()
6136 print_indent_tree(f, NCAR(node), indent + add); in print_indent_tree()
6137 while (IS_NOT_NULL(node = NCDR(node))) { in print_indent_tree()
6138 if (NTYPE(node) != type) { in print_indent_tree()
6139 fprintf(f, "ERROR: list/alt right is not a cons. %d\n", NTYPE(node)); in print_indent_tree()
6142 print_indent_tree(f, NCAR(node), indent + add); in print_indent_tree()
6148 (NSTRING_IS_RAW(node) ? "-raw" : ""), (int )node); in print_indent_tree()
6149 for (p = NSTR(node)->s; p < NSTR(node)->end; p++) { in print_indent_tree()
6159 fprintf(f, "<cclass:%x>", (int )node); in print_indent_tree()
6160 if (IS_NCCLASS_NOT(NCCLASS(node))) fputs(" not", f); in print_indent_tree()
6161 if (NCCLASS(node)->mbuf) { in print_indent_tree()
6162 BBuf* bbuf = NCCLASS(node)->mbuf; in print_indent_tree()
6171 fprintf(f, "<ctype:%x> ", (int )node); in print_indent_tree()
6172 switch (NCTYPE(node)->ctype) { in print_indent_tree()
6174 if (NCTYPE(node)->not != 0) in print_indent_tree()
6187 fprintf(f, "<anychar:%x>", (int )node); in print_indent_tree()
6191 fprintf(f, "<anchor:%x> ", (int )node); in print_indent_tree()
6192 switch (NANCHOR(node)->type) { in print_indent_tree()
6220 BRefNode* br = NBREF(node); in print_indent_tree()
6222 fprintf(f, "<backref:%x>", (int )node); in print_indent_tree()
6233 CallNode* cn = NCALL(node); in print_indent_tree()
6234 fprintf(f, "<call:%x>", (int )node); in print_indent_tree()
6241 fprintf(f, "<quantifier:%x>{%d,%d}%s\n", (int )node, in print_indent_tree()
6242 NQTFR(node)->lower, NQTFR(node)->upper, in print_indent_tree()
6243 (NQTFR(node)->greedy ? "" : "?")); in print_indent_tree()
6244 print_indent_tree(f, NQTFR(node)->target, indent + add); in print_indent_tree()
6248 fprintf(f, "<enclose:%x> ", (int )node); in print_indent_tree()
6249 switch (NENCLOSE(node)->type) { in print_indent_tree()
6251 fprintf(f, "option:%d", NENCLOSE(node)->option); in print_indent_tree()
6254 fprintf(f, "memory:%d", NENCLOSE(node)->regnum); in print_indent_tree()
6264 print_indent_tree(f, NENCLOSE(node)->target, indent + add); in print_indent_tree()
6268 fprintf(f, "print_indent_tree: undefined node type %d\n", NTYPE(node)); in print_indent_tree()
6281 print_tree(FILE* f, Node* node) in print_tree() argument
6283 print_indent_tree(f, node, 0); in print_tree()