# Generated from wrestlr/parsers/R/R.g4 by ANTLR 4.7.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3A")
        buf.write("\u013d\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\3\2\3\2\7\2\23\n\2\f\2\16\2\26\13\2\3\2\7\2\31")
        buf.write("\n\2\f\2\16\2\34\13\2\3\2\3\2\3\3\3\3\3\3\3\3\5\3$\n\3")
        buf.write("\3\3\3\3\3\3\3\3\7\3*\n\3\f\3\16\3-\13\3\3\3\3\3\3\3\7")
        buf.write("\3\62\n\3\f\3\16\3\65\13\3\3\3\3\3\3\3\3\3\3\3\7\3<\n")
        buf.write("\3\f\3\16\3?\13\3\3\3\3\3\7\3C\n\3\f\3\16\3F\13\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3|\n\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\7\3\u008a")
        buf.write("\n\3\f\3\16\3\u008d\13\3\3\3\3\3\3\3\3\3\7\3\u0093\n\3")
        buf.write("\f\3\16\3\u0096\13\3\3\3\3\3\3\3\3\3\7\3\u009c\n\3\f\3")
        buf.write("\16\3\u009f\13\3\3\3\3\3\3\3\3\3\7\3\u00a5\n\3\f\3\16")
        buf.write("\3\u00a8\13\3\3\3\3\3\3\3\3\3\7\3\u00ae\n\3\f\3\16\3\u00b1")
        buf.write("\13\3\3\3\3\3\3\3\3\3\7\3\u00b7\n\3\f\3\16\3\u00ba\13")
        buf.write("\3\3\3\3\3\3\3\3\3\7\3\u00c0\n\3\f\3\16\3\u00c3\13\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\7\3\u00cc\n\3\f\3\16\3\u00cf")
        buf.write("\13\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\7\3\u00df\n\3\f\3\16\3\u00e2\13\3\3\3\3\3\3\3")
        buf.write("\7\3\u00e7\n\3\f\3\16\3\u00ea\13\3\3\3\3\3\7\3\u00ee\n")
        buf.write("\3\f\3\16\3\u00f1\13\3\3\4\3\4\3\4\5\4\u00f6\n\4\7\4\u00f8")
        buf.write("\n\4\f\4\16\4\u00fb\13\4\3\4\5\4\u00fe\n\4\3\5\3\5\3\5")
        buf.write("\7\5\u0103\n\5\f\5\16\5\u0106\13\5\3\6\3\6\3\6\3\6\3\6")
        buf.write("\5\6\u010d\n\6\3\7\7\7\u0110\n\7\f\7\16\7\u0113\13\7\3")
        buf.write("\7\3\7\7\7\u0117\n\7\f\7\16\7\u011a\13\7\3\7\3\7\7\7\u011e")
        buf.write("\n\7\f\7\16\7\u0121\13\7\3\7\7\7\u0124\n\7\f\7\16\7\u0127")
        buf.write("\13\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b")
        buf.write("\3\b\3\b\3\b\3\b\3\b\3\b\5\b\u013b\n\b\3\b\2\3\4\t\2\4")
        buf.write("\6\b\n\f\16\2\13\4\2\3\3@@\3\2\17\20\3\2\7\b\3\2\t\n\3")
        buf.write("\2\22\23\3\2\24\31\3\2\33\34\3\2\35\36\3\2 %\2\u0181\2")
        buf.write("\32\3\2\2\2\4{\3\2\2\2\6\u00fd\3\2\2\2\b\u00ff\3\2\2\2")
        buf.write("\n\u010c\3\2\2\2\f\u0111\3\2\2\2\16\u013a\3\2\2\2\20\24")
        buf.write("\5\4\3\2\21\23\t\2\2\2\22\21\3\2\2\2\23\26\3\2\2\2\24")
        buf.write("\22\3\2\2\2\24\25\3\2\2\2\25\31\3\2\2\2\26\24\3\2\2\2")
        buf.write("\27\31\7@\2\2\30\20\3\2\2\2\30\27\3\2\2\2\31\34\3\2\2")
        buf.write("\2\32\30\3\2\2\2\32\33\3\2\2\2\33\35\3\2\2\2\34\32\3\2")
        buf.write("\2\2\35\36\7\2\2\3\36\3\3\2\2\2\37 \b\3\1\2 !\7\r\2\2")
        buf.write("!#\7\13\2\2\"$\5\b\5\2#\"\3\2\2\2#$\3\2\2\2$%\3\2\2\2")
        buf.write("%&\7\f\2\2&|\5\4\3&\'+\t\3\2\2(*\7@\2\2)(\3\2\2\2*-\3")
        buf.write("\2\2\2+)\3\2\2\2+,\3\2\2\2,.\3\2\2\2-+\3\2\2\2.|\5\4\3")
        buf.write("$/\63\7\32\2\2\60\62\7@\2\2\61\60\3\2\2\2\62\65\3\2\2")
        buf.write("\2\63\61\3\2\2\2\63\64\3\2\2\2\64\66\3\2\2\2\65\63\3\2")
        buf.write("\2\2\66|\5\4\3\36\678\7\37\2\28|\5\4\3\339=\7&\2\2:<\7")
        buf.write("@\2\2;:\3\2\2\2<?\3\2\2\2=;\3\2\2\2=>\3\2\2\2>@\3\2\2")
        buf.write("\2?=\3\2\2\2@D\5\6\4\2AC\7@\2\2BA\3\2\2\2CF\3\2\2\2DB")
        buf.write("\3\2\2\2DE\3\2\2\2EG\3\2\2\2FD\3\2\2\2GH\7\'\2\2H|\3\2")
        buf.write("\2\2IJ\7(\2\2JK\7\13\2\2KL\5\4\3\2LM\7\f\2\2MN\5\4\3\27")
        buf.write("N|\3\2\2\2OP\7(\2\2PQ\7\13\2\2QR\5\4\3\2RS\7\f\2\2ST\5")
        buf.write("\4\3\2TU\7)\2\2UV\5\4\3\26V|\3\2\2\2WX\7*\2\2XY\7\13\2")
        buf.write("\2YZ\7>\2\2Z[\7+\2\2[\\\5\4\3\2\\]\7\f\2\2]^\5\4\3\25")
        buf.write("^|\3\2\2\2_`\7,\2\2`a\7\13\2\2ab\5\4\3\2bc\7\f\2\2cd\5")
        buf.write("\4\3\24d|\3\2\2\2ef\7-\2\2f|\5\4\3\23gh\7.\2\2h|\5\4\3")
        buf.write("\22i|\7/\2\2j|\7\60\2\2kl\7\13\2\2lm\5\4\3\2mn\7\f\2\2")
        buf.write("n|\3\2\2\2o|\7>\2\2p|\7=\2\2q|\78\2\2r|\79\2\2s|\7:\2")
        buf.write("\2t|\7;\2\2u|\7\61\2\2v|\7\62\2\2w|\7\63\2\2x|\7\64\2")
        buf.write("\2y|\7\65\2\2z|\7\66\2\2{\37\3\2\2\2{\'\3\2\2\2{/\3\2")
        buf.write("\2\2{\67\3\2\2\2{9\3\2\2\2{I\3\2\2\2{O\3\2\2\2{W\3\2\2")
        buf.write("\2{_\3\2\2\2{e\3\2\2\2{g\3\2\2\2{i\3\2\2\2{j\3\2\2\2{")
        buf.write("k\3\2\2\2{o\3\2\2\2{p\3\2\2\2{q\3\2\2\2{r\3\2\2\2{s\3")
        buf.write("\2\2\2{t\3\2\2\2{u\3\2\2\2{v\3\2\2\2{w\3\2\2\2{x\3\2\2")
        buf.write("\2{y\3\2\2\2{z\3\2\2\2|\u00ef\3\2\2\2}~\f)\2\2~\177\t")
        buf.write("\4\2\2\177\u00ee\5\4\3*\u0080\u0081\f(\2\2\u0081\u0082")
        buf.write("\t\5\2\2\u0082\u00ee\5\4\3)\u0083\u0084\f%\2\2\u0084\u0085")
        buf.write("\7\16\2\2\u0085\u00ee\5\4\3%\u0086\u0087\f#\2\2\u0087")
        buf.write("\u008b\7\21\2\2\u0088\u008a\7@\2\2\u0089\u0088\3\2\2\2")
        buf.write("\u008a\u008d\3\2\2\2\u008b\u0089\3\2\2\2\u008b\u008c\3")
        buf.write("\2\2\2\u008c\u008e\3\2\2\2\u008d\u008b\3\2\2\2\u008e\u00ee")
        buf.write("\5\4\3$\u008f\u0090\f\"\2\2\u0090\u0094\7?\2\2\u0091\u0093")
        buf.write("\7@\2\2\u0092\u0091\3\2\2\2\u0093\u0096\3\2\2\2\u0094")
        buf.write("\u0092\3\2\2\2\u0094\u0095\3\2\2\2\u0095\u0097\3\2\2\2")
        buf.write("\u0096\u0094\3\2\2\2\u0097\u00ee\5\4\3#\u0098\u0099\f")
        buf.write("!\2\2\u0099\u009d\t\6\2\2\u009a\u009c\7@\2\2\u009b\u009a")
        buf.write("\3\2\2\2\u009c\u009f\3\2\2\2\u009d\u009b\3\2\2\2\u009d")
        buf.write("\u009e\3\2\2\2\u009e\u00a0\3\2\2\2\u009f\u009d\3\2\2\2")
        buf.write("\u00a0\u00ee\5\4\3\"\u00a1\u00a2\f \2\2\u00a2\u00a6\t")
        buf.write("\3\2\2\u00a3\u00a5\7@\2\2\u00a4\u00a3\3\2\2\2\u00a5\u00a8")
        buf.write("\3\2\2\2\u00a6\u00a4\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7")
        buf.write("\u00a9\3\2\2\2\u00a8\u00a6\3\2\2\2\u00a9\u00ee\5\4\3!")
        buf.write("\u00aa\u00ab\f\37\2\2\u00ab\u00af\t\7\2\2\u00ac\u00ae")
        buf.write("\7@\2\2\u00ad\u00ac\3\2\2\2\u00ae\u00b1\3\2\2\2\u00af")
        buf.write("\u00ad\3\2\2\2\u00af\u00b0\3\2\2\2\u00b0\u00b2\3\2\2\2")
        buf.write("\u00b1\u00af\3\2\2\2\u00b2\u00ee\5\4\3 \u00b3\u00b4\f")
        buf.write("\35\2\2\u00b4\u00b8\t\b\2\2\u00b5\u00b7\7@\2\2\u00b6\u00b5")
        buf.write("\3\2\2\2\u00b7\u00ba\3\2\2\2\u00b8\u00b6\3\2\2\2\u00b8")
        buf.write("\u00b9\3\2\2\2\u00b9\u00bb\3\2\2\2\u00ba\u00b8\3\2\2\2")
        buf.write("\u00bb\u00ee\5\4\3\36\u00bc\u00bd\f\34\2\2\u00bd\u00c1")
        buf.write("\t\t\2\2\u00be\u00c0\7@\2\2\u00bf\u00be\3\2\2\2\u00c0")
        buf.write("\u00c3\3\2\2\2\u00c1\u00bf\3\2\2\2\u00c1\u00c2\3\2\2\2")
        buf.write("\u00c2\u00c4\3\2\2\2\u00c3\u00c1\3\2\2\2\u00c4\u00ee\5")
        buf.write("\4\3\35\u00c5\u00c6\f\32\2\2\u00c6\u00c7\7\37\2\2\u00c7")
        buf.write("\u00ee\5\4\3\33\u00c8\u00c9\f\31\2\2\u00c9\u00cd\t\n\2")
        buf.write("\2\u00ca\u00cc\7@\2\2\u00cb\u00ca\3\2\2\2\u00cc\u00cf")
        buf.write("\3\2\2\2\u00cd\u00cb\3\2\2\2\u00cd\u00ce\3\2\2\2\u00ce")
        buf.write("\u00d0\3\2\2\2\u00cf\u00cd\3\2\2\2\u00d0\u00ee\5\4\3\32")
        buf.write("\u00d1\u00d2\f+\2\2\u00d2\u00d3\7\4\2\2\u00d3\u00d4\5")
        buf.write("\f\7\2\u00d4\u00d5\7\5\2\2\u00d5\u00d6\7\5\2\2\u00d6\u00ee")
        buf.write("\3\2\2\2\u00d7\u00d8\f*\2\2\u00d8\u00d9\7\6\2\2\u00d9")
        buf.write("\u00da\5\f\7\2\u00da\u00db\7\5\2\2\u00db\u00ee\3\2\2\2")
        buf.write("\u00dc\u00e0\f\'\2\2\u00dd\u00df\7@\2\2\u00de\u00dd\3")
        buf.write("\2\2\2\u00df\u00e2\3\2\2\2\u00e0\u00de\3\2\2\2\u00e0\u00e1")
        buf.write("\3\2\2\2\u00e1\u00e3\3\2\2\2\u00e2\u00e0\3\2\2\2\u00e3")
        buf.write("\u00e4\7\13\2\2\u00e4\u00e8\5\f\7\2\u00e5\u00e7\7@\2\2")
        buf.write("\u00e6\u00e5\3\2\2\2\u00e7\u00ea\3\2\2\2\u00e8\u00e6\3")
        buf.write("\2\2\2\u00e8\u00e9\3\2\2\2\u00e9\u00eb\3\2\2\2\u00ea\u00e8")
        buf.write("\3\2\2\2\u00eb\u00ec\7\f\2\2\u00ec\u00ee\3\2\2\2\u00ed")
        buf.write("}\3\2\2\2\u00ed\u0080\3\2\2\2\u00ed\u0083\3\2\2\2\u00ed")
        buf.write("\u0086\3\2\2\2\u00ed\u008f\3\2\2\2\u00ed\u0098\3\2\2\2")
        buf.write("\u00ed\u00a1\3\2\2\2\u00ed\u00aa\3\2\2\2\u00ed\u00b3\3")
        buf.write("\2\2\2\u00ed\u00bc\3\2\2\2\u00ed\u00c5\3\2\2\2\u00ed\u00c8")
        buf.write("\3\2\2\2\u00ed\u00d1\3\2\2\2\u00ed\u00d7\3\2\2\2\u00ed")
        buf.write("\u00dc\3\2\2\2\u00ee\u00f1\3\2\2\2\u00ef\u00ed\3\2\2\2")
        buf.write("\u00ef\u00f0\3\2\2\2\u00f0\5\3\2\2\2\u00f1\u00ef\3\2\2")
        buf.write("\2\u00f2\u00f9\5\4\3\2\u00f3\u00f5\t\2\2\2\u00f4\u00f6")
        buf.write("\5\4\3\2\u00f5\u00f4\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6")
        buf.write("\u00f8\3\2\2\2\u00f7\u00f3\3\2\2\2\u00f8\u00fb\3\2\2\2")
        buf.write("\u00f9\u00f7\3\2\2\2\u00f9\u00fa\3\2\2\2\u00fa\u00fe\3")
        buf.write("\2\2\2\u00fb\u00f9\3\2\2\2\u00fc\u00fe\3\2\2\2\u00fd\u00f2")
        buf.write("\3\2\2\2\u00fd\u00fc\3\2\2\2\u00fe\7\3\2\2\2\u00ff\u0104")
        buf.write("\5\n\6\2\u0100\u0101\7\67\2\2\u0101\u0103\5\n\6\2\u0102")
        buf.write("\u0100\3\2\2\2\u0103\u0106\3\2\2\2\u0104\u0102\3\2\2\2")
        buf.write("\u0104\u0105\3\2\2\2\u0105\t\3\2\2\2\u0106\u0104\3\2\2")
        buf.write("\2\u0107\u010d\7>\2\2\u0108\u0109\7>\2\2\u0109\u010a\7")
        buf.write("\"\2\2\u010a\u010d\5\4\3\2\u010b\u010d\7<\2\2\u010c\u0107")
        buf.write("\3\2\2\2\u010c\u0108\3\2\2\2\u010c\u010b\3\2\2\2\u010d")
        buf.write("\13\3\2\2\2\u010e\u0110\7@\2\2\u010f\u010e\3\2\2\2\u0110")
        buf.write("\u0113\3\2\2\2\u0111\u010f\3\2\2\2\u0111\u0112\3\2\2\2")
        buf.write("\u0112\u0114\3\2\2\2\u0113\u0111\3\2\2\2\u0114\u0118\5")
        buf.write("\16\b\2\u0115\u0117\7@\2\2\u0116\u0115\3\2\2\2\u0117\u011a")
        buf.write("\3\2\2\2\u0118\u0116\3\2\2\2\u0118\u0119\3\2\2\2\u0119")
        buf.write("\u0125\3\2\2\2\u011a\u0118\3\2\2\2\u011b\u011f\7\67\2")
        buf.write("\2\u011c\u011e\7@\2\2\u011d\u011c\3\2\2\2\u011e\u0121")
        buf.write("\3\2\2\2\u011f\u011d\3\2\2\2\u011f\u0120\3\2\2\2\u0120")
        buf.write("\u0122\3\2\2\2\u0121\u011f\3\2\2\2\u0122\u0124\5\16\b")
        buf.write("\2\u0123\u011b\3\2\2\2\u0124\u0127\3\2\2\2\u0125\u0123")
        buf.write("\3\2\2\2\u0125\u0126\3\2\2\2\u0126\r\3\2\2\2\u0127\u0125")
        buf.write("\3\2\2\2\u0128\u0129\7>\2\2\u0129\u013b\7\"\2\2\u012a")
        buf.write("\u012b\7>\2\2\u012b\u012c\7\"\2\2\u012c\u013b\5\4\3\2")
        buf.write("\u012d\u012e\7=\2\2\u012e\u013b\7\"\2\2\u012f\u0130\7")
        buf.write("=\2\2\u0130\u0131\7\"\2\2\u0131\u013b\5\4\3\2\u0132\u0133")
        buf.write("\7\61\2\2\u0133\u013b\7\"\2\2\u0134\u0135\7\61\2\2\u0135")
        buf.write("\u0136\7\"\2\2\u0136\u013b\5\4\3\2\u0137\u013b\7<\2\2")
        buf.write("\u0138\u013b\5\4\3\2\u0139\u013b\3\2\2\2\u013a\u0128\3")
        buf.write("\2\2\2\u013a\u012a\3\2\2\2\u013a\u012d\3\2\2\2\u013a\u012f")
        buf.write("\3\2\2\2\u013a\u0132\3\2\2\2\u013a\u0134\3\2\2\2\u013a")
        buf.write("\u0137\3\2\2\2\u013a\u0138\3\2\2\2\u013a\u0139\3\2\2\2")
        buf.write("\u013b\17\3\2\2\2!\24\30\32#+\63=D{\u008b\u0094\u009d")
        buf.write("\u00a6\u00af\u00b8\u00c1\u00cd\u00e0\u00e8\u00ed\u00ef")
        buf.write("\u00f5\u00f9\u00fd\u0104\u010c\u0111\u0118\u011f\u0125")
        buf.write("\u013a")
        return buf.getvalue()


