# Generated from RAParser.g4 by ANTLR 4.9.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\66")
        buf.write("\u00c2\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3")
        buf.write("\2\5\2\35\n\2\3\2\3\2\3\2\5\2\"\n\2\3\2\3\2\3\2\5\2\'")
        buf.write("\n\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3")
        buf.write("\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\7\2")
        buf.write("B\n\2\f\2\16\2E\13\2\3\3\3\3\3\3\5\3J\n\3\3\4\3\4\3\4")
        buf.write("\5\4O\n\4\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\5\5]\n\5\3\5\5\5`\n\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\5\5u")
        buf.write("\n\5\3\5\3\5\3\5\5\5z\n\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5")
        buf.write("\u0082\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\7\5\u0091\n\5\f\5\16\5\u0094\13\5\3\6\3\6\3\6")
        buf.write("\3\6\3\7\3\7\3\7\5\7\u009d\n\7\3\7\3\7\5\7\u00a1\n\7\3")
        buf.write("\7\3\7\5\7\u00a5\n\7\3\7\3\7\5\7\u00a9\n\7\3\7\3\7\3\7")
        buf.write("\3\7\3\7\3\7\5\7\u00b1\n\7\3\b\3\b\3\b\5\b\u00b6\n\b\3")
        buf.write("\b\3\b\3\t\7\t\u00bb\n\t\f\t\16\t\u00be\13\t\3\t\3\t\3")
        buf.write("\t\2\4\2\b\n\2\4\6\b\n\f\16\20\2\6\3\2\36\37\3\2 !\3\2")
        buf.write(").\4\2\22\22\36\36\2\u00e6\2&\3\2\2\2\4F\3\2\2\2\6K\3")
        buf.write("\2\2\2\by\3\2\2\2\n\u0095\3\2\2\2\f\u00b0\3\2\2\2\16\u00b5")
        buf.write("\3\2\2\2\20\u00bc\3\2\2\2\22\23\b\2\1\2\23\'\7\20\2\2")
        buf.write("\24\'\7\21\2\2\25\26\7#\2\2\26\27\5\2\2\2\27\30\7$\2\2")
        buf.write("\30\'\3\2\2\2\31\32\7\22\2\2\32\34\7#\2\2\33\35\5\4\3")
        buf.write("\2\34\33\3\2\2\2\34\35\3\2\2\2\35\36\3\2\2\2\36\'\7$\2")
        buf.write("\2\37 \7\22\2\2 \"\7\34\2\2!\37\3\2\2\2!\"\3\2\2\2\"#")
        buf.write("\3\2\2\2#\'\7\22\2\2$%\7\17\2\2%\'\5\2\2\5&\22\3\2\2\2")
        buf.write("&\24\3\2\2\2&\25\3\2\2\2&\31\3\2\2\2&!\3\2\2\2&$\3\2\2")
        buf.write("\2\'C\3\2\2\2()\f\f\2\2)*\t\2\2\2*B\5\2\2\r+,\f\13\2\2")
        buf.write(",-\t\3\2\2-B\5\2\2\f./\f\n\2\2/\60\7\"\2\2\60B\5\2\2\13")
        buf.write("\61\62\f\t\2\2\62\63\t\4\2\2\63B\5\2\2\n\64\65\f\b\2\2")
        buf.write("\65\66\7\f\2\2\66B\5\2\2\t\678\f\4\2\289\7\r\2\29B\5\2")
        buf.write("\2\5:;\f\3\2\2;<\7\16\2\2<B\5\2\2\4=>\f\7\2\2>B\7\b\2")
        buf.write("\2?@\f\6\2\2@B\7\t\2\2A(\3\2\2\2A+\3\2\2\2A.\3\2\2\2A")
        buf.write("\61\3\2\2\2A\64\3\2\2\2A\67\3\2\2\2A:\3\2\2\2A=\3\2\2")
        buf.write("\2A?\3\2\2\2BE\3\2\2\2CA\3\2\2\2CD\3\2\2\2D\3\3\2\2\2")
        buf.write("EC\3\2\2\2FI\5\2\2\2GH\7\35\2\2HJ\5\4\3\2IG\3\2\2\2IJ")
        buf.write("\3\2\2\2J\5\3\2\2\2KN\7\22\2\2LM\7\35\2\2MO\5\6\4\2NL")
        buf.write("\3\2\2\2NO\3\2\2\2O\7\3\2\2\2PQ\b\5\1\2QR\7#\2\2RS\5\b")
        buf.write("\5\2ST\7$\2\2Tz\3\2\2\2Uz\7\22\2\2VW\7\23\2\2W_\7%\2\2")
        buf.write("XY\7\22\2\2Y\\\7(\2\2Z]\7\36\2\2[]\5\6\4\2\\Z\3\2\2\2")
        buf.write("\\[\3\2\2\2]`\3\2\2\2^`\5\6\4\2_X\3\2\2\2_^\3\2\2\2`a")
        buf.write("\3\2\2\2ab\7&\2\2bz\5\b\5\13cd\7\24\2\2de\7%\2\2ef\5\4")
        buf.write("\3\2fg\7&\2\2gh\5\b\5\nhz\3\2\2\2ij\7\25\2\2jk\7%\2\2")
        buf.write("kl\5\2\2\2lm\7&\2\2mn\5\b\5\tnz\3\2\2\2op\7\33\2\2pq\7")
        buf.write("%\2\2qt\5\4\3\2rs\7(\2\2su\5\4\3\2tr\3\2\2\2tu\3\2\2\2")
        buf.write("uv\3\2\2\2vw\7&\2\2wx\5\b\5\3xz\3\2\2\2yP\3\2\2\2yU\3")
        buf.write("\2\2\2yV\3\2\2\2yc\3\2\2\2yi\3\2\2\2yo\3\2\2\2z\u0092")
        buf.write("\3\2\2\2{|\f\b\2\2|\u0081\7\26\2\2}~\7%\2\2~\177\5\2\2")
        buf.write("\2\177\u0080\7&\2\2\u0080\u0082\3\2\2\2\u0081}\3\2\2\2")
        buf.write("\u0081\u0082\3\2\2\2\u0082\u0083\3\2\2\2\u0083\u0091\5")
        buf.write("\b\5\t\u0084\u0085\f\7\2\2\u0085\u0086\7\27\2\2\u0086")
        buf.write("\u0091\5\b\5\b\u0087\u0088\f\6\2\2\u0088\u0089\7\30\2")
        buf.write("\2\u0089\u0091\5\b\5\7\u008a\u008b\f\5\2\2\u008b\u008c")
        buf.write("\7\31\2\2\u008c\u0091\5\b\5\6\u008d\u008e\f\4\2\2\u008e")
        buf.write("\u008f\7\32\2\2\u008f\u0091\5\b\5\5\u0090{\3\2\2\2\u0090")
        buf.write("\u0084\3\2\2\2\u0090\u0087\3\2\2\2\u0090\u008a\3\2\2\2")
        buf.write("\u0090\u008d\3\2\2\2\u0091\u0094\3\2\2\2\u0092\u0090\3")
        buf.write("\2\2\2\u0092\u0093\3\2\2\2\u0093\t\3\2\2\2\u0094\u0092")
        buf.write("\3\2\2\2\u0095\u0096\7\22\2\2\u0096\u0097\7\'\2\2\u0097")
        buf.write("\u0098\5\b\5\2\u0098\13\3\2\2\2\u0099\u00b1\7/\2\2\u009a")
        buf.write("\u00a0\7\60\2\2\u009b\u009d\7\7\2\2\u009c\u009b\3\2\2")
        buf.write("\2\u009c\u009d\3\2\2\2\u009d\u009e\3\2\2\2\u009e\u00a1")
        buf.write("\7\22\2\2\u009f\u00a1\7\36\2\2\u00a0\u009c\3\2\2\2\u00a0")
        buf.write("\u009f\3\2\2\2\u00a1\u00b1\3\2\2\2\u00a2\u00a4\7\61\2")
        buf.write("\2\u00a3\u00a5\7\7\2\2\u00a4\u00a3\3\2\2\2\u00a4\u00a5")
        buf.write("\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6\u00a8\t\5\2\2\u00a7")
        buf.write("\u00a9\7\20\2\2\u00a8\u00a7\3\2\2\2\u00a8\u00a9\3\2\2")
        buf.write("\2\u00a9\u00b1\3\2\2\2\u00aa\u00ab\7\62\2\2\u00ab\u00b1")
        buf.write("\7\20\2\2\u00ac\u00b1\7\63\2\2\u00ad\u00b1\7\64\2\2\u00ae")
        buf.write("\u00af\7\65\2\2\u00af\u00b1\7\66\2\2\u00b0\u0099\3\2\2")
        buf.write("\2\u00b0\u009a\3\2\2\2\u00b0\u00a2\3\2\2\2\u00b0\u00aa")
        buf.write("\3\2\2\2\u00b0\u00ac\3\2\2\2\u00b0\u00ad\3\2\2\2\u00b0")
        buf.write("\u00ae\3\2\2\2\u00b1\r\3\2\2\2\u00b2\u00b6\5\b\5\2\u00b3")
        buf.write("\u00b6\5\n\6\2\u00b4\u00b6\5\f\7\2\u00b5\u00b2\3\2\2\2")
        buf.write("\u00b5\u00b3\3\2\2\2\u00b5\u00b4\3\2\2\2\u00b6\u00b7\3")
        buf.write("\2\2\2\u00b7\u00b8\7\6\2\2\u00b8\17\3\2\2\2\u00b9\u00bb")
        buf.write("\5\16\b\2\u00ba\u00b9\3\2\2\2\u00bb\u00be\3\2\2\2\u00bc")
        buf.write("\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00bf\3\2\2\2")
        buf.write("\u00be\u00bc\3\2\2\2\u00bf\u00c0\7\2\2\3\u00c0\21\3\2")
        buf.write("\2\2\27\34!&ACIN\\_ty\u0081\u0090\u0092\u009c\u00a0\u00a4")
        buf.write("\u00a8\u00b0\u00b5\u00bc")
        return buf.getvalue()


