Lines Matching refs:sym

998             sym = Symbol()
999 sym.kconfig = self
1000 sym.name = nmy
1001 sym.is_constant = True
1002 sym.orig_type = TRISTATE
1003 sym._cached_tri_val = STR_TO_TRI[nmy]
1005 self.const_syms[nmy] = sym
1013 sym = self.const_syms[nmy]
1014 sym.rev_dep = sym.weak_rev_dep = sym.direct_dep = self.n
1119 for sym in self.unique_defined_syms:
1120 check_dep_loop_sym(sym, False)
1258 for sym in self.unique_defined_syms:
1259 sym._was_set = False
1276 sym = get_sym(name)
1277 if not sym or not sym.nodes:
1281 if sym.orig_type in _BOOL_TRISTATE:
1284 if not (sym.orig_type is BOOL
1286 sym.orig_type is TRISTATE
1290 .format(val, TYPE_TO_STR[sym.orig_type],
1291 sym.name_and_loc),
1297 if sym.choice and val != "n":
1302 prev_mode = sym.choice.user_value
1311 sym.choice.set_value(val)
1313 elif sym.orig_type is STRING:
1318 .format(sym.name_and_loc),
1339 sym = get_sym(name)
1340 if not sym or not sym.nodes:
1344 if sym.orig_type not in _BOOL_TRISTATE:
1351 if sym._was_set:
1352 self._assigned_twice(sym, val, filename, linenr)
1354 sym.set_value(val)
1360 for sym in self.unique_defined_syms:
1361 if not sym._was_set:
1362 sym.unset_value()
1377 def _assigned_twice(self, sym, new_val, filename, linenr): argument
1381 if sym.orig_type in _BOOL_TRISTATE:
1382 user_val = TRI_TO_STR[sym.user_value]
1384 user_val = sym.user_value
1387 sym.name_and_loc, user_val, new_val)
1470 for sym in self.unique_defined_syms:
1477 val = sym.str_value
1478 if not sym._write_to_conf:
1481 if sym.orig_type in _BOOL_TRISTATE:
1484 .format(self.config_prefix, sym.name))
1487 .format(self.config_prefix, sym.name))
1489 elif sym.orig_type is STRING:
1491 .format(self.config_prefix, sym.name, escape(val)))
1494 if sym.orig_type is HEX and \
1499 .format(self.config_prefix, sym.name, val))
1594 for sym in self.unique_defined_syms:
1595 sym._visited = False
1705 for sym in self.unique_defined_syms:
1709 if not sym.choice and \
1710 sym.visibility <= expr_value(sym.rev_dep):
1714 if sym.str_value == sym._str_default():
1721 if sym.choice and \
1722 not sym.choice.is_optional and \
1723 sym.choice._selection_from_defaults() is sym and \
1724 sym.orig_type is BOOL and \
1725 sym.tri_value == 2:
1728 add(sym.config_string)
1800 for sym in self.unique_defined_syms:
1807 val = sym.str_value
1812 if sym._write_to_conf:
1813 if sym._old_val is None and \
1814 sym.orig_type in _BOOL_TRISTATE and \
1820 if val == sym._old_val:
1824 elif sym._old_val is None:
1832 _touch_dep_file(path, sym.name)
1849 for sym in self.unique_defined_syms:
1850 sym._old_val = None
1870 sym = self.syms[name]
1872 if sym.orig_type is STRING:
1903 sym.config_string for sym in self.unique_defined_syms
1904 if not (sym.orig_type in _BOOL_TRISTATE and not sym.tri_value)
1931 for sym in self.unique_defined_syms:
1932 sym._visited = False
2000 for sym in self.unique_defined_syms:
2001 sym.unset_value()
2305 sym = Symbol()
2306 sym.kconfig = self
2307 sym.name = name
2308 sym.is_constant = False
2309 sym.rev_dep = sym.weak_rev_dep = sym.direct_dep = self.n
2312 self.syms[name] = sym
2316 return sym
2324 sym = Symbol()
2325 sym.kconfig = self
2326 sym.name = name
2327 sym.is_constant = True
2328 sym.rev_dep = sym.weak_rev_dep = sym.direct_dep = self.n
2331 self.const_syms[name] = sym
2333 return sym
2919 sym = self._tokens[1]
2921 if sym.__class__ is not Symbol or sym.is_constant:
2927 self.defined_syms.append(sym)
2931 node.item = sym
2939 sym.nodes.append(node)
2945 .format(sym.name_and_loc))
3480 for sym in self.unique_defined_syms:
3484 for node in sym.nodes:
3486 depend_on(sym, node.prompt[1])
3489 for value, cond in sym.defaults:
3490 depend_on(sym, value)
3491 depend_on(sym, cond)
3494 depend_on(sym, sym.rev_dep)
3495 depend_on(sym, sym.weak_rev_dep)
3498 for low, high, cond in sym.ranges:
3499 depend_on(sym, low)
3500 depend_on(sym, high)
3501 depend_on(sym, cond)
3508 depend_on(sym, sym.direct_dep)
3538 for sym in choice.syms:
3539 sym._dependents.add(choice)
3545 for sym in self.unique_defined_syms:
3546 sym._invalidate()
3699 sym = node.item
3702 sym.direct_dep = self._make_or(sym.direct_dep, node.dep)
3704 sym.defaults += node.defaults
3705 sym.ranges += node.ranges
3706 sym.selects += node.selects
3707 sym.implies += node.implies
3713 self._make_and(sym, cond))
3720 self._make_and(sym, cond))
3730 def num_ok(sym, type_): argument
3736 if not sym.nodes:
3737 return _is_base_n(sym.name, _TYPE_TO_BASE[type_])
3739 return sym.orig_type is type_
3741 for sym in self.unique_defined_syms:
3742 if sym.orig_type in _BOOL_TRISTATE:
3746 for target_sym, _ in sym.selects:
3750 .format(sym.name_and_loc,
3754 for target_sym, _ in sym.implies:
3758 .format(sym.name_and_loc,
3762 elif sym.orig_type: # STRING/INT/HEX
3763 for default, _ in sym.defaults:
3768 .format(TYPE_TO_STR[sym.orig_type],
3769 sym.name_and_loc, expr_str(default)))
3771 if sym.orig_type is STRING:
3780 + sym.name_and_loc)
3782 elif not num_ok(default, sym.orig_type): # INT/HEX
3784 .format(TYPE_TO_STR[sym.orig_type],
3785 sym.name_and_loc,
3788 if sym.selects or sym.implies:
3790 .format(TYPE_TO_STR[sym.orig_type],
3791 sym.name_and_loc))
3795 .format(sym.name_and_loc))
3798 if sym.ranges:
3799 if sym.orig_type not in _INT_HEX:
3802 .format(TYPE_TO_STR[sym.orig_type],
3803 sym.name_and_loc))
3805 for low, high, _ in sym.ranges:
3806 if not num_ok(low, sym.orig_type) or \
3807 not num_ok(high, sym.orig_type):
3811 .format(TYPE_TO_STR[sym.orig_type],
3812 sym.name_and_loc,
3820 def warn_select_imply(sym, expr, expr_type): argument
3823 .format(sym.name_and_loc, expr_type)
3855 for sym in choice.syms:
3856 if sym.defaults:
3859 "symbols".format(sym.name_and_loc))
3861 if sym.rev_dep is not sym.kconfig.n:
3862 warn_select_imply(sym, sym.rev_dep, "selected")
3864 if sym.weak_rev_dep is not sym.kconfig.n:
3865 warn_select_imply(sym, sym.weak_rev_dep, "implied")
3867 for node in sym.nodes:
3871 .format(sym.name_and_loc))
3876 .format(sym.name_and_loc))
3951 for sym in (self.syms.viewvalues if _IS_PY2 else self.syms.values)():
3959 if not sym.nodes and not is_num(sym.name) and \
3960 sym.name != "MODULES":
3962 msg = "undefined symbol {}:".format(sym.name)
3964 if sym in node.referenced:
4365 for sym, cond in self.defaults:
4369 val = sym.str_value
4410 for sym, cond in self.defaults:
4412 val = sym.str_value
5442 for sym, cond in self.defaults:
5444 if expr_value(cond) and sym.visibility:
5445 return sym
5448 for sym in self.syms:
5449 if sym.visibility:
5450 return sym
6367 def _sym_to_num(sym): argument
6374 return sym.tri_value if sym.orig_type in _BOOL_TRISTATE else \
6375 int(sym.str_value, _TYPE_TO_BASE[sym.orig_type])
6439 def _expr_depends_on(expr, sym): argument
6445 return expr is sym
6453 if right is sym:
6455 elif left is not sym:
6458 return (expr[0] is EQUAL and right is sym.kconfig.m or
6459 right is sym.kconfig.y) or \
6460 (expr[0] is UNEQUAL and right is sym.kconfig.n)
6463 (_expr_depends_on(expr[1], sym) or
6464 _expr_depends_on(expr[2], sym))
6554 for sym in choice.syms:
6555 if not sym.orig_type:
6556 sym.orig_type = choice.orig_type
6559 def _check_dep_loop_sym(sym, ignore_choice): argument
6592 if not sym._visited:
6595 sym._visited = 1
6597 for dep in sym._dependents:
6610 return _found_dep_loop(loop, sym)
6612 if sym.choice and not ignore_choice:
6613 loop = _check_dep_loop_choice(sym.choice, sym)
6616 return _found_dep_loop(loop, sym)
6619 sym._visited = 2
6624 if sym._visited == 2:
6631 return (sym,)
6643 for sym in choice.syms:
6644 if sym is not skip:
6647 loop = _check_dep_loop_sym(sym, True)