def literal(self):
    localctx = decafJavierParser.LiteralContext(self, self._ctx, self.state)
    self.enterRule(localctx, 38, self.RULE_literal)
    try:
        self.state = 269
        self._errHandler.sync(self)
        token = self._input.LA(1)
        if (token in [decafJavierParser.DECIMAL_LITERAL, decafJavierParser.HEX_LITERAL]):
            self.enterOuterAlt(localctx, 1)
            self.state = 266
            self.int_literal()
            pass
        elif (token in [decafJavierParser.CHAR_LITERAL]):
            self.enterOuterAlt(localctx, 2)
            self.state = 267
            self.match(decafJavierParser.CHAR_LITERAL)
            pass
        elif (token in [decafJavierParser.BOOL_LITERAL]):
            self.enterOuterAlt(localctx, 3)
            self.state = 268
            self.match(decafJavierParser.BOOL_LITERAL)
            pass
        else:
            raise NoViableAltException(self)
    except RecognitionException as re:
        localctx.exception = re
        self._errHandler.reportError(self, re)
        self._errHandler.recover(self, re)
    finally:
        self.exitRule()
    return localctx
def literal(self):
    localctx = decafJavierParser.LiteralContext(self, self._ctx, self.state)
    self.enterRule(localctx, 38, self.RULE_literal)
    try:
        self.state = 269
        self._errHandler.sync(self)
        token = self._input.LA(1)
        if (token in [decafJavierParser.DECIMAL_LITERAL, decafJavierParser.HEX_LITERAL]):
            self.enterOuterAlt(localctx, 1)
            self.state = 266
            self.int_literal()
            pass
        elif (token in [decafJavierParser.CHAR_LITERAL]):
            self.enterOuterAlt(localctx, 2)
            self.state = 267
            self.match(decafJavierParser.CHAR_LITERAL)
            pass
        elif (token in [decafJavierParser.BOOL_LITERAL]):
            self.enterOuterAlt(localctx, 3)
            self.state = 268
            self.match(decafJavierParser.BOOL_LITERAL)
            pass
        else:
            raise NoViableAltException(self)
    except RecognitionException as re:
        localctx.exception = re
        self._errHandler.reportError(self, re)
        self._errHandler.recover(self, re)
    finally:
        self.exitRule()
    return localctx