class RAParser ( Parser ):

    grammarFileName = "RAParser.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "';'", "'!'", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'\\rename'", "'\\project'", "'\\select'", "'\\join'", 
                     "'\\cross'", "'\\union'", "'\\diff'", "'\\intersect'", 
                     "'\\aggr'", "'.'", "','", "'*'", "'/'", "'+'", "'-'", 
                     "'||'", "'('", "')'", "'_{'", "'}'", "':-'", "':'", 
                     "'<='", "'<>'", "'>='", "'<'", "'='", "'>'", "'\\list'", 
                     "'\\clear'", "'\\save'", "'\\source'", "'\\help'", 
                     "'\\quit'", "'\\sqlexec'" ]

    symbolicNames = [ "<INVALID>", "WS", "COMMENT", "LINE_COMMENT", "TERMINATOR", 
                      "FORCE", "IS_NULL", "IS_NOT_NULL", "IS", "NULL", "LIKE", 
                      "AND", "OR", "NOT", "STRING", "NUMBER", "ID", "RENAME", 
                      "PROJECT", "SELECT", "JOIN", "CROSS", "UNION", "DIFF", 
                      "INTERSECT", "AGGR", "DOT", "COMMA", "STAR", "SLASH", 
                      "PLUS", "MINUS", "CONCAT", "PAREN_L", "PAREN_R", "ARG_L", 
                      "ARG_R", "GETS", "COLON", "LE", "NE", "GE", "LT", 
                      "EQ", "GT", "LIST", "CLEAR", "SAVE", "SOURCE", "HELP", 
                      "QUIT", "SQLEXEC", "SQLEXEC_TEXT" ]

    RULE_valExpr = 0
    RULE_listOfValExprs = 1
    RULE_listOfIDs = 2
    RULE_relExpr = 3
    RULE_definition = 4
    RULE_command = 5
    RULE_statement = 6
    RULE_program = 7

    ruleNames =  [ "valExpr", "listOfValExprs", "listOfIDs", "relExpr", 
                   "definition", "command", "statement", "program" ]

    EOF = Token.EOF
    WS=1
    COMMENT=2
    LINE_COMMENT=3
    TERMINATOR=4
    FORCE=5
    IS_NULL=6
    IS_NOT_NULL=7
    IS=8
    NULL=9
    LIKE=10
    AND=11
    OR=12
    NOT=13
    STRING=14
    NUMBER=15
    ID=16
    RENAME=17
    PROJECT=18
    SELECT=19
    JOIN=20
    CROSS=21
    UNION=22
    DIFF=23
    INTERSECT=24
    AGGR=25
    DOT=26
    COMMA=27
    STAR=28
    SLASH=29
    PLUS=30
    MINUS=31
    CONCAT=32
    PAREN_L=33
    PAREN_R=34
    ARG_L=35
    ARG_R=36
    GETS=37
    COLON=38
    LE=39
    NE=40
    GE=41
    LT=42
    EQ=43
    GT=44
    LIST=45
    CLEAR=46
    SAVE=47
    SOURCE=48
    HELP=49
    QUIT=50
    SQLEXEC=51
    SQLEXEC_TEXT=52

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




    class ValExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return RAParser.RULE_valExpr

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


    class NumberLiteralValExprContext(ValExprContext):

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

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

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


    class IsNotNullExprContext(ValExprContext):

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

        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def IS_NOT_NULL(self):
            return self.getToken(RAParser.IS_NOT_NULL, 0)

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


    class FuncExprContext(ValExprContext):

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

        def ID(self):
            return self.getToken(RAParser.ID, 0)
        def PAREN_L(self):
            return self.getToken(RAParser.PAREN_L, 0)
        def PAREN_R(self):
            return self.getToken(RAParser.PAREN_R, 0)
        def listOfValExprs(self):
            return self.getTypedRuleContext(RAParser.ListOfValExprsContext,0)


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


    class AttrRefContext(ValExprContext):

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

        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(RAParser.ID)
            else:
                return self.getToken(RAParser.ID, i)
        def DOT(self):
            return self.getToken(RAParser.DOT, 0)

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


    class PlusMinusExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def PLUS(self):
            return self.getToken(RAParser.PLUS, 0)
        def MINUS(self):
            return self.getToken(RAParser.MINUS, 0)

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


    class OrExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def OR(self):
            return self.getToken(RAParser.OR, 0)

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


    class ValExprParenthesizedContext(ValExprContext):

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

        def PAREN_L(self):
            return self.getToken(RAParser.PAREN_L, 0)
        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def PAREN_R(self):
            return self.getToken(RAParser.PAREN_R, 0)

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


    class ConcatExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def CONCAT(self):
            return self.getToken(RAParser.CONCAT, 0)

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


    class NotExprContext(ValExprContext):

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

        def NOT(self):
            return self.getToken(RAParser.NOT, 0)
        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)


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


    class IsNullExprContext(ValExprContext):

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

        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def IS_NULL(self):
            return self.getToken(RAParser.IS_NULL, 0)

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


    class StringLiteralValExprContext(ValExprContext):

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

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

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


    class LikeExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def LIKE(self):
            return self.getToken(RAParser.LIKE, 0)

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


    class MultDivExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def STAR(self):
            return self.getToken(RAParser.STAR, 0)
        def SLASH(self):
            return self.getToken(RAParser.SLASH, 0)

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


    class CompareExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def LT(self):
            return self.getToken(RAParser.LT, 0)
        def LE(self):
            return self.getToken(RAParser.LE, 0)
        def EQ(self):
            return self.getToken(RAParser.EQ, 0)
        def NE(self):
            return self.getToken(RAParser.NE, 0)
        def GE(self):
            return self.getToken(RAParser.GE, 0)
        def GT(self):
            return self.getToken(RAParser.GT, 0)

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


    class AndExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def AND(self):
            return self.getToken(RAParser.AND, 0)

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



    def valExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = RAParser.ValExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 0
        self.enterRecursionRule(localctx, 0, self.RULE_valExpr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 36
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,2,self._ctx)
            if la_ == 1:
                localctx = RAParser.StringLiteralValExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 17
                self.match(RAParser.STRING)
                pass

            elif la_ == 2:
                localctx = RAParser.NumberLiteralValExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 18
                self.match(RAParser.NUMBER)
                pass

            elif la_ == 3:
                localctx = RAParser.ValExprParenthesizedContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 19
                self.match(RAParser.PAREN_L)
                self.state = 20
                self.valExpr(0)
                self.state = 21
                self.match(RAParser.PAREN_R)
                pass

            elif la_ == 4:
                localctx = RAParser.FuncExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 23
                self.match(RAParser.ID)
                self.state = 24
                self.match(RAParser.PAREN_L)
                self.state = 26
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RAParser.NOT) | (1 << RAParser.STRING) | (1 << RAParser.NUMBER) | (1 << RAParser.ID) | (1 << RAParser.PAREN_L))) != 0):
                    self.state = 25
                    self.listOfValExprs()


                self.state = 28
                self.match(RAParser.PAREN_R)
                pass

            elif la_ == 5:
                localctx = RAParser.AttrRefContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 31
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,1,self._ctx)
                if la_ == 1:
                    self.state = 29
                    self.match(RAParser.ID)
                    self.state = 30
                    self.match(RAParser.DOT)


                self.state = 33
                self.match(RAParser.ID)
                pass

            elif la_ == 6:
                localctx = RAParser.NotExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 34
                self.match(RAParser.NOT)
                self.state = 35
                self.valExpr(3)
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 65
            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:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 63
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,3,self._ctx)
                    if la_ == 1:
                        localctx = RAParser.MultDivExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 38
                        if not self.precpred(self._ctx, 10):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
                        self.state = 39
                        _la = self._input.LA(1)
                        if not(_la==RAParser.STAR or _la==RAParser.SLASH):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 40
                        self.valExpr(11)
                        pass

                    elif la_ == 2:
                        localctx = RAParser.PlusMinusExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 41
                        if not self.precpred(self._ctx, 9):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
                        self.state = 42
                        _la = self._input.LA(1)
                        if not(_la==RAParser.PLUS or _la==RAParser.MINUS):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 43
                        self.valExpr(10)
                        pass

                    elif la_ == 3:
                        localctx = RAParser.ConcatExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 44
                        if not self.precpred(self._ctx, 8):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
                        self.state = 45
                        self.match(RAParser.CONCAT)
                        self.state = 46
                        self.valExpr(9)
                        pass

                    elif la_ == 4:
                        localctx = RAParser.CompareExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 47
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 48
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RAParser.LE) | (1 << RAParser.NE) | (1 << RAParser.GE) | (1 << RAParser.LT) | (1 << RAParser.EQ) | (1 << RAParser.GT))) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 49
                        self.valExpr(8)
                        pass

                    elif la_ == 5:
                        localctx = RAParser.LikeExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 50
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 51
                        self.match(RAParser.LIKE)
                        self.state = 52
                        self.valExpr(7)
                        pass

                    elif la_ == 6:
                        localctx = RAParser.AndExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 53
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 54
                        self.match(RAParser.AND)
                        self.state = 55
                        self.valExpr(3)
                        pass

                    elif la_ == 7:
                        localctx = RAParser.OrExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 56
                        if not self.precpred(self._ctx, 1):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                        self.state = 57
                        self.match(RAParser.OR)
                        self.state = 58
                        self.valExpr(2)
                        pass

                    elif la_ == 8:
                        localctx = RAParser.IsNullExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 59
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 60
                        self.match(RAParser.IS_NULL)
                        pass

                    elif la_ == 9:
                        localctx = RAParser.IsNotNullExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 61
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 62
                        self.match(RAParser.IS_NOT_NULL)
                        pass

             
                self.state = 67
                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.unrollRecursionContexts(_parentctx)
        return localctx


    class ListOfValExprsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)


        def COMMA(self):
            return self.getToken(RAParser.COMMA, 0)

        def listOfValExprs(self):
            return self.getTypedRuleContext(RAParser.ListOfValExprsContext,0)


        def getRuleIndex(self):
            return RAParser.RULE_listOfValExprs

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




    def listOfValExprs(self):

        localctx = RAParser.ListOfValExprsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_listOfValExprs)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 68
            self.valExpr(0)
            self.state = 71
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==RAParser.COMMA:
                self.state = 69
                self.match(RAParser.COMMA)
                self.state = 70
                self.listOfValExprs()


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


    class ListOfIDsContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def COMMA(self):
            return self.getToken(RAParser.COMMA, 0)

        def listOfIDs(self):
            return self.getTypedRuleContext(RAParser.ListOfIDsContext,0)


        def getRuleIndex(self):
            return RAParser.RULE_listOfIDs

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




    def listOfIDs(self):

        localctx = RAParser.ListOfIDsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_listOfIDs)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 73
            self.match(RAParser.ID)
            self.state = 76
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==RAParser.COMMA:
                self.state = 74
                self.match(RAParser.COMMA)
                self.state = 75
                self.listOfIDs()


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


    class RelExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return RAParser.RULE_relExpr

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


    class RelRefContext(RelExprContext):

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

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

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


    class RenameExprContext(RelExprContext):

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

        def RENAME(self):
            return self.getToken(RAParser.RENAME, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)

        def listOfIDs(self):
            return self.getTypedRuleContext(RAParser.ListOfIDsContext,0)

        def ID(self):
            return self.getToken(RAParser.ID, 0)
        def COLON(self):
            return self.getToken(RAParser.COLON, 0)
        def STAR(self):
            return self.getToken(RAParser.STAR, 0)

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


    class IntersectExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def INTERSECT(self):
            return self.getToken(RAParser.INTERSECT, 0)

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


    class JoinExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def JOIN(self):
            return self.getToken(RAParser.JOIN, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)

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


    class SelectExprContext(RelExprContext):

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

        def SELECT(self):
            return self.getToken(RAParser.SELECT, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)


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


    class RelExprParenthesizedContext(RelExprContext):

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

        def PAREN_L(self):
            return self.getToken(RAParser.PAREN_L, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)

        def PAREN_R(self):
            return self.getToken(RAParser.PAREN_R, 0)

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


    class CrossExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def CROSS(self):
            return self.getToken(RAParser.CROSS, 0)

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


    class AggrExprContext(RelExprContext):

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

        def AGGR(self):
            return self.getToken(RAParser.AGGR, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def listOfValExprs(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ListOfValExprsContext)
            else:
                return self.getTypedRuleContext(RAParser.ListOfValExprsContext,i)

        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)

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

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


    class ProjectExprContext(RelExprContext):

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

        def PROJECT(self):
            return self.getToken(RAParser.PROJECT, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def listOfValExprs(self):
            return self.getTypedRuleContext(RAParser.ListOfValExprsContext,0)

        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)


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


    class DiffExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def DIFF(self):
            return self.getToken(RAParser.DIFF, 0)

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


    class UnionExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def UNION(self):
            return self.getToken(RAParser.UNION, 0)

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



    def relExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = RAParser.RelExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 6
        self.enterRecursionRule(localctx, 6, self.RULE_relExpr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 119
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [RAParser.PAREN_L]:
                localctx = RAParser.RelExprParenthesizedContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 79
                self.match(RAParser.PAREN_L)
                self.state = 80
                self.relExpr(0)
                self.state = 81
                self.match(RAParser.PAREN_R)
                pass
            elif token in [RAParser.ID]:
                localctx = RAParser.RelRefContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 83
                self.match(RAParser.ID)
                pass
            elif token in [RAParser.RENAME]:
                localctx = RAParser.RenameExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 84
                self.match(RAParser.RENAME)
                self.state = 85
                self.match(RAParser.ARG_L)
                self.state = 93
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
                if la_ == 1:
                    self.state = 86
                    self.match(RAParser.ID)
                    self.state = 87
                    self.match(RAParser.COLON)
                    self.state = 90
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [RAParser.STAR]:
                        self.state = 88
                        self.match(RAParser.STAR)
                        pass
                    elif token in [RAParser.ID]:
                        self.state = 89
                        self.listOfIDs()
                        pass
                    else:
                        raise NoViableAltException(self)

                    pass

                elif la_ == 2:
                    self.state = 92
                    self.listOfIDs()
                    pass


                self.state = 95
                self.match(RAParser.ARG_R)
                self.state = 96
                self.relExpr(9)
                pass
            elif token in [RAParser.PROJECT]:
                localctx = RAParser.ProjectExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 97
                self.match(RAParser.PROJECT)
                self.state = 98
                self.match(RAParser.ARG_L)
                self.state = 99
                self.listOfValExprs()
                self.state = 100
                self.match(RAParser.ARG_R)
                self.state = 101
                self.relExpr(8)
                pass
            elif token in [RAParser.SELECT]:
                localctx = RAParser.SelectExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 103
                self.match(RAParser.SELECT)
                self.state = 104
                self.match(RAParser.ARG_L)
                self.state = 105
                self.valExpr(0)
                self.state = 106
                self.match(RAParser.ARG_R)
                self.state = 107
                self.relExpr(7)
                pass
            elif token in [RAParser.AGGR]:
                localctx = RAParser.AggrExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 109
                self.match(RAParser.AGGR)
                self.state = 110
                self.match(RAParser.ARG_L)
                self.state = 111
                self.listOfValExprs()
                self.state = 114
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==RAParser.COLON:
                    self.state = 112
                    self.match(RAParser.COLON)
                    self.state = 113
                    self.listOfValExprs()


                self.state = 116
                self.match(RAParser.ARG_R)
                self.state = 117
                self.relExpr(1)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 144
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,13,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 = 142
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
                    if la_ == 1:
                        localctx = RAParser.JoinExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 121
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 122
                        self.match(RAParser.JOIN)
                        self.state = 127
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==RAParser.ARG_L:
                            self.state = 123
                            self.match(RAParser.ARG_L)
                            self.state = 124
                            self.valExpr(0)
                            self.state = 125
                            self.match(RAParser.ARG_R)


                        self.state = 129
                        self.relExpr(7)
                        pass

                    elif la_ == 2:
                        localctx = RAParser.CrossExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 130
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 131
                        self.match(RAParser.CROSS)
                        self.state = 132
                        self.relExpr(6)
                        pass

                    elif la_ == 3:
                        localctx = RAParser.UnionExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 133
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 134
                        self.match(RAParser.UNION)
                        self.state = 135
                        self.relExpr(5)
                        pass

                    elif la_ == 4:
                        localctx = RAParser.DiffExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 136
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 137
                        self.match(RAParser.DIFF)
                        self.state = 138
                        self.relExpr(4)
                        pass

                    elif la_ == 5:
                        localctx = RAParser.IntersectExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 139
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 140
                        self.match(RAParser.INTERSECT)
                        self.state = 141
                        self.relExpr(3)
                        pass

             
                self.state = 146
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,13,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


    class DefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def GETS(self):
            return self.getToken(RAParser.GETS, 0)

        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)


        def getRuleIndex(self):
            return RAParser.RULE_definition

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




    def definition(self):

        localctx = RAParser.DefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_definition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 147
            self.match(RAParser.ID)
            self.state = 148
            self.match(RAParser.GETS)
            self.state = 149
            self.relExpr(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CommandContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return RAParser.RULE_command

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



    class ListCommandContext(CommandContext):

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

        def LIST(self):
            return self.getToken(RAParser.LIST, 0)

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


    class ClearCommandContext(CommandContext):

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

        def CLEAR(self):
            return self.getToken(RAParser.CLEAR, 0)
        def ID(self):
            return self.getToken(RAParser.ID, 0)
        def STAR(self):
            return self.getToken(RAParser.STAR, 0)
        def FORCE(self):
            return self.getToken(RAParser.FORCE, 0)

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


    class QuitCommandContext(CommandContext):

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

        def QUIT(self):
            return self.getToken(RAParser.QUIT, 0)

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


    class SourceCommandContext(CommandContext):

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

        def SOURCE(self):
            return self.getToken(RAParser.SOURCE, 0)
        def STRING(self):
            return self.getToken(RAParser.STRING, 0)

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


    class HelpCommandContext(CommandContext):

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

        def HELP(self):
            return self.getToken(RAParser.HELP, 0)

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


    class SaveCommandContext(CommandContext):

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

        def SAVE(self):
            return self.getToken(RAParser.SAVE, 0)
        def ID(self):
            return self.getToken(RAParser.ID, 0)
        def STAR(self):
            return self.getToken(RAParser.STAR, 0)
        def FORCE(self):
            return self.getToken(RAParser.FORCE, 0)
        def STRING(self):
            return self.getToken(RAParser.STRING, 0)

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


    class SqlexecCommandContext(CommandContext):

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

        def SQLEXEC(self):
            return self.getToken(RAParser.SQLEXEC, 0)
        def SQLEXEC_TEXT(self):
            return self.getToken(RAParser.SQLEXEC_TEXT, 0)

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



    def command(self):

        localctx = RAParser.CommandContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_command)
        self._la = 0 # Token type
        try:
            self.state = 174
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [RAParser.LIST]:
                localctx = RAParser.ListCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 151
                self.match(RAParser.LIST)
                pass
            elif token in [RAParser.CLEAR]:
                localctx = RAParser.ClearCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 152
                self.match(RAParser.CLEAR)
                self.state = 158
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [RAParser.FORCE, RAParser.ID]:
                    self.state = 154
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==RAParser.FORCE:
                        self.state = 153
                        self.match(RAParser.FORCE)


                    self.state = 156
                    self.match(RAParser.ID)
                    pass
                elif token in [RAParser.STAR]:
                    self.state = 157
                    self.match(RAParser.STAR)
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [RAParser.SAVE]:
                localctx = RAParser.SaveCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 160
                self.match(RAParser.SAVE)
                self.state = 162
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==RAParser.FORCE:
                    self.state = 161
                    self.match(RAParser.FORCE)


                self.state = 164
                _la = self._input.LA(1)
                if not(_la==RAParser.ID or _la==RAParser.STAR):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 166
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==RAParser.STRING:
                    self.state = 165
                    self.match(RAParser.STRING)


                pass
            elif token in [RAParser.SOURCE]:
                localctx = RAParser.SourceCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 168
                self.match(RAParser.SOURCE)
                self.state = 169
                self.match(RAParser.STRING)
                pass
            elif token in [RAParser.HELP]:
                localctx = RAParser.HelpCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 170
                self.match(RAParser.HELP)
                pass
            elif token in [RAParser.QUIT]:
                localctx = RAParser.QuitCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 171
                self.match(RAParser.QUIT)
                pass
            elif token in [RAParser.SQLEXEC]:
                localctx = RAParser.SqlexecCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 172
                self.match(RAParser.SQLEXEC)
                self.state = 173
                self.match(RAParser.SQLEXEC_TEXT)
                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 StatementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def TERMINATOR(self):
            return self.getToken(RAParser.TERMINATOR, 0)

        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)


        def definition(self):
            return self.getTypedRuleContext(RAParser.DefinitionContext,0)


        def command(self):
            return self.getTypedRuleContext(RAParser.CommandContext,0)


        def getRuleIndex(self):
            return RAParser.RULE_statement

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




    def statement(self):

        localctx = RAParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 179
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
            if la_ == 1:
                self.state = 176
                self.relExpr(0)
                pass

            elif la_ == 2:
                self.state = 177
                self.definition()
                pass

            elif la_ == 3:
                self.state = 178
                self.command()
                pass


            self.state = 181
            self.match(RAParser.TERMINATOR)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ProgramContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.StatementContext)
            else:
                return self.getTypedRuleContext(RAParser.StatementContext,i)


        def getRuleIndex(self):
            return RAParser.RULE_program

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




    def program(self):

        localctx = RAParser.ProgramContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_program)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 186
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RAParser.ID) | (1 << RAParser.RENAME) | (1 << RAParser.PROJECT) | (1 << RAParser.SELECT) | (1 << RAParser.AGGR) | (1 << RAParser.PAREN_L) | (1 << RAParser.LIST) | (1 << RAParser.CLEAR) | (1 << RAParser.SAVE) | (1 << RAParser.SOURCE) | (1 << RAParser.HELP) | (1 << RAParser.QUIT) | (1 << RAParser.SQLEXEC))) != 0):
                self.state = 183
                self.statement()
                self.state = 188
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[0] = self.valExpr_sempred
        self._predicates[3] = self.relExpr_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 valExpr_sempred(self, localctx:ValExprContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 10)
         

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

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

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

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

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

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

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

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

    def relExpr_sempred(self, localctx:RelExprContext, predIndex:int):
            if predIndex == 9:
                return self.precpred(self._ctx, 6)
         

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

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

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

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





