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
1121 for sym in self.unique_defined_syms:
1122 check_dep_loop_sym(sym, False)
1260 for sym in self.unique_defined_syms:
1261 sym._was_set = False
1278 sym = get_sym(name)
1279 if not sym or not sym.nodes:
1283 if sym.orig_type in _BOOL_TRISTATE:
1286 if not (sym.orig_type is BOOL
1288 sym.orig_type is TRISTATE
1292 .format(val, TYPE_TO_STR[sym.orig_type],
1293 sym.name_and_loc),
1299 if sym.choice and val != "n":
1304 prev_mode = sym.choice.user_value
1313 sym.choice.set_value(val)
1315 elif sym.orig_type is STRING:
1320 .format(sym.name_and_loc),
1341 sym = get_sym(name)
1342 if not sym or not sym.nodes:
1346 if sym.orig_type not in _BOOL_TRISTATE:
1353 if sym._was_set:
1354 self._assigned_twice(sym, val, filename, linenr)
1356 sym.set_value(val)
1362 for sym in self.unique_defined_syms:
1363 if not sym._was_set:
1364 sym.unset_value()
1379 def _assigned_twice(self, sym, new_val, filename, linenr): argument
1383 if sym.orig_type in _BOOL_TRISTATE:
1384 user_val = TRI_TO_STR[sym.user_value]
1386 user_val = sym.user_value
1389 sym.name_and_loc, user_val, new_val)
1472 for sym in self.unique_defined_syms:
1479 val = sym.str_value
1480 if not sym._write_to_conf:
1483 if sym.orig_type in _BOOL_TRISTATE:
1486 .format(self.config_prefix, sym.name))
1489 .format(self.config_prefix, sym.name))
1491 elif sym.orig_type is STRING:
1493 .format(self.config_prefix, sym.name, escape(val)))
1496 if sym.orig_type is HEX and \
1501 .format(self.config_prefix, sym.name, val))
1595 for sym in self.unique_defined_syms:
1596 sym._visited = False
1706 for sym in self.unique_defined_syms:
1710 if not sym.choice and \
1711 sym.visibility <= expr_value(sym.rev_dep):
1715 if sym.str_value == sym._str_default():
1722 if sym.choice and \
1723 not sym.choice.is_optional and \
1724 sym.choice._selection_from_defaults() is sym and \
1725 sym.orig_type is BOOL and \
1726 sym.tri_value == 2:
1729 add(sym.config_string)
1801 for sym in self.unique_defined_syms:
1808 val = sym.str_value
1813 if sym._write_to_conf:
1814 if sym._old_val is None and \
1815 sym.orig_type in _BOOL_TRISTATE and \
1821 if val == sym._old_val:
1825 elif sym._old_val is None:
1833 _touch_dep_file(path, sym.name)
1850 for sym in self.unique_defined_syms:
1851 sym._old_val = None
1871 sym = self.syms[name]
1873 if sym.orig_type is STRING:
1904 sym.config_string for sym in self.unique_defined_syms
1905 if not (sym.orig_type in _BOOL_TRISTATE and not sym.tri_value)
1932 for sym in self.unique_defined_syms:
1933 sym._visited = False
2001 for sym in self.unique_defined_syms:
2002 sym.unset_value()
2306 sym = Symbol()
2307 sym.kconfig = self
2308 sym.name = name
2309 sym.is_constant = False
2310 sym.configdefaults = []
2311 sym.rev_dep = sym.weak_rev_dep = sym.direct_dep = self.n
2314 self.syms[name] = sym
2318 return sym
2326 sym = Symbol()
2327 sym.kconfig = self
2328 sym.name = name
2329 sym.is_constant = True
2330 sym.configdefaults = []
2331 sym.rev_dep = sym.weak_rev_dep = sym.direct_dep = self.n
2334 self.const_syms[name] = sym
2336 return sym
2922 sym = self._tokens[1]
2924 if sym.__class__ is not Symbol or sym.is_constant:
2930 self.defined_syms.append(sym)
2934 node.item = sym
2943 sym.nodes.append(node)
2957 .format(sym.name_and_loc))
3492 for sym in self.unique_defined_syms:
3496 for node in sym.nodes:
3498 depend_on(sym, node.prompt[1])
3501 for value, cond in sym.defaults:
3502 depend_on(sym, value)
3503 depend_on(sym, cond)
3506 depend_on(sym, sym.rev_dep)
3507 depend_on(sym, sym.weak_rev_dep)
3510 for low, high, cond in sym.ranges:
3511 depend_on(sym, low)
3512 depend_on(sym, high)
3513 depend_on(sym, cond)
3520 depend_on(sym, sym.direct_dep)
3550 for sym in choice.syms:
3551 sym._dependents.add(choice)
3557 for sym in self.unique_defined_syms:
3558 sym._invalidate()
3567 def _finalize_sym(self, sym): argument
3576 for (idx, defaults) in sym.configdefaults:
3581 default = (d[0], self._make_and(sym.direct_dep, d[1]))
3582 sym.defaults.insert(inserted + idx, default)
3728 sym = node.item
3735 sym.configdefaults.append((len(sym.defaults), node.defaults))
3739 sym.direct_dep = self._make_or(sym.direct_dep, node.dep)
3741 sym.defaults += node.defaults
3742 sym.ranges += node.ranges
3743 sym.selects += node.selects
3744 sym.implies += node.implies
3750 self._make_and(sym, cond))
3757 self._make_and(sym, cond))
3767 def num_ok(sym, type_): argument
3773 if not sym.nodes:
3774 return _is_base_n(sym.name, _TYPE_TO_BASE[type_])
3776 return sym.orig_type is type_
3778 for sym in self.unique_defined_syms:
3779 if sym.orig_type in _BOOL_TRISTATE:
3783 for target_sym, _ in sym.selects:
3787 .format(sym.name_and_loc,
3791 for target_sym, _ in sym.implies:
3795 .format(sym.name_and_loc,
3799 elif sym.orig_type: # STRING/INT/HEX
3800 for default, _ in sym.defaults:
3805 .format(TYPE_TO_STR[sym.orig_type],
3806 sym.name_and_loc, expr_str(default)))
3808 if sym.orig_type is STRING:
3817 + sym.name_and_loc)
3819 elif not num_ok(default, sym.orig_type): # INT/HEX
3821 .format(TYPE_TO_STR[sym.orig_type],
3822 sym.name_and_loc,
3825 if sym.selects or sym.implies:
3827 .format(TYPE_TO_STR[sym.orig_type],
3828 sym.name_and_loc))
3832 .format(sym.name_and_loc))
3835 if sym.ranges:
3836 if sym.orig_type not in _INT_HEX:
3839 .format(TYPE_TO_STR[sym.orig_type],
3840 sym.name_and_loc))
3842 for low, high, _ in sym.ranges:
3843 if not num_ok(low, sym.orig_type) or \
3844 not num_ok(high, sym.orig_type):
3848 .format(TYPE_TO_STR[sym.orig_type],
3849 sym.name_and_loc,
3857 def warn_select_imply(sym, expr, expr_type): argument
3860 .format(sym.name_and_loc, expr_type)
3892 for sym in choice.syms:
3893 if sym.defaults:
3896 "symbols".format(sym.name_and_loc))
3898 if sym.rev_dep is not sym.kconfig.n:
3899 warn_select_imply(sym, sym.rev_dep, "selected")
3901 if sym.weak_rev_dep is not sym.kconfig.n:
3902 warn_select_imply(sym, sym.weak_rev_dep, "implied")
3904 for node in sym.nodes:
3908 .format(sym.name_and_loc))
3913 .format(sym.name_and_loc))
3988 for sym in (self.syms.viewvalues if _IS_PY2 else self.syms.values)():
3996 if not sym.nodes and not is_num(sym.name) and \
3997 sym.name != "MODULES":
3999 msg = "undefined symbol {}:".format(sym.name)
4001 if sym in node.referenced:
4403 for sym, cond in self.defaults:
4407 val = sym.str_value
4448 for sym, cond in self.defaults:
4450 val = sym.str_value
5480 for sym, cond in self.defaults:
5482 if expr_value(cond) and sym.visibility:
5483 return sym
5486 for sym in self.syms:
5487 if sym.visibility:
5488 return sym
6411 def _sym_to_num(sym): argument
6418 return sym.tri_value if sym.orig_type in _BOOL_TRISTATE else \
6419 int(sym.str_value, _TYPE_TO_BASE[sym.orig_type])
6488 def _expr_depends_on(expr, sym): argument
6494 return expr is sym
6502 if right is sym:
6504 elif left is not sym:
6507 return (expr[0] is EQUAL and right is sym.kconfig.m or
6508 right is sym.kconfig.y) or \
6509 (expr[0] is UNEQUAL and right is sym.kconfig.n)
6512 (_expr_depends_on(expr[1], sym) or
6513 _expr_depends_on(expr[2], sym))
6603 for sym in choice.syms:
6604 if not sym.orig_type:
6605 sym.orig_type = choice.orig_type
6608 def _check_dep_loop_sym(sym, ignore_choice): argument
6641 if not sym._visited:
6644 sym._visited = 1
6646 for dep in sym._dependents:
6659 return _found_dep_loop(loop, sym)
6661 if sym.choice and not ignore_choice:
6662 loop = _check_dep_loop_choice(sym.choice, sym)
6665 return _found_dep_loop(loop, sym)
6668 sym._visited = 2
6673 if sym._visited == 2:
6680 return (sym,)
6692 for sym in choice.syms:
6693 if sym is not skip:
6696 loop = _check_dep_loop_sym(sym, True)