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()
417 sym1 = tmp->left.sym; in expr_join_or()
419 sym1 = e1->left.sym; in expr_join_or()
423 sym2 = e2->left.expr->left.sym; in expr_join_or()
425 sym2 = e2->left.sym; in expr_join_or()
432 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_or()
433 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) { in expr_join_or()
438 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_or()
439 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) { in expr_join_or()
444 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_or()
445 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) { in expr_join_or()
481 sym1 = tmp->left.sym; in expr_join_and()
483 sym1 = e1->left.sym; in expr_join_and()
487 sym2 = e2->left.expr->left.sym; in expr_join_and()
489 sym2 = e2->left.sym; in expr_join_and()
495 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
496 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
500 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || in expr_join_and()
501 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) in expr_join_and()
505 if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
506 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) in expr_join_and()
513 sym2 = e1->right.sym; in expr_join_and()
514 if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
515 return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
520 sym2 = e2->right.sym; in expr_join_and()
521 if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) in expr_join_and()
522 return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) in expr_join_and()
526 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || in expr_join_and()
527 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) in expr_join_and()
532 ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || in expr_join_and()
533 (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) in expr_join_and()
538 ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || in expr_join_and()
539 (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) in expr_join_and()
543 if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || in expr_join_and()
544 (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) || in expr_join_and()
545 (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) || in expr_join_and()
546 (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes)) in expr_join_and()
688 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
690 if (e->right.sym == &symbol_no) { in expr_transform()
692 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
693 e->right.sym = NULL; in expr_transform()
696 if (e->right.sym == &symbol_mod) { in expr_transform()
697 printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name); in expr_transform()
699 e->left.sym = &symbol_no; in expr_transform()
700 e->right.sym = NULL; in expr_transform()
703 if (e->right.sym == &symbol_yes) { in expr_transform()
705 e->right.sym = NULL; in expr_transform()
710 if (e->left.sym->type != S_BOOLEAN) in expr_transform()
712 if (e->right.sym == &symbol_no) { 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 'y'\n", e->left.sym->name); in expr_transform()
720 e->left.sym = &symbol_yes; in expr_transform()
721 e->right.sym = NULL; in expr_transform()
724 if (e->right.sym == &symbol_yes) { in expr_transform()
726 e->left.expr = expr_alloc_symbol(e->left.sym); in expr_transform()
727 e->right.sym = NULL; in expr_transform()
784 if (e->left.expr->left.sym == &symbol_yes) { in expr_transform()
790 e->left.sym = &symbol_no; in expr_transform()
793 if (e->left.expr->left.sym == &symbol_mod) { in expr_transform()
799 e->left.sym = &symbol_mod; in expr_transform()
802 if (e->left.expr->left.sym == &symbol_no) { in expr_transform()
808 e->left.sym = &symbol_yes; in expr_transform()
822 int expr_contains_symbol(struct expr *dep, struct symbol *sym) in expr_contains_symbol() argument
830 return expr_contains_symbol(dep->left.expr, sym) || in expr_contains_symbol()
831 expr_contains_symbol(dep->right.expr, sym); in expr_contains_symbol()
833 return dep->left.sym == sym; in expr_contains_symbol()
840 return dep->left.sym == sym || in expr_contains_symbol()
841 dep->right.sym == sym; in expr_contains_symbol()
843 return expr_contains_symbol(dep->left.expr, sym); in expr_contains_symbol()
850 bool expr_depends_symbol(struct expr *dep, struct symbol *sym) in expr_depends_symbol() argument
857 return expr_depends_symbol(dep->left.expr, sym) || in expr_depends_symbol()
858 expr_depends_symbol(dep->right.expr, sym); in expr_depends_symbol()
860 return dep->left.sym == sym; in expr_depends_symbol()
862 if (dep->left.sym == sym) { in expr_depends_symbol()
863 if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod) in expr_depends_symbol()
868 if (dep->left.sym == sym) { in expr_depends_symbol()
869 if (dep->right.sym == &symbol_no) in expr_depends_symbol()
893 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym) in expr_trans_compare() argument
898 e = expr_alloc_symbol(sym); in expr_trans_compare()
905 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
906 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
907 if (sym == &symbol_yes) in expr_trans_compare()
909 if (sym == &symbol_no) in expr_trans_compare()
915 e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); in expr_trans_compare()
916 e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); in expr_trans_compare()
917 if (sym == &symbol_yes) in expr_trans_compare()
919 if (sym == &symbol_no) in expr_trans_compare()
925 return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym); in expr_trans_compare()
933 if (sym == &symbol_yes) in expr_trans_compare()
935 if (sym == &symbol_mod) in expr_trans_compare()
937 if (sym == &symbol_no) in expr_trans_compare()
940 if (sym == &symbol_yes) in expr_trans_compare()
942 if (sym == &symbol_mod) in expr_trans_compare()
944 if (sym == &symbol_no) in expr_trans_compare()
949 return expr_alloc_comp(type, e->left.sym, sym); in expr_trans_compare()
1014 sym_calc_value(e->left.sym); in expr_calc_value()
1015 return e->left.sym->curr.tri; in expr_calc_value()
1039 sym_calc_value(e->left.sym); in expr_calc_value()
1040 sym_calc_value(e->right.sym); in expr_calc_value()
1041 str1 = sym_get_string_value(e->left.sym); in expr_calc_value()
1042 str2 = sym_get_string_value(e->right.sym); in expr_calc_value()
1044 if (e->left.sym->type != S_STRING || e->right.sym->type != S_STRING) { in expr_calc_value()
1045 k1 = expr_parse_string(str1, e->left.sym->type, &lval); in expr_calc_value()
1046 k2 = expr_parse_string(str2, e->right.sym->type, &rval); in expr_calc_value()
1122 if (e->left.sym->name) in expr_print()
1123 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1132 if (e->left.sym->name) in expr_print()
1133 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1137 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1141 if (e->left.sym->name) in expr_print()
1142 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1146 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1150 if (e->left.sym->name) in expr_print()
1151 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1155 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1158 if (e->left.sym->name) in expr_print()
1159 fn(data, e->left.sym, e->left.sym->name); in expr_print()
1163 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1176 fn(data, e->right.sym, e->right.sym->name); in expr_print()
1184 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()
1201 static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) in expr_print_file_helper() argument
1211 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) in expr_print_gstr_helper() argument
1216 if (sym) in expr_print_gstr_helper()
1217 sym_str = sym_get_string_value(sym); in expr_print_gstr_helper()
1237 if (sym && sym->type != S_UNKNOWN) in expr_print_gstr_helper()