# Generated from SeawolfScript.g4 by ANTLR 4.6
# encoding: utf-8
from antlr4 import *
from io import StringIO

def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\'")
        buf.write("\u0090\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\3\2\3\2\6\2\r\n")
        buf.write("\2\r\2\16\2\16\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3?\n\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3J\n\3\3\4\6\4M\n\4\r\4")
        buf.write("\16\4N\3\5\3\5\3\5\3\5\3\5\3\5\3\5\7\5X\n\5\f\5\16\5[")
        buf.write("\13\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5")
        buf.write("\5\5i\n\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5")
        buf.write("\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3")
        buf.write("\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\7\5\u008b\n\5\f\5\16\5")
        buf.write("\u008e\13\5\3\5\2\3\b\6\2\4\6\b\2\5\3\2\22\23\3\2\26\27")
        buf.write("\3\2\34!\u00a6\2\n\3\2\2\2\4I\3\2\2\2\6L\3\2\2\2\bh\3")
        buf.write("\2\2\2\n\f\7\3\2\2\13\r\5\4\3\2\f\13\3\2\2\2\r\16\3\2")
        buf.write("\2\2\16\f\3\2\2\2\16\17\3\2\2\2\17\20\3\2\2\2\20\21\7")
        buf.write("\4\2\2\21\3\3\2\2\2\22\23\7\5\2\2\23\24\5\b\5\2\24\25")
        buf.write("\7\6\2\2\25\26\7&\2\2\26J\3\2\2\2\27\30\7\"\2\2\30\31")
        buf.write("\7\7\2\2\31\32\5\b\5\2\32\33\7\b\2\2\33\34\7&\2\2\34J")
        buf.write("\3\2\2\2\35\36\7\"\2\2\36\37\7\t\2\2\37 \5\b\5\2 !\7\n")
        buf.write("\2\2!\"\7\7\2\2\"#\5\b\5\2#$\7\b\2\2$%\7&\2\2%J\3\2\2")
        buf.write("\2&\'\7\"\2\2\'(\7\t\2\2()\5\b\5\2)*\7\n\2\2*+\7\t\2\2")
        buf.write("+,\5\b\5\2,-\7\n\2\2-.\7\7\2\2./\5\b\5\2/\60\7\b\2\2\60")
        buf.write("\61\7&\2\2\61J\3\2\2\2\62\63\7\13\2\2\63\64\7\f\2\2\64")
        buf.write("\65\5\b\5\2\65\66\7\r\2\2\66\67\7\3\2\2\678\5\6\4\28>")
        buf.write("\7\4\2\29:\7\16\2\2:;\7\3\2\2;<\5\6\4\2<=\7\4\2\2=?\3")
        buf.write("\2\2\2>9\3\2\2\2>?\3\2\2\2?J\3\2\2\2@A\7\17\2\2AB\7\f")
        buf.write("\2\2BC\5\b\5\2CD\7\r\2\2DE\7\3\2\2EF\5\6\4\2FG\7\4\2\2")
        buf.write("GJ\3\2\2\2HJ\7&\2\2I\22\3\2\2\2I\27\3\2\2\2I\35\3\2\2")
        buf.write("\2I&\3\2\2\2I\62\3\2\2\2I@\3\2\2\2IH\3\2\2\2J\5\3\2\2")
        buf.write("\2KM\5\4\3\2LK\3\2\2\2MN\3\2\2\2NL\3\2\2\2NO\3\2\2\2O")
        buf.write("\7\3\2\2\2PQ\b\5\1\2QR\7\27\2\2Ri\5\b\5\24ST\7\t\2\2T")
        buf.write("Y\5\b\5\2UV\7\20\2\2VX\5\b\5\2WU\3\2\2\2X[\3\2\2\2YW\3")
        buf.write("\2\2\2YZ\3\2\2\2Z\\\3\2\2\2[Y\3\2\2\2\\]\7\n\2\2]i\3\2")
        buf.write("\2\2^_\7\32\2\2_i\5\b\5\n`i\7$\2\2ai\7%\2\2bi\7#\2\2c")
        buf.write("i\7\"\2\2de\7\f\2\2ef\5\b\5\2fg\7\r\2\2gi\3\2\2\2hP\3")
        buf.write("\2\2\2hS\3\2\2\2h^\3\2\2\2h`\3\2\2\2ha\3\2\2\2hb\3\2\2")
        buf.write("\2hc\3\2\2\2hd\3\2\2\2i\u008c\3\2\2\2jk\f\21\2\2kl\t\2")
        buf.write("\2\2l\u008b\5\b\5\22mn\f\20\2\2no\7\25\2\2o\u008b\5\b")
        buf.write("\5\21pq\f\17\2\2qr\7\21\2\2r\u008b\5\b\5\20st\f\16\2\2")
        buf.write("tu\7\24\2\2u\u008b\5\b\5\17vw\f\r\2\2wx\t\3\2\2x\u008b")
        buf.write("\5\b\5\16yz\f\f\2\2z{\7\33\2\2{\u008b\5\b\5\r|}\f\13\2")
        buf.write("\2}~\t\4\2\2~\u008b\5\b\5\f\177\u0080\f\t\2\2\u0080\u0081")
        buf.write("\7\30\2\2\u0081\u008b\5\b\5\n\u0082\u0083\f\b\2\2\u0083")
        buf.write("\u0084\7\31\2\2\u0084\u008b\5\b\5\t\u0085\u0086\f\22\2")
        buf.write("\2\u0086\u0087\7\t\2\2\u0087\u0088\5\b\5\2\u0088\u0089")
        buf.write("\7\n\2\2\u0089\u008b\3\2\2\2\u008aj\3\2\2\2\u008am\3\2")
        buf.write("\2\2\u008ap\3\2\2\2\u008as\3\2\2\2\u008av\3\2\2\2\u008a")
        buf.write("y\3\2\2\2\u008a|\3\2\2\2\u008a\177\3\2\2\2\u008a\u0082")
        buf.write("\3\2\2\2\u008a\u0085\3\2\2\2\u008b\u008e\3\2\2\2\u008c")
        buf.write("\u008a\3\2\2\2\u008c\u008d\3\2\2\2\u008d\t\3\2\2\2\u008e")
        buf.write("\u008c\3\2\2\2\n\16>INYh\u008a\u008c")
        return buf.getvalue()


