conditional_expr \
            : logical_or_expr
            | logical_or_expr CONDOP assignment_expr COLON assignment_expr
349431
def p_conditional_expr(self, p):
        
        if len(p) == 2:
            p[0] = p[1]
        else:
            p[0] = ast.Conditional(
                predicate=p[1], consequent=p[3], alternative=p[5])
1370004
def p_expr_GT_expr(p):
    
    p[0] = make_binary(p.lineno(2), 'GT', p[1], p[3], lambda x, y: x > y)
336273
def _twos_comp_conditional(orig_wire, sign_bit, bw=None):
    """"""
    if bw is None:
        bw = len(orig_wire)
    new_wire = pyrtl.WireVector(bw)
    with pyrtl.conditional_assignment:
        with sign_bit:
            new_wire |= ~orig_wire + 1
        with pyrtl.otherwise:
            new_wire |= orig_wire
    return new_wire
595435
def parenthesize(self, expr, level, *args, strict=False, **kwargs):
        """"""
        needs_parenths = (
            (precedence(expr) < level) or
            (strict and precedence(expr) == level))
        if needs_parenths:
            return (
                self._parenth_left + self.doprint(expr, *args, **kwargs) +
                self._parenth_right)
        else:
            return self.doprint(expr, *args, **kwargs)
672457
def p_expr_mul_expr(p):
    
    p[0] = make_binary(p.lineno(2), 'MUL', p[1], p[3], lambda x, y: x * y)
702041
def p_or_p_expression(tok):
        """"""
        if len(tok) == 4:
            tok[0] = LogicalBinOpRule(tok[2], tok[1], tok[3])
        else:
            tok[0] = tok[1]
946044
def if_statement(self):
        
        self._process(Nature.IF)
        if_condition = self.logical_or_expr()
        if_body = self.compound()

        else_compound = None
        else_if_compounds = []
        while self.token.nature == Nature.ELSE:
            self._process(Nature.ELSE)

            if self.token.nature == Nature.IF:
                self._process(Nature.IF)
                else_if_compounds.append((self.logical_or_expr(), self.compound()))
            else:
                else_compound = (None, self.compound())

        return IfStatement(
            if_compound=(if_condition, if_body),
            else_if_compounds=else_if_compounds,
            else_compound=else_compound,
        )
613118
function(expr, options) {
                    var fn = options.fn;
                    options.fn = options.inverse;
                    options.inverse = fn;
                    return Mustache._helpers['if'].fn.apply(this, arguments);
                }
829097
def p_expr_usr(p):
    
    if p[2].type_ == TYPE.string:
        p[0] = make_builtin(p.lineno(1), 'USR_STR', p[2], type_=TYPE.uinteger)
    else:
        p[0] = make_builtin(p.lineno(1), 'USR',
                            make_typecast(TYPE.uinteger, p[2], p.lineno(1)),
                            type_=TYPE.uinteger)
771112
def _convert_claripy_bool_ast(self, cond):
        

        if isinstance(cond, ailment.Expr.Expression):
            return cond

        if cond.op == "BoolS" and claripy.is_true(cond):
            return cond
        if cond in self._condition_mapping:
            return self._condition_mapping[cond]

        _mapping = {
            'Not': lambda cond_: ailment.Expr.UnaryOp(None, 'Not', self._convert_claripy_bool_ast(cond_.args[0])),
            'And': lambda cond_: ailment.Expr.BinaryOp(None, 'LogicalAnd', (
                self._convert_claripy_bool_ast(cond_.args[0]),
                self._convert_claripy_bool_ast(cond_.args[1]),
            )),
            'Or': lambda cond_: ailment.Expr.BinaryOp(None, 'LogicalOr', (
                self._convert_claripy_bool_ast(cond_.args[0]),
                self._convert_claripy_bool_ast(cond_.args[1]),
            )),
            'ULE': lambda cond_: ailment.Expr.BinaryOp(None, 'CmpULE',
                                                          tuple(map(self._convert_claripy_bool_ast, cond_.args)),
                                                          ),
            '__le__': lambda cond_: ailment.Expr.BinaryOp(None, 'CmpLE',
                                                          tuple(map(self._convert_claripy_bool_ast, cond_.args)),
                                                          ),
            'UGT': lambda cond_: ailment.Expr.BinaryOp(None, 'CmpUGT',
                                                          tuple(map(self._convert_claripy_bool_ast, cond_.args)),
                                                          ),
            '__gt__': lambda cond_: ailment.Expr.BinaryOp(None, 'CmpGT',
                                                          tuple(map(self._convert_claripy_bool_ast, cond_.args)),
                                                          ),
            '__eq__': lambda cond_: ailment.Expr.BinaryOp(None, 'CmpEQ',
                                                          tuple(map(self._convert_claripy_bool_ast, cond_.args)),
                                                          ),
            '__ne__': lambda cond_: ailment.Expr.BinaryOp(None, 'CmpNE',
                                                          tuple(map(self._convert_claripy_bool_ast, cond_.args)),
                                                          ),
            '__xor__': lambda cond_: ailment.Expr.BinaryOp(None, 'Xor',
                                                          tuple(map(self._convert_claripy_bool_ast, cond_.args)),
                                                          ),
            'BVV': lambda cond_: ailment.Expr.Const(None, None, cond_.args[0], cond_.size()),
            'BoolV': lambda cond_: ailment.Expr.Const(None, None, True, 1) if cond_.args[0] is True
                                                                        else ailment.Expr.Const(None, None, False, 1),
        }

        if cond.op in _mapping:
            return _mapping[cond.op](cond)
        raise NotImplementedError(("Condition variable %s has an unsupported operator %s. "
                                   "Consider implementing.") % (cond, cond.op))
796719
def p_expr_require(p):
    ''
    p[0] = ast.Require(p[2], False, lineno=p.lineno(1))
193226
def logical_or(f1, f2):  # function factory
    '''
    '''
    def f(value):
        return np.logical_or(f1(value), f2(value))
    f.__name__ = "(" + f1.__name__ + "_or_" + f2.__name__ + ")"
    return f
427827
def p_expression_logical(self, p):
        
        p[0] = Expression(left=p[1], operator=p[2], right=p[3])
95346
def p_new_expr(self, p):
        
        if len(p) == 2:
            p[0] = p[1]
        else:
            p[0] = ast.NewExpr(p[2])
327921
def p_exprge(p):
    
    a = int(p[1]) if p[1].isdigit() else 0
    b = int(p[3]) if p[3].isdigit() else 0

    p[0] = '1' if a >= b else '0'
13070
def p_expr_unary_op(p):
    ''''''
    p[0] = ast.UnaryOp(p[1], p[2], lineno=p.lineno(1))
286725
def _or(ctx, *logical):
    
    for arg in logical:
        if conversions.to_boolean(arg, ctx):
            return True
    return False