# Generated from Zish.g4 by ANTLR 4.7
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys

def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\30")
        buf.write("\u00d2\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\3\2\7\2\24\n\2\f\2\16\2\27\13\2\3\2\7")
        buf.write("\2\32\n\2\f\2\16\2\35\13\2\3\2\7\2 \n\2\f\2\16\2#\13\2")
        buf.write("\3\2\3\2\3\3\3\3\5\3)\n\3\3\4\3\4\7\4-\n\4\f\4\16\4\60")
        buf.write("\13\4\3\4\3\4\7\4\64\n\4\f\4\16\4\67\13\4\3\4\3\4\7\4")
        buf.write(";\n\4\f\4\16\4>\13\4\3\4\7\4A\n\4\f\4\16\4D\13\4\3\4\7")
        buf.write("\4G\n\4\f\4\16\4J\13\4\3\4\3\4\3\4\3\4\7\4P\n\4\f\4\16")
        buf.write("\4S\13\4\3\4\5\4V\n\4\3\5\3\5\7\5Z\n\5\f\5\16\5]\13\5")
        buf.write("\3\5\3\5\7\5a\n\5\f\5\16\5d\13\5\3\5\3\5\7\5h\n\5\f\5")
        buf.write("\16\5k\13\5\3\5\7\5n\n\5\f\5\16\5q\13\5\3\5\7\5t\n\5\f")
        buf.write("\5\16\5w\13\5\3\5\3\5\3\5\3\5\7\5}\n\5\f\5\16\5\u0080")
        buf.write("\13\5\3\5\5\5\u0083\n\5\3\6\3\6\7\6\u0087\n\6\f\6\16\6")
        buf.write("\u008a\13\6\3\6\3\6\7\6\u008e\n\6\f\6\16\6\u0091\13\6")
        buf.write("\3\6\3\6\7\6\u0095\n\6\f\6\16\6\u0098\13\6\3\6\7\6\u009b")
        buf.write("\n\6\f\6\16\6\u009e\13\6\3\6\7\6\u00a1\n\6\f\6\16\6\u00a4")
        buf.write("\13\6\3\6\3\6\3\6\3\6\7\6\u00aa\n\6\f\6\16\6\u00ad\13")
        buf.write("\6\3\6\5\6\u00b0\n\6\3\7\3\7\7\7\u00b4\n\7\f\7\16\7\u00b7")
        buf.write("\13\7\3\7\3\7\7\7\u00bb\n\7\f\7\16\7\u00be\13\7\3\7\3")
        buf.write("\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\5\b")
        buf.write("\u00ce\n\b\3\t\3\t\3\t\2\2\n\2\4\6\b\n\f\16\20\2\3\3\2")
        buf.write("\13\r\2\u00ef\2\33\3\2\2\2\4(\3\2\2\2\6U\3\2\2\2\b\u0082")
        buf.write("\3\2\2\2\n\u00af\3\2\2\2\f\u00b1\3\2\2\2\16\u00cd\3\2")
        buf.write("\2\2\20\u00cf\3\2\2\2\22\24\5\20\t\2\23\22\3\2\2\2\24")
        buf.write("\27\3\2\2\2\25\23\3\2\2\2\25\26\3\2\2\2\26\30\3\2\2\2")
        buf.write("\27\25\3\2\2\2\30\32\5\4\3\2\31\25\3\2\2\2\32\35\3\2\2")
        buf.write("\2\33\31\3\2\2\2\33\34\3\2\2\2\34!\3\2\2\2\35\33\3\2\2")
        buf.write("\2\36 \5\20\t\2\37\36\3\2\2\2 #\3\2\2\2!\37\3\2\2\2!\"")
        buf.write("\3\2\2\2\"$\3\2\2\2#!\3\2\2\2$%\7\2\2\3%\3\3\2\2\2&)\5")
        buf.write("\16\b\2\')\5\n\6\2(&\3\2\2\2(\'\3\2\2\2)\5\3\2\2\2*.\7")
        buf.write("\3\2\2+-\5\20\t\2,+\3\2\2\2-\60\3\2\2\2.,\3\2\2\2./\3")
        buf.write("\2\2\2/\61\3\2\2\2\60.\3\2\2\2\61B\5\4\3\2\62\64\5\20")
        buf.write("\t\2\63\62\3\2\2\2\64\67\3\2\2\2\65\63\3\2\2\2\65\66\3")
        buf.write("\2\2\2\668\3\2\2\2\67\65\3\2\2\28<\7\4\2\29;\5\20\t\2")
        buf.write(":9\3\2\2\2;>\3\2\2\2<:\3\2\2\2<=\3\2\2\2=?\3\2\2\2><\3")
        buf.write("\2\2\2?A\5\4\3\2@\65\3\2\2\2AD\3\2\2\2B@\3\2\2\2BC\3\2")
        buf.write("\2\2CH\3\2\2\2DB\3\2\2\2EG\5\20\t\2FE\3\2\2\2GJ\3\2\2")
        buf.write("\2HF\3\2\2\2HI\3\2\2\2IK\3\2\2\2JH\3\2\2\2KL\7\5\2\2L")
        buf.write("V\3\2\2\2MQ\7\3\2\2NP\5\20\t\2ON\3\2\2\2PS\3\2\2\2QO\3")
        buf.write("\2\2\2QR\3\2\2\2RT\3\2\2\2SQ\3\2\2\2TV\7\5\2\2U*\3\2\2")
        buf.write("\2UM\3\2\2\2V\7\3\2\2\2W[\7\6\2\2XZ\5\20\t\2YX\3\2\2\2")
        buf.write("Z]\3\2\2\2[Y\3\2\2\2[\\\3\2\2\2\\^\3\2\2\2][\3\2\2\2^")
        buf.write("o\5\16\b\2_a\5\20\t\2`_\3\2\2\2ad\3\2\2\2b`\3\2\2\2bc")
        buf.write("\3\2\2\2ce\3\2\2\2db\3\2\2\2ei\7\4\2\2fh\5\20\t\2gf\3")
        buf.write("\2\2\2hk\3\2\2\2ig\3\2\2\2ij\3\2\2\2jl\3\2\2\2ki\3\2\2")
        buf.write("\2ln\5\16\b\2mb\3\2\2\2nq\3\2\2\2om\3\2\2\2op\3\2\2\2")
        buf.write("pu\3\2\2\2qo\3\2\2\2rt\5\20\t\2sr\3\2\2\2tw\3\2\2\2us")
        buf.write("\3\2\2\2uv\3\2\2\2vx\3\2\2\2wu\3\2\2\2xy\7\7\2\2y\u0083")
        buf.write("\3\2\2\2z~\7\6\2\2{}\5\20\t\2|{\3\2\2\2}\u0080\3\2\2\2")
        buf.write("~|\3\2\2\2~\177\3\2\2\2\177\u0081\3\2\2\2\u0080~\3\2\2")
        buf.write("\2\u0081\u0083\7\7\2\2\u0082W\3\2\2\2\u0082z\3\2\2\2\u0083")
        buf.write("\t\3\2\2\2\u0084\u0088\7\b\2\2\u0085\u0087\5\20\t\2\u0086")
        buf.write("\u0085\3\2\2\2\u0087\u008a\3\2\2\2\u0088\u0086\3\2\2\2")
        buf.write("\u0088\u0089\3\2\2\2\u0089\u008b\3\2\2\2\u008a\u0088\3")
        buf.write("\2\2\2\u008b\u009c\5\f\7\2\u008c\u008e\5\20\t\2\u008d")
        buf.write("\u008c\3\2\2\2\u008e\u0091\3\2\2\2\u008f\u008d\3\2\2\2")
        buf.write("\u008f\u0090\3\2\2\2\u0090\u0092\3\2\2\2\u0091\u008f\3")
        buf.write("\2\2\2\u0092\u0096\7\4\2\2\u0093\u0095\5\20\t\2\u0094")
        buf.write("\u0093\3\2\2\2\u0095\u0098\3\2\2\2\u0096\u0094\3\2\2\2")
        buf.write("\u0096\u0097\3\2\2\2\u0097\u0099\3\2\2\2\u0098\u0096\3")
        buf.write("\2\2\2\u0099\u009b\5\f\7\2\u009a\u008f\3\2\2\2\u009b\u009e")
        buf.write("\3\2\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3\2\2\2\u009d")
        buf.write("\u00a2\3\2\2\2\u009e\u009c\3\2\2\2\u009f\u00a1\5\20\t")
        buf.write("\2\u00a0\u009f\3\2\2\2\u00a1\u00a4\3\2\2\2\u00a2\u00a0")
        buf.write("\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\u00a5\3\2\2\2\u00a4")
        buf.write("\u00a2\3\2\2\2\u00a5\u00a6\7\t\2\2\u00a6\u00b0\3\2\2\2")
        buf.write("\u00a7\u00ab\7\b\2\2\u00a8\u00aa\5\20\t\2\u00a9\u00a8")
        buf.write("\3\2\2\2\u00aa\u00ad\3\2\2\2\u00ab\u00a9\3\2\2\2\u00ab")
        buf.write("\u00ac\3\2\2\2\u00ac\u00ae\3\2\2\2\u00ad\u00ab\3\2\2\2")
        buf.write("\u00ae\u00b0\7\t\2\2\u00af\u0084\3\2\2\2\u00af\u00a7\3")
        buf.write("\2\2\2\u00b0\13\3\2\2\2\u00b1\u00b5\5\16\b\2\u00b2\u00b4")
        buf.write("\5\20\t\2\u00b3\u00b2\3\2\2\2\u00b4\u00b7\3\2\2\2\u00b5")
        buf.write("\u00b3\3\2\2\2\u00b5\u00b6\3\2\2\2\u00b6\u00b8\3\2\2\2")
        buf.write("\u00b7\u00b5\3\2\2\2\u00b8\u00bc\7\n\2\2\u00b9\u00bb\5")
        buf.write("\20\t\2\u00ba\u00b9\3\2\2\2\u00bb\u00be\3\2\2\2\u00bc")
        buf.write("\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00bf\3\2\2\2")
        buf.write("\u00be\u00bc\3\2\2\2\u00bf\u00c0\5\4\3\2\u00c0\r\3\2\2")
        buf.write("\2\u00c1\u00ce\7\17\2\2\u00c2\u00ce\7\16\2\2\u00c3\u00ce")
        buf.write("\7\21\2\2\u00c4\u00ce\7\22\2\2\u00c5\u00ce\7\23\2\2\u00c6")
        buf.write("\u00ce\7\20\2\2\u00c7\u00ce\7\25\2\2\u00c8\u00ce\7\26")
        buf.write("\2\2\u00c9\u00ce\7\27\2\2\u00ca\u00ce\7\30\2\2\u00cb\u00ce")
        buf.write("\5\6\4\2\u00cc\u00ce\5\b\5\2\u00cd\u00c1\3\2\2\2\u00cd")
        buf.write("\u00c2\3\2\2\2\u00cd\u00c3\3\2\2\2\u00cd\u00c4\3\2\2\2")
        buf.write("\u00cd\u00c5\3\2\2\2\u00cd\u00c6\3\2\2\2\u00cd\u00c7\3")
        buf.write("\2\2\2\u00cd\u00c8\3\2\2\2\u00cd\u00c9\3\2\2\2\u00cd\u00ca")
        buf.write("\3\2\2\2\u00cd\u00cb\3\2\2\2\u00cd\u00cc\3\2\2\2\u00ce")
        buf.write("\17\3\2\2\2\u00cf\u00d0\t\2\2\2\u00d0\21\3\2\2\2\36\25")
        buf.write("\33!(.\65<BHQU[biou~\u0082\u0088\u008f\u0096\u009c\u00a2")
        buf.write("\u00ab\u00af\u00b5\u00bc\u00cd")
        return buf.getvalue()