class RParser ( Parser ):

    grammarFileName = "R.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "';'", "'[['", "']'", "'['", "'::'", "':::'", 
                     "'$'", "'@'", "'('", "')'", "'function'", "'^'", "'-'", 
                     "'+'", "':'", "'*'", "'/'", "'>'", "'>='", "'<'", "'<='", 
                     "'=='", "'!='", "'!'", "'&'", "'&&'", "'|'", "'||'", 
                     "'~'", "'<-'", "'<<-'", "'='", "'->'", "'->>'", "':='", 
                     "'{'", "'}'", "'if'", "'else'", "'for'", "'in'", "'while'", 
                     "'repeat'", "'?'", "'next'", "'break'", "'NULL'", "'NA'", 
                     "'Inf'", "'NaN'", "'TRUE'", "'FALSE'", "','", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "'...'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "HEX", "INT", "FLOAT", "COMPLEX", 
                      "ELLIPSIS", "STRING", "ID", "USER_OP", "NL", "WS" ]

    RULE_prog = 0
    RULE_expr = 1
    RULE_exprlist = 2
    RULE_formlist = 3
    RULE_form = 4
    RULE_sublist = 5
    RULE_sub = 6

    ruleNames =  [ "prog", "expr", "exprlist", "formlist", "form", "sublist", 
                   "sub" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    T__10=11
    T__11=12
    T__12=13
    T__13=14
    T__14=15
    T__15=16
    T__16=17
    T__17=18
    T__18=19
    T__19=20
    T__20=21
    T__21=22
    T__22=23
    T__23=24
    T__24=25
    T__25=26
    T__26=27
    T__27=28
    T__28=29
    T__29=30
    T__30=31
    T__31=32
    T__32=33
    T__33=34
    T__34=35
    T__35=36
    T__36=37
    T__37=38
    T__38=39
    T__39=40
    T__40=41
    T__41=42
    T__42=43
    T__43=44
    T__44=45
    T__45=46
    T__46=47
    T__47=48
    T__48=49
    T__49=50
    T__50=51
    T__51=52
    T__52=53
    HEX=54
    INT=55
    FLOAT=56
    COMPLEX=57
    ELLIPSIS=58
    STRING=59
    ID=60
    USER_OP=61
    NL=62
    WS=63

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




    class ProgContext(ParserRuleContext):

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

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

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


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

        def getRuleIndex(self):
            return RParser.RULE_prog

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

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

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




    def prog(self):

        localctx = RParser.ProgContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_prog)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 24
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RParser.T__8) | (1 << RParser.T__10) | (1 << RParser.T__12) | (1 << RParser.T__13) | (1 << RParser.T__23) | (1 << RParser.T__28) | (1 << RParser.T__35) | (1 << RParser.T__37) | (1 << RParser.T__39) | (1 << RParser.T__41) | (1 << RParser.T__42) | (1 << RParser.T__43) | (1 << RParser.T__44) | (1 << RParser.T__45) | (1 << RParser.T__46) | (1 << RParser.T__47) | (1 << RParser.T__48) | (1 << RParser.T__49) | (1 << RParser.T__50) | (1 << RParser.T__51) | (1 << RParser.HEX) | (1 << RParser.INT) | (1 << RParser.FLOAT) | (1 << RParser.COMPLEX) | (1 << RParser.STRING) | (1 << RParser.ID) | (1 << RParser.NL))) != 0):
                self.state = 22
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [RParser.T__8, RParser.T__10, RParser.T__12, RParser.T__13, RParser.T__23, RParser.T__28, RParser.T__35, RParser.T__37, RParser.T__39, RParser.T__41, RParser.T__42, RParser.T__43, RParser.T__44, RParser.T__45, RParser.T__46, RParser.T__47, RParser.T__48, RParser.T__49, RParser.T__50, RParser.T__51, RParser.HEX, RParser.INT, RParser.FLOAT, RParser.COMPLEX, RParser.STRING, RParser.ID]:
                    self.state = 14
                    self.expr(0)
                    self.state = 18
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,0,self._ctx)
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt==1:
                            self.state = 15
                            _la = self._input.LA(1)
                            if not(_la==RParser.T__0 or _la==RParser.NL):
                                self._errHandler.recoverInline(self)
                            else:
                                self._errHandler.reportMatch(self)
                                self.consume() 
                        self.state = 20
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,0,self._ctx)

                    pass
                elif token in [RParser.NL]:
                    self.state = 21
                    self.match(RParser.NL)
                    pass
                else:
                    raise NoViableAltException(self)

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

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


    class ExprContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return RParser.RULE_expr

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


    class LiteralHexContext(ExprContext):

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

        def HEX(self):
            return self.getToken(RParser.HEX, 0)

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

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

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


    class LiteralNanContext(ExprContext):

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


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

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

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


    class FunctionDefContext(ExprContext):

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

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

        def formlist(self):
            return self.getTypedRuleContext(RParser.FormlistContext,0)


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

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

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


    class WhileStatementContext(ExprContext):

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

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


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

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

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


    class NameContext(ExprContext):

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

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

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

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

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


    class IfStatementContext(ExprContext):

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

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


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

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

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


    class LiteralDblContext(ExprContext):

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

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

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

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

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


    class ForStatementContext(ExprContext):

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

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


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

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

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


    class LiteralInfContext(ExprContext):

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


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

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

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


    class BinaryOpUserContext(ExprContext):

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

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

        def USER_OP(self):
            return self.getToken(RParser.USER_OP, 0)
        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(RParser.NL)
            else:
                return self.getToken(RParser.NL, i)

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

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

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


    class ParenthesesContext(ExprContext):

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

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


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

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

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


    class BinaryOpContext(ExprContext):

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

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

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

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

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

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


    class CallContext(ExprContext):

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

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

        def sublist(self):
            return self.getTypedRuleContext(RParser.SublistContext,0)

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

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

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

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


    class LiteralBoolContext(ExprContext):

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


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

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

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


    class UnaryOpContext(ExprContext):

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

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

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

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

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

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


    class LiteralStrContext(ExprContext):

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

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

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

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

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


    class LiteralIntContext(ExprContext):

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

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

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

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

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


    class LiteralNaContext(ExprContext):

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


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

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

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


    class BreakStatementContext(ExprContext):

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


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

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

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


    class LiteralComplexContext(ExprContext):

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

        def COMPLEX(self):
            return self.getToken(RParser.COMPLEX, 0)

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

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

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


    class ExprListContext(ExprContext):

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

        def exprlist(self):
            return self.getTypedRuleContext(RParser.ExprlistContext,0)

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

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

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

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


    class LiteralNullContext(ExprContext):

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


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

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

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


    class NextStatementContext(ExprContext):

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


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

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

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


    class IndexSingleContext(ExprContext):

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

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

        def sublist(self):
            return self.getTypedRuleContext(RParser.SublistContext,0)


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

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

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


    class IndexManyContext(ExprContext):

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

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

        def sublist(self):
            return self.getTypedRuleContext(RParser.SublistContext,0)


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

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

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


    class RepeatStatementContext(ExprContext):

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

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


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

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

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



    def expr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = RParser.ExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 2
        self.enterRecursionRule(localctx, 2, self.RULE_expr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 121
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
            if la_ == 1:
                localctx = RParser.FunctionDefContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 30
                self.match(RParser.T__10)
                self.state = 31
                self.match(RParser.T__8)
                self.state = 33
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==RParser.ELLIPSIS or _la==RParser.ID:
                    self.state = 32
                    self.formlist()


                self.state = 35
                self.match(RParser.T__9)
                self.state = 36
                self.expr(36)
                pass

            elif la_ == 2:
                localctx = RParser.UnaryOpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 37
                localctx.op = self._input.LT(1)
                _la = self._input.LA(1)
                if not(_la==RParser.T__12 or _la==RParser.T__13):
                    localctx.op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 41
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==RParser.NL:
                    self.state = 38
                    self.match(RParser.NL)
                    self.state = 43
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 44
                self.expr(34)
                pass

            elif la_ == 3:
                localctx = RParser.UnaryOpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 45
                localctx.op = self.match(RParser.T__23)
                self.state = 49
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==RParser.NL:
                    self.state = 46
                    self.match(RParser.NL)
                    self.state = 51
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 52
                self.expr(28)
                pass

            elif la_ == 4:
                localctx = RParser.UnaryOpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 53
                localctx.op = self.match(RParser.T__28)
                self.state = 54
                self.expr(25)
                pass

            elif la_ == 5:
                localctx = RParser.ExprListContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 55
                self.match(RParser.T__35)
                self.state = 59
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,6,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 56
                        self.match(RParser.NL) 
                    self.state = 61
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,6,self._ctx)

                self.state = 62
                self.exprlist()
                self.state = 66
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==RParser.NL:
                    self.state = 63
                    self.match(RParser.NL)
                    self.state = 68
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 69
                self.match(RParser.T__36)
                pass

            elif la_ == 6:
                localctx = RParser.IfStatementContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 71
                self.match(RParser.T__37)
                self.state = 72
                self.match(RParser.T__8)
                self.state = 73
                self.expr(0)
                self.state = 74
                self.match(RParser.T__9)
                self.state = 75
                self.expr(21)
                pass

            elif la_ == 7:
                localctx = RParser.IfStatementContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 77
                self.match(RParser.T__37)
                self.state = 78
                self.match(RParser.T__8)
                self.state = 79
                self.expr(0)
                self.state = 80
                self.match(RParser.T__9)
                self.state = 81
                self.expr(0)
                self.state = 82
                self.match(RParser.T__38)
                self.state = 83
                self.expr(20)
                pass

            elif la_ == 8:
                localctx = RParser.ForStatementContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 85
                self.match(RParser.T__39)
                self.state = 86
                self.match(RParser.T__8)
                self.state = 87
                self.match(RParser.ID)
                self.state = 88
                self.match(RParser.T__40)
                self.state = 89
                self.expr(0)
                self.state = 90
                self.match(RParser.T__9)
                self.state = 91
                self.expr(19)
                pass

            elif la_ == 9:
                localctx = RParser.WhileStatementContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 93
                self.match(RParser.T__41)
                self.state = 94
                self.match(RParser.T__8)
                self.state = 95
                self.expr(0)
                self.state = 96
                self.match(RParser.T__9)
                self.state = 97
                self.expr(18)
                pass

            elif la_ == 10:
                localctx = RParser.RepeatStatementContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 99
                self.match(RParser.T__42)
                self.state = 100
                self.expr(17)
                pass

            elif la_ == 11:
                localctx = RParser.UnaryOpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 101
                localctx.op = self.match(RParser.T__43)
                self.state = 102
                self.expr(16)
                pass

            elif la_ == 12:
                localctx = RParser.NextStatementContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 103
                self.match(RParser.T__44)
                pass

            elif la_ == 13:
                localctx = RParser.BreakStatementContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 104
                self.match(RParser.T__45)
                pass

            elif la_ == 14:
                localctx = RParser.ParenthesesContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 105
                self.match(RParser.T__8)
                self.state = 106
                self.expr(0)
                self.state = 107
                self.match(RParser.T__9)
                pass

            elif la_ == 15:
                localctx = RParser.NameContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 109
                self.match(RParser.ID)
                pass

            elif la_ == 16:
                localctx = RParser.LiteralStrContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 110
                self.match(RParser.STRING)
                pass

            elif la_ == 17:
                localctx = RParser.LiteralHexContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 111
                self.match(RParser.HEX)
                pass

            elif la_ == 18:
                localctx = RParser.LiteralIntContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 112
                self.match(RParser.INT)
                pass

            elif la_ == 19:
                localctx = RParser.LiteralDblContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 113
                self.match(RParser.FLOAT)
                pass

            elif la_ == 20:
                localctx = RParser.LiteralComplexContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 114
                self.match(RParser.COMPLEX)
                pass

            elif la_ == 21:
                localctx = RParser.LiteralNullContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 115
                self.match(RParser.T__46)
                pass

            elif la_ == 22:
                localctx = RParser.LiteralNaContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 116
                self.match(RParser.T__47)
                pass

            elif la_ == 23:
                localctx = RParser.LiteralInfContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 117
                self.match(RParser.T__48)
                pass

            elif la_ == 24:
                localctx = RParser.LiteralNanContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 118
                self.match(RParser.T__49)
                pass

            elif la_ == 25:
                localctx = RParser.LiteralBoolContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 119
                self.match(RParser.T__50)
                pass

            elif la_ == 26:
                localctx = RParser.LiteralBoolContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 120
                self.match(RParser.T__51)
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 237
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,20,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 = 235
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
                    if la_ == 1:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 123
                        if not self.precpred(self._ctx, 39):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 39)")
                        self.state = 124
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==RParser.T__4 or _la==RParser.T__5):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 125
                        self.expr(40)
                        pass

                    elif la_ == 2:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 126
                        if not self.precpred(self._ctx, 38):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 38)")
                        self.state = 127
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==RParser.T__6 or _la==RParser.T__7):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 128
                        self.expr(39)
                        pass

                    elif la_ == 3:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 129
                        if not self.precpred(self._ctx, 35):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 35)")
                        self.state = 130
                        localctx.op = self.match(RParser.T__11)
                        self.state = 131
                        self.expr(35)
                        pass

                    elif la_ == 4:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 132
                        if not self.precpred(self._ctx, 33):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 33)")
                        self.state = 133
                        localctx.op = self.match(RParser.T__14)
                        self.state = 137
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 134
                            self.match(RParser.NL)
                            self.state = 139
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 140
                        self.expr(34)
                        pass

                    elif la_ == 5:
                        localctx = RParser.BinaryOpUserContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 141
                        if not self.precpred(self._ctx, 32):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 32)")
                        self.state = 142
                        localctx.op = self.match(RParser.USER_OP)
                        self.state = 146
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 143
                            self.match(RParser.NL)
                            self.state = 148
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 149
                        self.expr(33)
                        pass

                    elif la_ == 6:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 150
                        if not self.precpred(self._ctx, 31):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 31)")
                        self.state = 151
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==RParser.T__15 or _la==RParser.T__16):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 155
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 152
                            self.match(RParser.NL)
                            self.state = 157
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 158
                        self.expr(32)
                        pass

                    elif la_ == 7:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 159
                        if not self.precpred(self._ctx, 30):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 30)")
                        self.state = 160
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==RParser.T__12 or _la==RParser.T__13):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 164
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 161
                            self.match(RParser.NL)
                            self.state = 166
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 167
                        self.expr(31)
                        pass

                    elif la_ == 8:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 168
                        if not self.precpred(self._ctx, 29):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 29)")
                        self.state = 169
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RParser.T__17) | (1 << RParser.T__18) | (1 << RParser.T__19) | (1 << RParser.T__20) | (1 << RParser.T__21) | (1 << RParser.T__22))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 173
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 170
                            self.match(RParser.NL)
                            self.state = 175
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 176
                        self.expr(30)
                        pass

                    elif la_ == 9:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 177
                        if not self.precpred(self._ctx, 27):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 27)")
                        self.state = 178
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==RParser.T__24 or _la==RParser.T__25):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 182
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 179
                            self.match(RParser.NL)
                            self.state = 184
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 185
                        self.expr(28)
                        pass

                    elif la_ == 10:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 186
                        if not self.precpred(self._ctx, 26):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 26)")
                        self.state = 187
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==RParser.T__26 or _la==RParser.T__27):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 191
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 188
                            self.match(RParser.NL)
                            self.state = 193
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 194
                        self.expr(27)
                        pass

                    elif la_ == 11:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 195
                        if not self.precpred(self._ctx, 24):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 24)")
                        self.state = 196
                        localctx.op = self.match(RParser.T__28)
                        self.state = 197
                        self.expr(25)
                        pass

                    elif la_ == 12:
                        localctx = RParser.BinaryOpContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 198
                        if not self.precpred(self._ctx, 23):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 23)")
                        self.state = 199
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RParser.T__29) | (1 << RParser.T__30) | (1 << RParser.T__31) | (1 << RParser.T__32) | (1 << RParser.T__33) | (1 << RParser.T__34))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 203
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 200
                            self.match(RParser.NL)
                            self.state = 205
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 206
                        self.expr(24)
                        pass

                    elif la_ == 13:
                        localctx = RParser.IndexSingleContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 207
                        if not self.precpred(self._ctx, 41):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 41)")
                        self.state = 208
                        self.match(RParser.T__1)
                        self.state = 209
                        self.sublist()
                        self.state = 210
                        self.match(RParser.T__2)
                        self.state = 211
                        self.match(RParser.T__2)
                        pass

                    elif la_ == 14:
                        localctx = RParser.IndexManyContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 213
                        if not self.precpred(self._ctx, 40):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 40)")
                        self.state = 214
                        self.match(RParser.T__3)
                        self.state = 215
                        self.sublist()
                        self.state = 216
                        self.match(RParser.T__2)
                        pass

                    elif la_ == 15:
                        localctx = RParser.CallContext(self, RParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 218
                        if not self.precpred(self._ctx, 37):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 37)")
                        self.state = 222
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 219
                            self.match(RParser.NL)
                            self.state = 224
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 225
                        self.match(RParser.T__8)
                        self.state = 226
                        self.sublist()
                        self.state = 230
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==RParser.NL:
                            self.state = 227
                            self.match(RParser.NL)
                            self.state = 232
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)

                        self.state = 233
                        self.match(RParser.T__9)
                        pass

             
                self.state = 239
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,20,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 ExprlistContext(ParserRuleContext):

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

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


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

        def getRuleIndex(self):
            return RParser.RULE_exprlist

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

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

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




    def exprlist(self):

        localctx = RParser.ExprlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_exprlist)
        self._la = 0 # Token type
        try:
            self.state = 251
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [RParser.T__8, RParser.T__10, RParser.T__12, RParser.T__13, RParser.T__23, RParser.T__28, RParser.T__35, RParser.T__37, RParser.T__39, RParser.T__41, RParser.T__42, RParser.T__43, RParser.T__44, RParser.T__45, RParser.T__46, RParser.T__47, RParser.T__48, RParser.T__49, RParser.T__50, RParser.T__51, RParser.HEX, RParser.INT, RParser.FLOAT, RParser.COMPLEX, RParser.STRING, RParser.ID]:
                self.enterOuterAlt(localctx, 1)
                self.state = 240
                self.expr(0)
                self.state = 247
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,22,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 241
                        _la = self._input.LA(1)
                        if not(_la==RParser.T__0 or _la==RParser.NL):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 243
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << RParser.T__8) | (1 << RParser.T__10) | (1 << RParser.T__12) | (1 << RParser.T__13) | (1 << RParser.T__23) | (1 << RParser.T__28) | (1 << RParser.T__35) | (1 << RParser.T__37) | (1 << RParser.T__39) | (1 << RParser.T__41) | (1 << RParser.T__42) | (1 << RParser.T__43) | (1 << RParser.T__44) | (1 << RParser.T__45) | (1 << RParser.T__46) | (1 << RParser.T__47) | (1 << RParser.T__48) | (1 << RParser.T__49) | (1 << RParser.T__50) | (1 << RParser.T__51) | (1 << RParser.HEX) | (1 << RParser.INT) | (1 << RParser.FLOAT) | (1 << RParser.COMPLEX) | (1 << RParser.STRING) | (1 << RParser.ID))) != 0):
                            self.state = 242
                            self.expr(0)

                 
                    self.state = 249
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,22,self._ctx)

                pass
            elif token in [RParser.T__36, RParser.NL]:
                self.enterOuterAlt(localctx, 2)

                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 FormlistContext(ParserRuleContext):

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

        def form(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RParser.FormContext)
            else:
                return self.getTypedRuleContext(RParser.FormContext,i)


        def getRuleIndex(self):
            return RParser.RULE_formlist

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

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

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




    def formlist(self):

        localctx = RParser.FormlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_formlist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 253
            self.form()
            self.state = 258
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==RParser.T__52:
                self.state = 254
                self.match(RParser.T__52)
                self.state = 255
                self.form()
                self.state = 260
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class FormContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return RParser.RULE_form

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



    class ParamKwargContext(FormContext):

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

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


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

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

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


    class ParamContext(FormContext):

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

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

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

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

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


    class LiteralEllipsis1Context(FormContext):

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

        def ELLIPSIS(self):
            return self.getToken(RParser.ELLIPSIS, 0)

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

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

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



    def form(self):

        localctx = RParser.FormContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_form)
        try:
            self.state = 266
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,25,self._ctx)
            if la_ == 1:
                localctx = RParser.ParamContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 261
                self.match(RParser.ID)
                pass

            elif la_ == 2:
                localctx = RParser.ParamKwargContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 262
                self.match(RParser.ID)
                self.state = 263
                self.match(RParser.T__31)
                self.state = 264
                self.expr(0)
                pass

            elif la_ == 3:
                localctx = RParser.LiteralEllipsis1Context(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 265
                self.match(RParser.ELLIPSIS)
                pass


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


    class SublistContext(ParserRuleContext):

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

        def sub(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(RParser.SubContext)
            else:
                return self.getTypedRuleContext(RParser.SubContext,i)


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

        def getRuleIndex(self):
            return RParser.RULE_sublist

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

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

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




    def sublist(self):

        localctx = RParser.SublistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_sublist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 271
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,26,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 268
                    self.match(RParser.NL) 
                self.state = 273
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,26,self._ctx)

            self.state = 274
            self.sub()
            self.state = 278
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,27,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 275
                    self.match(RParser.NL) 
                self.state = 280
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,27,self._ctx)

            self.state = 291
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==RParser.T__52:
                self.state = 281
                self.match(RParser.T__52)
                self.state = 285
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,28,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 282
                        self.match(RParser.NL) 
                    self.state = 287
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,28,self._ctx)

                self.state = 288
                self.sub()
                self.state = 293
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class SubContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return RParser.RULE_sub

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



    class KwargContext(SubContext):

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

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


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

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

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


    class StrKwargEmptyContext(SubContext):

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

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

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

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

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


    class ArgContext(SubContext):

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

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


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

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

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


    class LiteralEllipsis2Context(SubContext):

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

        def ELLIPSIS(self):
            return self.getToken(RParser.ELLIPSIS, 0)

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

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

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


    class NullKwargEmptyContext(SubContext):

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


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

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

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


    class NullKwargContext(SubContext):

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

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


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

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

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


    class StrKwargContext(SubContext):

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

        def STRING(self):
            return self.getToken(RParser.STRING, 0)
        def expr(self):
            return self.getTypedRuleContext(RParser.ExprContext,0)


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

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

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


    class KwargEmptyContext(SubContext):

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

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

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

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

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


    class NoMatchContext(SubContext):

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


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

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

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



    def sub(self):

        localctx = RParser.SubContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_sub)
        try:
            self.state = 312
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,30,self._ctx)
            if la_ == 1:
                localctx = RParser.KwargEmptyContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 294
                self.match(RParser.ID)
                self.state = 295
                self.match(RParser.T__31)
                pass

            elif la_ == 2:
                localctx = RParser.KwargContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 296
                self.match(RParser.ID)
                self.state = 297
                self.match(RParser.T__31)
                self.state = 298
                self.expr(0)
                pass

            elif la_ == 3:
                localctx = RParser.StrKwargEmptyContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 299
                self.match(RParser.STRING)
                self.state = 300
                self.match(RParser.T__31)
                pass

            elif la_ == 4:
                localctx = RParser.StrKwargContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 301
                self.match(RParser.STRING)
                self.state = 302
                self.match(RParser.T__31)
                self.state = 303
                self.expr(0)
                pass

            elif la_ == 5:
                localctx = RParser.NullKwargEmptyContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 304
                self.match(RParser.T__46)
                self.state = 305
                self.match(RParser.T__31)
                pass

            elif la_ == 6:
                localctx = RParser.NullKwargContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 306
                self.match(RParser.T__46)
                self.state = 307
                self.match(RParser.T__31)
                self.state = 308
                self.expr(0)
                pass

            elif la_ == 7:
                localctx = RParser.LiteralEllipsis2Context(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 309
                self.match(RParser.ELLIPSIS)
                pass

            elif la_ == 8:
                localctx = RParser.ArgContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 310
                self.expr(0)
                pass

            elif la_ == 9:
                localctx = RParser.NoMatchContext(self, localctx)
                self.enterOuterAlt(localctx, 9)

                pass


        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[1] = self.expr_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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