class SeawolfScriptParser ( Parser ):

    grammarFileName = "SeawolfScript.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'{'", "'}'", "'print('", "');'", "'='", 
                     "';'", "'['", "']'", "'if'", "'('", "')'", "'else'", 
                     "'while'", "','", "'**'", "'*'", "'/'", "'//'", "'%'", 
                     "'+'", "'-'", "'and'", "'or'", "'not'", "'in'", "'<'", 
                     "'>'", "'<='", "'>='", "'=='", "'<>'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "EXPONENT", 
                      "MUL", "DIV", "FLOOR", "MOD", "ADD", "SUB", "AND", 
                      "OR", "NOT", "IN", "LTHAN", "GTHAN", "LTHANE", "GTHANE", 
                      "EQUAL", "NEQUAL", "ID", "STRING", "INT", "REAL", 
                      "NEWLINE", "WS" ]

    RULE_prog = 0
    RULE_stat = 1
    RULE_stat_block = 2
    RULE_expr = 3

    ruleNames =  [ "prog", "stat", "stat_block", "expr" ]

    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
    T__11=12
    T__12=13
    T__13=14
    EXPONENT=15
    MUL=16
    DIV=17
    FLOOR=18
    MOD=19
    ADD=20
    SUB=21
    AND=22
    OR=23
    NOT=24
    IN=25
    LTHAN=26
    GTHAN=27
    LTHANE=28
    GTHANE=29
    EQUAL=30
    NEQUAL=31
    ID=32
    STRING=33
    INT=34
    REAL=35
    NEWLINE=36
    WS=37

    def __init__(self, input:TokenStream):
        super().__init__(input)
        self.checkVersion("4.6")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None



    class ProgContext(ParserRuleContext):

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

        def stat(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.StatContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.StatContext,i)


        def getRuleIndex(self):
            return SeawolfScriptParser.RULE_prog

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

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

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




    def prog(self):

        localctx = SeawolfScriptParser.ProgContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_prog)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8
            self.match(SeawolfScriptParser.T__0)
            self.state = 10 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 9
                self.stat()
                self.state = 12 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SeawolfScriptParser.T__2) | (1 << SeawolfScriptParser.T__8) | (1 << SeawolfScriptParser.T__12) | (1 << SeawolfScriptParser.ID) | (1 << SeawolfScriptParser.NEWLINE))) != 0)):
                    break

            self.state = 14
            self.match(SeawolfScriptParser.T__1)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class StatContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SeawolfScriptParser.RULE_stat

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class BlankContext(StatContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.StatContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def NEWLINE(self):
            return self.getToken(SeawolfScriptParser.NEWLINE, 0)

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

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

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


    class AssignMatrixContext(StatContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.StatContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def ID(self):
            return self.getToken(SeawolfScriptParser.ID, 0)
        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)

        def NEWLINE(self):
            return self.getToken(SeawolfScriptParser.NEWLINE, 0)

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

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

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


    class WhileContext(StatContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.StatContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,0)

        def stat_block(self):
            return self.getTypedRuleContext(SeawolfScriptParser.Stat_blockContext,0)


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

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

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


    class IfContext(StatContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.StatContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,0)

        def stat_block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.Stat_blockContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.Stat_blockContext,i)


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

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

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


    class AssignIndexContext(StatContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.StatContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def ID(self):
            return self.getToken(SeawolfScriptParser.ID, 0)
        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)

        def NEWLINE(self):
            return self.getToken(SeawolfScriptParser.NEWLINE, 0)

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

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

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


    class PrintExprContext(StatContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.StatContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,0)

        def NEWLINE(self):
            return self.getToken(SeawolfScriptParser.NEWLINE, 0)

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

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

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


    class AssignContext(StatContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.StatContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def ID(self):
            return self.getToken(SeawolfScriptParser.ID, 0)
        def expr(self):
            return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,0)

        def NEWLINE(self):
            return self.getToken(SeawolfScriptParser.NEWLINE, 0)

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

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

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



    def stat(self):

        localctx = SeawolfScriptParser.StatContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_stat)
        self._la = 0 # Token type
        try:
            self.state = 71
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,2,self._ctx)
            if la_ == 1:
                localctx = SeawolfScriptParser.PrintExprContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 16
                self.match(SeawolfScriptParser.T__2)
                self.state = 17
                self.expr(0)
                self.state = 18
                self.match(SeawolfScriptParser.T__3)
                self.state = 19
                self.match(SeawolfScriptParser.NEWLINE)
                pass

            elif la_ == 2:
                localctx = SeawolfScriptParser.AssignContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 21
                self.match(SeawolfScriptParser.ID)
                self.state = 22
                self.match(SeawolfScriptParser.T__4)
                self.state = 23
                self.expr(0)
                self.state = 24
                self.match(SeawolfScriptParser.T__5)
                self.state = 25
                self.match(SeawolfScriptParser.NEWLINE)
                pass

            elif la_ == 3:
                localctx = SeawolfScriptParser.AssignIndexContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 27
                self.match(SeawolfScriptParser.ID)
                self.state = 28
                self.match(SeawolfScriptParser.T__6)
                self.state = 29
                self.expr(0)
                self.state = 30
                self.match(SeawolfScriptParser.T__7)
                self.state = 31
                self.match(SeawolfScriptParser.T__4)
                self.state = 32
                self.expr(0)
                self.state = 33
                self.match(SeawolfScriptParser.T__5)
                self.state = 34
                self.match(SeawolfScriptParser.NEWLINE)
                pass

            elif la_ == 4:
                localctx = SeawolfScriptParser.AssignMatrixContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 36
                self.match(SeawolfScriptParser.ID)
                self.state = 37
                self.match(SeawolfScriptParser.T__6)
                self.state = 38
                self.expr(0)
                self.state = 39
                self.match(SeawolfScriptParser.T__7)
                self.state = 40
                self.match(SeawolfScriptParser.T__6)
                self.state = 41
                self.expr(0)
                self.state = 42
                self.match(SeawolfScriptParser.T__7)
                self.state = 43
                self.match(SeawolfScriptParser.T__4)
                self.state = 44
                self.expr(0)
                self.state = 45
                self.match(SeawolfScriptParser.T__5)
                self.state = 46
                self.match(SeawolfScriptParser.NEWLINE)
                pass

            elif la_ == 5:
                localctx = SeawolfScriptParser.IfContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 48
                self.match(SeawolfScriptParser.T__8)
                self.state = 49
                self.match(SeawolfScriptParser.T__9)
                self.state = 50
                self.expr(0)
                self.state = 51
                self.match(SeawolfScriptParser.T__10)
                self.state = 52
                self.match(SeawolfScriptParser.T__0)
                self.state = 53
                self.stat_block()
                self.state = 54
                self.match(SeawolfScriptParser.T__1)
                self.state = 60
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SeawolfScriptParser.T__11:
                    self.state = 55
                    self.match(SeawolfScriptParser.T__11)
                    self.state = 56
                    self.match(SeawolfScriptParser.T__0)
                    self.state = 57
                    self.stat_block()
                    self.state = 58
                    self.match(SeawolfScriptParser.T__1)


                pass

            elif la_ == 6:
                localctx = SeawolfScriptParser.WhileContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 62
                self.match(SeawolfScriptParser.T__12)
                self.state = 63
                self.match(SeawolfScriptParser.T__9)
                self.state = 64
                self.expr(0)
                self.state = 65
                self.match(SeawolfScriptParser.T__10)
                self.state = 66
                self.match(SeawolfScriptParser.T__0)
                self.state = 67
                self.stat_block()
                self.state = 68
                self.match(SeawolfScriptParser.T__1)
                pass

            elif la_ == 7:
                localctx = SeawolfScriptParser.BlankContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 70
                self.match(SeawolfScriptParser.NEWLINE)
                pass


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

    class Stat_blockContext(ParserRuleContext):

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

        def stat(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.StatContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.StatContext,i)


        def getRuleIndex(self):
            return SeawolfScriptParser.RULE_stat_block

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

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

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




    def stat_block(self):

        localctx = SeawolfScriptParser.Stat_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_stat_block)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 74 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 73
                self.stat()
                self.state = 76 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SeawolfScriptParser.T__2) | (1 << SeawolfScriptParser.T__8) | (1 << SeawolfScriptParser.T__12) | (1 << SeawolfScriptParser.ID) | (1 << SeawolfScriptParser.NEWLINE))) != 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 ExprContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SeawolfScriptParser.RULE_expr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class FloorContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class ParensContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,0)


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

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

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


    class CondContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class ModContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class OrContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class ExponentContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class MulDivContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class AddSubContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class InContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class IndexContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class StringContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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

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

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


    class IntContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def INT(self):
            return self.getToken(SeawolfScriptParser.INT, 0)

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

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

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


    class ArrayContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


        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)


    class NotContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,0)


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

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

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


    class NegativeContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,0)


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

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

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


    class AndContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SeawolfScriptParser.ExprContext)
            else:
                return self.getTypedRuleContext(SeawolfScriptParser.ExprContext,i)


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

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

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


    class RealContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def REAL(self):
            return self.getToken(SeawolfScriptParser.REAL, 0)

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

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

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


    class IdContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SeawolfScriptParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def ID(self):
            return self.getToken(SeawolfScriptParser.ID, 0)

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

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

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



    def expr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = SeawolfScriptParser.ExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 6
        self.enterRecursionRule(localctx, 6, self.RULE_expr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 102
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SeawolfScriptParser.SUB]:
                localctx = SeawolfScriptParser.NegativeContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 79
                self.match(SeawolfScriptParser.SUB)
                self.state = 80
                self.expr(18)
                pass
            elif token in [SeawolfScriptParser.T__6]:
                localctx = SeawolfScriptParser.ArrayContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 81
                self.match(SeawolfScriptParser.T__6)
                self.state = 82
                self.expr(0)
                self.state = 87
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==SeawolfScriptParser.T__13:
                    self.state = 83
                    self.match(SeawolfScriptParser.T__13)
                    self.state = 84
                    self.expr(0)
                    self.state = 89
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 90
                self.match(SeawolfScriptParser.T__7)
                pass
            elif token in [SeawolfScriptParser.NOT]:
                localctx = SeawolfScriptParser.NotContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 92
                self.match(SeawolfScriptParser.NOT)
                self.state = 93
                self.expr(8)
                pass
            elif token in [SeawolfScriptParser.INT]:
                localctx = SeawolfScriptParser.IntContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 94
                self.match(SeawolfScriptParser.INT)
                pass
            elif token in [SeawolfScriptParser.REAL]:
                localctx = SeawolfScriptParser.RealContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 95
                self.match(SeawolfScriptParser.REAL)
                pass
            elif token in [SeawolfScriptParser.STRING]:
                localctx = SeawolfScriptParser.StringContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 96
                self.match(SeawolfScriptParser.STRING)
                pass
            elif token in [SeawolfScriptParser.ID]:
                localctx = SeawolfScriptParser.IdContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 97
                self.match(SeawolfScriptParser.ID)
                pass
            elif token in [SeawolfScriptParser.T__9]:
                localctx = SeawolfScriptParser.ParensContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 98
                self.match(SeawolfScriptParser.T__9)
                self.state = 99
                self.expr(0)
                self.state = 100
                self.match(SeawolfScriptParser.T__10)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 138
            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:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 136
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,6,self._ctx)
                    if la_ == 1:
                        localctx = SeawolfScriptParser.MulDivContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 104
                        if not self.precpred(self._ctx, 15):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 15)")
                        self.state = 105
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==SeawolfScriptParser.MUL or _la==SeawolfScriptParser.DIV):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 106
                        self.expr(16)
                        pass

                    elif la_ == 2:
                        localctx = SeawolfScriptParser.ModContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 107
                        if not self.precpred(self._ctx, 14):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 14)")
                        self.state = 108
                        self.match(SeawolfScriptParser.MOD)
                        self.state = 109
                        self.expr(15)
                        pass

                    elif la_ == 3:
                        localctx = SeawolfScriptParser.ExponentContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 110
                        if not self.precpred(self._ctx, 13):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 13)")
                        self.state = 111
                        self.match(SeawolfScriptParser.EXPONENT)
                        self.state = 112
                        self.expr(14)
                        pass

                    elif la_ == 4:
                        localctx = SeawolfScriptParser.FloorContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 113
                        if not self.precpred(self._ctx, 12):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 12)")
                        self.state = 114
                        self.match(SeawolfScriptParser.FLOOR)
                        self.state = 115
                        self.expr(13)
                        pass

                    elif la_ == 5:
                        localctx = SeawolfScriptParser.AddSubContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 116
                        if not self.precpred(self._ctx, 11):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 11)")
                        self.state = 117
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==SeawolfScriptParser.ADD or _la==SeawolfScriptParser.SUB):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 118
                        self.expr(12)
                        pass

                    elif la_ == 6:
                        localctx = SeawolfScriptParser.InContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 119
                        if not self.precpred(self._ctx, 10):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
                        self.state = 120
                        self.match(SeawolfScriptParser.IN)
                        self.state = 121
                        self.expr(11)
                        pass

                    elif la_ == 7:
                        localctx = SeawolfScriptParser.CondContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 122
                        if not self.precpred(self._ctx, 9):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
                        self.state = 123
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SeawolfScriptParser.LTHAN) | (1 << SeawolfScriptParser.GTHAN) | (1 << SeawolfScriptParser.LTHANE) | (1 << SeawolfScriptParser.GTHANE) | (1 << SeawolfScriptParser.EQUAL) | (1 << SeawolfScriptParser.NEQUAL))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 124
                        self.expr(10)
                        pass

                    elif la_ == 8:
                        localctx = SeawolfScriptParser.AndContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 125
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 126
                        self.match(SeawolfScriptParser.AND)
                        self.state = 127
                        self.expr(8)
                        pass

                    elif la_ == 9:
                        localctx = SeawolfScriptParser.OrContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 128
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 129
                        self.match(SeawolfScriptParser.OR)
                        self.state = 130
                        self.expr(7)
                        pass

                    elif la_ == 10:
                        localctx = SeawolfScriptParser.IndexContext(self, SeawolfScriptParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 131
                        if not self.precpred(self._ctx, 16):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 16)")
                        self.state = 132
                        self.match(SeawolfScriptParser.T__6)
                        self.state = 133
                        self.expr(0)
                        self.state = 134
                        self.match(SeawolfScriptParser.T__7)
                        pass

             
                self.state = 140
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,7,self._ctx)

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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[3] = self.expr_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

    def expr_sempred(self, localctx:ExprContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 15)
         

            if predIndex == 1:
                return self.precpred(self._ctx, 14)
         

            if predIndex == 2:
                return self.precpred(self._ctx, 13)
         

            if predIndex == 3:
                return self.precpred(self._ctx, 12)
         

            if predIndex == 4:
                return self.precpred(self._ctx, 11)
         

            if predIndex == 5:
                return self.precpred(self._ctx, 10)
         

            if predIndex == 6:
                return self.precpred(self._ctx, 9)
         

            if predIndex == 7:
                return self.precpred(self._ctx, 7)
         

            if predIndex == 8:
                return self.precpred(self._ctx, 6)
         

            if predIndex == 9:
                return self.precpred(self._ctx, 16)
         




