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()
167 e1->left.sym == e2->left.sym && in __expr_eliminate_eq()
168 (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no)) in __expr_eliminate_eq()
264 return e1->left.sym == e2->left.sym && e1->right.sym == e2->right.sym; in expr_eq()
266 return e1->left.sym == e2->left.sym; in expr_eq()
276 e1->left.sym == e2->left.sym); in expr_eq()
317 if (e->left.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
321 e->left.sym = &symbol_no; in expr_eliminate_yn()
324 } else if (e->left.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
333 if (e->right.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
337 e->left.sym = &symbol_no; in expr_eliminate_yn()
340 } else if (e->right.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
353 if (e->left.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
359 } else if (e->left.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
363 e->left.sym = &symbol_yes; in expr_eliminate_yn()
369 if (e->right.expr->left.sym == &symbol_no) { in expr_eliminate_yn()
375 } else if (e->right.expr->left.sym == &symbol_yes) { in expr_eliminate_yn()
379 e->left.sym = &symbol_yes; in expr_eliminate_yn()
407 if (e->left.sym->type == S_TRISTATE) { in expr_trans_bool()
408 if (e->right.sym == &symbol_no) { in expr_trans_bool()
410 e->right.sym = NULL; in expr_trans_bool()
438 sym1 = tmp->left.sym; in expr_join_or()
440 sym1 = e1->left.sym; in expr_join_or()
444 sym2 = e2->left.expr->left.sym; in expr_join_or()
446 sym2 = e2->left.sym; in expr_join_or()
453 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_or()
454 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) { in expr_join_or()
459 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_or()
460 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) { in expr_join_or()
465 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_or()
466 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) { in expr_join_or()
502 sym1 = tmp->left.sym; in expr_join_and()
504 sym1 = e1->left.sym; in expr_join_and()
508 sym2 = e2->left.expr->left.sym; in expr_join_and()
510 sym2 = e2->left.sym; in expr_join_and()
516 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
517 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
521 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || in expr_join_and()
522 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) in expr_join_and()
526 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
527 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) in expr_join_and()
534 sym2 = e1->right.sym; in expr_join_and()
535 if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
536 return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
541 sym2 = e2->right.sym; in expr_join_and()
542 if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
543 return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
547 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_and()
548 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) in expr_join_and()
553 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_and()
554 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) in expr_join_and()
559 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_and()
560 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) in expr_join_and()
564 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
565 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) || in expr_join_and()
566 (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
567 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
709 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
711 if (e->right.sym == &symbol_no) { in expr_transform()
713 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
714 e->right.sym = NULL; in expr_transform()
717 if (e->right.sym == &symbol_mod) { in expr_transform()
718 printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name); in expr_transform()
720 e->left.sym = &symbol_no; in expr_transform()
721 e->right.sym = NULL; in expr_transform()
724 if (e->right.sym == &symbol_yes) { in expr_transform()
726 e->right.sym = NULL; in expr_transform()
731 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
733 if (e->right.sym == &symbol_no) { in expr_transform()
735 e->right.sym = NULL; in expr_transform()
738 if (e->right.sym == &symbol_mod) { in expr_transform()
739 printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name); in expr_transform()
741 e->left.sym = &symbol_yes; in expr_transform()
742 e->right.sym = NULL; in expr_transform()
745 if (e->right.sym == &symbol_yes) { in expr_transform()
747 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
748 e->right.sym = NULL; in expr_transform()
805 if (e->left.expr->left.sym == &symbol_yes) { in expr_transform()
811 e->left.sym = &symbol_no; in expr_transform()
814 if (e->left.expr->left.sym == &symbol_mod) { in expr_transform()
820 e->left.sym = &symbol_mod; in expr_transform()
823 if (e->left.expr->left.sym == &symbol_no) { in expr_transform()
829 e->left.sym = &symbol_yes; in expr_transform()
843 int expr_contains_symbol(struct expr *dep, struct symbol *sym) in expr_contains_symbol() argument
851 return expr_contains_symbol(dep->left.expr, sym) || in expr_contains_symbol()
852 expr_contains_symbol(dep->right.expr, sym); in expr_contains_symbol()
854 return dep->left.sym == sym; in expr_contains_symbol()
861 return dep->left.sym == sym || in expr_contains_symbol()
862 dep->right.sym == sym; in expr_contains_symbol()
864 return expr_contains_symbol(dep->left.expr, sym); in expr_contains_symbol()
871 bool expr_depends_symbol(struct expr *dep, struct symbol *sym) in expr_depends_symbol() argument
878 return expr_depends_symbol(dep->left.expr, sym) || in expr_depends_symbol()
879 expr_depends_symbol(dep->right.expr, sym); in expr_depends_symbol()
881 return dep->left.sym == sym; in expr_depends_symbol()
883 if (dep->left.sym == sym) { in expr_depends_symbol()
884 if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod) in expr_depends_symbol()
889 if (dep->left.sym == sym) { in expr_depends_symbol()
890 if (dep->right.sym == &symbol_no) in expr_depends_symbol()
914 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym) in expr_trans_compare() argument
919 e = expr_alloc_symbol(sym); in expr_trans_compare()
926 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
927 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
928 if (sym == &symbol_yes) in expr_trans_compare()
930 if (sym == &symbol_no) in expr_trans_compare()
936 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
937 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
938 if (sym == &symbol_yes) in expr_trans_compare()
940 if (sym == &symbol_no) in expr_trans_compare()
946 return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym); in expr_trans_compare()
954 if (sym == &symbol_yes) in expr_trans_compare()
956 if (sym == &symbol_mod) in expr_trans_compare()
958 if (sym == &symbol_no) in expr_trans_compare()
961 if (sym == &symbol_yes) in expr_trans_compare()
963 if (sym == &symbol_mod) in expr_trans_compare()
965 if (sym == &symbol_no) in expr_trans_compare()
970 return expr_alloc_comp(type, e->left.sym, sym); in expr_trans_compare()
1039 sym_calc_value(e->left.sym); in expr_calc_value()
1040 return e->left.sym->curr.tri; in expr_calc_value()
1064 sym_calc_value(e->left.sym); in expr_calc_value()
1065 sym_calc_value(e->right.sym); in expr_calc_value()
1066 str1 = sym_get_string_value(e->left.sym); in expr_calc_value()
1067 str2 = sym_get_string_value(e->right.sym); in expr_calc_value()
1069 if (e->left.sym->type != S_STRING || e->right.sym->type != S_STRING) { in expr_calc_value()
1070 k1 = expr_parse_string(str1, e->left.sym->type, &lval); in expr_calc_value()
1071 k2 = expr_parse_string(str2, e->right.sym->type, &rval); in expr_calc_value()
1153 if (e->left.sym->name) in expr_print()
1154 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1163 if (e->left.sym->name) in expr_print()
1164 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1168 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1172 if (e->left.sym->name) in expr_print()
1173 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1177 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1181 if (e->left.sym->name) in expr_print()
1182 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1186 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1189 if (e->left.sym->name) in expr_print()
1190 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1194 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1207 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1215 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1217 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1232 static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) in expr_print_file_helper() argument
1242 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) in expr_print_gstr_helper() argument
1247 if (sym) in expr_print_gstr_helper()
1248 sym_str = sym_get_string_value(sym); in expr_print_gstr_helper()
1268 if (sym && sym->type != S_UNKNOWN) in expr_print_gstr_helper()