Lines Matching refs:sym

18 struct expr *expr_alloc_symbol(struct symbol *sym)  in expr_alloc_symbol()  argument
22 e->left.sym = sym; in expr_alloc_symbol()
47 e->left.sym = s1; in expr_alloc_comp()
48 e->right.sym = s2; in expr_alloc_comp()
88 e->left.sym = org->left.sym; in expr_copy()
89 e->right.sym = org->right.sym; in expr_copy()
168 e1->left.sym == e2->left.sym && in __expr_eliminate_eq()
169 (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no)) in __expr_eliminate_eq()
272 return e1->left.sym == e2->left.sym && e1->right.sym == e2->right.sym; in expr_eq()
274 return e1->left.sym == e2->left.sym; in expr_eq()
284 e1->left.sym == e2->left.sym); in expr_eq()
325 if (e->left.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
329 e->left.sym = &symbol_no; in expr_eliminate_yn()
332 } else if (e->left.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
341 if (e->right.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
345 e->left.sym = &symbol_no; in expr_eliminate_yn()
348 } else if (e->right.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
361 if (e->left.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
367 } else if (e->left.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
371 e->left.sym = &symbol_yes; in expr_eliminate_yn()
377 if (e->right.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
383 } else if (e->right.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
387 e->left.sym = &symbol_yes; in expr_eliminate_yn()
415 if (e->left.sym->type == S_TRISTATE) { in expr_trans_bool()
416 if (e->right.sym == &symbol_no) { in expr_trans_bool()
418 e->right.sym = NULL; in expr_trans_bool()
446 sym1 = tmp->left.sym; in expr_join_or()
448 sym1 = e1->left.sym; in expr_join_or()
452 sym2 = e2->left.expr->left.sym; in expr_join_or()
454 sym2 = e2->left.sym; in expr_join_or()
461 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_or()
462 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) { in expr_join_or()
467 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_or()
468 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) { in expr_join_or()
473 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_or()
474 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) { in expr_join_or()
510 sym1 = tmp->left.sym; in expr_join_and()
512 sym1 = e1->left.sym; in expr_join_and()
516 sym2 = e2->left.expr->left.sym; in expr_join_and()
518 sym2 = e2->left.sym; in expr_join_and()
524 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
525 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
529 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || in expr_join_and()
530 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) in expr_join_and()
534 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
535 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) in expr_join_and()
542 sym2 = e1->right.sym; in expr_join_and()
543 if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
544 return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
549 sym2 = e2->right.sym; in expr_join_and()
550 if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
551 return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
555 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_and()
556 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) in expr_join_and()
561 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_and()
562 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) in expr_join_and()
567 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_and()
568 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) in expr_join_and()
572 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
573 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) || in expr_join_and()
574 (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
575 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
717 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
719 if (e->right.sym == &symbol_no) { in expr_transform()
721 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
722 e->right.sym = NULL; in expr_transform()
725 if (e->right.sym == &symbol_mod) { in expr_transform()
726 printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name); in expr_transform()
728 e->left.sym = &symbol_no; in expr_transform()
729 e->right.sym = NULL; in expr_transform()
732 if (e->right.sym == &symbol_yes) { in expr_transform()
734 e->right.sym = NULL; in expr_transform()
739 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
741 if (e->right.sym == &symbol_no) { in expr_transform()
743 e->right.sym = NULL; in expr_transform()
746 if (e->right.sym == &symbol_mod) { in expr_transform()
747 printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name); in expr_transform()
749 e->left.sym = &symbol_yes; in expr_transform()
750 e->right.sym = NULL; in expr_transform()
753 if (e->right.sym == &symbol_yes) { in expr_transform()
755 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
756 e->right.sym = NULL; in expr_transform()
813 if (e->left.expr->left.sym == &symbol_yes) { in expr_transform()
819 e->left.sym = &symbol_no; in expr_transform()
822 if (e->left.expr->left.sym == &symbol_mod) { in expr_transform()
828 e->left.sym = &symbol_mod; in expr_transform()
831 if (e->left.expr->left.sym == &symbol_no) { in expr_transform()
837 e->left.sym = &symbol_yes; in expr_transform()
851 int expr_contains_symbol(struct expr *dep, struct symbol *sym) in expr_contains_symbol() argument
859 return expr_contains_symbol(dep->left.expr, sym) || in expr_contains_symbol()
860 expr_contains_symbol(dep->right.expr, sym); in expr_contains_symbol()
862 return dep->left.sym == sym; in expr_contains_symbol()
869 return dep->left.sym == sym || in expr_contains_symbol()
870 dep->right.sym == sym; in expr_contains_symbol()
872 return expr_contains_symbol(dep->left.expr, sym); in expr_contains_symbol()
879 bool expr_depends_symbol(struct expr *dep, struct symbol *sym) in expr_depends_symbol() argument
886 return expr_depends_symbol(dep->left.expr, sym) || in expr_depends_symbol()
887 expr_depends_symbol(dep->right.expr, sym); in expr_depends_symbol()
889 return dep->left.sym == sym; in expr_depends_symbol()
891 if (dep->left.sym == sym) { in expr_depends_symbol()
892 if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod) in expr_depends_symbol()
897 if (dep->left.sym == sym) { in expr_depends_symbol()
898 if (dep->right.sym == &symbol_no) in expr_depends_symbol()
922 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym) in expr_trans_compare() argument
927 e = expr_alloc_symbol(sym); in expr_trans_compare()
934 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
935 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
936 if (sym == &symbol_yes) in expr_trans_compare()
938 if (sym == &symbol_no) in expr_trans_compare()
944 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
945 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
946 if (sym == &symbol_yes) in expr_trans_compare()
948 if (sym == &symbol_no) in expr_trans_compare()
954 return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym); in expr_trans_compare()
962 if (sym == &symbol_yes) in expr_trans_compare()
964 if (sym == &symbol_mod) in expr_trans_compare()
966 if (sym == &symbol_no) in expr_trans_compare()
969 if (sym == &symbol_yes) in expr_trans_compare()
971 if (sym == &symbol_mod) in expr_trans_compare()
973 if (sym == &symbol_no) in expr_trans_compare()
978 return expr_alloc_comp(type, e->left.sym, sym); in expr_trans_compare()
1043 sym_calc_value(e->left.sym); in expr_calc_value()
1044 return e->left.sym->curr.tri; in expr_calc_value()
1068 sym_calc_value(e->left.sym); in expr_calc_value()
1069 sym_calc_value(e->right.sym); in expr_calc_value()
1070 str1 = sym_get_string_value(e->left.sym); in expr_calc_value()
1071 str2 = sym_get_string_value(e->right.sym); in expr_calc_value()
1073 if (e->left.sym->type != S_STRING || e->right.sym->type != S_STRING) { in expr_calc_value()
1074 k1 = expr_parse_string(str1, e->left.sym->type, &lval); in expr_calc_value()
1075 k2 = expr_parse_string(str2, e->right.sym->type, &rval); in expr_calc_value()
1151 if (e->left.sym->name) in expr_print()
1152 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1161 if (e->left.sym->name) in expr_print()
1162 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1166 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1170 if (e->left.sym->name) in expr_print()
1171 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1175 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1179 if (e->left.sym->name) in expr_print()
1180 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1184 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1187 if (e->left.sym->name) in expr_print()
1188 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1192 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1205 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1213 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1215 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1230 static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) in expr_print_file_helper() argument
1240 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) in expr_print_gstr_helper() argument
1245 if (sym) in expr_print_gstr_helper()
1246 sym_str = sym_get_string_value(sym); in expr_print_gstr_helper()
1266 if (sym && sym->type != S_UNKNOWN) in expr_print_gstr_helper()