Lines Matching refs:sym

17 struct expr *expr_alloc_symbol(struct symbol *sym)  in expr_alloc_symbol()  argument
21 e->left.sym = sym; in expr_alloc_symbol()
46 e->left.sym = s1; in expr_alloc_comp()
47 e->right.sym = s2; in expr_alloc_comp()
87 e->left.sym = org->left.sym; in expr_copy()
88 e->right.sym = org->right.sym; in expr_copy()
154 e1->left.sym == e2->left.sym && in __expr_eliminate_eq()
155 (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no)) in __expr_eliminate_eq()
213 return e1->left.sym == e2->left.sym && e1->right.sym == e2->right.sym; in expr_eq()
215 return e1->left.sym == e2->left.sym; in expr_eq()
225 e1->left.sym == e2->left.sym); in expr_eq()
255 if (e->left.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
259 e->left.sym = &symbol_no; in expr_eliminate_yn()
262 } else if (e->left.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
271 if (e->right.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
275 e->left.sym = &symbol_no; in expr_eliminate_yn()
278 } else if (e->right.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
291 if (e->left.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
297 } else if (e->left.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
301 e->left.sym = &symbol_yes; in expr_eliminate_yn()
307 if (e->right.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
313 } else if (e->right.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
317 e->left.sym = &symbol_yes; in expr_eliminate_yn()
345 if (e->left.sym->type == S_TRISTATE) { in expr_trans_bool()
346 if (e->right.sym == &symbol_no) { in expr_trans_bool()
348 e->right.sym = NULL; in expr_trans_bool()
376 sym1 = tmp->left.sym; in expr_join_or()
378 sym1 = e1->left.sym; in expr_join_or()
382 sym2 = e2->left.expr->left.sym; in expr_join_or()
384 sym2 = e2->left.sym; in expr_join_or()
391 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_or()
392 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) { in expr_join_or()
397 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_or()
398 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) { in expr_join_or()
403 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_or()
404 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) { in expr_join_or()
440 sym1 = tmp->left.sym; in expr_join_and()
442 sym1 = e1->left.sym; in expr_join_and()
446 sym2 = e2->left.expr->left.sym; in expr_join_and()
448 sym2 = e2->left.sym; in expr_join_and()
454 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
455 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
459 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || in expr_join_and()
460 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) in expr_join_and()
464 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
465 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) in expr_join_and()
472 sym2 = e1->right.sym; in expr_join_and()
473 if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
474 return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
479 sym2 = e2->right.sym; in expr_join_and()
480 if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
481 return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
485 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_and()
486 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) in expr_join_and()
491 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_and()
492 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) in expr_join_and()
497 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_and()
498 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) in expr_join_and()
502 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
503 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) || in expr_join_and()
504 (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
505 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
617 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
619 if (e->right.sym == &symbol_no) { in expr_transform()
621 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
622 e->right.sym = NULL; in expr_transform()
625 if (e->right.sym == &symbol_mod) { in expr_transform()
626 printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name); in expr_transform()
628 e->left.sym = &symbol_no; in expr_transform()
629 e->right.sym = NULL; in expr_transform()
632 if (e->right.sym == &symbol_yes) { in expr_transform()
634 e->right.sym = NULL; in expr_transform()
639 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
641 if (e->right.sym == &symbol_no) { in expr_transform()
643 e->right.sym = NULL; in expr_transform()
646 if (e->right.sym == &symbol_mod) { in expr_transform()
647 printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name); in expr_transform()
649 e->left.sym = &symbol_yes; in expr_transform()
650 e->right.sym = NULL; in expr_transform()
653 if (e->right.sym == &symbol_yes) { in expr_transform()
655 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
656 e->right.sym = NULL; in expr_transform()
713 if (e->left.expr->left.sym == &symbol_yes) { in expr_transform()
719 e->left.sym = &symbol_no; in expr_transform()
722 if (e->left.expr->left.sym == &symbol_mod) { in expr_transform()
728 e->left.sym = &symbol_mod; in expr_transform()
731 if (e->left.expr->left.sym == &symbol_no) { in expr_transform()
737 e->left.sym = &symbol_yes; in expr_transform()
751 int expr_contains_symbol(struct expr *dep, struct symbol *sym) in expr_contains_symbol() argument
759 return expr_contains_symbol(dep->left.expr, sym) || in expr_contains_symbol()
760 expr_contains_symbol(dep->right.expr, sym); in expr_contains_symbol()
762 return dep->left.sym == sym; in expr_contains_symbol()
769 return dep->left.sym == sym || in expr_contains_symbol()
770 dep->right.sym == sym; in expr_contains_symbol()
772 return expr_contains_symbol(dep->left.expr, sym); in expr_contains_symbol()
779 bool expr_depends_symbol(struct expr *dep, struct symbol *sym) in expr_depends_symbol() argument
786 return expr_depends_symbol(dep->left.expr, sym) || in expr_depends_symbol()
787 expr_depends_symbol(dep->right.expr, sym); in expr_depends_symbol()
789 return dep->left.sym == sym; in expr_depends_symbol()
791 if (dep->left.sym == sym) { in expr_depends_symbol()
792 if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod) in expr_depends_symbol()
797 if (dep->left.sym == sym) { in expr_depends_symbol()
798 if (dep->right.sym == &symbol_no) in expr_depends_symbol()
808 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym) in expr_trans_compare() argument
813 e = expr_alloc_symbol(sym); in expr_trans_compare()
820 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
821 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
822 if (sym == &symbol_yes) in expr_trans_compare()
824 if (sym == &symbol_no) in expr_trans_compare()
830 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
831 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
832 if (sym == &symbol_yes) in expr_trans_compare()
834 if (sym == &symbol_no) in expr_trans_compare()
840 return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym); in expr_trans_compare()
848 if (sym == &symbol_yes) in expr_trans_compare()
850 if (sym == &symbol_mod) in expr_trans_compare()
852 if (sym == &symbol_no) in expr_trans_compare()
855 if (sym == &symbol_yes) in expr_trans_compare()
857 if (sym == &symbol_mod) in expr_trans_compare()
859 if (sym == &symbol_no) in expr_trans_compare()
864 return expr_alloc_comp(type, e->left.sym, sym); in expr_trans_compare()
930 sym_calc_value(e->left.sym); in expr_calc_value()
931 return e->left.sym->curr.tri; in expr_calc_value()
955 sym_calc_value(e->left.sym); in expr_calc_value()
956 sym_calc_value(e->right.sym); in expr_calc_value()
957 str1 = sym_get_string_value(e->left.sym); in expr_calc_value()
958 str2 = sym_get_string_value(e->right.sym); in expr_calc_value()
960 if (e->left.sym->type != S_STRING || e->right.sym->type != S_STRING) { in expr_calc_value()
961 k1 = expr_parse_string(str1, e->left.sym->type, &lval); in expr_calc_value()
962 k2 = expr_parse_string(str2, e->right.sym->type, &rval); in expr_calc_value()
1084 if (e->left.sym->name) in expr_print()
1085 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1094 if (e->left.sym->name) in expr_print()
1095 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1099 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1103 if (e->left.sym->name) in expr_print()
1104 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1108 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1112 if (e->left.sym->name) in expr_print()
1113 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1117 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1120 if (e->left.sym->name) in expr_print()
1121 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1125 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1138 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1146 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1148 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1163 static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) in expr_print_file_helper() argument
1173 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) in expr_print_gstr_helper() argument
1178 if (sym) in expr_print_gstr_helper()
1179 sym_str = sym_get_string_value(sym); in expr_print_gstr_helper()
1199 if (sym && sym->type != S_UNKNOWN) in expr_print_gstr_helper()