# Generated from PW_explorer/Input_Parsers/Clingo_Parser/Antlr_Files/Clingo.g4 by ANTLR 4.7.1
# 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\20")
        buf.write("s\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b")
        buf.write("\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\3\2\7\2")
        buf.write("\34\n\2\f\2\16\2\37\13\2\3\2\5\2\"\n\2\3\2\3\2\3\3\3\3")
        buf.write("\3\3\7\3)\n\3\f\3\16\3,\13\3\3\3\5\3/\n\3\3\3\5\3\62\n")
        buf.write("\3\3\4\3\4\3\4\3\4\3\4\5\49\n\4\3\5\3\5\5\5=\n\5\3\5\3")
        buf.write("\5\7\5A\n\5\f\5\16\5D\13\5\3\5\3\5\5\5H\n\5\3\6\3\6\3")
        buf.write("\7\3\7\5\7N\n\7\3\7\5\7Q\n\7\3\7\3\7\3\7\3\7\3\b\3\b\3")
        buf.write("\b\3\b\5\b[\n\b\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\13\3")
        buf.write("\13\3\13\3\13\3\f\6\fj\n\f\r\f\16\fk\3\r\6\ro\n\r\r\r")
        buf.write("\16\rp\3\r\2\2\16\2\4\6\b\n\f\16\20\22\24\26\30\2\3\5")
        buf.write("\2\5\6\t\t\17\17\2t\2\35\3\2\2\2\4%\3\2\2\2\6\63\3\2\2")
        buf.write("\2\bB\3\2\2\2\nI\3\2\2\2\fK\3\2\2\2\16V\3\2\2\2\20\\\3")
        buf.write("\2\2\2\22`\3\2\2\2\24d\3\2\2\2\26i\3\2\2\2\30n\3\2\2\2")
        buf.write("\32\34\5\4\3\2\33\32\3\2\2\2\34\37\3\2\2\2\35\33\3\2\2")
        buf.write("\2\35\36\3\2\2\2\36!\3\2\2\2\37\35\3\2\2\2 \"\7\16\2\2")
        buf.write("! \3\2\2\2!\"\3\2\2\2\"#\3\2\2\2#$\5\f\7\2$\3\3\2\2\2")
        buf.write("%&\7\3\2\2&*\7\17\2\2\')\5\6\4\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-/\7\4\2\2.-\3")
        buf.write("\2\2\2./\3\2\2\2/\61\3\2\2\2\60\62\7\17\2\2\61\60\3\2")
        buf.write("\2\2\61\62\3\2\2\2\62\5\3\2\2\2\638\7\17\2\2\64\65\7\5")
        buf.write("\2\2\65\66\5\b\5\2\66\67\7\6\2\2\679\3\2\2\28\64\3\2\2")
        buf.write("\289\3\2\2\29\7\3\2\2\2:=\5\n\6\2;=\5\6\4\2<:\3\2\2\2")
        buf.write("<;\3\2\2\2=>\3\2\2\2>?\7\7\2\2?A\3\2\2\2@<\3\2\2\2AD\3")
        buf.write("\2\2\2B@\3\2\2\2BC\3\2\2\2CG\3\2\2\2DB\3\2\2\2EH\5\n\6")
        buf.write("\2FH\5\6\4\2GE\3\2\2\2GF\3\2\2\2H\t\3\2\2\2IJ\7\17\2\2")
        buf.write("J\13\3\2\2\2KM\5\16\b\2LN\5\20\t\2ML\3\2\2\2MN\3\2\2\2")
        buf.write("NP\3\2\2\2OQ\5\22\n\2PO\3\2\2\2PQ\3\2\2\2QR\3\2\2\2RS")
        buf.write("\5\24\13\2ST\5\26\f\2TU\5\30\r\2U\r\3\2\2\2VW\7\b\2\2")
        buf.write("WX\7\t\2\2XZ\7\17\2\2Y[\7\n\2\2ZY\3\2\2\2Z[\3\2\2\2[\17")
        buf.write("\3\2\2\2\\]\7\13\2\2]^\7\t\2\2^_\7\17\2\2_\21\3\2\2\2")
        buf.write("`a\7\f\2\2ab\7\t\2\2bc\7\17\2\2c\23\3\2\2\2de\7\r\2\2")
        buf.write("ef\7\t\2\2fg\7\17\2\2g\25\3\2\2\2hj\t\2\2\2ih\3\2\2\2")
        buf.write("jk\3\2\2\2ki\3\2\2\2kl\3\2\2\2l\27\3\2\2\2mo\t\2\2\2n")
        buf.write("m\3\2\2\2op\3\2\2\2pn\3\2\2\2pq\3\2\2\2q\31\3\2\2\2\20")
        buf.write("\35!*.\618<BGMPZkp")
        return buf.getvalue()


