Lines Matching refs:sym
15 struct expr *expr_alloc_symbol(struct symbol *sym) in expr_alloc_symbol() argument
20 e->left.sym = sym; in expr_alloc_symbol()
48 e->left.sym = s1; in expr_alloc_comp()
49 e->right.sym = s2; in expr_alloc_comp()
85 e->left.sym = org->left.sym; in expr_copy()
86 e->right.sym = org->right.sym; in expr_copy()
148 e1->left.sym == e2->left.sym && in __expr_eliminate_eq()
149 (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no)) in __expr_eliminate_eq()
203 return e1->left.sym == e2->left.sym && e1->right.sym == e2->right.sym; in expr_eq()
205 return e1->left.sym == e2->left.sym; in expr_eq()
215 e1->left.sym == e2->left.sym); in expr_eq()
245 if (e->left.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
249 e->left.sym = &symbol_no; in expr_eliminate_yn()
252 } else if (e->left.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
261 if (e->right.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
265 e->left.sym = &symbol_no; in expr_eliminate_yn()
268 } else if (e->right.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
281 if (e->left.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
287 } else if (e->left.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
291 e->left.sym = &symbol_yes; in expr_eliminate_yn()
297 if (e->right.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
303 } else if (e->right.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
307 e->left.sym = &symbol_yes; in expr_eliminate_yn()
335 if (e->left.sym->type == S_TRISTATE) { in expr_trans_bool()
336 if (e->right.sym == &symbol_no) { in expr_trans_bool()
338 e->right.sym = NULL; in expr_trans_bool()
366 sym1 = tmp->left.sym; in expr_join_or()
368 sym1 = e1->left.sym; in expr_join_or()
372 sym2 = e2->left.expr->left.sym; in expr_join_or()
374 sym2 = e2->left.sym; in expr_join_or()
381 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_or()
382 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) { in expr_join_or()
387 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_or()
388 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) { in expr_join_or()
393 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_or()
394 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) { in expr_join_or()
430 sym1 = tmp->left.sym; in expr_join_and()
432 sym1 = e1->left.sym; in expr_join_and()
436 sym2 = e2->left.expr->left.sym; in expr_join_and()
438 sym2 = e2->left.sym; in expr_join_and()
444 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
445 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
449 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || in expr_join_and()
450 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) in expr_join_and()
454 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
455 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) in expr_join_and()
462 sym2 = e1->right.sym; in expr_join_and()
463 if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
464 return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
469 sym2 = e2->right.sym; in expr_join_and()
470 if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
471 return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
475 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_and()
476 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) in expr_join_and()
481 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_and()
482 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) in expr_join_and()
487 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_and()
488 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) in expr_join_and()
492 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
493 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) || in expr_join_and()
494 (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
495 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
660 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
662 if (e->right.sym == &symbol_no) { in expr_transform()
664 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
665 e->right.sym = NULL; in expr_transform()
668 if (e->right.sym == &symbol_mod) { in expr_transform()
669 printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name); in expr_transform()
671 e->left.sym = &symbol_no; in expr_transform()
672 e->right.sym = NULL; in expr_transform()
675 if (e->right.sym == &symbol_yes) { in expr_transform()
677 e->right.sym = NULL; in expr_transform()
682 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
684 if (e->right.sym == &symbol_no) { in expr_transform()
686 e->right.sym = NULL; in expr_transform()
689 if (e->right.sym == &symbol_mod) { in expr_transform()
690 printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name); in expr_transform()
692 e->left.sym = &symbol_yes; in expr_transform()
693 e->right.sym = NULL; in expr_transform()
696 if (e->right.sym == &symbol_yes) { in expr_transform()
698 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
699 e->right.sym = NULL; in expr_transform()
740 if (e->left.expr->left.sym == &symbol_yes) { in expr_transform()
746 e->left.sym = &symbol_no; in expr_transform()
749 if (e->left.expr->left.sym == &symbol_mod) { in expr_transform()
755 e->left.sym = &symbol_mod; in expr_transform()
758 if (e->left.expr->left.sym == &symbol_no) { in expr_transform()
764 e->left.sym = &symbol_yes; in expr_transform()
778 int expr_contains_symbol(struct expr *dep, struct symbol *sym) in expr_contains_symbol() argument
786 return expr_contains_symbol(dep->left.expr, sym) || in expr_contains_symbol()
787 expr_contains_symbol(dep->right.expr, sym); in expr_contains_symbol()
789 return dep->left.sym == sym; in expr_contains_symbol()
792 return dep->left.sym == sym || in expr_contains_symbol()
793 dep->right.sym == sym; in expr_contains_symbol()
795 return expr_contains_symbol(dep->left.expr, sym); in expr_contains_symbol()
802 bool expr_depends_symbol(struct expr *dep, struct symbol *sym) in expr_depends_symbol() argument
809 return expr_depends_symbol(dep->left.expr, sym) || in expr_depends_symbol()
810 expr_depends_symbol(dep->right.expr, sym); in expr_depends_symbol()
812 return dep->left.sym == sym; in expr_depends_symbol()
814 if (dep->left.sym == sym) { in expr_depends_symbol()
815 if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod) in expr_depends_symbol()
820 if (dep->left.sym == sym) { in expr_depends_symbol()
821 if (dep->right.sym == &symbol_no) in expr_depends_symbol()
882 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym) in expr_trans_compare() argument
887 e = expr_alloc_symbol(sym); in expr_trans_compare()
894 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
895 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
896 if (sym == &symbol_yes) in expr_trans_compare()
898 if (sym == &symbol_no) in expr_trans_compare()
904 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
905 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
906 if (sym == &symbol_yes) in expr_trans_compare()
908 if (sym == &symbol_no) in expr_trans_compare()
914 return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym); in expr_trans_compare()
918 if (sym == &symbol_yes) in expr_trans_compare()
920 if (sym == &symbol_mod) in expr_trans_compare()
922 if (sym == &symbol_no) in expr_trans_compare()
925 if (sym == &symbol_yes) in expr_trans_compare()
927 if (sym == &symbol_mod) in expr_trans_compare()
929 if (sym == &symbol_no) in expr_trans_compare()
934 return expr_alloc_comp(type, e->left.sym, sym); in expr_trans_compare()
953 sym_calc_value(e->left.sym); in expr_calc_value()
954 return e->left.sym->curr.tri; in expr_calc_value()
967 sym_calc_value(e->left.sym); in expr_calc_value()
968 sym_calc_value(e->right.sym); in expr_calc_value()
969 str1 = sym_get_string_value(e->left.sym); in expr_calc_value()
970 str2 = sym_get_string_value(e->right.sym); in expr_calc_value()
973 sym_calc_value(e->left.sym); in expr_calc_value()
974 sym_calc_value(e->right.sym); in expr_calc_value()
975 str1 = sym_get_string_value(e->left.sym); in expr_calc_value()
976 str2 = sym_get_string_value(e->right.sym); in expr_calc_value()
1027 if (e->left.sym->name) in expr_print()
1028 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1037 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1039 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1042 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1044 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1057 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1065 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1067 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1082 static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) in expr_print_file_helper() argument
1092 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) in expr_print_gstr_helper() argument