Lines Matching refs:expr
2583 expr = self._parse_expr(True)
2588 return expr
3125 expr = self._parse_expr(True) if self._check_token(_T_IF) else self.y
3130 return expr
3857 def warn_select_imply(sym, expr, expr_type): argument
3863 for si in split_expr(expr, OR):
5925 def _strip_dep(self, expr): argument
5931 if self.dep is expr:
5935 if expr.__class__ is tuple and expr[0] is AND and expr[2] is self.dep:
5936 return expr[1]
5938 return expr
6032 def expr_value(expr): argument
6043 if expr.__class__ is not tuple:
6044 return expr.tri_value
6046 if expr[0] is AND:
6047 v1 = expr_value(expr[1])
6050 return 0 if not v1 else min(v1, expr_value(expr[2]))
6052 if expr[0] is OR:
6053 v1 = expr_value(expr[1])
6055 return 2 if v1 == 2 else max(v1, expr_value(expr[2]))
6057 if expr[0] is NOT:
6058 return 2 - expr_value(expr[1])
6066 rel, v1, v2 = expr
6104 def expr_str(expr, sc_expr_str_fn=standard_sc_expr_str): argument
6122 if expr.__class__ is not tuple:
6123 return sc_expr_str_fn(expr)
6125 if expr[0] is AND:
6126 return "{} && {}".format(_parenthesize(expr[1], OR, sc_expr_str_fn),
6127 _parenthesize(expr[2], OR, sc_expr_str_fn))
6129 if expr[0] is OR:
6132 return "{} || {}".format(_parenthesize(expr[1], AND, sc_expr_str_fn),
6133 _parenthesize(expr[2], AND, sc_expr_str_fn))
6135 if expr[0] is NOT:
6136 if expr[1].__class__ is tuple:
6137 return "!({})".format(expr_str(expr[1], sc_expr_str_fn))
6138 return "!" + sc_expr_str_fn(expr[1]) # Symbol
6144 return "{} {} {}".format(sc_expr_str_fn(expr[1]), REL_TO_STR[expr[0]],
6145 sc_expr_str_fn(expr[2]))
6148 def expr_items(expr): argument
6171 rec(expr)
6175 def split_expr(expr, op): argument
6216 rec(expr)
6360 def _depend_on(sc, expr): argument
6365 if expr.__class__ is tuple:
6368 _depend_on(sc, expr[1])
6371 if expr[0] is not NOT:
6372 _depend_on(sc, expr[2])
6374 elif not expr.is_constant:
6376 expr._dependents.add(sc)
6379 def _parenthesize(expr, type_, sc_expr_str_fn): argument
6382 if expr.__class__ is tuple and expr[0] is type_:
6383 return "({})".format(expr_str(expr, sc_expr_str_fn))
6384 return expr_str(expr, sc_expr_str_fn)
6488 def _expr_depends_on(expr, sym): argument
6493 if expr.__class__ is not tuple:
6494 return expr is sym
6496 if expr[0] in _EQUAL_UNEQUAL:
6500 left, right = expr[1:]
6507 return (expr[0] is EQUAL and right is sym.kconfig.m or
6509 (expr[0] is UNEQUAL and right is sym.kconfig.n)
6511 return expr[0] is AND and \
6512 (_expr_depends_on(expr[1], sym) or
6513 _expr_depends_on(expr[2], sym))