# Generated from RAParser.g4 by ANTLR 4.9.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\66")
        buf.write("\u00c2\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3")
        buf.write("\2\5\2\35\n\2\3\2\3\2\3\2\5\2\"\n\2\3\2\3\2\3\2\5\2\'")
        buf.write("\n\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3")
        buf.write("\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\7\2")
        buf.write("B\n\2\f\2\16\2E\13\2\3\3\3\3\3\3\5\3J\n\3\3\4\3\4\3\4")
        buf.write("\5\4O\n\4\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\5\5]\n\5\3\5\5\5`\n\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\5\5u")
        buf.write("\n\5\3\5\3\5\3\5\5\5z\n\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5")
        buf.write("\u0082\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\7\5\u0091\n\5\f\5\16\5\u0094\13\5\3\6\3\6\3\6")
        buf.write("\3\6\3\7\3\7\3\7\5\7\u009d\n\7\3\7\3\7\5\7\u00a1\n\7\3")
        buf.write("\7\3\7\5\7\u00a5\n\7\3\7\3\7\5\7\u00a9\n\7\3\7\3\7\3\7")
        buf.write("\3\7\3\7\3\7\5\7\u00b1\n\7\3\b\3\b\3\b\5\b\u00b6\n\b\3")
        buf.write("\b\3\b\3\t\7\t\u00bb\n\t\f\t\16\t\u00be\13\t\3\t\3\t\3")
        buf.write("\t\2\4\2\b\n\2\4\6\b\n\f\16\20\2\6\3\2\36\37\3\2 !\3\2")
        buf.write(").\4\2\22\22\36\36\2\u00e6\2&\3\2\2\2\4F\3\2\2\2\6K\3")
        buf.write("\2\2\2\by\3\2\2\2\n\u0095\3\2\2\2\f\u00b0\3\2\2\2\16\u00b5")
        buf.write("\3\2\2\2\20\u00bc\3\2\2\2\22\23\b\2\1\2\23\'\7\20\2\2")
        buf.write("\24\'\7\21\2\2\25\26\7#\2\2\26\27\5\2\2\2\27\30\7$\2\2")
        buf.write("\30\'\3\2\2\2\31\32\7\22\2\2\32\34\7#\2\2\33\35\5\4\3")
        buf.write("\2\34\33\3\2\2\2\34\35\3\2\2\2\35\36\3\2\2\2\36\'\7$\2")
        buf.write("\2\37 \7\22\2\2 \"\7\34\2\2!\37\3\2\2\2!\"\3\2\2\2\"#")
        buf.write("\3\2\2\2#\'\7\22\2\2$%\7\17\2\2%\'\5\2\2\5&\22\3\2\2\2")
        buf.write("&\24\3\2\2\2&\25\3\2\2\2&\31\3\2\2\2&!\3\2\2\2&$\3\2\2")
        buf.write("\2\'C\3\2\2\2()\f\f\2\2)*\t\2\2\2*B\5\2\2\r+,\f\13\2\2")
        buf.write(",-\t\3\2\2-B\5\2\2\f./\f\n\2\2/\60\7\"\2\2\60B\5\2\2\13")
        buf.write("\61\62\f\t\2\2\62\63\t\4\2\2\63B\5\2\2\n\64\65\f\b\2\2")
        buf.write("\65\66\7\f\2\2\66B\5\2\2\t\678\f\4\2\289\7\r\2\29B\5\2")
        buf.write("\2\5:;\f\3\2\2;<\7\16\2\2<B\5\2\2\4=>\f\7\2\2>B\7\b\2")
        buf.write("\2?@\f\6\2\2@B\7\t\2\2A(\3\2\2\2A+\3\2\2\2A.\3\2\2\2A")
        buf.write("\61\3\2\2\2A\64\3\2\2\2A\67\3\2\2\2A:\3\2\2\2A=\3\2\2")
        buf.write("\2A?\3\2\2\2BE\3\2\2\2CA\3\2\2\2CD\3\2\2\2D\3\3\2\2\2")
        buf.write("EC\3\2\2\2FI\5\2\2\2GH\7\35\2\2HJ\5\4\3\2IG\3\2\2\2IJ")
        buf.write("\3\2\2\2J\5\3\2\2\2KN\7\22\2\2LM\7\35\2\2MO\5\6\4\2NL")
        buf.write("\3\2\2\2NO\3\2\2\2O\7\3\2\2\2PQ\b\5\1\2QR\7#\2\2RS\5\b")
        buf.write("\5\2ST\7$\2\2Tz\3\2\2\2Uz\7\22\2\2VW\7\23\2\2W_\7%\2\2")
        buf.write("XY\7\22\2\2Y\\\7(\2\2Z]\7\36\2\2[]\5\6\4\2\\Z\3\2\2\2")
        buf.write("\\[\3\2\2\2]`\3\2\2\2^`\5\6\4\2_X\3\2\2\2_^\3\2\2\2`a")
        buf.write("\3\2\2\2ab\7&\2\2bz\5\b\5\13cd\7\24\2\2de\7%\2\2ef\5\4")
        buf.write("\3\2fg\7&\2\2gh\5\b\5\nhz\3\2\2\2ij\7\25\2\2jk\7%\2\2")
        buf.write("kl\5\2\2\2lm\7&\2\2mn\5\b\5\tnz\3\2\2\2op\7\33\2\2pq\7")
        buf.write("%\2\2qt\5\4\3\2rs\7(\2\2su\5\4\3\2tr\3\2\2\2tu\3\2\2\2")
        buf.write("uv\3\2\2\2vw\7&\2\2wx\5\b\5\3xz\3\2\2\2yP\3\2\2\2yU\3")
        buf.write("\2\2\2yV\3\2\2\2yc\3\2\2\2yi\3\2\2\2yo\3\2\2\2z\u0092")
        buf.write("\3\2\2\2{|\f\b\2\2|\u0081\7\26\2\2}~\7%\2\2~\177\5\2\2")
        buf.write("\2\177\u0080\7&\2\2\u0080\u0082\3\2\2\2\u0081}\3\2\2\2")
        buf.write("\u0081\u0082\3\2\2\2\u0082\u0083\3\2\2\2\u0083\u0091\5")
        buf.write("\b\5\t\u0084\u0085\f\7\2\2\u0085\u0086\7\27\2\2\u0086")
        buf.write("\u0091\5\b\5\b\u0087\u0088\f\6\2\2\u0088\u0089\7\30\2")
        buf.write("\2\u0089\u0091\5\b\5\7\u008a\u008b\f\5\2\2\u008b\u008c")
        buf.write("\7\31\2\2\u008c\u0091\5\b\5\6\u008d\u008e\f\4\2\2\u008e")
        buf.write("\u008f\7\32\2\2\u008f\u0091\5\b\5\5\u0090{\3\2\2\2\u0090")
        buf.write("\u0084\3\2\2\2\u0090\u0087\3\2\2\2\u0090\u008a\3\2\2\2")
        buf.write("\u0090\u008d\3\2\2\2\u0091\u0094\3\2\2\2\u0092\u0090\3")
        buf.write("\2\2\2\u0092\u0093\3\2\2\2\u0093\t\3\2\2\2\u0094\u0092")
        buf.write("\3\2\2\2\u0095\u0096\7\22\2\2\u0096\u0097\7\'\2\2\u0097")
        buf.write("\u0098\5\b\5\2\u0098\13\3\2\2\2\u0099\u00b1\7/\2\2\u009a")
        buf.write("\u00a0\7\60\2\2\u009b\u009d\7\7\2\2\u009c\u009b\3\2\2")
        buf.write("\2\u009c\u009d\3\2\2\2\u009d\u009e\3\2\2\2\u009e\u00a1")
        buf.write("\7\22\2\2\u009f\u00a1\7\36\2\2\u00a0\u009c\3\2\2\2\u00a0")
        buf.write("\u009f\3\2\2\2\u00a1\u00b1\3\2\2\2\u00a2\u00a4\7\61\2")
        buf.write("\2\u00a3\u00a5\7\7\2\2\u00a4\u00a3\3\2\2\2\u00a4\u00a5")
        buf.write("\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6\u00a8\t\5\2\2\u00a7")
        buf.write("\u00a9\7\20\2\2\u00a8\u00a7\3\2\2\2\u00a8\u00a9\3\2\2")
        buf.write("\2\u00a9\u00b1\3\2\2\2\u00aa\u00ab\7\62\2\2\u00ab\u00b1")
        buf.write("\7\20\2\2\u00ac\u00b1\7\63\2\2\u00ad\u00b1\7\64\2\2\u00ae")
        buf.write("\u00af\7\65\2\2\u00af\u00b1\7\66\2\2\u00b0\u0099\3\2\2")
        buf.write("\2\u00b0\u009a\3\2\2\2\u00b0\u00a2\3\2\2\2\u00b0\u00aa")
        buf.write("\3\2\2\2\u00b0\u00ac\3\2\2\2\u00b0\u00ad\3\2\2\2\u00b0")
        buf.write("\u00ae\3\2\2\2\u00b1\r\3\2\2\2\u00b2\u00b6\5\b\5\2\u00b3")
        buf.write("\u00b6\5\n\6\2\u00b4\u00b6\5\f\7\2\u00b5\u00b2\3\2\2\2")
        buf.write("\u00b5\u00b3\3\2\2\2\u00b5\u00b4\3\2\2\2\u00b6\u00b7\3")
        buf.write("\2\2\2\u00b7\u00b8\7\6\2\2\u00b8\17\3\2\2\2\u00b9\u00bb")
        buf.write("\5\16\b\2\u00ba\u00b9\3\2\2\2\u00bb\u00be\3\2\2\2\u00bc")
        buf.write("\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00bf\3\2\2\2")
        buf.write("\u00be\u00bc\3\2\2\2\u00bf\u00c0\7\2\2\3\u00c0\21\3\2")
        buf.write("\2\2\27\34!&ACIN\\_ty\u0081\u0090\u0092\u009c\u00a0\u00a4")
        buf.write("\u00a8\u00b0\u00b5\u00bc")
        return buf.getvalue()