class ZishParser ( Parser ):

    grammarFileName = "Zish.g4"

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'['", "','", "']'", "'('", "')'", "'{'", 
                     "'}'", "':'", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'null'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "WHITESPACE", "INLINE_COMMENT", "BLOCK_COMMENT", 
                      "NULL", "BOOL", "TIMESTAMP", "BIN_INTEGER", "DEC_INTEGER", 
                      "HEX_INTEGER", "SPECIAL_FLOAT", "FLOAT", "DECIMAL", 
                      "STRING", "BLOB" ]

    RULE_start = 0
    RULE_element = 1
    RULE_list_type = 2
    RULE_set_type = 3
    RULE_map_type = 4
    RULE_pair = 5
    RULE_key = 6
    RULE_ws = 7

    ruleNames =  [ "start", "element", "list_type", "set_type", "map_type", 
                   "pair", "key", "ws" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    WHITESPACE=9
    INLINE_COMMENT=10
    BLOCK_COMMENT=11
    NULL=12
    BOOL=13
    TIMESTAMP=14
    BIN_INTEGER=15
    DEC_INTEGER=16
    HEX_INTEGER=17
    SPECIAL_FLOAT=18
    FLOAT=19
    DECIMAL=20
    STRING=21
    BLOB=22

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.7")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None



    class StartContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EOF(self):
            return self.getToken(ZishParser.EOF, 0)

        def element(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.ElementContext)
            else:
                return self.getTypedRuleContext(ZishParser.ElementContext,i)


        def ws(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.WsContext)
            else:
                return self.getTypedRuleContext(ZishParser.WsContext,i)


        def getRuleIndex(self):
            return ZishParser.RULE_start

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStart" ):
                listener.enterStart(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStart" ):
                listener.exitStart(self)




    def start(self):

        localctx = ZishParser.StartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_start)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 25
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,1,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 19
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                        self.state = 16
                        self.ws()
                        self.state = 21
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)

                    self.state = 22
                    self.element() 
                self.state = 27
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,1,self._ctx)

            self.state = 31
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                self.state = 28
                self.ws()
                self.state = 33
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 34
            self.match(ZishParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ElementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def key(self):
            return self.getTypedRuleContext(ZishParser.KeyContext,0)


        def map_type(self):
            return self.getTypedRuleContext(ZishParser.Map_typeContext,0)


        def getRuleIndex(self):
            return ZishParser.RULE_element

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterElement" ):
                listener.enterElement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitElement" ):
                listener.exitElement(self)




    def element(self):

        localctx = ZishParser.ElementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_element)
        try:
            self.state = 38
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ZishParser.T__0, ZishParser.T__3, ZishParser.NULL, ZishParser.BOOL, ZishParser.TIMESTAMP, ZishParser.BIN_INTEGER, ZishParser.DEC_INTEGER, ZishParser.HEX_INTEGER, ZishParser.FLOAT, ZishParser.DECIMAL, ZishParser.STRING, ZishParser.BLOB]:
                self.enterOuterAlt(localctx, 1)
                self.state = 36
                self.key()
                pass
            elif token in [ZishParser.T__5]:
                self.enterOuterAlt(localctx, 2)
                self.state = 37
                self.map_type()
                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

    class List_typeContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def element(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.ElementContext)
            else:
                return self.getTypedRuleContext(ZishParser.ElementContext,i)


        def ws(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.WsContext)
            else:
                return self.getTypedRuleContext(ZishParser.WsContext,i)


        def getRuleIndex(self):
            return ZishParser.RULE_list_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterList_type" ):
                listener.enterList_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitList_type" ):
                listener.exitList_type(self)




    def list_type(self):

        localctx = ZishParser.List_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_list_type)
        self._la = 0 # Token type
        try:
            self.state = 83
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,10,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 40
                self.match(ZishParser.T__0)
                self.state = 44
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 41
                    self.ws()
                    self.state = 46
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 47
                self.element()
                self.state = 64
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,7,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 51
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                            self.state = 48
                            self.ws()
                            self.state = 53
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 54
                        self.match(ZishParser.T__1)
                        self.state = 58
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                            self.state = 55
                            self.ws()
                            self.state = 60
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 61
                        self.element() 
                    self.state = 66
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,7,self._ctx)

                self.state = 70
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 67
                    self.ws()
                    self.state = 72
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 73
                self.match(ZishParser.T__2)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 75
                self.match(ZishParser.T__0)
                self.state = 79
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 76
                    self.ws()
                    self.state = 81
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 82
                self.match(ZishParser.T__2)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Set_typeContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def key(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.KeyContext)
            else:
                return self.getTypedRuleContext(ZishParser.KeyContext,i)


        def ws(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.WsContext)
            else:
                return self.getTypedRuleContext(ZishParser.WsContext,i)


        def getRuleIndex(self):
            return ZishParser.RULE_set_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSet_type" ):
                listener.enterSet_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSet_type" ):
                listener.exitSet_type(self)




    def set_type(self):

        localctx = ZishParser.Set_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_set_type)
        self._la = 0 # Token type
        try:
            self.state = 128
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 85
                self.match(ZishParser.T__3)
                self.state = 89
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 86
                    self.ws()
                    self.state = 91
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 92
                self.key()
                self.state = 109
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,14,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 96
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                            self.state = 93
                            self.ws()
                            self.state = 98
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 99
                        self.match(ZishParser.T__1)
                        self.state = 103
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                            self.state = 100
                            self.ws()
                            self.state = 105
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 106
                        self.key() 
                    self.state = 111
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,14,self._ctx)

                self.state = 115
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 112
                    self.ws()
                    self.state = 117
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 118
                self.match(ZishParser.T__4)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 120
                self.match(ZishParser.T__3)
                self.state = 124
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 121
                    self.ws()
                    self.state = 126
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 127
                self.match(ZishParser.T__4)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Map_typeContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def pair(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.PairContext)
            else:
                return self.getTypedRuleContext(ZishParser.PairContext,i)


        def ws(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.WsContext)
            else:
                return self.getTypedRuleContext(ZishParser.WsContext,i)


        def getRuleIndex(self):
            return ZishParser.RULE_map_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMap_type" ):
                listener.enterMap_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMap_type" ):
                listener.exitMap_type(self)




    def map_type(self):

        localctx = ZishParser.Map_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_map_type)
        self._la = 0 # Token type
        try:
            self.state = 173
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,24,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 130
                self.match(ZishParser.T__5)
                self.state = 134
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 131
                    self.ws()
                    self.state = 136
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 137
                self.pair()
                self.state = 154
                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:
                        self.state = 141
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                            self.state = 138
                            self.ws()
                            self.state = 143
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 144
                        self.match(ZishParser.T__1)
                        self.state = 148
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                            self.state = 145
                            self.ws()
                            self.state = 150
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 151
                        self.pair() 
                    self.state = 156
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,21,self._ctx)

                self.state = 160
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 157
                    self.ws()
                    self.state = 162
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 163
                self.match(ZishParser.T__6)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 165
                self.match(ZishParser.T__5)
                self.state = 169
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                    self.state = 166
                    self.ws()
                    self.state = 171
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 172
                self.match(ZishParser.T__6)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class PairContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def key(self):
            return self.getTypedRuleContext(ZishParser.KeyContext,0)


        def element(self):
            return self.getTypedRuleContext(ZishParser.ElementContext,0)


        def ws(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZishParser.WsContext)
            else:
                return self.getTypedRuleContext(ZishParser.WsContext,i)


        def getRuleIndex(self):
            return ZishParser.RULE_pair

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPair" ):
                listener.enterPair(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPair" ):
                listener.exitPair(self)




    def pair(self):

        localctx = ZishParser.PairContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_pair)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 175
            self.key()
            self.state = 179
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                self.state = 176
                self.ws()
                self.state = 181
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 182
            self.match(ZishParser.T__7)
            self.state = 186
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0):
                self.state = 183
                self.ws()
                self.state = 188
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 189
            self.element()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class KeyContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BOOL(self):
            return self.getToken(ZishParser.BOOL, 0)

        def NULL(self):
            return self.getToken(ZishParser.NULL, 0)

        def BIN_INTEGER(self):
            return self.getToken(ZishParser.BIN_INTEGER, 0)

        def DEC_INTEGER(self):
            return self.getToken(ZishParser.DEC_INTEGER, 0)

        def HEX_INTEGER(self):
            return self.getToken(ZishParser.HEX_INTEGER, 0)

        def TIMESTAMP(self):
            return self.getToken(ZishParser.TIMESTAMP, 0)

        def FLOAT(self):
            return self.getToken(ZishParser.FLOAT, 0)

        def DECIMAL(self):
            return self.getToken(ZishParser.DECIMAL, 0)

        def STRING(self):
            return self.getToken(ZishParser.STRING, 0)

        def BLOB(self):
            return self.getToken(ZishParser.BLOB, 0)

        def list_type(self):
            return self.getTypedRuleContext(ZishParser.List_typeContext,0)


        def set_type(self):
            return self.getTypedRuleContext(ZishParser.Set_typeContext,0)


        def getRuleIndex(self):
            return ZishParser.RULE_key

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterKey" ):
                listener.enterKey(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitKey" ):
                listener.exitKey(self)




    def key(self):

        localctx = ZishParser.KeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_key)
        try:
            self.state = 203
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ZishParser.BOOL]:
                self.enterOuterAlt(localctx, 1)
                self.state = 191
                self.match(ZishParser.BOOL)
                pass
            elif token in [ZishParser.NULL]:
                self.enterOuterAlt(localctx, 2)
                self.state = 192
                self.match(ZishParser.NULL)
                pass
            elif token in [ZishParser.BIN_INTEGER]:
                self.enterOuterAlt(localctx, 3)
                self.state = 193
                self.match(ZishParser.BIN_INTEGER)
                pass
            elif token in [ZishParser.DEC_INTEGER]:
                self.enterOuterAlt(localctx, 4)
                self.state = 194
                self.match(ZishParser.DEC_INTEGER)
                pass
            elif token in [ZishParser.HEX_INTEGER]:
                self.enterOuterAlt(localctx, 5)
                self.state = 195
                self.match(ZishParser.HEX_INTEGER)
                pass
            elif token in [ZishParser.TIMESTAMP]:
                self.enterOuterAlt(localctx, 6)
                self.state = 196
                self.match(ZishParser.TIMESTAMP)
                pass
            elif token in [ZishParser.FLOAT]:
                self.enterOuterAlt(localctx, 7)
                self.state = 197
                self.match(ZishParser.FLOAT)
                pass
            elif token in [ZishParser.DECIMAL]:
                self.enterOuterAlt(localctx, 8)
                self.state = 198
                self.match(ZishParser.DECIMAL)
                pass
            elif token in [ZishParser.STRING]:
                self.enterOuterAlt(localctx, 9)
                self.state = 199
                self.match(ZishParser.STRING)
                pass
            elif token in [ZishParser.BLOB]:
                self.enterOuterAlt(localctx, 10)
                self.state = 200
                self.match(ZishParser.BLOB)
                pass
            elif token in [ZishParser.T__0]:
                self.enterOuterAlt(localctx, 11)
                self.state = 201
                self.list_type()
                pass
            elif token in [ZishParser.T__3]:
                self.enterOuterAlt(localctx, 12)
                self.state = 202
                self.set_type()
                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

    class WsContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHITESPACE(self):
            return self.getToken(ZishParser.WHITESPACE, 0)

        def INLINE_COMMENT(self):
            return self.getToken(ZishParser.INLINE_COMMENT, 0)

        def BLOCK_COMMENT(self):
            return self.getToken(ZishParser.BLOCK_COMMENT, 0)

        def getRuleIndex(self):
            return ZishParser.RULE_ws

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWs" ):
                listener.enterWs(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWs" ):
                listener.exitWs(self)




    def ws(self):

        localctx = ZishParser.WsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_ws)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 205
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ZishParser.WHITESPACE) | (1 << ZishParser.INLINE_COMMENT) | (1 << ZishParser.BLOCK_COMMENT))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





