Lines Matching refs:node
157 unset_addr_list_add(UnsetAddrList* uslist, int offset, struct _Node* node) in unset_addr_list_add() argument
171 uslist->us[uslist->num].target = node; in unset_addr_list_add()
284 static int compile_length_tree(Node* node, regex_t* reg);
285 static int compile_tree(Node* node, regex_t* reg);
338 compile_tree_empty_check(Node* node, regex_t* reg, int empty_info) in compile_tree_empty_check() argument
351 r = compile_tree(node, reg); in compile_tree_empty_check()
370 compile_call(CallNode* node, regex_t* reg) in compile_call() argument
376 r = unset_addr_list_add(node->unset_addr_list, BBUF_GET_OFFSET_POS(reg), in compile_call()
377 node->target); in compile_call()
385 compile_tree_n_times(Node* node, int n, regex_t* reg) in compile_tree_n_times() argument
390 r = compile_tree(node, reg); in compile_tree_n_times()
436 compile_length_string_node(Node* node, regex_t* reg) in compile_length_string_node() argument
443 sn = &(NSTRING(node)); in compile_length_string_node()
447 ambig = NSTRING_IS_AMBIG(node); in compile_length_string_node()
484 compile_string_node(Node* node, regex_t* reg) in compile_string_node() argument
491 sn = &(NSTRING(node)); in compile_string_node()
496 ambig = NSTRING_IS_AMBIG(node); in compile_string_node()
1139 compile_length_option_node(EffectNode* node, regex_t* reg) in compile_length_option_node() argument
1144 reg->options = node->option; in compile_length_option_node()
1145 tlen = compile_length_tree(node->target, reg); in compile_length_option_node()
1150 if (IS_DYNAMIC_OPTION(prev ^ node->option)) { in compile_length_option_node()
1159 compile_option_node(EffectNode* node, regex_t* reg) in compile_option_node() argument
1164 if (IS_DYNAMIC_OPTION(prev ^ node->option)) { in compile_option_node()
1165 r = add_opcode_option(reg, OP_SET_OPTION_PUSH, node->option); in compile_option_node()
1173 reg->options = node->option; in compile_option_node()
1174 r = compile_tree(node->target, reg); in compile_option_node()
1177 if (IS_DYNAMIC_OPTION(prev ^ node->option)) { in compile_option_node()
1185 compile_length_effect_node(EffectNode* node, regex_t* reg) in compile_length_effect_node() argument
1190 if (node->type == EFFECT_OPTION) in compile_length_effect_node()
1191 return compile_length_option_node(node, reg); in compile_length_effect_node()
1193 if (node->target) { in compile_length_effect_node()
1194 tlen = compile_length_tree(node->target, reg); in compile_length_effect_node()
1200 switch (node->type) { in compile_length_effect_node()
1203 if (IS_EFFECT_CALLED(node)) { in compile_length_effect_node()
1206 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_length_effect_node()
1207 len += (IS_EFFECT_RECURSION(node) in compile_length_effect_node()
1210 len += (IS_EFFECT_RECURSION(node) in compile_length_effect_node()
1216 if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) in compile_length_effect_node()
1221 len += tlen + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum) in compile_length_effect_node()
1227 if (IS_EFFECT_STOP_BT_SIMPLE_REPEAT(node)) { in compile_length_effect_node()
1228 QuantifierNode* qn = &NQUANTIFIER(node->target); in compile_length_effect_node()
1248 static int get_char_length_tree(Node* node, regex_t* reg, int* len);
1251 compile_effect_node(EffectNode* node, regex_t* reg) in compile_effect_node() argument
1255 if (node->type == EFFECT_OPTION) in compile_effect_node()
1256 return compile_option_node(node, reg); in compile_effect_node()
1258 switch (node->type) { in compile_effect_node()
1261 if (IS_EFFECT_CALLED(node)) { in compile_effect_node()
1264 node->call_addr = BBUF_GET_OFFSET_POS(reg) + SIZE_ABSADDR + SIZE_OP_JUMP; in compile_effect_node()
1265 node->state |= NST_ADDR_FIXED; in compile_effect_node()
1266 r = add_abs_addr(reg, (int )node->call_addr); in compile_effect_node()
1268 len = compile_length_tree(node->target, reg); in compile_effect_node()
1270 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_effect_node()
1271 len += (IS_EFFECT_RECURSION(node) in compile_effect_node()
1274 len += (IS_EFFECT_RECURSION(node) in compile_effect_node()
1281 if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum)) in compile_effect_node()
1286 r = add_mem_num(reg, node->regnum); in compile_effect_node()
1288 r = compile_tree(node->target, reg); in compile_effect_node()
1291 if (IS_EFFECT_CALLED(node)) { in compile_effect_node()
1292 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_effect_node()
1293 r = add_opcode(reg, (IS_EFFECT_RECURSION(node) in compile_effect_node()
1296 r = add_opcode(reg, (IS_EFFECT_RECURSION(node) in compile_effect_node()
1300 r = add_mem_num(reg, node->regnum); in compile_effect_node()
1307 if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)) in compile_effect_node()
1312 r = add_mem_num(reg, node->regnum); in compile_effect_node()
1317 if (IS_EFFECT_STOP_BT_SIMPLE_REPEAT(node)) { in compile_effect_node()
1318 QuantifierNode* qn = &NQUANTIFIER(node->target); in compile_effect_node()
1337 r = compile_tree(node->target, reg); in compile_effect_node()
1352 compile_length_anchor_node(AnchorNode* node, regex_t* reg) in compile_length_anchor_node() argument
1357 if (node->target) { in compile_length_anchor_node()
1358 tlen = compile_length_tree(node->target, reg); in compile_length_anchor_node()
1362 switch (node->type) { in compile_length_anchor_node()
1385 compile_anchor_node(AnchorNode* node, regex_t* reg) in compile_anchor_node() argument
1389 switch (node->type) { in compile_anchor_node()
1407 r = compile_tree(node->target, reg); in compile_anchor_node()
1413 len = compile_length_tree(node->target, reg); in compile_anchor_node()
1417 r = compile_tree(node->target, reg); in compile_anchor_node()
1427 if (node->char_len < 0) { in compile_anchor_node()
1428 r = get_char_length_tree(node->target, reg, &n); in compile_anchor_node()
1432 n = node->char_len; in compile_anchor_node()
1435 r = compile_tree(node->target, reg); in compile_anchor_node()
1442 len = compile_length_tree(node->target, reg); in compile_anchor_node()
1446 if (node->char_len < 0) { in compile_anchor_node()
1447 r = get_char_length_tree(node->target, reg, &n); in compile_anchor_node()
1451 n = node->char_len; in compile_anchor_node()
1454 r = compile_tree(node->target, reg); in compile_anchor_node()
1469 compile_length_tree(Node* node, regex_t* reg) in compile_length_tree() argument
1473 type = NTYPE(node); in compile_length_tree()
1478 r = compile_length_tree(NCONS(node).left, reg); in compile_length_tree()
1481 } while (IS_NOT_NULL(node = NCONS(node).right)); in compile_length_tree()
1491 r += compile_length_tree(NCONS(node).left, reg); in compile_length_tree()
1493 } while (IS_NOT_NULL(node = NCONS(node).right)); in compile_length_tree()
1499 if (NSTRING_IS_RAW(node)) in compile_length_tree()
1500 r = compile_length_string_raw_node(&(NSTRING(node)), reg); in compile_length_tree()
1502 r = compile_length_string_node(node, reg); in compile_length_tree()
1506 r = compile_length_cclass_node(&(NCCLASS(node)), reg); in compile_length_tree()
1516 BackrefNode* br = &(NBACKREF(node)); in compile_length_tree()
1542 r = compile_length_quantifier_node(&(NQUANTIFIER(node)), reg); in compile_length_tree()
1546 r = compile_length_effect_node(&NEFFECT(node), reg); in compile_length_tree()
1550 r = compile_length_anchor_node(&(NANCHOR(node)), reg); in compile_length_tree()
1562 compile_tree(Node* node, regex_t* reg) in compile_tree() argument
1566 type = NTYPE(node); in compile_tree()
1570 r = compile_tree(NCONS(node).left, reg); in compile_tree()
1571 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in compile_tree()
1576 Node* x = node; in compile_tree()
1587 len = compile_length_tree(NCONS(node).left, reg); in compile_tree()
1588 if (IS_NOT_NULL(NCONS(node).right)) { in compile_tree()
1592 r = compile_tree(NCONS(node).left, reg); in compile_tree()
1594 if (IS_NOT_NULL(NCONS(node).right)) { in compile_tree()
1599 } while (IS_NOT_NULL(node = NCONS(node).right)); in compile_tree()
1604 if (NSTRING_IS_RAW(node)) in compile_tree()
1605 r = compile_string_raw_node(&(NSTRING(node)), reg); in compile_tree()
1607 r = compile_string_node(node, reg); in compile_tree()
1611 r = compile_cclass_node(&(NCCLASS(node)), reg); in compile_tree()
1618 switch (NCTYPE(node).type) { in compile_tree()
1638 BackrefNode* br = &(NBACKREF(node)); in compile_tree()
1700 r = compile_call(&(NCALL(node)), reg); in compile_tree()
1705 r = compile_quantifier_node(&(NQUANTIFIER(node)), reg); in compile_tree()
1709 r = compile_effect_node(&NEFFECT(node), reg); in compile_tree()
1713 r = compile_anchor_node(&(NANCHOR(node)), reg); in compile_tree()
1718 fprintf(stderr, "compile_tree: undefined node type %d\n", NTYPE(node)); in compile_tree()
1732 Node* node = *plink; in noname_disable_map() local
1734 switch (NTYPE(node)) { in noname_disable_map()
1738 r = noname_disable_map(&(NCONS(node).left), map, counter); in noname_disable_map()
1739 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in noname_disable_map()
1744 Node** ptarget = &(NQUANTIFIER(node).target); in noname_disable_map()
1748 onig_reduce_nested_quantifier(node, *ptarget); in noname_disable_map()
1755 EffectNode* en = &(NEFFECT(node)); in noname_disable_map()
1766 onig_node_free(node); in noname_disable_map()
1783 renumber_node_backref(Node* node, GroupNumRemap* map) in renumber_node_backref() argument
1787 BackrefNode* bn = &(NBACKREF(node)); in renumber_node_backref()
1811 renumber_by_map(Node* node, GroupNumRemap* map) in renumber_by_map() argument
1815 switch (NTYPE(node)) { in renumber_by_map()
1819 r = renumber_by_map(NCONS(node).left, map); in renumber_by_map()
1820 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in renumber_by_map()
1823 r = renumber_by_map(NQUANTIFIER(node).target, map); in renumber_by_map()
1826 r = renumber_by_map(NEFFECT(node).target, map); in renumber_by_map()
1830 r = renumber_node_backref(node, map); in renumber_by_map()
1841 numbered_ref_check(Node* node) in numbered_ref_check() argument
1845 switch (NTYPE(node)) { in numbered_ref_check()
1849 r = numbered_ref_check(NCONS(node).left); in numbered_ref_check()
1850 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in numbered_ref_check()
1853 r = numbered_ref_check(NQUANTIFIER(node).target); in numbered_ref_check()
1856 r = numbered_ref_check(NEFFECT(node).target); in numbered_ref_check()
1860 if (! IS_BACKREF_NAME_REF(&(NBACKREF(node)))) in numbered_ref_check()
1934 quantifiers_memory_node_info(Node* node) in quantifiers_memory_node_info() argument
1938 switch (NTYPE(node)) { in quantifiers_memory_node_info()
1944 v = quantifiers_memory_node_info(NCONS(node).left); in quantifiers_memory_node_info()
1946 } while (v >= 0 && IS_NOT_NULL(node = NCONS(node).right)); in quantifiers_memory_node_info()
1952 if (IS_CALL_RECURSION(&NCALL(node))) { in quantifiers_memory_node_info()
1956 r = quantifiers_memory_node_info(NCALL(node).target); in quantifiers_memory_node_info()
1962 QuantifierNode* qn = &(NQUANTIFIER(node)); in quantifiers_memory_node_info()
1971 EffectNode* en = &(NEFFECT(node)); in quantifiers_memory_node_info()
2002 get_min_match_length(Node* node, OnigDistance *min, ScanEnv* env) in get_min_match_length() argument
2008 switch (NTYPE(node)) { in get_min_match_length()
2014 BackrefNode* br = &(NBACKREF(node)); in get_min_match_length()
2032 if (IS_CALL_RECURSION(&NCALL(node))) { in get_min_match_length()
2033 EffectNode* en = &(NEFFECT(NCALL(node).target)); in get_min_match_length()
2038 r = get_min_match_length(NCALL(node).target, min, env); in get_min_match_length()
2044 r = get_min_match_length(NCONS(node).left, &tmin, env); in get_min_match_length()
2046 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in get_min_match_length()
2052 y = node; in get_min_match_length()
2057 if (y == node) *min = tmin; in get_min_match_length()
2065 StrNode* sn = &(NSTRING(node)); in get_min_match_length()
2071 switch (NCTYPE(node).type) { in get_min_match_length()
2086 QuantifierNode* qn = &(NQUANTIFIER(node)); in get_min_match_length()
2098 EffectNode* en = &(NEFFECT(node)); in get_min_match_length()
2108 SET_EFFECT_STATUS(node, NST_MIN_FIXED); in get_min_match_length()
2130 get_max_match_length(Node* node, OnigDistance *max, ScanEnv* env) in get_max_match_length() argument
2136 switch (NTYPE(node)) { in get_max_match_length()
2139 r = get_max_match_length(NCONS(node).left, &tmax, env); in get_max_match_length()
2142 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in get_max_match_length()
2147 r = get_max_match_length(NCONS(node).left, &tmax, env); in get_max_match_length()
2149 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in get_max_match_length()
2154 StrNode* sn = &(NSTRING(node)); in get_max_match_length()
2160 switch (NCTYPE(node).type) { in get_max_match_length()
2181 BackrefNode* br = &(NBACKREF(node)); in get_max_match_length()
2198 if (! IS_CALL_RECURSION(&(NCALL(node)))) in get_max_match_length()
2199 r = get_max_match_length(NCALL(node).target, max, env); in get_max_match_length()
2207 QuantifierNode* qn = &(NQUANTIFIER(node)); in get_max_match_length()
2223 EffectNode* en = &(NEFFECT(node)); in get_max_match_length()
2233 SET_EFFECT_STATUS(node, NST_MAX_FIXED); in get_max_match_length()
2259 get_char_length_tree1(Node* node, regex_t* reg, int* len, int level) in get_char_length_tree1() argument
2266 switch (NTYPE(node)) { in get_char_length_tree1()
2269 r = get_char_length_tree1(NCONS(node).left, reg, &tlen, level); in get_char_length_tree1()
2272 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in get_char_length_tree1()
2280 r = get_char_length_tree1(NCONS(node).left, reg, &tlen, level); in get_char_length_tree1()
2281 while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)) { in get_char_length_tree1()
2282 r = get_char_length_tree1(NCONS(node).left, reg, &tlen2, level); in get_char_length_tree1()
2303 StrNode* sn = &(NSTRING(node)); in get_char_length_tree1()
2314 QuantifierNode* qn = &(NQUANTIFIER(node)); in get_char_length_tree1()
2327 if (! IS_CALL_RECURSION(&(NCALL(node)))) in get_char_length_tree1()
2328 r = get_char_length_tree1(NCALL(node).target, reg, len, level); in get_char_length_tree1()
2335 switch (NCTYPE(node).type) { in get_char_length_tree1()
2350 EffectNode* en = &(NEFFECT(node)); in get_char_length_tree1()
2360 SET_EFFECT_STATUS(node, NST_CLEN_FIXED); in get_char_length_tree1()
2387 get_char_length_tree(Node* node, regex_t* reg, int* len) in get_char_length_tree() argument
2389 return get_char_length_tree1(node, reg, len, 0); in get_char_length_tree()
2578 get_head_value_node(Node* node, int exact, regex_t* reg) in get_head_value_node() argument
2582 switch (NTYPE(node)) { in get_head_value_node()
2594 n = node; in get_head_value_node()
2599 n = get_head_value_node(NCONS(node).left, exact, reg); in get_head_value_node()
2604 StrNode* sn = &(NSTRING(node)); in get_head_value_node()
2610 !NSTRING_IS_RAW(node) && IS_IGNORECASE(reg->options)) { in get_head_value_node()
2615 n = node; in get_head_value_node()
2619 n = node; in get_head_value_node()
2626 QuantifierNode* qn = &(NQUANTIFIER(node)); in get_head_value_node()
2638 EffectNode* en = &(NEFFECT(node)); in get_head_value_node()
2644 reg->options = NEFFECT(node).option; in get_head_value_node()
2645 n = get_head_value_node(NEFFECT(node).target, exact, reg); in get_head_value_node()
2659 if (NANCHOR(node).type == ANCHOR_PREC_READ) in get_head_value_node()
2660 n = get_head_value_node(NANCHOR(node).target, exact, reg); in get_head_value_node()
2671 check_type_tree(Node* node, int type_mask, int effect_mask, int anchor_mask) in check_type_tree() argument
2675 type = NTYPE(node); in check_type_tree()
2683 r = check_type_tree(NCONS(node).left, type_mask, effect_mask, anchor_mask); in check_type_tree()
2684 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in check_type_tree()
2688 r = check_type_tree(NQUANTIFIER(node).target, type_mask, effect_mask, in check_type_tree()
2694 EffectNode* en = &(NEFFECT(node)); in check_type_tree()
2703 type = NANCHOR(node).type; in check_type_tree()
2707 if (NANCHOR(node).target) in check_type_tree()
2708 r = check_type_tree(NANCHOR(node).target, in check_type_tree()
2724 subexp_inf_recursive_check(Node* node, ScanEnv* env, int head) in subexp_inf_recursive_check() argument
2729 type = NTYPE(node); in subexp_inf_recursive_check()
2737 x = node; in subexp_inf_recursive_check()
2756 ret = subexp_inf_recursive_check(NCONS(node).left, env, head); in subexp_inf_recursive_check()
2759 } while (IS_NOT_NULL(node = NCONS(node).right)); in subexp_inf_recursive_check()
2764 r = subexp_inf_recursive_check(NQUANTIFIER(node).target, env, head); in subexp_inf_recursive_check()
2766 if (NQUANTIFIER(node).lower == 0) r = 0; in subexp_inf_recursive_check()
2772 AnchorNode* an = &(NANCHOR(node)); in subexp_inf_recursive_check()
2785 r = subexp_inf_recursive_check(NCALL(node).target, env, head); in subexp_inf_recursive_check()
2789 if (IS_EFFECT_MARK2(&(NEFFECT(node)))) in subexp_inf_recursive_check()
2791 else if (IS_EFFECT_MARK1(&(NEFFECT(node)))) in subexp_inf_recursive_check()
2794 SET_EFFECT_STATUS(node, NST_MARK2); in subexp_inf_recursive_check()
2795 r = subexp_inf_recursive_check(NEFFECT(node).target, env, head); in subexp_inf_recursive_check()
2796 CLEAR_EFFECT_STATUS(node, NST_MARK2); in subexp_inf_recursive_check()
2808 subexp_inf_recursive_check_trav(Node* node, ScanEnv* env) in subexp_inf_recursive_check_trav() argument
2813 type = NTYPE(node); in subexp_inf_recursive_check_trav()
2818 r = subexp_inf_recursive_check_trav(NCONS(node).left, env); in subexp_inf_recursive_check_trav()
2819 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in subexp_inf_recursive_check_trav()
2823 r = subexp_inf_recursive_check_trav(NQUANTIFIER(node).target, env); in subexp_inf_recursive_check_trav()
2828 AnchorNode* an = &(NANCHOR(node)); in subexp_inf_recursive_check_trav()
2842 EffectNode* en = &(NEFFECT(node)); in subexp_inf_recursive_check_trav()
2845 SET_EFFECT_STATUS(node, NST_MARK1); in subexp_inf_recursive_check_trav()
2848 CLEAR_EFFECT_STATUS(node, NST_MARK1); in subexp_inf_recursive_check_trav()
2863 subexp_recursive_check(Node* node) in subexp_recursive_check() argument
2868 type = NTYPE(node); in subexp_recursive_check()
2873 r |= subexp_recursive_check(NCONS(node).left); in subexp_recursive_check()
2874 } while (IS_NOT_NULL(node = NCONS(node).right)); in subexp_recursive_check()
2878 r = subexp_recursive_check(NQUANTIFIER(node).target); in subexp_recursive_check()
2883 AnchorNode* an = &(NANCHOR(node)); in subexp_recursive_check()
2896 r = subexp_recursive_check(NCALL(node).target); in subexp_recursive_check()
2897 if (r != 0) SET_CALL_RECURSION(node); in subexp_recursive_check()
2901 if (IS_EFFECT_MARK2(&(NEFFECT(node)))) in subexp_recursive_check()
2903 else if (IS_EFFECT_MARK1(&(NEFFECT(node)))) in subexp_recursive_check()
2906 SET_EFFECT_STATUS(node, NST_MARK2); in subexp_recursive_check()
2907 r = subexp_recursive_check(NEFFECT(node).target); in subexp_recursive_check()
2908 CLEAR_EFFECT_STATUS(node, NST_MARK2); in subexp_recursive_check()
2921 subexp_recursive_check_trav(Node* node, ScanEnv* env) in subexp_recursive_check_trav() argument
2928 type = NTYPE(node); in subexp_recursive_check_trav()
2935 ret = subexp_recursive_check_trav(NCONS(node).left, env); in subexp_recursive_check_trav()
2938 } while (IS_NOT_NULL(node = NCONS(node).right)); in subexp_recursive_check_trav()
2943 r = subexp_recursive_check_trav(NQUANTIFIER(node).target, env); in subexp_recursive_check_trav()
2944 if (NQUANTIFIER(node).upper == 0) { in subexp_recursive_check_trav()
2946 NQUANTIFIER(node).is_refered = 1; in subexp_recursive_check_trav()
2952 AnchorNode* an = &(NANCHOR(node)); in subexp_recursive_check_trav()
2966 EffectNode* en = &(NEFFECT(node)); in subexp_recursive_check_trav()
2970 SET_EFFECT_STATUS(node, NST_MARK1); in subexp_recursive_check_trav()
2972 if (r != 0) SET_EFFECT_STATUS(node, NST_RECURSION); in subexp_recursive_check_trav()
2973 CLEAR_EFFECT_STATUS(node, NST_MARK1); in subexp_recursive_check_trav()
2990 setup_subexp_call(Node* node, ScanEnv* env) in setup_subexp_call() argument
2995 type = NTYPE(node); in setup_subexp_call()
2999 r = setup_subexp_call(NCONS(node).left, env); in setup_subexp_call()
3000 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in setup_subexp_call()
3005 r = setup_subexp_call(NCONS(node).left, env); in setup_subexp_call()
3006 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in setup_subexp_call()
3010 r = setup_subexp_call(NQUANTIFIER(node).target, env); in setup_subexp_call()
3013 r = setup_subexp_call(NEFFECT(node).target, env); in setup_subexp_call()
3020 CallNode* cn = &(NCALL(node)); in setup_subexp_call()
3075 AnchorNode* an = &(NANCHOR(node)); in setup_subexp_call()
3101 divide_look_behind_alternatives(Node* node) in divide_look_behind_alternatives() argument
3105 AnchorNode* an = &(NANCHOR(node)); in divide_look_behind_alternatives()
3110 tmp_node = *node; *node = *head; *head = tmp_node; in divide_look_behind_alternatives()
3111 NCONS(node).left = head; in divide_look_behind_alternatives()
3114 np = node; in divide_look_behind_alternatives()
3123 np = node; in divide_look_behind_alternatives()
3132 setup_look_behind(Node* node, regex_t* reg, ScanEnv* env) in setup_look_behind() argument
3135 AnchorNode* an = &(NANCHOR(node)); in setup_look_behind()
3144 r = divide_look_behind_alternatives(node); in setup_look_behind()
3153 next_setup(Node* node, Node* next_node, regex_t* reg) in next_setup() argument
3158 type = NTYPE(node); in next_setup()
3160 QuantifierNode* qn = &(NQUANTIFIER(node)); in next_setup()
3177 swap_node(node, en); in next_setup()
3178 NEFFECT(node).target = en; in next_setup()
3186 EffectNode* en = &(NEFFECT(node)); in next_setup()
3188 node = en->target; in next_setup()
3236 divide_ambig_string_node(Node* node, regex_t* reg) in divide_ambig_string_node() argument
3238 StrNode* sn = &NSTRING(node); in divide_ambig_string_node()
3267 NSTRING_SET_AMBIG(node); in divide_ambig_string_node()
3274 if (wp != sn->end) NSTRING_SET_AMBIG_REDUCE(node); in divide_ambig_string_node()
3283 swap_node(node, root); in divide_ambig_string_node()
3301 setup_comb_exp_check(Node* node, int state, ScanEnv* env) in setup_comb_exp_check() argument
3306 type = NTYPE(node); in setup_comb_exp_check()
3312 r = setup_comb_exp_check(NCONS(node).left, r, env); in setup_comb_exp_check()
3313 prev = NCONS(node).left; in setup_comb_exp_check()
3314 } while (r >= 0 && IS_NOT_NULL(node = NCONS(node).right)); in setup_comb_exp_check()
3322 ret = setup_comb_exp_check(NCONS(node).left, state, env); in setup_comb_exp_check()
3324 } while (ret >= 0 && IS_NOT_NULL(node = NCONS(node).right)); in setup_comb_exp_check()
3332 QuantifierNode* qn = &(NQUANTIFIER(node)); in setup_comb_exp_check()
3395 EffectNode* en = &(NEFFECT(node)); in setup_comb_exp_check()
3416 if (IS_CALL_RECURSION(&(NCALL(node)))) in setup_comb_exp_check()
3419 r = setup_comb_exp_check(NCALL(node).target, state, env); in setup_comb_exp_check()
3445 setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env) in setup_tree() argument
3450 type = NTYPE(node); in setup_tree()
3456 r = setup_tree(NCONS(node).left, reg, state, env); in setup_tree()
3458 r = next_setup(prev, NCONS(node).left, reg); in setup_tree()
3460 prev = NCONS(node).left; in setup_tree()
3461 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in setup_tree()
3467 r = setup_tree(NCONS(node).left, reg, (state | IN_ALT), env); in setup_tree()
3468 } while (r == 0 && IS_NOT_NULL(node = NCONS(node).right)); in setup_tree()
3475 if (IS_IGNORECASE(reg->options) && !NSTRING_IS_RAW(node)) { in setup_tree()
3476 r = divide_ambig_string_node(node, reg); in setup_tree()
3494 BackrefNode* br = &(NBACKREF(node)); in setup_tree()
3513 QuantifierNode* qn = &(NQUANTIFIER(node)); in setup_tree()
3562 onig_node_conv_to_str_node(node, NSTRING(target).flag); in setup_tree()
3564 r = onig_node_str_cat(node, sn->s, sn->end); in setup_tree()
3592 EffectNode* en = &(NEFFECT(node)); in setup_tree()
3598 reg->options = NEFFECT(node).option; in setup_tree()
3599 r = setup_tree(NEFFECT(node).target, reg, state, env); in setup_tree()
3622 SET_EFFECT_STATUS(node, NST_STOP_BT_SIMPLE_REPEAT); in setup_tree()
3633 AnchorNode* an = &(NANCHOR(node)); in setup_tree()
3662 r = setup_look_behind(node, reg, env); in setup_tree()
3674 r = setup_look_behind(node, reg, env); in setup_tree()
4334 optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) in optimize_node_left() argument
4342 type = NTYPE(node); in optimize_node_left()
4348 Node* nd = node; in optimize_node_left()
4364 Node* nd = node; in optimize_node_left()
4369 if (nd == node) copy_node_opt_info(opt, &nopt); in optimize_node_left()
4378 StrNode* sn = &(NSTRING(node)); in optimize_node_left()
4380 int is_raw = NSTRING_IS_RAW(node); in optimize_node_left()
4382 if (! NSTRING_IS_AMBIG(node)) { in optimize_node_left()
4384 NSTRING_IS_RAW(node), env->enc); in optimize_node_left()
4403 if (NSTRING_IS_AMBIG_REDUCE(node)) { in optimize_node_left()
4421 CClassNode* cc = &(NCCLASS(node)); in optimize_node_left()
4452 switch (NCTYPE(node).type) { in optimize_node_left()
4486 switch (NANCHOR(node).type) { in optimize_node_left()
4493 add_opt_anc_info(&opt->anc, NANCHOR(node).type); in optimize_node_left()
4500 r = optimize_node_left(NANCHOR(node).target, &nopt, env); in optimize_node_left()
4528 BackrefNode* br = &(NBACKREF(node)); in optimize_node_left()
4553 if (IS_CALL_RECURSION(&(NCALL(node)))) in optimize_node_left()
4557 env->options = NEFFECT(NCALL(node).target).option; in optimize_node_left()
4558 r = optimize_node_left(NCALL(node).target, opt, env); in optimize_node_left()
4569 QuantifierNode* qn = &(NQUANTIFIER(node)); in optimize_node_left()
4619 EffectNode* en = &(NEFFECT(node)); in optimize_node_left()
4666 NTYPE(node)); in optimize_node_left()
4751 set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env) in set_optimize_info_from_tree() argument
4764 r = optimize_node_left(node, &opt, &env); in set_optimize_info_from_tree()
5128 static void print_tree P_((FILE* f, Node* node));
5878 print_indent_tree(FILE* f, Node* node, int indent) in print_indent_tree() argument
5885 if (IS_NULL(node)) { in print_indent_tree()
5890 type = NTYPE(node); in print_indent_tree()
5894 if (NTYPE(node) == N_LIST) in print_indent_tree()
5895 fprintf(f, "<list:%x>\n", (int )node); in print_indent_tree()
5897 fprintf(f, "<alt:%x>\n", (int )node); in print_indent_tree()
5899 print_indent_tree(f, NCONS(node).left, indent + add); in print_indent_tree()
5900 while (IS_NOT_NULL(node = NCONS(node).right)) { in print_indent_tree()
5901 if (NTYPE(node) != type) { in print_indent_tree()
5902 fprintf(f, "ERROR: list/alt right is not a cons. %d\n", NTYPE(node)); in print_indent_tree()
5905 print_indent_tree(f, NCONS(node).left, indent + add); in print_indent_tree()
5911 (NSTRING_IS_RAW(node) ? "-raw" : ""), (int )node); in print_indent_tree()
5912 for (p = NSTRING(node).s; p < NSTRING(node).end; p++) { in print_indent_tree()
5922 fprintf(f, "<cclass:%x>", (int )node); in print_indent_tree()
5923 if (IS_CCLASS_NOT(&NCCLASS(node))) fputs(" not", f); in print_indent_tree()
5924 if (NCCLASS(node).mbuf) { in print_indent_tree()
5925 BBuf* bbuf = NCCLASS(node).mbuf; in print_indent_tree()
5934 fprintf(f, "<ctype:%x> ", (int )node); in print_indent_tree()
5935 switch (NCTYPE(node).type) { in print_indent_tree()
5945 fprintf(f, "<anychar:%x>", (int )node); in print_indent_tree()
5949 fprintf(f, "<anchor:%x> ", (int )node); in print_indent_tree()
5950 switch (NANCHOR(node).type) { in print_indent_tree()
5978 BackrefNode* br = &(NBACKREF(node)); in print_indent_tree()
5980 fprintf(f, "<backref:%x>", (int )node); in print_indent_tree()
5991 CallNode* cn = &(NCALL(node)); in print_indent_tree()
5992 fprintf(f, "<call:%x>", (int )node); in print_indent_tree()
5999 fprintf(f, "<quantifier:%x>{%d,%d}%s\n", (int )node, in print_indent_tree()
6000 NQUANTIFIER(node).lower, NQUANTIFIER(node).upper, in print_indent_tree()
6001 (NQUANTIFIER(node).greedy ? "" : "?")); in print_indent_tree()
6002 print_indent_tree(f, NQUANTIFIER(node).target, indent + add); in print_indent_tree()
6006 fprintf(f, "<effect:%x> ", (int )node); in print_indent_tree()
6007 switch (NEFFECT(node).type) { in print_indent_tree()
6009 fprintf(f, "option:%d\n", NEFFECT(node).option); in print_indent_tree()
6010 print_indent_tree(f, NEFFECT(node).target, indent + add); in print_indent_tree()
6013 fprintf(f, "memory:%d", NEFFECT(node).regnum); in print_indent_tree()
6023 print_indent_tree(f, NEFFECT(node).target, indent + add); in print_indent_tree()
6027 fprintf(f, "print_indent_tree: undefined node type %d\n", NTYPE(node)); in print_indent_tree()
6040 print_tree(FILE* f, Node* node) in print_tree() argument
6042 print_indent_tree(f, node, 0); in print_tree()