def expr(self, _p: int=0):
    _parentctx = self._ctx
    _parentState = self.state
    localctx = decafJavierParser.ExprContext(self, self._ctx, _parentState)
    _prevctx = localctx
    _startState = 24
    self.enterRecursionRule(localctx, 24, self.RULE_expr, _p)
    try:
        self.enterOuterAlt(localctx, 1)
        self.state = 239
        self._errHandler.sync(self)
        la_ = self._interp.adaptivePredict(self._input, 20, self._ctx)
        if (la_ == 1):
            self.state = 228
            self.location()
            pass
        elif (la_ == 2):
            self.state = 229
            self.literal()
            pass
        elif (la_ == 3):
            self.state = 230
            self.match(decafJavierParser.SUB)
            self.state = 231
            self.expr(4)
            pass
        elif (la_ == 4):
            self.state = 232
            self.method_call()
            pass
        elif (la_ == 5):
            self.state = 233
            self.match(decafJavierParser.NOT)
            self.state = 234
            self.expr(2)
            pass
        elif (la_ == 6):
            self.state = 235
            self.match(decafJavierParser.LROUND)
            self.state = 236
            self.expr(0)
            self.state = 237
            self.match(decafJavierParser.RROUND)
            pass
        self._ctx.stop = self._input.LT((- 1))
        self.state = 247
        self._errHandler.sync(self)
        _alt = self._interp.adaptivePredict(self._input, 21, self._ctx)
        while ((_alt != 2) and (_alt != ATN.INVALID_ALT_NUMBER)):
            if (_alt == 1):
                if (self._parseListeners is not None):
                    self.triggerExitRuleEvent()
                _prevctx = localctx
                localctx = decafJavierParser.ExprContext(self, _parentctx, _parentState)
                self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                self.state = 241
                if (not self.precpred(self._ctx, 5)):
                    from antlr4.error.Errors import FailedPredicateException
                    raise FailedPredicateException(self, 'self.precpred(self._ctx, 5)')
                self.state = 242
                self.bin_op()
                self.state = 243
                self.expr(6)
            self.state = 249
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input, 21, self._ctx)
    except RecognitionException as re:
        localctx.exception = re
        self._errHandler.reportError(self, re)
        self._errHandler.recover(self, re)
    finally:
        self.unrollRecursionContexts(_parentctx)
    return localctx
def expr(self, _p: int=0):
    _parentctx = self._ctx
    _parentState = self.state
    localctx = decafJavierParser.ExprContext(self, self._ctx, _parentState)
    _prevctx = localctx
    _startState = 24
    self.enterRecursionRule(localctx, 24, self.RULE_expr, _p)
    try:
        self.enterOuterAlt(localctx, 1)
        self.state = 239
        self._errHandler.sync(self)
        la_ = self._interp.adaptivePredict(self._input, 20, self._ctx)
        if (la_ == 1):
            self.state = 228
            self.location()
            pass
        elif (la_ == 2):
            self.state = 229
            self.literal()
            pass
        elif (la_ == 3):
            self.state = 230
            self.match(decafJavierParser.SUB)
            self.state = 231
            self.expr(4)
            pass
        elif (la_ == 4):
            self.state = 232
            self.method_call()
            pass
        elif (la_ == 5):
            self.state = 233
            self.match(decafJavierParser.NOT)
            self.state = 234
            self.expr(2)
            pass
        elif (la_ == 6):
            self.state = 235
            self.match(decafJavierParser.LROUND)
            self.state = 236
            self.expr(0)
            self.state = 237
            self.match(decafJavierParser.RROUND)
            pass
        self._ctx.stop = self._input.LT((- 1))
        self.state = 247
        self._errHandler.sync(self)
        _alt = self._interp.adaptivePredict(self._input, 21, self._ctx)
        while ((_alt != 2) and (_alt != ATN.INVALID_ALT_NUMBER)):
            if (_alt == 1):
                if (self._parseListeners is not None):
                    self.triggerExitRuleEvent()
                _prevctx = localctx
                localctx = decafJavierParser.ExprContext(self, _parentctx, _parentState)
                self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                self.state = 241
                if (not self.precpred(self._ctx, 5)):
                    from antlr4.error.Errors import FailedPredicateException
                    raise FailedPredicateException(self, 'self.precpred(self._ctx, 5)')
                self.state = 242
                self.bin_op()
                self.state = 243
                self.expr(6)
            self.state = 249
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input, 21, self._ctx)
    except RecognitionException as re:
        localctx.exception = re
        self._errHandler.reportError(self, re)
        self._errHandler.recover(self, re)
    finally:
        self.unrollRecursionContexts(_parentctx)
    return localctx