# Generated from pylingo.g4 by ANTLR 4.7.2
# 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\33")
        buf.write("\u00dd\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\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
        buf.write("\t\16\3\2\7\2\36\n\2\f\2\16\2!\13\2\3\2\3\2\7\2%\n\2\f")
        buf.write("\2\16\2(\13\2\6\2*\n\2\r\2\16\2+\3\3\3\3\5\3\60\n\3\3")
        buf.write("\4\3\4\7\4\64\n\4\f\4\16\4\67\13\4\3\5\3\5\3\5\3\6\5\6")
        buf.write("=\n\6\3\6\7\6@\n\6\f\6\16\6C\13\6\3\7\3\7\7\7G\n\7\f\7")
        buf.write("\16\7J\13\7\3\7\3\7\6\7N\n\7\r\7\16\7O\3\7\7\7S\n\7\f")
        buf.write("\7\16\7V\13\7\3\7\7\7Y\n\7\f\7\16\7\\\13\7\3\7\3\7\3\7")
        buf.write("\3\7\7\7b\n\7\f\7\16\7e\13\7\3\7\5\7h\n\7\3\b\3\b\3\b")
        buf.write("\3\b\3\b\6\bo\n\b\r\b\16\bp\3\b\3\b\5\bu\n\b\3\t\3\t\3")
        buf.write("\n\3\n\3\n\5\n|\n\n\3\13\3\13\7\13\u0080\n\13\f\13\16")
        buf.write("\13\u0083\13\13\3\13\3\13\3\13\5\13\u0088\n\13\3\13\3")
        buf.write("\13\7\13\u008c\n\13\f\13\16\13\u008f\13\13\3\13\3\13\3")
        buf.write("\13\5\13\u0094\n\13\3\13\7\13\u0097\n\13\f\13\16\13\u009a")
        buf.write("\13\13\3\13\7\13\u009d\n\13\f\13\16\13\u00a0\13\13\3\13")
        buf.write("\3\13\3\13\3\13\7\13\u00a6\n\13\f\13\16\13\u00a9\13\13")
        buf.write("\3\13\5\13\u00ac\n\13\3\f\3\f\7\f\u00b0\n\f\f\f\16\f\u00b3")
        buf.write("\13\f\3\f\3\f\3\f\7\f\u00b8\n\f\f\f\16\f\u00bb\13\f\3")
        buf.write("\f\7\f\u00be\n\f\f\f\16\f\u00c1\13\f\3\f\7\f\u00c4\n\f")
        buf.write("\f\f\16\f\u00c7\13\f\3\f\3\f\3\f\3\f\7\f\u00cd\n\f\f\f")
        buf.write("\16\f\u00d0\13\f\3\f\3\f\3\f\3\f\3\f\5\f\u00d7\n\f\3\r")
        buf.write("\3\r\3\16\3\16\3\16\2\2\17\2\4\6\b\n\f\16\20\22\24\26")
        buf.write("\30\32\2\6\4\2\24\25\27\27\6\2\n\n\f\17\24\24\27\27\3")
        buf.write("\2\n\17\5\2\b\t\24\26\31\31\2\u00f3\2\37\3\2\2\2\4/\3")
        buf.write("\2\2\2\6\61\3\2\2\2\b8\3\2\2\2\n<\3\2\2\2\fg\3\2\2\2\16")
        buf.write("t\3\2\2\2\20v\3\2\2\2\22{\3\2\2\2\24\u00ab\3\2\2\2\26")
        buf.write("\u00d6\3\2\2\2\30\u00d8\3\2\2\2\32\u00da\3\2\2\2\34\36")
        buf.write("\7\33\2\2\35\34\3\2\2\2\36!\3\2\2\2\37\35\3\2\2\2\37 ")
        buf.write("\3\2\2\2 )\3\2\2\2!\37\3\2\2\2\"&\5\4\3\2#%\7\33\2\2$")
        buf.write("#\3\2\2\2%(\3\2\2\2&$\3\2\2\2&\'\3\2\2\2\'*\3\2\2\2(&")
        buf.write("\3\2\2\2)\"\3\2\2\2*+\3\2\2\2+)\3\2\2\2+,\3\2\2\2,\3\3")
        buf.write("\2\2\2-\60\5\b\5\2.\60\5\6\4\2/-\3\2\2\2/.\3\2\2\2\60")
        buf.write("\5\3\2\2\2\61\65\7\30\2\2\62\64\7\33\2\2\63\62\3\2\2\2")
        buf.write("\64\67\3\2\2\2\65\63\3\2\2\2\65\66\3\2\2\2\66\7\3\2\2")
        buf.write("\2\67\65\3\2\2\289\5\n\6\29:\5\f\7\2:\t\3\2\2\2;=\5\30")
        buf.write("\r\2<;\3\2\2\2<=\3\2\2\2=A\3\2\2\2>@\t\2\2\2?>\3\2\2\2")
        buf.write("@C\3\2\2\2A?\3\2\2\2AB\3\2\2\2B\13\3\2\2\2CA\3\2\2\2D")
        buf.write("H\7\3\2\2EG\7\33\2\2FE\3\2\2\2GJ\3\2\2\2HF\3\2\2\2HI\3")
        buf.write("\2\2\2IK\3\2\2\2JH\3\2\2\2KT\5\16\b\2LN\7\33\2\2ML\3\2")
        buf.write("\2\2NO\3\2\2\2OM\3\2\2\2OP\3\2\2\2PQ\3\2\2\2QS\5\16\b")
        buf.write("\2RM\3\2\2\2SV\3\2\2\2TR\3\2\2\2TU\3\2\2\2UZ\3\2\2\2V")
        buf.write("T\3\2\2\2WY\7\33\2\2XW\3\2\2\2Y\\\3\2\2\2ZX\3\2\2\2Z[")
        buf.write("\3\2\2\2[]\3\2\2\2\\Z\3\2\2\2]^\7\4\2\2^h\3\2\2\2_c\7")
        buf.write("\3\2\2`b\7\33\2\2a`\3\2\2\2be\3\2\2\2ca\3\2\2\2cd\3\2")
        buf.write("\2\2df\3\2\2\2ec\3\2\2\2fh\7\4\2\2gD\3\2\2\2g_\3\2\2\2")
        buf.write("h\r\3\2\2\2ij\5\20\t\2jk\7\22\2\2kl\5\22\n\2lu\3\2\2\2")
        buf.write("mo\t\2\2\2nm\3\2\2\2op\3\2\2\2pn\3\2\2\2pq\3\2\2\2qr\3")
        buf.write("\2\2\2ru\5\f\7\2su\5\6\4\2ti\3\2\2\2tn\3\2\2\2ts\3\2\2")
        buf.write("\2u\17\3\2\2\2vw\t\3\2\2w\21\3\2\2\2x|\5\32\16\2y|\5\26")
        buf.write("\f\2z|\5\24\13\2{x\3\2\2\2{y\3\2\2\2{z\3\2\2\2|\23\3\2")
        buf.write("\2\2}\u0081\7\5\2\2~\u0080\7\33\2\2\177~\3\2\2\2\u0080")
        buf.write("\u0083\3\2\2\2\u0081\177\3\2\2\2\u0081\u0082\3\2\2\2\u0082")
        buf.write("\u0087\3\2\2\2\u0083\u0081\3\2\2\2\u0084\u0088\5\32\16")
        buf.write("\2\u0085\u0088\5\26\f\2\u0086\u0088\5\24\13\2\u0087\u0084")
        buf.write("\3\2\2\2\u0087\u0085\3\2\2\2\u0087\u0086\3\2\2\2\u0088")
        buf.write("\u0098\3\2\2\2\u0089\u008d\7\6\2\2\u008a\u008c\7\33\2")
        buf.write("\2\u008b\u008a\3\2\2\2\u008c\u008f\3\2\2\2\u008d\u008b")
        buf.write("\3\2\2\2\u008d\u008e\3\2\2\2\u008e\u0093\3\2\2\2\u008f")
        buf.write("\u008d\3\2\2\2\u0090\u0094\5\32\16\2\u0091\u0094\5\26")
        buf.write("\f\2\u0092\u0094\5\24\13\2\u0093\u0090\3\2\2\2\u0093\u0091")
        buf.write("\3\2\2\2\u0093\u0092\3\2\2\2\u0094\u0097\3\2\2\2\u0095")
        buf.write("\u0097\7\6\2\2\u0096\u0089\3\2\2\2\u0096\u0095\3\2\2\2")
        buf.write("\u0097\u009a\3\2\2\2\u0098\u0096\3\2\2\2\u0098\u0099\3")
        buf.write("\2\2\2\u0099\u009e\3\2\2\2\u009a\u0098\3\2\2\2\u009b\u009d")
        buf.write("\7\33\2\2\u009c\u009b\3\2\2\2\u009d\u00a0\3\2\2\2\u009e")
        buf.write("\u009c\3\2\2\2\u009e\u009f\3\2\2\2\u009f\u00a1\3\2\2\2")
        buf.write("\u00a0\u009e\3\2\2\2\u00a1\u00a2\7\7\2\2\u00a2\u00ac\3")
        buf.write("\2\2\2\u00a3\u00a7\7\5\2\2\u00a4\u00a6\7\33\2\2\u00a5")
        buf.write("\u00a4\3\2\2\2\u00a6\u00a9\3\2\2\2\u00a7\u00a5\3\2\2\2")
        buf.write("\u00a7\u00a8\3\2\2\2\u00a8\u00aa\3\2\2\2\u00a9\u00a7\3")
        buf.write("\2\2\2\u00aa\u00ac\7\7\2\2\u00ab}\3\2\2\2\u00ab\u00a3")
        buf.write("\3\2\2\2\u00ac\25\3\2\2\2\u00ad\u00b1\7\3\2\2\u00ae\u00b0")
        buf.write("\7\33\2\2\u00af\u00ae\3\2\2\2\u00b0\u00b3\3\2\2\2\u00b1")
        buf.write("\u00af\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\u00b4\3\2\2\2")
        buf.write("\u00b3\u00b1\3\2\2\2\u00b4\u00bf\5\26\f\2\u00b5\u00b9")
        buf.write("\7\6\2\2\u00b6\u00b8\7\33\2\2\u00b7\u00b6\3\2\2\2\u00b8")
        buf.write("\u00bb\3\2\2\2\u00b9\u00b7\3\2\2\2\u00b9\u00ba\3\2\2\2")
        buf.write("\u00ba\u00bc\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bc\u00be\5")
        buf.write("\26\f\2\u00bd\u00b5\3\2\2\2\u00be\u00c1\3\2\2\2\u00bf")
        buf.write("\u00bd\3\2\2\2\u00bf\u00c0\3\2\2\2\u00c0\u00c5\3\2\2\2")
        buf.write("\u00c1\u00bf\3\2\2\2\u00c2\u00c4\7\33\2\2\u00c3\u00c2")
        buf.write("\3\2\2\2\u00c4\u00c7\3\2\2\2\u00c5\u00c3\3\2\2\2\u00c5")
        buf.write("\u00c6\3\2\2\2\u00c6\u00c8\3\2\2\2\u00c7\u00c5\3\2\2\2")
        buf.write("\u00c8\u00c9\7\4\2\2\u00c9\u00d7\3\2\2\2\u00ca\u00ce\7")
        buf.write("\3\2\2\u00cb\u00cd\7\33\2\2\u00cc\u00cb\3\2\2\2\u00cd")
        buf.write("\u00d0\3\2\2\2\u00ce\u00cc\3\2\2\2\u00ce\u00cf\3\2\2\2")
        buf.write("\u00cf\u00d1\3\2\2\2\u00d0\u00ce\3\2\2\2\u00d1\u00d7\7")
        buf.write("\4\2\2\u00d2\u00d3\5\20\t\2\u00d3\u00d4\7\23\2\2\u00d4")
        buf.write("\u00d5\5\22\n\2\u00d5\u00d7\3\2\2\2\u00d6\u00ad\3\2\2")
        buf.write("\2\u00d6\u00ca\3\2\2\2\u00d6\u00d2\3\2\2\2\u00d7\27\3")
        buf.write("\2\2\2\u00d8\u00d9\t\4\2\2\u00d9\31\3\2\2\2\u00da\u00db")
        buf.write("\t\5\2\2\u00db\33\3\2\2\2!\37&+/\65<AHOTZcgpt{\u0081\u0087")
        buf.write("\u008d\u0093\u0096\u0098\u009e\u00a7\u00ab\u00b1\u00b9")
        buf.write("\u00bf\u00c5\u00ce\u00d6")
        return buf.getvalue()


class pylingoParser ( Parser ):

    grammarFileName = "pylingo.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'{'", "'}'", "'['", "','", "']'", "'true'", 
                     "'false'", "'data'", "'config'", "'generator'", "'import'", 
                     "'variable'", "'output'", "'<<DOC'", "'DOC'", "<INVALID>", 
                     "':'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "DATA", "CONFIG", "GENERATOR", "IMPORT", "VARIABLE", 
                      "OUTPUT", "BEGINDOC", "ENDDOC", "EQ", "COLON", "LITERAL", 
                      "STRING", "NUMBER", "WORD", "COMMENT", "DOCUMENT", 
                      "WHITESPACE", "NEWLINE" ]

    RULE_lexee = 0
    RULE_decl = 1
    RULE_comment = 2
    RULE_code = 3
    RULE_preamble = 4
    RULE_obj = 5
    RULE_body = 6
    RULE_variable = 7
    RULE_assignment = 8
    RULE_array = 9
    RULE_json = 10
    RULE_ident = 11
    RULE_value = 12

    ruleNames =  [ "lexee", "decl", "comment", "code", "preamble", "obj", 
                   "body", "variable", "assignment", "array", "json", "ident", 
                   "value" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    DATA=8
    CONFIG=9
    GENERATOR=10
    IMPORT=11
    VARIABLE=12
    OUTPUT=13
    BEGINDOC=14
    ENDDOC=15
    EQ=16
    COLON=17
    LITERAL=18
    STRING=19
    NUMBER=20
    WORD=21
    COMMENT=22
    DOCUMENT=23
    WHITESPACE=24
    NEWLINE=25

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




    class LexeeContext(ParserRuleContext):

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

        def NEWLINE(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.NEWLINE)
            else:
                return self.getToken(pylingoParser.NEWLINE, i)

        def decl(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pylingoParser.DeclContext)
            else:
                return self.getTypedRuleContext(pylingoParser.DeclContext,i)


        def getRuleIndex(self):
            return pylingoParser.RULE_lexee

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitLexee" ):
                return visitor.visitLexee(self)
            else:
                return visitor.visitChildren(self)




    def lexee(self):

        localctx = pylingoParser.LexeeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_lexee)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 29
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pylingoParser.NEWLINE:
                self.state = 26
                self.match(pylingoParser.NEWLINE)
                self.state = 31
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 39 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 32
                self.decl()
                self.state = 36
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 33
                    self.match(pylingoParser.NEWLINE)
                    self.state = 38
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 41 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.T__0) | (1 << pylingoParser.DATA) | (1 << pylingoParser.CONFIG) | (1 << pylingoParser.GENERATOR) | (1 << pylingoParser.IMPORT) | (1 << pylingoParser.VARIABLE) | (1 << pylingoParser.OUTPUT) | (1 << pylingoParser.LITERAL) | (1 << pylingoParser.STRING) | (1 << pylingoParser.WORD) | (1 << pylingoParser.COMMENT))) != 0)):
                    break

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


    class DeclContext(ParserRuleContext):

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

        def code(self):
            return self.getTypedRuleContext(pylingoParser.CodeContext,0)


        def comment(self):
            return self.getTypedRuleContext(pylingoParser.CommentContext,0)


        def getRuleIndex(self):
            return pylingoParser.RULE_decl

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDecl" ):
                return visitor.visitDecl(self)
            else:
                return visitor.visitChildren(self)




    def decl(self):

        localctx = pylingoParser.DeclContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_decl)
        try:
            self.state = 45
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pylingoParser.T__0, pylingoParser.DATA, pylingoParser.CONFIG, pylingoParser.GENERATOR, pylingoParser.IMPORT, pylingoParser.VARIABLE, pylingoParser.OUTPUT, pylingoParser.LITERAL, pylingoParser.STRING, pylingoParser.WORD]:
                self.enterOuterAlt(localctx, 1)
                self.state = 43
                self.code()
                pass
            elif token in [pylingoParser.COMMENT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 44
                self.comment()
                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 CommentContext(ParserRuleContext):

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

        def COMMENT(self):
            return self.getToken(pylingoParser.COMMENT, 0)

        def NEWLINE(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.NEWLINE)
            else:
                return self.getToken(pylingoParser.NEWLINE, i)

        def getRuleIndex(self):
            return pylingoParser.RULE_comment

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComment" ):
                return visitor.visitComment(self)
            else:
                return visitor.visitChildren(self)




    def comment(self):

        localctx = pylingoParser.CommentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_comment)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 47
            self.match(pylingoParser.COMMENT)
            self.state = 51
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,4,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 48
                    self.match(pylingoParser.NEWLINE) 
                self.state = 53
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,4,self._ctx)

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


    class CodeContext(ParserRuleContext):

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

        def preamble(self):
            return self.getTypedRuleContext(pylingoParser.PreambleContext,0)


        def obj(self):
            return self.getTypedRuleContext(pylingoParser.ObjContext,0)


        def getRuleIndex(self):
            return pylingoParser.RULE_code

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitCode" ):
                return visitor.visitCode(self)
            else:
                return visitor.visitChildren(self)




    def code(self):

        localctx = pylingoParser.CodeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_code)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 54
            self.preamble()
            self.state = 55
            self.obj()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PreambleContext(ParserRuleContext):

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

        def ident(self):
            return self.getTypedRuleContext(pylingoParser.IdentContext,0)


        def STRING(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.STRING)
            else:
                return self.getToken(pylingoParser.STRING, i)

        def LITERAL(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.LITERAL)
            else:
                return self.getToken(pylingoParser.LITERAL, i)

        def WORD(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.WORD)
            else:
                return self.getToken(pylingoParser.WORD, i)

        def getRuleIndex(self):
            return pylingoParser.RULE_preamble

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPreamble" ):
                return visitor.visitPreamble(self)
            else:
                return visitor.visitChildren(self)




    def preamble(self):

        localctx = pylingoParser.PreambleContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_preamble)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 58
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.DATA) | (1 << pylingoParser.CONFIG) | (1 << pylingoParser.GENERATOR) | (1 << pylingoParser.IMPORT) | (1 << pylingoParser.VARIABLE) | (1 << pylingoParser.OUTPUT))) != 0):
                self.state = 57
                self.ident()


            self.state = 63
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.LITERAL) | (1 << pylingoParser.STRING) | (1 << pylingoParser.WORD))) != 0):
                self.state = 60
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.LITERAL) | (1 << pylingoParser.STRING) | (1 << pylingoParser.WORD))) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 65
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class ObjContext(ParserRuleContext):

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

        def body(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pylingoParser.BodyContext)
            else:
                return self.getTypedRuleContext(pylingoParser.BodyContext,i)


        def NEWLINE(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.NEWLINE)
            else:
                return self.getToken(pylingoParser.NEWLINE, i)

        def getRuleIndex(self):
            return pylingoParser.RULE_obj

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitObj" ):
                return visitor.visitObj(self)
            else:
                return visitor.visitChildren(self)




    def obj(self):

        localctx = pylingoParser.ObjContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_obj)
        self._la = 0 # Token type
        try:
            self.state = 101
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 66
                self.match(pylingoParser.T__0)
                self.state = 70
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 67
                    self.match(pylingoParser.NEWLINE)
                    self.state = 72
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 73
                self.body()
                self.state = 82
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,9,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 75 
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while True:
                            self.state = 74
                            self.match(pylingoParser.NEWLINE)
                            self.state = 77 
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)
                            if not (_la==pylingoParser.NEWLINE):
                                break

                        self.state = 79
                        self.body() 
                    self.state = 84
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,9,self._ctx)

                self.state = 88
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 85
                    self.match(pylingoParser.NEWLINE)
                    self.state = 90
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 91
                self.match(pylingoParser.T__1)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 93
                self.match(pylingoParser.T__0)
                self.state = 97
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 94
                    self.match(pylingoParser.NEWLINE)
                    self.state = 99
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 100
                self.match(pylingoParser.T__1)
                pass


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


    class BodyContext(ParserRuleContext):

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

        def variable(self):
            return self.getTypedRuleContext(pylingoParser.VariableContext,0)


        def EQ(self):
            return self.getToken(pylingoParser.EQ, 0)

        def assignment(self):
            return self.getTypedRuleContext(pylingoParser.AssignmentContext,0)


        def obj(self):
            return self.getTypedRuleContext(pylingoParser.ObjContext,0)


        def STRING(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.STRING)
            else:
                return self.getToken(pylingoParser.STRING, i)

        def LITERAL(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.LITERAL)
            else:
                return self.getToken(pylingoParser.LITERAL, i)

        def WORD(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.WORD)
            else:
                return self.getToken(pylingoParser.WORD, i)

        def comment(self):
            return self.getTypedRuleContext(pylingoParser.CommentContext,0)


        def getRuleIndex(self):
            return pylingoParser.RULE_body

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitBody" ):
                return visitor.visitBody(self)
            else:
                return visitor.visitChildren(self)




    def body(self):

        localctx = pylingoParser.BodyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_body)
        self._la = 0 # Token type
        try:
            self.state = 114
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,14,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 103
                self.variable()
                self.state = 104
                self.match(pylingoParser.EQ)
                self.state = 105
                self.assignment()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 108 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 107
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.LITERAL) | (1 << pylingoParser.STRING) | (1 << pylingoParser.WORD))) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 110 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.LITERAL) | (1 << pylingoParser.STRING) | (1 << pylingoParser.WORD))) != 0)):
                        break

                self.state = 112
                self.obj()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 113
                self.comment()
                pass


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


    class VariableContext(ParserRuleContext):

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

        def DATA(self):
            return self.getToken(pylingoParser.DATA, 0)

        def OUTPUT(self):
            return self.getToken(pylingoParser.OUTPUT, 0)

        def GENERATOR(self):
            return self.getToken(pylingoParser.GENERATOR, 0)

        def IMPORT(self):
            return self.getToken(pylingoParser.IMPORT, 0)

        def VARIABLE(self):
            return self.getToken(pylingoParser.VARIABLE, 0)

        def WORD(self):
            return self.getToken(pylingoParser.WORD, 0)

        def LITERAL(self):
            return self.getToken(pylingoParser.LITERAL, 0)

        def getRuleIndex(self):
            return pylingoParser.RULE_variable

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitVariable" ):
                return visitor.visitVariable(self)
            else:
                return visitor.visitChildren(self)




    def variable(self):

        localctx = pylingoParser.VariableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_variable)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 116
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.DATA) | (1 << pylingoParser.GENERATOR) | (1 << pylingoParser.IMPORT) | (1 << pylingoParser.VARIABLE) | (1 << pylingoParser.OUTPUT) | (1 << pylingoParser.LITERAL) | (1 << pylingoParser.WORD))) != 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


    class AssignmentContext(ParserRuleContext):

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

        def value(self):
            return self.getTypedRuleContext(pylingoParser.ValueContext,0)


        def json(self):
            return self.getTypedRuleContext(pylingoParser.JsonContext,0)


        def array(self):
            return self.getTypedRuleContext(pylingoParser.ArrayContext,0)


        def getRuleIndex(self):
            return pylingoParser.RULE_assignment

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitAssignment" ):
                return visitor.visitAssignment(self)
            else:
                return visitor.visitChildren(self)




    def assignment(self):

        localctx = pylingoParser.AssignmentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_assignment)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 121
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,15,self._ctx)
            if la_ == 1:
                self.state = 118
                self.value()
                pass

            elif la_ == 2:
                self.state = 119
                self.json()
                pass

            elif la_ == 3:
                self.state = 120
                self.array()
                pass


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


    class ArrayContext(ParserRuleContext):

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

        def value(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pylingoParser.ValueContext)
            else:
                return self.getTypedRuleContext(pylingoParser.ValueContext,i)


        def json(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pylingoParser.JsonContext)
            else:
                return self.getTypedRuleContext(pylingoParser.JsonContext,i)


        def array(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pylingoParser.ArrayContext)
            else:
                return self.getTypedRuleContext(pylingoParser.ArrayContext,i)


        def NEWLINE(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.NEWLINE)
            else:
                return self.getToken(pylingoParser.NEWLINE, i)

        def getRuleIndex(self):
            return pylingoParser.RULE_array

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitArray" ):
                return visitor.visitArray(self)
            else:
                return visitor.visitChildren(self)




    def array(self):

        localctx = pylingoParser.ArrayContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_array)
        self._la = 0 # Token type
        try:
            self.state = 169
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,24,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 123
                self.match(pylingoParser.T__2)
                self.state = 127
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 124
                    self.match(pylingoParser.NEWLINE)
                    self.state = 129
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 133
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
                if la_ == 1:
                    self.state = 130
                    self.value()
                    pass

                elif la_ == 2:
                    self.state = 131
                    self.json()
                    pass

                elif la_ == 3:
                    self.state = 132
                    self.array()
                    pass


                self.state = 150
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.T__3:
                    self.state = 148
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,20,self._ctx)
                    if la_ == 1:
                        self.state = 135
                        self.match(pylingoParser.T__3)
                        self.state = 139
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==pylingoParser.NEWLINE:
                            self.state = 136
                            self.match(pylingoParser.NEWLINE)
                            self.state = 141
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 145
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
                        if la_ == 1:
                            self.state = 142
                            self.value()
                            pass

                        elif la_ == 2:
                            self.state = 143
                            self.json()
                            pass

                        elif la_ == 3:
                            self.state = 144
                            self.array()
                            pass


                        pass

                    elif la_ == 2:
                        self.state = 147
                        self.match(pylingoParser.T__3)
                        pass


                    self.state = 152
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 156
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 153
                    self.match(pylingoParser.NEWLINE)
                    self.state = 158
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 159
                self.match(pylingoParser.T__4)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 161
                self.match(pylingoParser.T__2)
                self.state = 165
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 162
                    self.match(pylingoParser.NEWLINE)
                    self.state = 167
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 168
                self.match(pylingoParser.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 JsonContext(ParserRuleContext):

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

        def json(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pylingoParser.JsonContext)
            else:
                return self.getTypedRuleContext(pylingoParser.JsonContext,i)


        def NEWLINE(self, i:int=None):
            if i is None:
                return self.getTokens(pylingoParser.NEWLINE)
            else:
                return self.getToken(pylingoParser.NEWLINE, i)

        def variable(self):
            return self.getTypedRuleContext(pylingoParser.VariableContext,0)


        def COLON(self):
            return self.getToken(pylingoParser.COLON, 0)

        def assignment(self):
            return self.getTypedRuleContext(pylingoParser.AssignmentContext,0)


        def getRuleIndex(self):
            return pylingoParser.RULE_json

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitJson" ):
                return visitor.visitJson(self)
            else:
                return visitor.visitChildren(self)




    def json(self):

        localctx = pylingoParser.JsonContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_json)
        self._la = 0 # Token type
        try:
            self.state = 212
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,30,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 171
                self.match(pylingoParser.T__0)
                self.state = 175
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 172
                    self.match(pylingoParser.NEWLINE)
                    self.state = 177
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 178
                self.json()
                self.state = 189
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.T__3:
                    self.state = 179
                    self.match(pylingoParser.T__3)
                    self.state = 183
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while _la==pylingoParser.NEWLINE:
                        self.state = 180
                        self.match(pylingoParser.NEWLINE)
                        self.state = 185
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)

                    self.state = 186
                    self.json()
                    self.state = 191
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 195
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 192
                    self.match(pylingoParser.NEWLINE)
                    self.state = 197
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 198
                self.match(pylingoParser.T__1)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 200
                self.match(pylingoParser.T__0)
                self.state = 204
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pylingoParser.NEWLINE:
                    self.state = 201
                    self.match(pylingoParser.NEWLINE)
                    self.state = 206
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 207
                self.match(pylingoParser.T__1)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 208
                self.variable()
                self.state = 209
                self.match(pylingoParser.COLON)
                self.state = 210
                self.assignment()
                pass


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


    class IdentContext(ParserRuleContext):

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

        def CONFIG(self):
            return self.getToken(pylingoParser.CONFIG, 0)

        def DATA(self):
            return self.getToken(pylingoParser.DATA, 0)

        def GENERATOR(self):
            return self.getToken(pylingoParser.GENERATOR, 0)

        def IMPORT(self):
            return self.getToken(pylingoParser.IMPORT, 0)

        def VARIABLE(self):
            return self.getToken(pylingoParser.VARIABLE, 0)

        def OUTPUT(self):
            return self.getToken(pylingoParser.OUTPUT, 0)

        def getRuleIndex(self):
            return pylingoParser.RULE_ident

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitIdent" ):
                return visitor.visitIdent(self)
            else:
                return visitor.visitChildren(self)




    def ident(self):

        localctx = pylingoParser.IdentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_ident)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 214
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.DATA) | (1 << pylingoParser.CONFIG) | (1 << pylingoParser.GENERATOR) | (1 << pylingoParser.IMPORT) | (1 << pylingoParser.VARIABLE) | (1 << pylingoParser.OUTPUT))) != 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


    class ValueContext(ParserRuleContext):

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

        def NUMBER(self):
            return self.getToken(pylingoParser.NUMBER, 0)

        def LITERAL(self):
            return self.getToken(pylingoParser.LITERAL, 0)

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

        def DOCUMENT(self):
            return self.getToken(pylingoParser.DOCUMENT, 0)

        def getRuleIndex(self):
            return pylingoParser.RULE_value

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitValue" ):
                return visitor.visitValue(self)
            else:
                return visitor.visitChildren(self)




    def value(self):

        localctx = pylingoParser.ValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_value)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 216
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pylingoParser.T__5) | (1 << pylingoParser.T__6) | (1 << pylingoParser.LITERAL) | (1 << pylingoParser.STRING) | (1 << pylingoParser.NUMBER) | (1 << pylingoParser.DOCUMENT))) != 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