class RAParser ( Parser ):

    grammarFileName = "RAParser.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "';'", "'!'", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'\\rename'", "'\\project'", "'\\select'", "'\\join'", 
                     "'\\cross'", "'\\union'", "'\\diff'", "'\\intersect'", 
                     "'\\aggr'", "'.'", "','", "'*'", "'/'", "'+'", "'-'", 
                     "'||'", "'('", "')'", "'_{'", "'}'", "':-'", "':'", 
                     "'<='", "'<>'", "'>='", "'<'", "'='", "'>'", "'\\list'", 
                     "'\\clear'", "'\\save'", "'\\source'", "'\\help'", 
                     "'\\quit'", "'\\sqlexec'" ]

    symbolicNames = [ "<INVALID>", "WS", "COMMENT", "LINE_COMMENT", "TERMINATOR", 
                      "FORCE", "IS_NULL", "IS_NOT_NULL", "IS", "NULL", "LIKE", 
                      "AND", "OR", "NOT", "STRING", "NUMBER", "ID", "RENAME", 
                      "PROJECT", "SELECT", "JOIN", "CROSS", "UNION", "DIFF", 
                      "INTERSECT", "AGGR", "DOT", "COMMA", "STAR", "SLASH", 
                      "PLUS", "MINUS", "CONCAT", "PAREN_L", "PAREN_R", "ARG_L", 
                      "ARG_R", "GETS", "COLON", "LE", "NE", "GE", "LT", 
                      "EQ", "GT", "LIST", "CLEAR", "SAVE", "SOURCE", "HELP", 
                      "QUIT", "SQLEXEC", "SQLEXEC_TEXT" ]

    RULE_valExpr = 0
    RULE_listOfValExprs = 1
    RULE_listOfIDs = 2
    RULE_relExpr = 3
    RULE_definition = 4
    RULE_command = 5
    RULE_statement = 6
    RULE_program = 7

    ruleNames =  [ "valExpr", "listOfValExprs", "listOfIDs", "relExpr", 
                   "definition", "command", "statement", "program" ]

    EOF = Token.EOF
    WS=1
    COMMENT=2
    LINE_COMMENT=3
    TERMINATOR=4
    FORCE=5
    IS_NULL=6
    IS_NOT_NULL=7
    IS=8
    NULL=9
    LIKE=10
    AND=11
    OR=12
    NOT=13
    STRING=14
    NUMBER=15
    ID=16
    RENAME=17
    PROJECT=18
    SELECT=19
    JOIN=20
    CROSS=21
    UNION=22
    DIFF=23
    INTERSECT=24
    AGGR=25
    DOT=26
    COMMA=27
    STAR=28
    SLASH=29
    PLUS=30
    MINUS=31
    CONCAT=32
    PAREN_L=33
    PAREN_R=34
    ARG_L=35
    ARG_R=36
    GETS=37
    COLON=38
    LE=39
    NE=40
    GE=41
    LT=42
    EQ=43
    GT=44
    LIST=45
    CLEAR=46
    SAVE=47
    SOURCE=48
    HELP=49
    QUIT=50
    SQLEXEC=51
    SQLEXEC_TEXT=52

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




    class ValExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return RAParser.RULE_valExpr

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


    class NumberLiteralValExprContext(ValExprContext):

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

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

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


    class IsNotNullExprContext(ValExprContext):

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

        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def IS_NOT_NULL(self):
            return self.getToken(RAParser.IS_NOT_NULL, 0)

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


    class FuncExprContext(ValExprContext):

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

        def ID(self):
            return self.getToken(RAParser.ID, 0)
        def PAREN_L(self):
            return self.getToken(RAParser.PAREN_L, 0)
        def PAREN_R(self):
            return self.getToken(RAParser.PAREN_R, 0)
        def listOfValExprs(self):
            return self.getTypedRuleContext(RAParser.ListOfValExprsContext,0)


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


    class AttrRefContext(ValExprContext):

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

        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(RAParser.ID)
            else:
                return self.getToken(RAParser.ID, i)
        def DOT(self):
            return self.getToken(RAParser.DOT, 0)

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


    class PlusMinusExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def PLUS(self):
            return self.getToken(RAParser.PLUS, 0)
        def MINUS(self):
            return self.getToken(RAParser.MINUS, 0)

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


    class OrExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def OR(self):
            return self.getToken(RAParser.OR, 0)

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


    class ValExprParenthesizedContext(ValExprContext):

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

        def PAREN_L(self):
            return self.getToken(RAParser.PAREN_L, 0)
        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def PAREN_R(self):
            return self.getToken(RAParser.PAREN_R, 0)

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


    class ConcatExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def CONCAT(self):
            return self.getToken(RAParser.CONCAT, 0)

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


    class NotExprContext(ValExprContext):

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

        def NOT(self):
            return self.getToken(RAParser.NOT, 0)
        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)


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


    class IsNullExprContext(ValExprContext):

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

        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def IS_NULL(self):
            return self.getToken(RAParser.IS_NULL, 0)

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


    class StringLiteralValExprContext(ValExprContext):

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

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

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


    class LikeExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def LIKE(self):
            return self.getToken(RAParser.LIKE, 0)

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


    class MultDivExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def STAR(self):
            return self.getToken(RAParser.STAR, 0)
        def SLASH(self):
            return self.getToken(RAParser.SLASH, 0)

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


    class CompareExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def LT(self):
            return self.getToken(RAParser.LT, 0)
        def LE(self):
            return self.getToken(RAParser.LE, 0)
        def EQ(self):
            return self.getToken(RAParser.EQ, 0)
        def NE(self):
            return self.getToken(RAParser.NE, 0)
        def GE(self):
            return self.getToken(RAParser.GE, 0)
        def GT(self):
            return self.getToken(RAParser.GT, 0)

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


    class AndExprContext(ValExprContext):

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

        def valExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ValExprContext)
            else:
                return self.getTypedRuleContext(RAParser.ValExprContext,i)

        def AND(self):
            return self.getToken(RAParser.AND, 0)

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



    def valExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = RAParser.ValExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 0
        self.enterRecursionRule(localctx, 0, self.RULE_valExpr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 36
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,2,self._ctx)
            if la_ == 1:
                localctx = RAParser.StringLiteralValExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 17
                self.match(RAParser.STRING)
                pass

            elif la_ == 2:
                localctx = RAParser.NumberLiteralValExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 18
                self.match(RAParser.NUMBER)
                pass

            elif la_ == 3:
                localctx = RAParser.ValExprParenthesizedContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 19
                self.match(RAParser.PAREN_L)
                self.state = 20
                self.valExpr(0)
                self.state = 21
                self.match(RAParser.PAREN_R)
                pass

            elif la_ == 4:
                localctx = RAParser.FuncExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 23
                self.match(RAParser.ID)
                self.state = 24
                self.match(RAParser.PAREN_L)
                self.state = 26
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RAParser.NOT) | (1 << RAParser.STRING) | (1 << RAParser.NUMBER) | (1 << RAParser.ID) | (1 << RAParser.PAREN_L))) != 0):
                    self.state = 25
                    self.listOfValExprs()


                self.state = 28
                self.match(RAParser.PAREN_R)
                pass

            elif la_ == 5:
                localctx = RAParser.AttrRefContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 31
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,1,self._ctx)
                if la_ == 1:
                    self.state = 29
                    self.match(RAParser.ID)
                    self.state = 30
                    self.match(RAParser.DOT)


                self.state = 33
                self.match(RAParser.ID)
                pass

            elif la_ == 6:
                localctx = RAParser.NotExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 34
                self.match(RAParser.NOT)
                self.state = 35
                self.valExpr(3)
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 65
            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:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 63
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,3,self._ctx)
                    if la_ == 1:
                        localctx = RAParser.MultDivExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 38
                        if not self.precpred(self._ctx, 10):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
                        self.state = 39
                        _la = self._input.LA(1)
                        if not(_la==RAParser.STAR or _la==RAParser.SLASH):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 40
                        self.valExpr(11)
                        pass

                    elif la_ == 2:
                        localctx = RAParser.PlusMinusExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 41
                        if not self.precpred(self._ctx, 9):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
                        self.state = 42
                        _la = self._input.LA(1)
                        if not(_la==RAParser.PLUS or _la==RAParser.MINUS):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 43
                        self.valExpr(10)
                        pass

                    elif la_ == 3:
                        localctx = RAParser.ConcatExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 44
                        if not self.precpred(self._ctx, 8):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
                        self.state = 45
                        self.match(RAParser.CONCAT)
                        self.state = 46
                        self.valExpr(9)
                        pass

                    elif la_ == 4:
                        localctx = RAParser.CompareExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 47
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 48
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RAParser.LE) | (1 << RAParser.NE) | (1 << RAParser.GE) | (1 << RAParser.LT) | (1 << RAParser.EQ) | (1 << RAParser.GT))) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 49
                        self.valExpr(8)
                        pass

                    elif la_ == 5:
                        localctx = RAParser.LikeExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 50
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 51
                        self.match(RAParser.LIKE)
                        self.state = 52
                        self.valExpr(7)
                        pass

                    elif la_ == 6:
                        localctx = RAParser.AndExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 53
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 54
                        self.match(RAParser.AND)
                        self.state = 55
                        self.valExpr(3)
                        pass

                    elif la_ == 7:
                        localctx = RAParser.OrExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 56
                        if not self.precpred(self._ctx, 1):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                        self.state = 57
                        self.match(RAParser.OR)
                        self.state = 58
                        self.valExpr(2)
                        pass

                    elif la_ == 8:
                        localctx = RAParser.IsNullExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 59
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 60
                        self.match(RAParser.IS_NULL)
                        pass

                    elif la_ == 9:
                        localctx = RAParser.IsNotNullExprContext(self, RAParser.ValExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_valExpr)
                        self.state = 61
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 62
                        self.match(RAParser.IS_NOT_NULL)
                        pass

             
                self.state = 67
                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.unrollRecursionContexts(_parentctx)
        return localctx


    class ListOfValExprsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)


        def COMMA(self):
            return self.getToken(RAParser.COMMA, 0)

        def listOfValExprs(self):
            return self.getTypedRuleContext(RAParser.ListOfValExprsContext,0)


        def getRuleIndex(self):
            return RAParser.RULE_listOfValExprs

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




    def listOfValExprs(self):

        localctx = RAParser.ListOfValExprsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_listOfValExprs)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 68
            self.valExpr(0)
            self.state = 71
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==RAParser.COMMA:
                self.state = 69
                self.match(RAParser.COMMA)
                self.state = 70
                self.listOfValExprs()


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


    class ListOfIDsContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def COMMA(self):
            return self.getToken(RAParser.COMMA, 0)

        def listOfIDs(self):
            return self.getTypedRuleContext(RAParser.ListOfIDsContext,0)


        def getRuleIndex(self):
            return RAParser.RULE_listOfIDs

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




    def listOfIDs(self):

        localctx = RAParser.ListOfIDsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_listOfIDs)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 73
            self.match(RAParser.ID)
            self.state = 76
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==RAParser.COMMA:
                self.state = 74
                self.match(RAParser.COMMA)
                self.state = 75
                self.listOfIDs()


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


    class RelExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return RAParser.RULE_relExpr

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


    class RelRefContext(RelExprContext):

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

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

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


    class RenameExprContext(RelExprContext):

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

        def RENAME(self):
            return self.getToken(RAParser.RENAME, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)

        def listOfIDs(self):
            return self.getTypedRuleContext(RAParser.ListOfIDsContext,0)

        def ID(self):
            return self.getToken(RAParser.ID, 0)
        def COLON(self):
            return self.getToken(RAParser.COLON, 0)
        def STAR(self):
            return self.getToken(RAParser.STAR, 0)

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


    class IntersectExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def INTERSECT(self):
            return self.getToken(RAParser.INTERSECT, 0)

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


    class JoinExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def JOIN(self):
            return self.getToken(RAParser.JOIN, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)

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


    class SelectExprContext(RelExprContext):

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

        def SELECT(self):
            return self.getToken(RAParser.SELECT, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def valExpr(self):
            return self.getTypedRuleContext(RAParser.ValExprContext,0)

        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)


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


    class RelExprParenthesizedContext(RelExprContext):

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

        def PAREN_L(self):
            return self.getToken(RAParser.PAREN_L, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)

        def PAREN_R(self):
            return self.getToken(RAParser.PAREN_R, 0)

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


    class CrossExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def CROSS(self):
            return self.getToken(RAParser.CROSS, 0)

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


    class AggrExprContext(RelExprContext):

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

        def AGGR(self):
            return self.getToken(RAParser.AGGR, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def listOfValExprs(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.ListOfValExprsContext)
            else:
                return self.getTypedRuleContext(RAParser.ListOfValExprsContext,i)

        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)

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

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


    class ProjectExprContext(RelExprContext):

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

        def PROJECT(self):
            return self.getToken(RAParser.PROJECT, 0)
        def ARG_L(self):
            return self.getToken(RAParser.ARG_L, 0)
        def listOfValExprs(self):
            return self.getTypedRuleContext(RAParser.ListOfValExprsContext,0)

        def ARG_R(self):
            return self.getToken(RAParser.ARG_R, 0)
        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)


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


    class DiffExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def DIFF(self):
            return self.getToken(RAParser.DIFF, 0)

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


    class UnionExprContext(RelExprContext):

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

        def relExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.RelExprContext)
            else:
                return self.getTypedRuleContext(RAParser.RelExprContext,i)

        def UNION(self):
            return self.getToken(RAParser.UNION, 0)

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



    def relExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = RAParser.RelExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 6
        self.enterRecursionRule(localctx, 6, self.RULE_relExpr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 119
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [RAParser.PAREN_L]:
                localctx = RAParser.RelExprParenthesizedContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 79
                self.match(RAParser.PAREN_L)
                self.state = 80
                self.relExpr(0)
                self.state = 81
                self.match(RAParser.PAREN_R)
                pass
            elif token in [RAParser.ID]:
                localctx = RAParser.RelRefContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 83
                self.match(RAParser.ID)
                pass
            elif token in [RAParser.RENAME]:
                localctx = RAParser.RenameExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 84
                self.match(RAParser.RENAME)
                self.state = 85
                self.match(RAParser.ARG_L)
                self.state = 93
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
                if la_ == 1:
                    self.state = 86
                    self.match(RAParser.ID)
                    self.state = 87
                    self.match(RAParser.COLON)
                    self.state = 90
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [RAParser.STAR]:
                        self.state = 88
                        self.match(RAParser.STAR)
                        pass
                    elif token in [RAParser.ID]:
                        self.state = 89
                        self.listOfIDs()
                        pass
                    else:
                        raise NoViableAltException(self)

                    pass

                elif la_ == 2:
                    self.state = 92
                    self.listOfIDs()
                    pass


                self.state = 95
                self.match(RAParser.ARG_R)
                self.state = 96
                self.relExpr(9)
                pass
            elif token in [RAParser.PROJECT]:
                localctx = RAParser.ProjectExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 97
                self.match(RAParser.PROJECT)
                self.state = 98
                self.match(RAParser.ARG_L)
                self.state = 99
                self.listOfValExprs()
                self.state = 100
                self.match(RAParser.ARG_R)
                self.state = 101
                self.relExpr(8)
                pass
            elif token in [RAParser.SELECT]:
                localctx = RAParser.SelectExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 103
                self.match(RAParser.SELECT)
                self.state = 104
                self.match(RAParser.ARG_L)
                self.state = 105
                self.valExpr(0)
                self.state = 106
                self.match(RAParser.ARG_R)
                self.state = 107
                self.relExpr(7)
                pass
            elif token in [RAParser.AGGR]:
                localctx = RAParser.AggrExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 109
                self.match(RAParser.AGGR)
                self.state = 110
                self.match(RAParser.ARG_L)
                self.state = 111
                self.listOfValExprs()
                self.state = 114
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==RAParser.COLON:
                    self.state = 112
                    self.match(RAParser.COLON)
                    self.state = 113
                    self.listOfValExprs()


                self.state = 116
                self.match(RAParser.ARG_R)
                self.state = 117
                self.relExpr(1)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 144
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,13,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 = 142
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
                    if la_ == 1:
                        localctx = RAParser.JoinExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 121
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 122
                        self.match(RAParser.JOIN)
                        self.state = 127
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==RAParser.ARG_L:
                            self.state = 123
                            self.match(RAParser.ARG_L)
                            self.state = 124
                            self.valExpr(0)
                            self.state = 125
                            self.match(RAParser.ARG_R)


                        self.state = 129
                        self.relExpr(7)
                        pass

                    elif la_ == 2:
                        localctx = RAParser.CrossExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 130
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 131
                        self.match(RAParser.CROSS)
                        self.state = 132
                        self.relExpr(6)
                        pass

                    elif la_ == 3:
                        localctx = RAParser.UnionExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 133
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 134
                        self.match(RAParser.UNION)
                        self.state = 135
                        self.relExpr(5)
                        pass

                    elif la_ == 4:
                        localctx = RAParser.DiffExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 136
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 137
                        self.match(RAParser.DIFF)
                        self.state = 138
                        self.relExpr(4)
                        pass

                    elif la_ == 5:
                        localctx = RAParser.IntersectExprContext(self, RAParser.RelExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relExpr)
                        self.state = 139
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 140
                        self.match(RAParser.INTERSECT)
                        self.state = 141
                        self.relExpr(3)
                        pass

             
                self.state = 146
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,13,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


    class DefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def GETS(self):
            return self.getToken(RAParser.GETS, 0)

        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)


        def getRuleIndex(self):
            return RAParser.RULE_definition

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




    def definition(self):

        localctx = RAParser.DefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_definition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 147
            self.match(RAParser.ID)
            self.state = 148
            self.match(RAParser.GETS)
            self.state = 149
            self.relExpr(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CommandContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return RAParser.RULE_command

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



    class ListCommandContext(CommandContext):

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

        def LIST(self):
            return self.getToken(RAParser.LIST, 0)

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


    class ClearCommandContext(CommandContext):

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

        def CLEAR(self):
            return self.getToken(RAParser.CLEAR, 0)
        def ID(self):
            return self.getToken(RAParser.ID, 0)
        def STAR(self):
            return self.getToken(RAParser.STAR, 0)
        def FORCE(self):
            return self.getToken(RAParser.FORCE, 0)

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


    class QuitCommandContext(CommandContext):

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

        def QUIT(self):
            return self.getToken(RAParser.QUIT, 0)

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


    class SourceCommandContext(CommandContext):

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

        def SOURCE(self):
            return self.getToken(RAParser.SOURCE, 0)
        def STRING(self):
            return self.getToken(RAParser.STRING, 0)

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


    class HelpCommandContext(CommandContext):

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

        def HELP(self):
            return self.getToken(RAParser.HELP, 0)

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


    class SaveCommandContext(CommandContext):

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

        def SAVE(self):
            return self.getToken(RAParser.SAVE, 0)
        def ID(self):
            return self.getToken(RAParser.ID, 0)
        def STAR(self):
            return self.getToken(RAParser.STAR, 0)
        def FORCE(self):
            return self.getToken(RAParser.FORCE, 0)
        def STRING(self):
            return self.getToken(RAParser.STRING, 0)

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


    class SqlexecCommandContext(CommandContext):

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

        def SQLEXEC(self):
            return self.getToken(RAParser.SQLEXEC, 0)
        def SQLEXEC_TEXT(self):
            return self.getToken(RAParser.SQLEXEC_TEXT, 0)

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



    def command(self):

        localctx = RAParser.CommandContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_command)
        self._la = 0 # Token type
        try:
            self.state = 174
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [RAParser.LIST]:
                localctx = RAParser.ListCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 151
                self.match(RAParser.LIST)
                pass
            elif token in [RAParser.CLEAR]:
                localctx = RAParser.ClearCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 152
                self.match(RAParser.CLEAR)
                self.state = 158
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [RAParser.FORCE, RAParser.ID]:
                    self.state = 154
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==RAParser.FORCE:
                        self.state = 153
                        self.match(RAParser.FORCE)


                    self.state = 156
                    self.match(RAParser.ID)
                    pass
                elif token in [RAParser.STAR]:
                    self.state = 157
                    self.match(RAParser.STAR)
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [RAParser.SAVE]:
                localctx = RAParser.SaveCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 160
                self.match(RAParser.SAVE)
                self.state = 162
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==RAParser.FORCE:
                    self.state = 161
                    self.match(RAParser.FORCE)


                self.state = 164
                _la = self._input.LA(1)
                if not(_la==RAParser.ID or _la==RAParser.STAR):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 166
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==RAParser.STRING:
                    self.state = 165
                    self.match(RAParser.STRING)


                pass
            elif token in [RAParser.SOURCE]:
                localctx = RAParser.SourceCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 168
                self.match(RAParser.SOURCE)
                self.state = 169
                self.match(RAParser.STRING)
                pass
            elif token in [RAParser.HELP]:
                localctx = RAParser.HelpCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 170
                self.match(RAParser.HELP)
                pass
            elif token in [RAParser.QUIT]:
                localctx = RAParser.QuitCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 171
                self.match(RAParser.QUIT)
                pass
            elif token in [RAParser.SQLEXEC]:
                localctx = RAParser.SqlexecCommandContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 172
                self.match(RAParser.SQLEXEC)
                self.state = 173
                self.match(RAParser.SQLEXEC_TEXT)
                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 StatementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def TERMINATOR(self):
            return self.getToken(RAParser.TERMINATOR, 0)

        def relExpr(self):
            return self.getTypedRuleContext(RAParser.RelExprContext,0)


        def definition(self):
            return self.getTypedRuleContext(RAParser.DefinitionContext,0)


        def command(self):
            return self.getTypedRuleContext(RAParser.CommandContext,0)


        def getRuleIndex(self):
            return RAParser.RULE_statement

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




    def statement(self):

        localctx = RAParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 179
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
            if la_ == 1:
                self.state = 176
                self.relExpr(0)
                pass

            elif la_ == 2:
                self.state = 177
                self.definition()
                pass

            elif la_ == 3:
                self.state = 178
                self.command()
                pass


            self.state = 181
            self.match(RAParser.TERMINATOR)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ProgramContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RAParser.StatementContext)
            else:
                return self.getTypedRuleContext(RAParser.StatementContext,i)


        def getRuleIndex(self):
            return RAParser.RULE_program

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




    def program(self):

        localctx = RAParser.ProgramContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_program)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 186
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RAParser.ID) | (1 << RAParser.RENAME) | (1 << RAParser.PROJECT) | (1 << RAParser.SELECT) | (1 << RAParser.AGGR) | (1 << RAParser.PAREN_L) | (1 << RAParser.LIST) | (1 << RAParser.CLEAR) | (1 << RAParser.SAVE) | (1 << RAParser.SOURCE) | (1 << RAParser.HELP) | (1 << RAParser.QUIT) | (1 << RAParser.SQLEXEC))) != 0):
                self.state = 183
                self.statement()
                self.state = 188
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[0] = self.valExpr_sempred
        self._predicates[3] = self.relExpr_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 valExpr_sempred(self, localctx:ValExprContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 10)
         

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

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

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

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

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

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

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

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

    def relExpr_sempred(self, localctx:RelExprContext, predIndex:int):
            if predIndex == 9:
                return self.precpred(self._ctx, 6)
         

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

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

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

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





# Generated from RAParser.g4 by ANTLR 4.9.2 # encoding: utf-8 #\2\2\26\27\5\2\2\2\27\30\7$\2\2") #\2\2\33\35\5\4\3") #\'\7\22\2\2$%\7\17\2\2%\'\5\2\2\5&\22\3\2\2\2") #\2\2RS\5\b") # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # actually a RAParser.ValExprContext # Token type # Token type # Token type # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # actually a RAParser.RelExprContext # Token type # actually a RAParser.CommandContext # actually a RAParser.CommandContext # actually a RAParser.CommandContext # actually a RAParser.CommandContext # actually a RAParser.CommandContext # actually a RAParser.CommandContext # actually a RAParser.CommandContext # Token type # Token type