Lines Matching refs:expr
2581 expr = self._parse_expr(True)
2586 return expr
3121 expr = self._parse_expr(True) if self._check_token(_T_IF) else self.y
3126 return expr
3852 def warn_select_imply(sym, expr, expr_type): argument
3858 for si in split_expr(expr, OR):
6023 def _strip_dep(self, expr): argument
6029 if self.dep is expr:
6033 if expr.__class__ is tuple and expr[0] is AND and expr[2] is self.dep:
6034 return expr[1]
6036 return expr
6130 def expr_value(expr): argument
6141 if expr.__class__ is not tuple:
6142 return expr.tri_value
6144 if expr[0] is AND:
6145 v1 = expr_value(expr[1])
6148 return 0 if not v1 else min(v1, expr_value(expr[2]))
6150 if expr[0] is OR:
6151 v1 = expr_value(expr[1])
6153 return 2 if v1 == 2 else max(v1, expr_value(expr[2]))
6155 if expr[0] is NOT:
6156 return 2 - expr_value(expr[1])
6164 rel, v1, v2 = expr
6202 def expr_str(expr, sc_expr_str_fn=standard_sc_expr_str): argument
6220 if expr.__class__ is not tuple:
6221 return sc_expr_str_fn(expr)
6223 if expr[0] is AND:
6224 return "{} && {}".format(_parenthesize(expr[1], OR, sc_expr_str_fn),
6225 _parenthesize(expr[2], OR, sc_expr_str_fn))
6227 if expr[0] is OR:
6230 return "{} || {}".format(_parenthesize(expr[1], AND, sc_expr_str_fn),
6231 _parenthesize(expr[2], AND, sc_expr_str_fn))
6233 if expr[0] is NOT:
6234 if expr[1].__class__ is tuple:
6235 return "!({})".format(expr_str(expr[1], sc_expr_str_fn))
6236 return "!" + sc_expr_str_fn(expr[1]) # Symbol
6242 return "{} {} {}".format(sc_expr_str_fn(expr[1]), REL_TO_STR[expr[0]],
6243 sc_expr_str_fn(expr[2]))
6246 def expr_items(expr): argument
6269 rec(expr)
6273 def split_expr(expr, op): argument
6314 rec(expr)
6458 def _depend_on(sc, expr): argument
6463 if expr.__class__ is tuple:
6466 _depend_on(sc, expr[1])
6469 if expr[0] is not NOT:
6470 _depend_on(sc, expr[2])
6472 elif not expr.is_constant:
6474 expr._dependents.add(sc)
6477 def _parenthesize(expr, type_, sc_expr_str_fn): argument
6480 if expr.__class__ is tuple and expr[0] is type_:
6481 return "({})".format(expr_str(expr, sc_expr_str_fn))
6482 return expr_str(expr, sc_expr_str_fn)
6586 def _expr_depends_on(expr, sym): argument
6591 if expr.__class__ is not tuple:
6592 return expr is sym
6594 if expr[0] in _EQUAL_UNEQUAL:
6598 left, right = expr[1:]
6605 return (expr[0] is EQUAL and right is sym.kconfig.m or
6607 (expr[0] is UNEQUAL and right is sym.kconfig.n)
6609 return expr[0] is AND and \
6610 (_expr_depends_on(expr[1], sym) or
6611 _expr_depends_on(expr[2], sym))