class ClingoParser ( Parser ):

    grammarFileName = "Clingo.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'Answer:'", "'Optimization:'", "'('", 
                     "')'", "','", "'Models'", "':'", "'+'", "'Optimum'", 
                     "'Optimization'", "'Calls'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "OPTIMUM_FOUND", "TEXT", "WHITESPACE" ]

    RULE_clingoOutput = 0
    RULE_pw = 1
    RULE_fact = 2
    RULE_fact_content = 3
    RULE_fact_text = 4
    RULE_summary = 5
    RULE_models = 6
    RULE_optimum = 7
    RULE_optimization = 8
    RULE_calls = 9
    RULE_time = 10
    RULE_cpuTime = 11

    ruleNames =  [ "clingoOutput", "pw", "fact", "fact_content", "fact_text", 
                   "summary", "models", "optimum", "optimization", "calls", 
                   "time", "cpuTime" ]

    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
    T__8=9
    T__9=10
    T__10=11
    OPTIMUM_FOUND=12
    TEXT=13
    WHITESPACE=14

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



    class ClingoOutputContext(ParserRuleContext):

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

        def summary(self):
            return self.getTypedRuleContext(ClingoParser.SummaryContext,0)


        def pw(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ClingoParser.PwContext)
            else:
                return self.getTypedRuleContext(ClingoParser.PwContext,i)


        def OPTIMUM_FOUND(self):
            return self.getToken(ClingoParser.OPTIMUM_FOUND, 0)

        def getRuleIndex(self):
            return ClingoParser.RULE_clingoOutput

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

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




    def clingoOutput(self):

        localctx = ClingoParser.ClingoOutputContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_clingoOutput)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 27
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ClingoParser.T__0:
                self.state = 24
                self.pw()
                self.state = 29
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 31
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ClingoParser.OPTIMUM_FOUND:
                self.state = 30
                self.match(ClingoParser.OPTIMUM_FOUND)


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

    class PwContext(ParserRuleContext):

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

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

        def fact(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ClingoParser.FactContext)
            else:
                return self.getTypedRuleContext(ClingoParser.FactContext,i)


        def getRuleIndex(self):
            return ClingoParser.RULE_pw

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

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




    def pw(self):

        localctx = ClingoParser.PwContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_pw)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 35
            self.match(ClingoParser.T__0)
            self.state = 36
            self.match(ClingoParser.TEXT)
            self.state = 40
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,2,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 37
                    self.fact() 
                self.state = 42
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,2,self._ctx)

            self.state = 44
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ClingoParser.T__1:
                self.state = 43
                self.match(ClingoParser.T__1)


            self.state = 47
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ClingoParser.TEXT:
                self.state = 46
                self.match(ClingoParser.TEXT)


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

    class FactContext(ParserRuleContext):

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

        def TEXT(self):
            return self.getToken(ClingoParser.TEXT, 0)

        def fact_content(self):
            return self.getTypedRuleContext(ClingoParser.Fact_contentContext,0)


        def getRuleIndex(self):
            return ClingoParser.RULE_fact

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

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




    def fact(self):

        localctx = ClingoParser.FactContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_fact)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 49
            self.match(ClingoParser.TEXT)
            self.state = 54
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ClingoParser.T__2:
                self.state = 50
                self.match(ClingoParser.T__2)
                self.state = 51
                self.fact_content()
                self.state = 52
                self.match(ClingoParser.T__3)


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

    class Fact_contentContext(ParserRuleContext):

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

        def fact_text(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ClingoParser.Fact_textContext)
            else:
                return self.getTypedRuleContext(ClingoParser.Fact_textContext,i)


        def fact(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ClingoParser.FactContext)
            else:
                return self.getTypedRuleContext(ClingoParser.FactContext,i)


        def getRuleIndex(self):
            return ClingoParser.RULE_fact_content

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

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




    def fact_content(self):

        localctx = ClingoParser.Fact_contentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_fact_content)
        try:
            self.enterOuterAlt(localctx, 1)
            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 = 58
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,6,self._ctx)
                    if la_ == 1:
                        self.state = 56
                        self.fact_text()
                        pass

                    elif la_ == 2:
                        self.state = 57
                        self.fact()
                        pass


                    self.state = 60
                    self.match(ClingoParser.T__4) 
                self.state = 66
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,7,self._ctx)

            self.state = 69
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
            if la_ == 1:
                self.state = 67
                self.fact_text()
                pass

            elif la_ == 2:
                self.state = 68
                self.fact()
                pass


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

    class Fact_textContext(ParserRuleContext):

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

        def TEXT(self):
            return self.getToken(ClingoParser.TEXT, 0)

        def getRuleIndex(self):
            return ClingoParser.RULE_fact_text

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

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




    def fact_text(self):

        localctx = ClingoParser.Fact_textContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_fact_text)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 71
            self.match(ClingoParser.TEXT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class SummaryContext(ParserRuleContext):

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

        def models(self):
            return self.getTypedRuleContext(ClingoParser.ModelsContext,0)


        def calls(self):
            return self.getTypedRuleContext(ClingoParser.CallsContext,0)


        def time(self):
            return self.getTypedRuleContext(ClingoParser.TimeContext,0)


        def cpuTime(self):
            return self.getTypedRuleContext(ClingoParser.CpuTimeContext,0)


        def optimum(self):
            return self.getTypedRuleContext(ClingoParser.OptimumContext,0)


        def optimization(self):
            return self.getTypedRuleContext(ClingoParser.OptimizationContext,0)


        def getRuleIndex(self):
            return ClingoParser.RULE_summary

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

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




    def summary(self):

        localctx = ClingoParser.SummaryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_summary)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 73
            self.models()
            self.state = 75
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ClingoParser.T__8:
                self.state = 74
                self.optimum()


            self.state = 78
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ClingoParser.T__9:
                self.state = 77
                self.optimization()


            self.state = 80
            self.calls()
            self.state = 81
            self.time()
            self.state = 82
            self.cpuTime()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ModelsContext(ParserRuleContext):

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

        def TEXT(self):
            return self.getToken(ClingoParser.TEXT, 0)

        def getRuleIndex(self):
            return ClingoParser.RULE_models

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

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




    def models(self):

        localctx = ClingoParser.ModelsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_models)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 84
            self.match(ClingoParser.T__5)
            self.state = 85
            self.match(ClingoParser.T__6)
            self.state = 86
            self.match(ClingoParser.TEXT)
            self.state = 88
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ClingoParser.T__7:
                self.state = 87
                self.match(ClingoParser.T__7)


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

    class OptimumContext(ParserRuleContext):

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

        def TEXT(self):
            return self.getToken(ClingoParser.TEXT, 0)

        def getRuleIndex(self):
            return ClingoParser.RULE_optimum

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

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




    def optimum(self):

        localctx = ClingoParser.OptimumContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_optimum)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 90
            self.match(ClingoParser.T__8)
            self.state = 91
            self.match(ClingoParser.T__6)
            self.state = 92
            self.match(ClingoParser.TEXT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class OptimizationContext(ParserRuleContext):

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

        def TEXT(self):
            return self.getToken(ClingoParser.TEXT, 0)

        def getRuleIndex(self):
            return ClingoParser.RULE_optimization

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

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




    def optimization(self):

        localctx = ClingoParser.OptimizationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_optimization)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 94
            self.match(ClingoParser.T__9)
            self.state = 95
            self.match(ClingoParser.T__6)
            self.state = 96
            self.match(ClingoParser.TEXT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class CallsContext(ParserRuleContext):

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

        def TEXT(self):
            return self.getToken(ClingoParser.TEXT, 0)

        def getRuleIndex(self):
            return ClingoParser.RULE_calls

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

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




    def calls(self):

        localctx = ClingoParser.CallsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_calls)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 98
            self.match(ClingoParser.T__10)
            self.state = 99
            self.match(ClingoParser.T__6)
            self.state = 100
            self.match(ClingoParser.TEXT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class TimeContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return ClingoParser.RULE_time

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

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




    def time(self):

        localctx = ClingoParser.TimeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_time)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 103 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 102
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ClingoParser.T__2) | (1 << ClingoParser.T__3) | (1 << ClingoParser.T__6) | (1 << ClingoParser.TEXT))) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()

                else:
                    raise NoViableAltException(self)
                self.state = 105 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,12,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 CpuTimeContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return ClingoParser.RULE_cpuTime

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

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




    def cpuTime(self):

        localctx = ClingoParser.CpuTimeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_cpuTime)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            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 << ClingoParser.T__2) | (1 << ClingoParser.T__3) | (1 << ClingoParser.T__6) | (1 << ClingoParser.TEXT))) != 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 << ClingoParser.T__2) | (1 << ClingoParser.T__3) | (1 << ClingoParser.T__6) | (1 << ClingoParser.TEXT))) != 0)):
                    break

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





