text: # Generated from C:/Users/91018/Documents/GitHub/zlua_prototype\Lua.g4 by ANTLR 4.7
  # 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\39")
          buf.write("\u0179\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
          buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
          buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
          buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31")
          buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36")
          buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\3\2\3\2\3\2\3\3\7\3I\n")
          buf.write("\3\f\3\16\3L\13\3\3\3\5\3O\n\3\3\4\3\4\5\4S\n\4\3\4\5")
          buf.write("\4V\n\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3")
          buf.write("\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\7\5n\n\5\f")
          buf.write("\5\16\5q\13\5\3\5\5\5t\n\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5")
          buf.write("\3\5\3\5\3\5\5\5\u0080\n\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5")
          buf.write("\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3")
          buf.write("\5\3\5\3\5\3\5\3\5\3\5\5\5\u009c\n\5\5\5\u009e\n\5\3\6")
          buf.write("\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\t\3\t\7")
          buf.write("\t\u00ae\n\t\f\t\16\t\u00b1\13\t\3\n\3\n\5\n\u00b5\n\n")
          buf.write("\3\13\3\13\3\13\7\13\u00ba\n\13\f\13\16\13\u00bd\13\13")
          buf.write("\3\f\3\f\3\f\7\f\u00c2\n\f\f\f\16\f\u00c5\13\f\3\r\3\r")
          buf.write("\3\r\7\r\u00ca\n\r\f\r\16\r\u00cd\13\r\3\16\3\16\3\17")
          buf.write("\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\5\17\u00da\n")
          buf.write("\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17")
          buf.write("\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17")
          buf.write("\7\17\u00f1\n\17\f\17\16\17\u00f4\13\17\3\20\3\20\7\20")
          buf.write("\u00f8\n\20\f\20\16\20\u00fb\13\20\3\21\3\21\6\21\u00ff")
          buf.write("\n\21\r\21\16\21\u0100\3\22\3\22\3\22\3\22\3\22\5\22\u0108")
          buf.write("\n\22\3\23\3\23\3\23\3\23\5\23\u010e\n\23\3\24\3\24\3")
          buf.write("\24\3\24\3\24\3\24\5\24\u0116\n\24\3\25\3\25\3\25\3\25")
          buf.write("\3\25\3\25\5\25\u011e\n\25\3\26\3\26\7\26\u0122\n\26\f")
          buf.write("\26\16\26\u0125\13\26\3\26\3\26\3\26\3\26\6\26\u012b\n")
          buf.write("\26\r\26\16\26\u012c\5\26\u012f\n\26\3\27\7\27\u0132\n")
          buf.write("\27\f\27\16\27\u0135\13\27\3\27\3\27\3\30\3\30\5\30\u013b")
          buf.write("\n\30\3\30\3\30\3\31\3\31\5\31\u0141\n\31\3\31\3\31\3")
          buf.write("\31\5\31\u0146\n\31\3\32\3\32\3\32\3\33\3\33\5\33\u014d")
          buf.write("\n\33\3\33\3\33\3\33\3\33\3\34\3\34\3\35\3\35\5\35\u0157")
          buf.write("\n\35\3\35\3\35\3\36\3\36\3\36\3\36\7\36\u015f\n\36\f")
          buf.write("\36\16\36\u0162\13\36\3\36\5\36\u0165\n\36\3\37\3\37\3")
          buf.write("\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\5\37\u0171\n\37")
          buf.write("\3 \3 \3!\3!\3\"\3\"\3\"\2\3\34#\2\4\6\b\n\f\16\20\22")
          buf.write("\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@B\2\n\3\2")
          buf.write("\34\36\3\2\37!\3\2\"$\4\2!!%%\3\2\',\4\2\4\4\r\r\3\2\63")
          buf.write("\65\3\2\60\62\2\u0190\2D\3\2\2\2\4J\3\2\2\2\6P\3\2\2\2")
          buf.write("\b\u009d\3\2\2\2\n\u009f\3\2\2\2\f\u00a4\3\2\2\2\16\u00a7")
          buf.write("\3\2\2\2\20\u00af\3\2\2\2\22\u00b4\3\2\2\2\24\u00b6\3")
          buf.write("\2\2\2\26\u00be\3\2\2\2\30\u00c6\3\2\2\2\32\u00ce\3\2")
          buf.write("\2\2\34\u00d9\3\2\2\2\36\u00f5\3\2\2\2 \u00fc\3\2\2\2")
          buf.write("\"\u0107\3\2\2\2$\u010d\3\2\2\2&\u0115\3\2\2\2(\u011d")
          buf.write("\3\2\2\2*\u012e\3\2\2\2,\u0133\3\2\2\2.\u013a\3\2\2\2")
          buf.write("\60\u0145\3\2\2\2\62\u0147\3\2\2\2\64\u014a\3\2\2\2\66")
          buf.write("\u0152\3\2\2\28\u0154\3\2\2\2:\u015a\3\2\2\2<\u0170\3")
          buf.write("\2\2\2>\u0172\3\2\2\2@\u0174\3\2\2\2B\u0176\3\2\2\2DE")
          buf.write("\5\4\3\2EF\7\2\2\3F\3\3\2\2\2GI\5\b\5\2HG\3\2\2\2IL\3")
          buf.write("\2\2\2JH\3\2\2\2JK\3\2\2\2KN\3\2\2\2LJ\3\2\2\2MO\5\6\4")
          buf.write("\2NM\3\2\2\2NO\3\2\2\2O\5\3\2\2\2PR\7\3\2\2QS\5\30\r\2")
          buf.write("RQ\3\2\2\2RS\3\2\2\2SU\3\2\2\2TV\7\4\2\2UT\3\2\2\2UV\3")
          buf.write("\2\2\2V\7\3\2\2\2W\u009e\7\4\2\2XY\5$\23\2YZ\7\5\2\2Z")
          buf.write("[\5\34\17\2[\u009e\3\2\2\2\\\u009e\5 \21\2]\u009e\7\6")
          buf.write("\2\2^_\7\7\2\2_`\5\4\3\2`a\7\b\2\2a\u009e\3\2\2\2bc\7")
          buf.write("\t\2\2cd\5\34\17\2de\7\7\2\2ef\5\4\3\2fg\7\b\2\2g\u009e")
          buf.write("\3\2\2\2hi\7\n\2\2ij\5\34\17\2jk\7\13\2\2ko\5\4\3\2ln")
          buf.write("\5\n\6\2ml\3\2\2\2nq\3\2\2\2om\3\2\2\2op\3\2\2\2ps\3\2")
          buf.write("\2\2qo\3\2\2\2rt\5\f\7\2sr\3\2\2\2st\3\2\2\2tu\3\2\2\2")
          buf.write("uv\7\b\2\2v\u009e\3\2\2\2wx\7\f\2\2xy\7/\2\2yz\7\5\2\2")
          buf.write("z{\5\34\17\2{|\7\r\2\2|\177\5\34\17\2}~\7\r\2\2~\u0080")
          buf.write("\5\34\17\2\177}\3\2\2\2\177\u0080\3\2\2\2\u0080\u0081")
          buf.write("\3\2\2\2\u0081\u0082\7\7\2\2\u0082\u0083\5\4\3\2\u0083")
          buf.write("\u0084\7\b\2\2\u0084\u009e\3\2\2\2\u0085\u0086\7\f\2\2")
          buf.write("\u0086\u0087\7/\2\2\u0087\u0088\7\r\2\2\u0088\u0089\7")
          buf.write("/\2\2\u0089\u008a\7\16\2\2\u008a\u008b\5\34\17\2\u008b")
          buf.write("\u008c\7\7\2\2\u008c\u008d\5\4\3\2\u008d\u008e\7\b\2\2")
          buf.write("\u008e\u009e\3\2\2\2\u008f\u0090\7\17\2\2\u0090\u0091")
          buf.write("\5\16\b\2\u0091\u0092\5\64\33\2\u0092\u009e\3\2\2\2\u0093")
          buf.write("\u0094\7\20\2\2\u0094\u0095\7\17\2\2\u0095\u0096\7/\2")
          buf.write("\2\u0096\u009e\5\64\33\2\u0097\u0098\7\20\2\2\u0098\u009b")
          buf.write("\5\26\f\2\u0099\u009a\7\5\2\2\u009a\u009c\5\30\r\2\u009b")
          buf.write("\u0099\3\2\2\2\u009b\u009c\3\2\2\2\u009c\u009e\3\2\2\2")
          buf.write("\u009dW\3\2\2\2\u009dX\3\2\2\2\u009d\\\3\2\2\2\u009d]")
          buf.write("\3\2\2\2\u009d^\3\2\2\2\u009db\3\2\2\2\u009dh\3\2\2\2")
          buf.write("\u009dw\3\2\2\2\u009d\u0085\3\2\2\2\u009d\u008f\3\2\2")
          buf.write("\2\u009d\u0093\3\2\2\2\u009d\u0097\3\2\2\2\u009e\t\3\2")
          buf.write("\2\2\u009f\u00a0\7\21\2\2\u00a0\u00a1\5\34\17\2\u00a1")
          buf.write("\u00a2\7\13\2\2\u00a2\u00a3\5\4\3\2\u00a3\13\3\2\2\2\u00a4")
          buf.write("\u00a5\7\22\2\2\u00a5\u00a6\5\4\3\2\u00a6\r\3\2\2\2\u00a7")
          buf.write("\u00a8\7/\2\2\u00a8\u00a9\5\20\t\2\u00a9\u00aa\5\22\n")
          buf.write("\2\u00aa\17\3\2\2\2\u00ab\u00ac\7\23\2\2\u00ac\u00ae\7")
          buf.write("/\2\2\u00ad\u00ab\3\2\2\2\u00ae\u00b1\3\2\2\2\u00af\u00ad")
          buf.write("\3\2\2\2\u00af\u00b0\3\2\2\2\u00b0\21\3\2\2\2\u00b1\u00af")
          buf.write("\3\2\2\2\u00b2\u00b3\7\24\2\2\u00b3\u00b5\7/\2\2\u00b4")
          buf.write("\u00b2\3\2\2\2\u00b4\u00b5\3\2\2\2\u00b5\23\3\2\2\2\u00b6")
          buf.write("\u00bb\5*\26\2\u00b7\u00b8\7\r\2\2\u00b8\u00ba\5*\26\2")
          buf.write("\u00b9\u00b7\3\2\2\2\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3")
          buf.write("\2\2\2\u00bb\u00bc\3\2\2\2\u00bc\25\3\2\2\2\u00bd\u00bb")
          buf.write("\3\2\2\2\u00be\u00c3\7/\2\2\u00bf\u00c0\7\r\2\2\u00c0")
          buf.write("\u00c2\7/\2\2\u00c1\u00bf\3\2\2\2\u00c2\u00c5\3\2\2\2")
          buf.write("\u00c3\u00c1\3\2\2\2\u00c3\u00c4\3\2\2\2\u00c4\27\3\2")
          buf.write("\2\2\u00c5\u00c3\3\2\2\2\u00c6\u00cb\5\34\17\2\u00c7\u00c8")
          buf.write("\7\r\2\2\u00c8\u00ca\5\34\17\2\u00c9\u00c7\3\2\2\2\u00ca")
          buf.write("\u00cd\3\2\2\2\u00cb\u00c9\3\2\2\2\u00cb\u00cc\3\2\2\2")
          buf.write("\u00cc\31\3\2\2\2\u00cd\u00cb\3\2\2\2\u00ce\u00cf\7\62")
          buf.write("\2\2\u00cf\33\3\2\2\2\u00d0\u00d1\b\17\1\2\u00d1\u00da")
          buf.write("\t\2\2\2\u00d2\u00da\5@!\2\u00d3\u00da\5B\"\2\u00d4\u00da")
          buf.write("\5\62\32\2\u00d5\u00da\5\36\20\2\u00d6\u00da\58\35\2\u00d7")
          buf.write("\u00d8\t\3\2\2\u00d8\u00da\5\34\17\t\u00d9\u00d0\3\2\2")
          buf.write("\2\u00d9\u00d2\3\2\2\2\u00d9\u00d3\3\2\2\2\u00d9\u00d4")
          buf.write("\3\2\2\2\u00d9\u00d5\3\2\2\2\u00d9\u00d6\3\2\2\2\u00d9")
          buf.write("\u00d7\3\2\2\2\u00da\u00f2\3\2\2\2\u00db\u00dc\f\n\2\2")
          buf.write("\u00dc\u00dd\7\25\2\2\u00dd\u00f1\5\34\17\n\u00de\u00df")
          buf.write("\f\b\2\2\u00df\u00e0\t\4\2\2\u00e0\u00f1\5\34\17\t\u00e1")
          buf.write("\u00e2\f\7\2\2\u00e2\u00e3\t\5\2\2\u00e3\u00f1\5\34\17")
          buf.write("\b\u00e4\u00e5\f\6\2\2\u00e5\u00e6\7&\2\2\u00e6\u00f1")
          buf.write("\5\34\17\6\u00e7\u00e8\f\5\2\2\u00e8\u00e9\t\6\2\2\u00e9")
          buf.write("\u00f1\5\34\17\6\u00ea\u00eb\f\4\2\2\u00eb\u00ec\7-\2")
          buf.write("\2\u00ec\u00f1\5\34\17\5\u00ed\u00ee\f\3\2\2\u00ee\u00ef")
          buf.write("\7.\2\2\u00ef\u00f1\5\34\17\4\u00f0\u00db\3\2\2\2\u00f0")
          buf.write("\u00de\3\2\2\2\u00f0\u00e1\3\2\2\2\u00f0\u00e4\3\2\2\2")
          buf.write("\u00f0\u00e7\3\2\2\2\u00f0\u00ea\3\2\2\2\u00f0\u00ed\3")
          buf.write("\2\2\2\u00f1\u00f4\3\2\2\2\u00f2\u00f0\3\2\2\2\u00f2\u00f3")
          buf.write("\3\2\2\2\u00f3\35\3\2\2\2\u00f4\u00f2\3\2\2\2\u00f5\u00f9")
          buf.write("\5\"\22\2\u00f6\u00f8\5.\30\2\u00f7\u00f6\3\2\2\2\u00f8")
          buf.write("\u00fb\3\2\2\2\u00f9\u00f7\3\2\2\2\u00f9\u00fa\3\2\2\2")
          buf.write("\u00fa\37\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fc\u00fe\5\"")
          buf.write("\22\2\u00fd\u00ff\5.\30\2\u00fe\u00fd\3\2\2\2\u00ff\u0100")
          buf.write("\3\2\2\2\u0100\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101")
          buf.write("!\3\2\2\2\u0102\u0108\5*\26\2\u0103\u0104\7\26\2\2\u0104")
          buf.write("\u0105\5\34\17\2\u0105\u0106\7\27\2\2\u0106\u0108\3\2")
          buf.write("\2\2\u0107\u0102\3\2\2\2\u0107\u0103\3\2\2\2\u0108#\3")
          buf.write("\2\2\2\u0109\u010e\7/\2\2\u010a\u010b\5\36\20\2\u010b")
          buf.write("\u010c\5&\24\2\u010c\u010e\3\2\2\2\u010d\u0109\3\2\2\2")
          buf.write("\u010d\u010a\3\2\2\2\u010e%\3\2\2\2\u010f\u0110\7\30\2")
          buf.write("\2\u0110\u0111\5\34\17\2\u0111\u0112\7\31\2\2\u0112\u0116")
          buf.write("\3\2\2\2\u0113\u0114\7\23\2\2\u0114\u0116\7/\2\2\u0115")
          buf.write("\u010f\3\2\2\2\u0115\u0113\3\2\2\2\u0116\'\3\2\2\2\u0117")
          buf.write("\u0118\7\30\2\2\u0118\u0119\5\34\17\2\u0119\u011a\7\31")
          buf.write("\2\2\u011a\u011e\3\2\2\2\u011b\u011c\7\23\2\2\u011c\u011e")
          buf.write("\7/\2\2\u011d\u0117\3\2\2\2\u011d\u011b\3\2\2\2\u011e")
          buf.write(")\3\2\2\2\u011f\u0123\7/\2\2\u0120\u0122\5,\27\2\u0121")
          buf.write("\u0120\3\2\2\2\u0122\u0125\3\2\2\2\u0123\u0121\3\2\2\2")
          buf.write("\u0123\u0124\3\2\2\2\u0124\u012f\3\2\2\2\u0125\u0123\3")
          buf.write("\2\2\2\u0126\u0127\7\26\2\2\u0127\u0128\5\34\17\2\u0128")
          buf.write("\u012a\7\27\2\2\u0129\u012b\5,\27\2\u012a\u0129\3\2\2")
          buf.write("\2\u012b\u012c\3\2\2\2\u012c\u012a\3\2\2\2\u012c\u012d")
          buf.write("\3\2\2\2\u012d\u012f\3\2\2\2\u012e\u011f\3\2\2\2\u012e")
          buf.write("\u0126\3\2\2\2\u012f+\3\2\2\2\u0130\u0132\5.\30\2\u0131")
          buf.write("\u0130\3\2\2\2\u0132\u0135\3\2\2\2\u0133\u0131\3\2\2\2")
          buf.write("\u0133\u0134\3\2\2\2\u0134\u0136\3\2\2\2\u0135\u0133\3")
          buf.write("\2\2\2\u0136\u0137\5(\25\2\u0137-\3\2\2\2\u0138\u0139")
          buf.write("\7\24\2\2\u0139\u013b\7/\2\2\u013a\u0138\3\2\2\2\u013a")
          buf.write("\u013b\3\2\2\2\u013b\u013c\3\2\2\2\u013c\u013d\5\60\31")
          buf.write("\2\u013d/\3\2\2\2\u013e\u0140\7\26\2\2\u013f\u0141\5\30")
          buf.write("\r\2\u0140\u013f\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u0142")
          buf.write("\3\2\2\2\u0142\u0146\7\27\2\2\u0143\u0146\58\35\2\u0144")
          buf.write("\u0146\5B\"\2\u0145\u013e\3\2\2\2\u0145\u0143\3\2\2\2")
          buf.write("\u0145\u0144\3\2\2\2\u0146\61\3\2\2\2\u0147\u0148\7\17")
          buf.write("\2\2\u0148\u0149\5\64\33\2\u0149\63\3\2\2\2\u014a\u014c")
          buf.write("\7\26\2\2\u014b\u014d\5\66\34\2\u014c\u014b\3\2\2\2\u014c")
          buf.write("\u014d\3\2\2\2\u014d\u014e\3\2\2\2\u014e\u014f\7\27\2")
          buf.write("\2\u014f\u0150\5\4\3\2\u0150\u0151\7\b\2\2\u0151\65\3")
          buf.write("\2\2\2\u0152\u0153\5\26\f\2\u0153\67\3\2\2\2\u0154\u0156")
          buf.write("\7\32\2\2\u0155\u0157\5:\36\2\u0156\u0155\3\2\2\2\u0156")
          buf.write("\u0157\3\2\2\2\u0157\u0158\3\2\2\2\u0158\u0159\7\33\2")
          buf.write("\2\u01599\3\2\2\2\u015a\u0160\5<\37\2\u015b\u015c\5> ")
          buf.write("\2\u015c\u015d\5<\37\2\u015d\u015f\3\2\2\2\u015e\u015b")
          buf.write("\3\2\2\2\u015f\u0162\3\2\2\2\u0160\u015e\3\2\2\2\u0160")
          buf.write("\u0161\3\2\2\2\u0161\u0164\3\2\2\2\u0162\u0160\3\2\2\2")
          buf.write("\u0163\u0165\5> \2\u0164\u0163\3\2\2\2\u0164\u0165\3\2")
          buf.write("\2\2\u0165;\3\2\2\2\u0166\u0167\7\30\2\2\u0167\u0168\5")
          buf.write("\34\17\2\u0168\u0169\7\31\2\2\u0169\u016a\7\5\2\2\u016a")
          buf.write("\u016b\5\34\17\2\u016b\u0171\3\2\2\2\u016c\u016d\7/\2")
          buf.write("\2\u016d\u016e\7\5\2\2\u016e\u0171\5\34\17\2\u016f\u0171")
          buf.write("\5\34\17\2\u0170\u0166\3\2\2\2\u0170\u016c\3\2\2\2\u0170")
          buf.write("\u016f\3\2\2\2\u0171=\3\2\2\2\u0172\u0173\t\7\2\2\u0173")
          buf.write("?\3\2\2\2\u0174\u0175\t\b\2\2\u0175A\3\2\2\2\u0176\u0177")
          buf.write("\t\t\2\2\u0177C\3\2\2\2%JNRUos\177\u009b\u009d\u00af\u00b4")
          buf.write("\u00bb\u00c3\u00cb\u00d9\u00f0\u00f2\u00f9\u0100\u0107")
          buf.write("\u010d\u0115\u011d\u0123\u012c\u012e\u0133\u013a\u0140")
          buf.write("\u0145\u014c\u0156\u0160\u0164\u0170")
          return buf.getvalue()
  
  
  class LuaParser ( Parser ):
  
      grammarFileName = "Lua.g4"
  
      atn = ATNDeserializer().deserialize(serializedATN())
  
      decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
  
      sharedContextCache = PredictionContextCache()
  
      literalNames = [ "<INVALID>", "'return'", "';'", "'='", "'break'", "'do'", 
                       "'end'", "'while'", "'if'", "'then'", "'for'", "','", 
                       "'in'", "'function'", "'local'", "'elseif'", "'else'", 
                       "'.'", "':'", "'^'", "'('", "')'", "'['", "']'", "'{'", 
                       "'}'", "'nil'", "'false'", "'true'", "'not'", "'#'", 
                       "'-'", "'*'", "'/'", "'%'", "'+'", "'..'", "'<'", "'>'", 
                       "'<='", "'>='", "'~='", "'=='", "'and'", "'or'" ]
  
      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>", "NilKW", "FalseKW", "TrueKW", 
                        "NotKW", "LenKW", "MinusKW", "MulKW", "DivKW", "ModKW", 
                        "AddKW", "ConcatKW", "LtKW", "MtKW", "LeKW", "MeKW", 
                        "NeKW", "EqKW", "AndKW", "OrKW", "NAME", "NORMALSTRING", 
                        "CHARSTRING", "LONGSTRING", "INT", "HEX", "FLOAT", 
                        "COMMENT", "LINE_COMMENT", "WS", "SHEBANG" ]
  
      RULE_chunk = 0
      RULE_block = 1
      RULE_retstat = 2
      RULE_stat = 3
      RULE_elseifBlock = 4
      RULE_elseBlock = 5
      RULE_funcname = 6
      RULE_tableOrFunc = 7
      RULE_methodname = 8
      RULE_varlist = 9
      RULE_namelist = 10
      RULE_explist = 11
      RULE_doc = 12
      RULE_exp = 13
      RULE_prefixexp = 14
      RULE_functioncall = 15
      RULE_varOrExp = 16
      RULE_lvalue = 17
      RULE_setter = 18
      RULE_getter = 19
      RULE_var = 20
      RULE_varSuffix = 21
      RULE_nameAndArgs = 22
      RULE_args = 23
      RULE_functiondef = 24
      RULE_funcbody = 25
      RULE_parlist = 26
      RULE_tableconstructor = 27
      RULE_fieldlist = 28
      RULE_field = 29
      RULE_fieldsep = 30
      RULE_number = 31
      RULE_string = 32
  
      ruleNames =  [ "chunk", "block", "retstat", "stat", "elseifBlock", "elseBlock", 
                     "funcname", "tableOrFunc", "methodname", "varlist", "namelist", 
                     "explist", "doc", "exp", "prefixexp", "functioncall", 
                     "varOrExp", "lvalue", "setter", "getter", "var", "varSuffix", 
                     "nameAndArgs", "args", "functiondef", "funcbody", "parlist", 
                     "tableconstructor", "fieldlist", "field", "fieldsep", 
                     "number", "string" ]
  
      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
      NilKW=26
      FalseKW=27
      TrueKW=28
      NotKW=29
      LenKW=30
      MinusKW=31
      MulKW=32
      DivKW=33
      ModKW=34
      AddKW=35
      ConcatKW=36
      LtKW=37
      MtKW=38
      LeKW=39
      MeKW=40
      NeKW=41
      EqKW=42
      AndKW=43
      OrKW=44
      NAME=45
      NORMALSTRING=46
      CHARSTRING=47
      LONGSTRING=48
      INT=49
      HEX=50
      FLOAT=51
      COMMENT=52
      LINE_COMMENT=53
      WS=54
      SHEBANG=55
  
      def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
          super().__init__(input, output)
          self.checkVersion("4.7")
          self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
          self._predicates = None
  
  
  
      class ChunkContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
  
          def EOF(self):
              return self.getToken(LuaParser.EOF, 0)
  
          def getRuleIndex(self):
              return LuaParser.RULE_chunk
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitChunk" ):
                  return visitor.visitChunk(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def chunk(self):
  
          localctx = LuaParser.ChunkContext(self, self._ctx, self.state)
          self.enterRule(localctx, 0, self.RULE_chunk)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 66
              self.block()
              self.state = 67
              self.match(LuaParser.EOF)
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class BlockContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def stat(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.StatContext)
              else:
                  return self.getTypedRuleContext(LuaParser.StatContext,i)
  
  
          def retstat(self):
              return self.getTypedRuleContext(LuaParser.RetstatContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_block
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitBlock" ):
                  return visitor.visitBlock(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def block(self):
  
          localctx = LuaParser.BlockContext(self, self._ctx, self.state)
          self.enterRule(localctx, 2, self.RULE_block)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 72
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.T__1) | (1 << LuaParser.T__3) | (1 << LuaParser.T__4) | (1 << LuaParser.T__6) | (1 << LuaParser.T__7) | (1 << LuaParser.T__9) | (1 << LuaParser.T__12) | (1 << LuaParser.T__13) | (1 << LuaParser.T__19) | (1 << LuaParser.NAME))) != 0):
                  self.state = 69
                  self.stat()
                  self.state = 74
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
  
              self.state = 76
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if _la==LuaParser.T__0:
                  self.state = 75
                  self.retstat()
  
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class RetstatContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def explist(self):
              return self.getTypedRuleContext(LuaParser.ExplistContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_retstat
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitRetstat" ):
                  return visitor.visitRetstat(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def retstat(self):
  
          localctx = LuaParser.RetstatContext(self, self._ctx, self.state)
          self.enterRule(localctx, 4, self.RULE_retstat)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 78
              self.match(LuaParser.T__0)
              self.state = 80
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.T__12) | (1 << LuaParser.T__19) | (1 << LuaParser.T__23) | (1 << LuaParser.NilKW) | (1 << LuaParser.FalseKW) | (1 << LuaParser.TrueKW) | (1 << LuaParser.NotKW) | (1 << LuaParser.LenKW) | (1 << LuaParser.MinusKW) | (1 << LuaParser.NAME) | (1 << LuaParser.NORMALSTRING) | (1 << LuaParser.CHARSTRING) | (1 << LuaParser.LONGSTRING) | (1 << LuaParser.INT) | (1 << LuaParser.HEX) | (1 << LuaParser.FLOAT))) != 0):
                  self.state = 79
                  self.explist()
  
  
              self.state = 83
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if _la==LuaParser.T__1:
                  self.state = 82
                  self.match(LuaParser.T__1)
  
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class StatContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_stat
  
       
          def copyFrom(self, ctx:ParserRuleContext):
              super().copyFrom(ctx)
  
  
  
      class DoendStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitDoendStat" ):
                  return visitor.visitDoendStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class FunctioncallStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def functioncall(self):
              return self.getTypedRuleContext(LuaParser.FunctioncallContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFunctioncallStat" ):
                  return visitor.visitFunctioncallStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class IfelseStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
          def elseifBlock(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ElseifBlockContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ElseifBlockContext,i)
  
          def elseBlock(self):
              return self.getTypedRuleContext(LuaParser.ElseBlockContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitIfelseStat" ):
                  return visitor.visitIfelseStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class ForijkStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitForijkStat" ):
                  return visitor.visitForijkStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class FunctiondefStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def funcname(self):
              return self.getTypedRuleContext(LuaParser.FuncnameContext,0)
  
          def funcbody(self):
              return self.getTypedRuleContext(LuaParser.FuncbodyContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFunctiondefStat" ):
                  return visitor.visitFunctiondefStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class LocalfunctiondefStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
          def funcbody(self):
              return self.getTypedRuleContext(LuaParser.FuncbodyContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitLocalfunctiondefStat" ):
                  return visitor.visitLocalfunctiondefStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class AssignStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def lvalue(self):
              return self.getTypedRuleContext(LuaParser.LvalueContext,0)
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitAssignStat" ):
                  return visitor.visitAssignStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class BreakStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitBreakStat" ):
                  return visitor.visitBreakStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class EmptyStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitEmptyStat" ):
                  return visitor.visitEmptyStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class ForinStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def NAME(self, i:int=None):
              if i is None:
                  return self.getTokens(LuaParser.NAME)
              else:
                  return self.getToken(LuaParser.NAME, i)
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitForinStat" ):
                  return visitor.visitForinStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class LocalDeclarationStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def namelist(self):
              return self.getTypedRuleContext(LuaParser.NamelistContext,0)
  
          def explist(self):
              return self.getTypedRuleContext(LuaParser.ExplistContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitLocalDeclarationStat" ):
                  return visitor.visitLocalDeclarationStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class WhileStatContext(StatContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.StatContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitWhileStat" ):
                  return visitor.visitWhileStat(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
      def stat(self):
  
          localctx = LuaParser.StatContext(self, self._ctx, self.state)
          self.enterRule(localctx, 6, self.RULE_stat)
          self._la = 0 # Token type
          try:
              self.state = 155
              self._errHandler.sync(self)
              la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
              if la_ == 1:
                  localctx = LuaParser.EmptyStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 1)
                  self.state = 85
                  self.match(LuaParser.T__1)
                  pass
  
              elif la_ == 2:
                  localctx = LuaParser.AssignStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 2)
                  self.state = 86
                  self.lvalue()
                  self.state = 87
                  self.match(LuaParser.T__2)
                  self.state = 88
                  self.exp(0)
                  pass
  
              elif la_ == 3:
                  localctx = LuaParser.FunctioncallStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 3)
                  self.state = 90
                  self.functioncall()
                  pass
  
              elif la_ == 4:
                  localctx = LuaParser.BreakStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 4)
                  self.state = 91
                  self.match(LuaParser.T__3)
                  pass
  
              elif la_ == 5:
                  localctx = LuaParser.DoendStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 5)
                  self.state = 92
                  self.match(LuaParser.T__4)
                  self.state = 93
                  self.block()
                  self.state = 94
                  self.match(LuaParser.T__5)
                  pass
  
              elif la_ == 6:
                  localctx = LuaParser.WhileStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 6)
                  self.state = 96
                  self.match(LuaParser.T__6)
                  self.state = 97
                  self.exp(0)
                  self.state = 98
                  self.match(LuaParser.T__4)
                  self.state = 99
                  self.block()
                  self.state = 100
                  self.match(LuaParser.T__5)
                  pass
  
              elif la_ == 7:
                  localctx = LuaParser.IfelseStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 7)
                  self.state = 102
                  self.match(LuaParser.T__7)
                  self.state = 103
                  self.exp(0)
                  self.state = 104
                  self.match(LuaParser.T__8)
                  self.state = 105
                  self.block()
                  self.state = 109
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  while _la==LuaParser.T__14:
                      self.state = 106
                      self.elseifBlock()
                      self.state = 111
                      self._errHandler.sync(self)
                      _la = self._input.LA(1)
  
                  self.state = 113
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la==LuaParser.T__15:
                      self.state = 112
                      self.elseBlock()
  
  
                  self.state = 115
                  self.match(LuaParser.T__5)
                  pass
  
              elif la_ == 8:
                  localctx = LuaParser.ForijkStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 8)
                  self.state = 117
                  self.match(LuaParser.T__9)
                  self.state = 118
                  self.match(LuaParser.NAME)
                  self.state = 119
                  self.match(LuaParser.T__2)
                  self.state = 120
                  self.exp(0)
                  self.state = 121
                  self.match(LuaParser.T__10)
                  self.state = 122
                  self.exp(0)
                  self.state = 125
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la==LuaParser.T__10:
                      self.state = 123
                      self.match(LuaParser.T__10)
                      self.state = 124
                      self.exp(0)
  
  
                  self.state = 127
                  self.match(LuaParser.T__4)
                  self.state = 128
                  self.block()
                  self.state = 129
                  self.match(LuaParser.T__5)
                  pass
  
              elif la_ == 9:
                  localctx = LuaParser.ForinStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 9)
                  self.state = 131
                  self.match(LuaParser.T__9)
                  self.state = 132
                  self.match(LuaParser.NAME)
                  self.state = 133
                  self.match(LuaParser.T__10)
                  self.state = 134
                  self.match(LuaParser.NAME)
                  self.state = 135
                  self.match(LuaParser.T__11)
                  self.state = 136
                  self.exp(0)
                  self.state = 137
                  self.match(LuaParser.T__4)
                  self.state = 138
                  self.block()
                  self.state = 139
                  self.match(LuaParser.T__5)
                  pass
  
              elif la_ == 10:
                  localctx = LuaParser.FunctiondefStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 10)
                  self.state = 141
                  self.match(LuaParser.T__12)
                  self.state = 142
                  self.funcname()
                  self.state = 143
                  self.funcbody()
                  pass
  
              elif la_ == 11:
                  localctx = LuaParser.LocalfunctiondefStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 11)
                  self.state = 145
                  self.match(LuaParser.T__13)
                  self.state = 146
                  self.match(LuaParser.T__12)
                  self.state = 147
                  self.match(LuaParser.NAME)
                  self.state = 148
                  self.funcbody()
                  pass
  
              elif la_ == 12:
                  localctx = LuaParser.LocalDeclarationStatContext(self, localctx)
                  self.enterOuterAlt(localctx, 12)
                  self.state = 149
                  self.match(LuaParser.T__13)
                  self.state = 150
                  self.namelist()
                  self.state = 153
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if _la==LuaParser.T__2:
                      self.state = 151
                      self.match(LuaParser.T__2)
                      self.state = 152
                      self.explist()
  
  
                  pass
  
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class ElseifBlockContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_elseifBlock
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitElseifBlock" ):
                  return visitor.visitElseifBlock(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def elseifBlock(self):
  
          localctx = LuaParser.ElseifBlockContext(self, self._ctx, self.state)
          self.enterRule(localctx, 8, self.RULE_elseifBlock)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 157
              self.match(LuaParser.T__14)
              self.state = 158
              self.exp(0)
              self.state = 159
              self.match(LuaParser.T__8)
              self.state = 160
              self.block()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class ElseBlockContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_elseBlock
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitElseBlock" ):
                  return visitor.visitElseBlock(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def elseBlock(self):
  
          localctx = LuaParser.ElseBlockContext(self, self._ctx, self.state)
          self.enterRule(localctx, 10, self.RULE_elseBlock)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 162
              self.match(LuaParser.T__15)
              self.state = 163
              self.block()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class FuncnameContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
  
          def tableOrFunc(self):
              return self.getTypedRuleContext(LuaParser.TableOrFuncContext,0)
  
  
          def methodname(self):
              return self.getTypedRuleContext(LuaParser.MethodnameContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_funcname
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFuncname" ):
                  return visitor.visitFuncname(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def funcname(self):
  
          localctx = LuaParser.FuncnameContext(self, self._ctx, self.state)
          self.enterRule(localctx, 12, self.RULE_funcname)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 165
              self.match(LuaParser.NAME)
              self.state = 166
              self.tableOrFunc()
              self.state = 167
              self.methodname()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class TableOrFuncContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def NAME(self, i:int=None):
              if i is None:
                  return self.getTokens(LuaParser.NAME)
              else:
                  return self.getToken(LuaParser.NAME, i)
  
          def getRuleIndex(self):
              return LuaParser.RULE_tableOrFunc
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitTableOrFunc" ):
                  return visitor.visitTableOrFunc(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def tableOrFunc(self):
  
          localctx = LuaParser.TableOrFuncContext(self, self._ctx, self.state)
          self.enterRule(localctx, 14, self.RULE_tableOrFunc)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 173
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              while _la==LuaParser.T__16:
                  self.state = 169
                  self.match(LuaParser.T__16)
                  self.state = 170
                  self.match(LuaParser.NAME)
                  self.state = 175
                  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 MethodnameContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
  
          def getRuleIndex(self):
              return LuaParser.RULE_methodname
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitMethodname" ):
                  return visitor.visitMethodname(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def methodname(self):
  
          localctx = LuaParser.MethodnameContext(self, self._ctx, self.state)
          self.enterRule(localctx, 16, self.RULE_methodname)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 178
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if _la==LuaParser.T__17:
                  self.state = 176
                  self.match(LuaParser.T__17)
                  self.state = 177
                  self.match(LuaParser.NAME)
  
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class VarlistContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def var(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.VarContext)
              else:
                  return self.getTypedRuleContext(LuaParser.VarContext,i)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_varlist
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitVarlist" ):
                  return visitor.visitVarlist(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def varlist(self):
  
          localctx = LuaParser.VarlistContext(self, self._ctx, self.state)
          self.enterRule(localctx, 18, self.RULE_varlist)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 180
              self.var()
              self.state = 185
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              while _la==LuaParser.T__10:
                  self.state = 181
                  self.match(LuaParser.T__10)
                  self.state = 182
                  self.var()
                  self.state = 187
                  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 NamelistContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def NAME(self, i:int=None):
              if i is None:
                  return self.getTokens(LuaParser.NAME)
              else:
                  return self.getToken(LuaParser.NAME, i)
  
          def getRuleIndex(self):
              return LuaParser.RULE_namelist
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNamelist" ):
                  return visitor.visitNamelist(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def namelist(self):
  
          localctx = LuaParser.NamelistContext(self, self._ctx, self.state)
          self.enterRule(localctx, 20, self.RULE_namelist)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 188
              self.match(LuaParser.NAME)
              self.state = 193
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              while _la==LuaParser.T__10:
                  self.state = 189
                  self.match(LuaParser.T__10)
                  self.state = 190
                  self.match(LuaParser.NAME)
                  self.state = 195
                  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 ExplistContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_explist
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitExplist" ):
                  return visitor.visitExplist(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def explist(self):
  
          localctx = LuaParser.ExplistContext(self, self._ctx, self.state)
          self.enterRule(localctx, 22, self.RULE_explist)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 196
              self.exp(0)
              self.state = 201
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              while _la==LuaParser.T__10:
                  self.state = 197
                  self.match(LuaParser.T__10)
                  self.state = 198
                  self.exp(0)
                  self.state = 203
                  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 DocContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def LONGSTRING(self):
              return self.getToken(LuaParser.LONGSTRING, 0)
  
          def getRuleIndex(self):
              return LuaParser.RULE_doc
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitDoc" ):
                  return visitor.visitDoc(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def doc(self):
  
          localctx = LuaParser.DocContext(self, self._ctx, self.state)
          self.enterRule(localctx, 24, self.RULE_doc)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 204
              self.match(LuaParser.LONGSTRING)
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class ExpContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_exp
  
       
          def copyFrom(self, ctx:ParserRuleContext):
              super().copyFrom(ctx)
  
  
      class MuldivExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.lhs = None # ExpContext
              self.operatorMulDivMod = None # Token
              self.rhs = None # ExpContext
              self.copyFrom(ctx)
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitMuldivExp" ):
                  return visitor.visitMuldivExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class FunctiondefExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def functiondef(self):
              return self.getTypedRuleContext(LuaParser.FunctiondefContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFunctiondefExp" ):
                  return visitor.visitFunctiondefExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class NumberExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def number(self):
              return self.getTypedRuleContext(LuaParser.NumberContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNumberExp" ):
                  return visitor.visitNumberExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class AndExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.lhs = None # ExpContext
              self.operatorAnd = None # Token
              self.rhs = None # ExpContext
              self.copyFrom(ctx)
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitAndExp" ):
                  return visitor.visitAndExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class ConcatExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.lhs = None # ExpContext
              self.operatorStrcat = None # Token
              self.rhs = None # ExpContext
              self.copyFrom(ctx)
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitConcatExp" ):
                  return visitor.visitConcatExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class OrExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.lhs = None # ExpContext
              self.operatorOr = None # Token
              self.rhs = None # ExpContext
              self.copyFrom(ctx)
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitOrExp" ):
                  return visitor.visitOrExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class UnmExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.operatorUnary = None # Token
              self.copyFrom(ctx)
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitUnmExp" ):
                  return visitor.visitUnmExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class PrefixexpExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def prefixexp(self):
              return self.getTypedRuleContext(LuaParser.PrefixexpContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitPrefixexpExp" ):
                  return visitor.visitPrefixexpExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class AddsubExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.lhs = None # ExpContext
              self.operatorAddSub = None # Token
              self.rhs = None # ExpContext
              self.copyFrom(ctx)
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitAddsubExp" ):
                  return visitor.visitAddsubExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class CmpExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.lhs = None # ExpContext
              self.operatorComparison = None # Token
              self.rhs = None # ExpContext
              self.copyFrom(ctx)
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitCmpExp" ):
                  return visitor.visitCmpExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class PowExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.lhs = None # ExpContext
              self.operatorPower = None # Token
              self.rhs = None # ExpContext
              self.copyFrom(ctx)
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitPowExp" ):
                  return visitor.visitPowExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class StringExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def string(self):
              return self.getTypedRuleContext(LuaParser.StringContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitStringExp" ):
                  return visitor.visitStringExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class NilfalsetrueExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.nilfalsetrue = None # Token
              self.copyFrom(ctx)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNilfalsetrueExp" ):
                  return visitor.visitNilfalsetrueExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class TablectorExpContext(ExpContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ExpContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def tableconstructor(self):
              return self.getTypedRuleContext(LuaParser.TableconstructorContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitTablectorExp" ):
                  return visitor.visitTablectorExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
      def exp(self, _p:int=0):
          _parentctx = self._ctx
          _parentState = self.state
          localctx = LuaParser.ExpContext(self, self._ctx, _parentState)
          _prevctx = localctx
          _startState = 26
          self.enterRecursionRule(localctx, 26, self.RULE_exp, _p)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 215
              self._errHandler.sync(self)
              token = self._input.LA(1)
              if token in [LuaParser.NilKW, LuaParser.FalseKW, LuaParser.TrueKW]:
                  localctx = LuaParser.NilfalsetrueExpContext(self, localctx)
                  self._ctx = localctx
                  _prevctx = localctx
  
                  self.state = 207
                  localctx.nilfalsetrue = self._input.LT(1)
                  _la = self._input.LA(1)
                  if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.NilKW) | (1 << LuaParser.FalseKW) | (1 << LuaParser.TrueKW))) != 0)):
                      localctx.nilfalsetrue = self._errHandler.recoverInline(self)
                  else:
                      self._errHandler.reportMatch(self)
                      self.consume()
                  pass
              elif token in [LuaParser.INT, LuaParser.HEX, LuaParser.FLOAT]:
                  localctx = LuaParser.NumberExpContext(self, localctx)
                  self._ctx = localctx
                  _prevctx = localctx
                  self.state = 208
                  self.number()
                  pass
              elif token in [LuaParser.NORMALSTRING, LuaParser.CHARSTRING, LuaParser.LONGSTRING]:
                  localctx = LuaParser.StringExpContext(self, localctx)
                  self._ctx = localctx
                  _prevctx = localctx
                  self.state = 209
                  self.string()
                  pass
              elif token in [LuaParser.T__12]:
                  localctx = LuaParser.FunctiondefExpContext(self, localctx)
                  self._ctx = localctx
                  _prevctx = localctx
                  self.state = 210
                  self.functiondef()
                  pass
              elif token in [LuaParser.T__19, LuaParser.NAME]:
                  localctx = LuaParser.PrefixexpExpContext(self, localctx)
                  self._ctx = localctx
                  _prevctx = localctx
                  self.state = 211
                  self.prefixexp()
                  pass
              elif token in [LuaParser.T__23]:
                  localctx = LuaParser.TablectorExpContext(self, localctx)
                  self._ctx = localctx
                  _prevctx = localctx
                  self.state = 212
                  self.tableconstructor()
                  pass
              elif token in [LuaParser.NotKW, LuaParser.LenKW, LuaParser.MinusKW]:
                  localctx = LuaParser.UnmExpContext(self, localctx)
                  self._ctx = localctx
                  _prevctx = localctx
                  self.state = 213
                  localctx.operatorUnary = self._input.LT(1)
                  _la = self._input.LA(1)
                  if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.NotKW) | (1 << LuaParser.LenKW) | (1 << LuaParser.MinusKW))) != 0)):
                      localctx.operatorUnary = self._errHandler.recoverInline(self)
                  else:
                      self._errHandler.reportMatch(self)
                      self.consume()
                  self.state = 214
                  self.exp(7)
                  pass
              else:
                  raise NoViableAltException(self)
  
              self._ctx.stop = self._input.LT(-1)
              self.state = 240
              self._errHandler.sync(self)
              _alt = self._interp.adaptivePredict(self._input,16,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 = 238
                      self._errHandler.sync(self)
                      la_ = self._interp.adaptivePredict(self._input,15,self._ctx)
                      if la_ == 1:
                          localctx = LuaParser.PowExpContext(self, LuaParser.ExpContext(self, _parentctx, _parentState))
                          localctx.lhs = _prevctx
                          self.pushNewRecursionContext(localctx, _startState, self.RULE_exp)
                          self.state = 217
                          if not self.precpred(self._ctx, 8):
                              from antlr4.error.Errors import FailedPredicateException
                              raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
                          self.state = 218
                          localctx.operatorPower = self.match(LuaParser.T__18)
                          self.state = 219
                          localctx.rhs = self.exp(8)
                          pass
  
                      elif la_ == 2:
                          localctx = LuaParser.MuldivExpContext(self, LuaParser.ExpContext(self, _parentctx, _parentState))
                          localctx.lhs = _prevctx
                          self.pushNewRecursionContext(localctx, _startState, self.RULE_exp)
                          self.state = 220
                          if not self.precpred(self._ctx, 6):
                              from antlr4.error.Errors import FailedPredicateException
                              raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                          self.state = 221
                          localctx.operatorMulDivMod = self._input.LT(1)
                          _la = self._input.LA(1)
                          if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.MulKW) | (1 << LuaParser.DivKW) | (1 << LuaParser.ModKW))) != 0)):
                              localctx.operatorMulDivMod = self._errHandler.recoverInline(self)
                          else:
                              self._errHandler.reportMatch(self)
                              self.consume()
                          self.state = 222
                          localctx.rhs = self.exp(7)
                          pass
  
                      elif la_ == 3:
                          localctx = LuaParser.AddsubExpContext(self, LuaParser.ExpContext(self, _parentctx, _parentState))
                          localctx.lhs = _prevctx
                          self.pushNewRecursionContext(localctx, _startState, self.RULE_exp)
                          self.state = 223
                          if not self.precpred(self._ctx, 5):
                              from antlr4.error.Errors import FailedPredicateException
                              raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                          self.state = 224
                          localctx.operatorAddSub = self._input.LT(1)
                          _la = self._input.LA(1)
                          if not(_la==LuaParser.MinusKW or _la==LuaParser.AddKW):
                              localctx.operatorAddSub = self._errHandler.recoverInline(self)
                          else:
                              self._errHandler.reportMatch(self)
                              self.consume()
                          self.state = 225
                          localctx.rhs = self.exp(6)
                          pass
  
                      elif la_ == 4:
                          localctx = LuaParser.ConcatExpContext(self, LuaParser.ExpContext(self, _parentctx, _parentState))
                          localctx.lhs = _prevctx
                          self.pushNewRecursionContext(localctx, _startState, self.RULE_exp)
                          self.state = 226
                          if not self.precpred(self._ctx, 4):
                              from antlr4.error.Errors import FailedPredicateException
                              raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                          self.state = 227
                          localctx.operatorStrcat = self.match(LuaParser.ConcatKW)
                          self.state = 228
                          localctx.rhs = self.exp(4)
                          pass
  
                      elif la_ == 5:
                          localctx = LuaParser.CmpExpContext(self, LuaParser.ExpContext(self, _parentctx, _parentState))
                          localctx.lhs = _prevctx
                          self.pushNewRecursionContext(localctx, _startState, self.RULE_exp)
                          self.state = 229
                          if not self.precpred(self._ctx, 3):
                              from antlr4.error.Errors import FailedPredicateException
                              raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                          self.state = 230
                          localctx.operatorComparison = self._input.LT(1)
                          _la = self._input.LA(1)
                          if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.LtKW) | (1 << LuaParser.MtKW) | (1 << LuaParser.LeKW) | (1 << LuaParser.MeKW) | (1 << LuaParser.NeKW) | (1 << LuaParser.EqKW))) != 0)):
                              localctx.operatorComparison = self._errHandler.recoverInline(self)
                          else:
                              self._errHandler.reportMatch(self)
                              self.consume()
                          self.state = 231
                          localctx.rhs = self.exp(4)
                          pass
  
                      elif la_ == 6:
                          localctx = LuaParser.AndExpContext(self, LuaParser.ExpContext(self, _parentctx, _parentState))
                          localctx.lhs = _prevctx
                          self.pushNewRecursionContext(localctx, _startState, self.RULE_exp)
                          self.state = 232
                          if not self.precpred(self._ctx, 2):
                              from antlr4.error.Errors import FailedPredicateException
                              raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                          self.state = 233
                          localctx.operatorAnd = self.match(LuaParser.AndKW)
                          self.state = 234
                          localctx.rhs = self.exp(3)
                          pass
  
                      elif la_ == 7:
                          localctx = LuaParser.OrExpContext(self, LuaParser.ExpContext(self, _parentctx, _parentState))
                          localctx.lhs = _prevctx
                          self.pushNewRecursionContext(localctx, _startState, self.RULE_exp)
                          self.state = 235
                          if not self.precpred(self._ctx, 1):
                              from antlr4.error.Errors import FailedPredicateException
                              raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                          self.state = 236
                          localctx.operatorOr = self.match(LuaParser.OrKW)
                          self.state = 237
                          localctx.rhs = self.exp(2)
                          pass
  
               
                  self.state = 242
                  self._errHandler.sync(self)
                  _alt = self._interp.adaptivePredict(self._input,16,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 PrefixexpContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def varOrExp(self):
              return self.getTypedRuleContext(LuaParser.VarOrExpContext,0)
  
  
          def nameAndArgs(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.NameAndArgsContext)
              else:
                  return self.getTypedRuleContext(LuaParser.NameAndArgsContext,i)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_prefixexp
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitPrefixexp" ):
                  return visitor.visitPrefixexp(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def prefixexp(self):
  
          localctx = LuaParser.PrefixexpContext(self, self._ctx, self.state)
          self.enterRule(localctx, 28, self.RULE_prefixexp)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 243
              self.varOrExp()
              self.state = 247
              self._errHandler.sync(self)
              _alt = self._interp.adaptivePredict(self._input,17,self._ctx)
              while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                  if _alt==1:
                      self.state = 244
                      self.nameAndArgs() 
                  self.state = 249
                  self._errHandler.sync(self)
                  _alt = self._interp.adaptivePredict(self._input,17,self._ctx)
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class FunctioncallContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def varOrExp(self):
              return self.getTypedRuleContext(LuaParser.VarOrExpContext,0)
  
  
          def nameAndArgs(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.NameAndArgsContext)
              else:
                  return self.getTypedRuleContext(LuaParser.NameAndArgsContext,i)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_functioncall
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFunctioncall" ):
                  return visitor.visitFunctioncall(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def functioncall(self):
  
          localctx = LuaParser.FunctioncallContext(self, self._ctx, self.state)
          self.enterRule(localctx, 30, self.RULE_functioncall)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 250
              self.varOrExp()
              self.state = 252 
              self._errHandler.sync(self)
              _alt = 1
              while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                  if _alt == 1:
                      self.state = 251
                      self.nameAndArgs()
  
                  else:
                      raise NoViableAltException(self)
                  self.state = 254 
                  self._errHandler.sync(self)
                  _alt = self._interp.adaptivePredict(self._input,18,self._ctx)
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class VarOrExpContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def var(self):
              return self.getTypedRuleContext(LuaParser.VarContext,0)
  
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_varOrExp
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitVarOrExp" ):
                  return visitor.visitVarOrExp(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def varOrExp(self):
  
          localctx = LuaParser.VarOrExpContext(self, self._ctx, self.state)
          self.enterRule(localctx, 32, self.RULE_varOrExp)
          try:
              self.state = 261
              self._errHandler.sync(self)
              la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
              if la_ == 1:
                  self.enterOuterAlt(localctx, 1)
                  self.state = 256
                  self.var()
                  pass
  
              elif la_ == 2:
                  self.enterOuterAlt(localctx, 2)
                  self.state = 257
                  self.match(LuaParser.T__19)
                  self.state = 258
                  self.exp(0)
                  self.state = 259
                  self.match(LuaParser.T__20)
                  pass
  
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class LvalueContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_lvalue
  
       
          def copyFrom(self, ctx:ParserRuleContext):
              super().copyFrom(ctx)
  
  
  
      class FieldLvalueContext(LvalueContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.LvalueContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def prefixexp(self):
              return self.getTypedRuleContext(LuaParser.PrefixexpContext,0)
  
          def setter(self):
              return self.getTypedRuleContext(LuaParser.SetterContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFieldLvalue" ):
                  return visitor.visitFieldLvalue(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class NameLvalueContext(LvalueContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.LvalueContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNameLvalue" ):
                  return visitor.visitNameLvalue(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
      def lvalue(self):
  
          localctx = LuaParser.LvalueContext(self, self._ctx, self.state)
          self.enterRule(localctx, 34, self.RULE_lvalue)
          try:
              self.state = 267
              self._errHandler.sync(self)
              la_ = self._interp.adaptivePredict(self._input,20,self._ctx)
              if la_ == 1:
                  localctx = LuaParser.NameLvalueContext(self, localctx)
                  self.enterOuterAlt(localctx, 1)
                  self.state = 263
                  self.match(LuaParser.NAME)
                  pass
  
              elif la_ == 2:
                  localctx = LuaParser.FieldLvalueContext(self, localctx)
                  self.enterOuterAlt(localctx, 2)
                  self.state = 264
                  self.prefixexp()
                  self.state = 265
                  self.setter()
                  pass
  
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class SetterContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_setter
  
       
          def copyFrom(self, ctx:ParserRuleContext):
              super().copyFrom(ctx)
  
  
  
      class DotSetterContext(SetterContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.SetterContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitDotSetter" ):
                  return visitor.visitDotSetter(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class NormalSetterContext(SetterContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.SetterContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNormalSetter" ):
                  return visitor.visitNormalSetter(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
      def setter(self):
  
          localctx = LuaParser.SetterContext(self, self._ctx, self.state)
          self.enterRule(localctx, 36, self.RULE_setter)
          try:
              self.state = 275
              self._errHandler.sync(self)
              token = self._input.LA(1)
              if token in [LuaParser.T__21]:
                  localctx = LuaParser.NormalSetterContext(self, localctx)
                  self.enterOuterAlt(localctx, 1)
                  self.state = 269
                  self.match(LuaParser.T__21)
                  self.state = 270
                  self.exp(0)
                  self.state = 271
                  self.match(LuaParser.T__22)
                  pass
              elif token in [LuaParser.T__16]:
                  localctx = LuaParser.DotSetterContext(self, localctx)
                  self.enterOuterAlt(localctx, 2)
                  self.state = 273
                  self.match(LuaParser.T__16)
                  self.state = 274
                  self.match(LuaParser.NAME)
                  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 GetterContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_getter
  
       
          def copyFrom(self, ctx:ParserRuleContext):
              super().copyFrom(ctx)
  
  
  
      class NormalGetterContext(GetterContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.GetterContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNormalGetter" ):
                  return visitor.visitNormalGetter(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class DotGetterContext(GetterContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.GetterContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitDotGetter" ):
                  return visitor.visitDotGetter(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
      def getter(self):
  
          localctx = LuaParser.GetterContext(self, self._ctx, self.state)
          self.enterRule(localctx, 38, self.RULE_getter)
          try:
              self.state = 283
              self._errHandler.sync(self)
              token = self._input.LA(1)
              if token in [LuaParser.T__21]:
                  localctx = LuaParser.NormalGetterContext(self, localctx)
                  self.enterOuterAlt(localctx, 1)
                  self.state = 277
                  self.match(LuaParser.T__21)
                  self.state = 278
                  self.exp(0)
                  self.state = 279
                  self.match(LuaParser.T__22)
                  pass
              elif token in [LuaParser.T__16]:
                  localctx = LuaParser.DotGetterContext(self, localctx)
                  self.enterOuterAlt(localctx, 2)
                  self.state = 281
                  self.match(LuaParser.T__16)
                  self.state = 282
                  self.match(LuaParser.NAME)
                  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 VarContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_var
  
       
          def copyFrom(self, ctx:ParserRuleContext):
              super().copyFrom(ctx)
  
  
  
      class LvalueVarContext(VarContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.VarContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
          def varSuffix(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.VarSuffixContext)
              else:
                  return self.getTypedRuleContext(LuaParser.VarSuffixContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitLvalueVar" ):
                  return visitor.visitLvalueVar(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class RvalueVarContext(VarContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.VarContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
          def varSuffix(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.VarSuffixContext)
              else:
                  return self.getTypedRuleContext(LuaParser.VarSuffixContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitRvalueVar" ):
                  return visitor.visitRvalueVar(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
      def var(self):
  
          localctx = LuaParser.VarContext(self, self._ctx, self.state)
          self.enterRule(localctx, 40, self.RULE_var)
          try:
              self.state = 300
              self._errHandler.sync(self)
              token = self._input.LA(1)
              if token in [LuaParser.NAME]:
                  localctx = LuaParser.LvalueVarContext(self, localctx)
                  self.enterOuterAlt(localctx, 1)
                  self.state = 285
                  self.match(LuaParser.NAME)
                  self.state = 289
                  self._errHandler.sync(self)
                  _alt = self._interp.adaptivePredict(self._input,23,self._ctx)
                  while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                      if _alt==1:
                          self.state = 286
                          self.varSuffix() 
                      self.state = 291
                      self._errHandler.sync(self)
                      _alt = self._interp.adaptivePredict(self._input,23,self._ctx)
  
                  pass
              elif token in [LuaParser.T__19]:
                  localctx = LuaParser.RvalueVarContext(self, localctx)
                  self.enterOuterAlt(localctx, 2)
                  self.state = 292
                  self.match(LuaParser.T__19)
                  self.state = 293
                  self.exp(0)
                  self.state = 294
                  self.match(LuaParser.T__20)
                  self.state = 296 
                  self._errHandler.sync(self)
                  _alt = 1
                  while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                      if _alt == 1:
                          self.state = 295
                          self.varSuffix()
  
                      else:
                          raise NoViableAltException(self)
                      self.state = 298 
                      self._errHandler.sync(self)
                      _alt = self._interp.adaptivePredict(self._input,24,self._ctx)
  
                  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 VarSuffixContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def getter(self):
              return self.getTypedRuleContext(LuaParser.GetterContext,0)
  
  
          def nameAndArgs(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.NameAndArgsContext)
              else:
                  return self.getTypedRuleContext(LuaParser.NameAndArgsContext,i)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_varSuffix
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitVarSuffix" ):
                  return visitor.visitVarSuffix(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def varSuffix(self):
  
          localctx = LuaParser.VarSuffixContext(self, self._ctx, self.state)
          self.enterRule(localctx, 42, self.RULE_varSuffix)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 305
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.T__17) | (1 << LuaParser.T__19) | (1 << LuaParser.T__23) | (1 << LuaParser.NORMALSTRING) | (1 << LuaParser.CHARSTRING) | (1 << LuaParser.LONGSTRING))) != 0):
                  self.state = 302
                  self.nameAndArgs()
                  self.state = 307
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
  
              self.state = 308
              self.getter()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class NameAndArgsContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def args(self):
              return self.getTypedRuleContext(LuaParser.ArgsContext,0)
  
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
  
          def getRuleIndex(self):
              return LuaParser.RULE_nameAndArgs
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNameAndArgs" ):
                  return visitor.visitNameAndArgs(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def nameAndArgs(self):
  
          localctx = LuaParser.NameAndArgsContext(self, self._ctx, self.state)
          self.enterRule(localctx, 44, self.RULE_nameAndArgs)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 312
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if _la==LuaParser.T__17:
                  self.state = 310
                  self.match(LuaParser.T__17)
                  self.state = 311
                  self.match(LuaParser.NAME)
  
  
              self.state = 314
              self.args()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class ArgsContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_args
  
       
          def copyFrom(self, ctx:ParserRuleContext):
              super().copyFrom(ctx)
  
  
  
      class TablectorArgsContext(ArgsContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ArgsContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def tableconstructor(self):
              return self.getTypedRuleContext(LuaParser.TableconstructorContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitTablectorArgs" ):
                  return visitor.visitTablectorArgs(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class StringArgsContext(ArgsContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ArgsContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def string(self):
              return self.getTypedRuleContext(LuaParser.StringContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitStringArgs" ):
                  return visitor.visitStringArgs(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class NormalArgsContext(ArgsContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.ArgsContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def explist(self):
              return self.getTypedRuleContext(LuaParser.ExplistContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNormalArgs" ):
                  return visitor.visitNormalArgs(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
      def args(self):
  
          localctx = LuaParser.ArgsContext(self, self._ctx, self.state)
          self.enterRule(localctx, 46, self.RULE_args)
          self._la = 0 # Token type
          try:
              self.state = 323
              self._errHandler.sync(self)
              token = self._input.LA(1)
              if token in [LuaParser.T__19]:
                  localctx = LuaParser.NormalArgsContext(self, localctx)
                  self.enterOuterAlt(localctx, 1)
                  self.state = 316
                  self.match(LuaParser.T__19)
                  self.state = 318
                  self._errHandler.sync(self)
                  _la = self._input.LA(1)
                  if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.T__12) | (1 << LuaParser.T__19) | (1 << LuaParser.T__23) | (1 << LuaParser.NilKW) | (1 << LuaParser.FalseKW) | (1 << LuaParser.TrueKW) | (1 << LuaParser.NotKW) | (1 << LuaParser.LenKW) | (1 << LuaParser.MinusKW) | (1 << LuaParser.NAME) | (1 << LuaParser.NORMALSTRING) | (1 << LuaParser.CHARSTRING) | (1 << LuaParser.LONGSTRING) | (1 << LuaParser.INT) | (1 << LuaParser.HEX) | (1 << LuaParser.FLOAT))) != 0):
                      self.state = 317
                      self.explist()
  
  
                  self.state = 320
                  self.match(LuaParser.T__20)
                  pass
              elif token in [LuaParser.T__23]:
                  localctx = LuaParser.TablectorArgsContext(self, localctx)
                  self.enterOuterAlt(localctx, 2)
                  self.state = 321
                  self.tableconstructor()
                  pass
              elif token in [LuaParser.NORMALSTRING, LuaParser.CHARSTRING, LuaParser.LONGSTRING]:
                  localctx = LuaParser.StringArgsContext(self, localctx)
                  self.enterOuterAlt(localctx, 3)
                  self.state = 322
                  self.string()
                  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 FunctiondefContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def funcbody(self):
              return self.getTypedRuleContext(LuaParser.FuncbodyContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_functiondef
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFunctiondef" ):
                  return visitor.visitFunctiondef(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def functiondef(self):
  
          localctx = LuaParser.FunctiondefContext(self, self._ctx, self.state)
          self.enterRule(localctx, 48, self.RULE_functiondef)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 325
              self.match(LuaParser.T__12)
              self.state = 326
              self.funcbody()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class FuncbodyContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def block(self):
              return self.getTypedRuleContext(LuaParser.BlockContext,0)
  
  
          def parlist(self):
              return self.getTypedRuleContext(LuaParser.ParlistContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_funcbody
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFuncbody" ):
                  return visitor.visitFuncbody(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def funcbody(self):
  
          localctx = LuaParser.FuncbodyContext(self, self._ctx, self.state)
          self.enterRule(localctx, 50, self.RULE_funcbody)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 328
              self.match(LuaParser.T__19)
              self.state = 330
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if _la==LuaParser.NAME:
                  self.state = 329
                  self.parlist()
  
  
              self.state = 332
              self.match(LuaParser.T__20)
              self.state = 333
              self.block()
              self.state = 334
              self.match(LuaParser.T__5)
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class ParlistContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def namelist(self):
              return self.getTypedRuleContext(LuaParser.NamelistContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_parlist
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitParlist" ):
                  return visitor.visitParlist(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def parlist(self):
  
          localctx = LuaParser.ParlistContext(self, self._ctx, self.state)
          self.enterRule(localctx, 52, self.RULE_parlist)
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 336
              self.namelist()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class TableconstructorContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def fieldlist(self):
              return self.getTypedRuleContext(LuaParser.FieldlistContext,0)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_tableconstructor
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitTableconstructor" ):
                  return visitor.visitTableconstructor(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def tableconstructor(self):
  
          localctx = LuaParser.TableconstructorContext(self, self._ctx, self.state)
          self.enterRule(localctx, 54, self.RULE_tableconstructor)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 338
              self.match(LuaParser.T__23)
              self.state = 340
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.T__12) | (1 << LuaParser.T__19) | (1 << LuaParser.T__21) | (1 << LuaParser.T__23) | (1 << LuaParser.NilKW) | (1 << LuaParser.FalseKW) | (1 << LuaParser.TrueKW) | (1 << LuaParser.NotKW) | (1 << LuaParser.LenKW) | (1 << LuaParser.MinusKW) | (1 << LuaParser.NAME) | (1 << LuaParser.NORMALSTRING) | (1 << LuaParser.CHARSTRING) | (1 << LuaParser.LONGSTRING) | (1 << LuaParser.INT) | (1 << LuaParser.HEX) | (1 << LuaParser.FLOAT))) != 0):
                  self.state = 339
                  self.fieldlist()
  
  
              self.state = 342
              self.match(LuaParser.T__24)
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class FieldlistContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def field(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.FieldContext)
              else:
                  return self.getTypedRuleContext(LuaParser.FieldContext,i)
  
  
          def fieldsep(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.FieldsepContext)
              else:
                  return self.getTypedRuleContext(LuaParser.FieldsepContext,i)
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_fieldlist
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFieldlist" ):
                  return visitor.visitFieldlist(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def fieldlist(self):
  
          localctx = LuaParser.FieldlistContext(self, self._ctx, self.state)
          self.enterRule(localctx, 56, self.RULE_fieldlist)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 344
              self.field()
              self.state = 350
              self._errHandler.sync(self)
              _alt = self._interp.adaptivePredict(self._input,32,self._ctx)
              while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                  if _alt==1:
                      self.state = 345
                      self.fieldsep()
                      self.state = 346
                      self.field() 
                  self.state = 352
                  self._errHandler.sync(self)
                  _alt = self._interp.adaptivePredict(self._input,32,self._ctx)
  
              self.state = 354
              self._errHandler.sync(self)
              _la = self._input.LA(1)
              if _la==LuaParser.T__1 or _la==LuaParser.T__10:
                  self.state = 353
                  self.fieldsep()
  
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class FieldContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_field
  
       
          def copyFrom(self, ctx:ParserRuleContext):
              super().copyFrom(ctx)
  
  
  
      class ExpFieldContext(FieldContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.FieldContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitExpField" ):
                  return visitor.visitExpField(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class KeyValFieldContext(FieldContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.FieldContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def exp(self, i:int=None):
              if i is None:
                  return self.getTypedRuleContexts(LuaParser.ExpContext)
              else:
                  return self.getTypedRuleContext(LuaParser.ExpContext,i)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitKeyValField" ):
                  return visitor.visitKeyValField(self)
              else:
                  return visitor.visitChildren(self)
  
  
      class NameValFieldContext(FieldContext):
  
          def __init__(self, parser, ctx:ParserRuleContext): # actually a LuaParser.FieldContext
              super().__init__(parser)
              self.copyFrom(ctx)
  
          def NAME(self):
              return self.getToken(LuaParser.NAME, 0)
          def exp(self):
              return self.getTypedRuleContext(LuaParser.ExpContext,0)
  
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNameValField" ):
                  return visitor.visitNameValField(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
      def field(self):
  
          localctx = LuaParser.FieldContext(self, self._ctx, self.state)
          self.enterRule(localctx, 58, self.RULE_field)
          try:
              self.state = 366
              self._errHandler.sync(self)
              la_ = self._interp.adaptivePredict(self._input,34,self._ctx)
              if la_ == 1:
                  localctx = LuaParser.KeyValFieldContext(self, localctx)
                  self.enterOuterAlt(localctx, 1)
                  self.state = 356
                  self.match(LuaParser.T__21)
                  self.state = 357
                  self.exp(0)
                  self.state = 358
                  self.match(LuaParser.T__22)
                  self.state = 359
                  self.match(LuaParser.T__2)
                  self.state = 360
                  self.exp(0)
                  pass
  
              elif la_ == 2:
                  localctx = LuaParser.NameValFieldContext(self, localctx)
                  self.enterOuterAlt(localctx, 2)
                  self.state = 362
                  self.match(LuaParser.NAME)
                  self.state = 363
                  self.match(LuaParser.T__2)
                  self.state = 364
                  self.exp(0)
                  pass
  
              elif la_ == 3:
                  localctx = LuaParser.ExpFieldContext(self, localctx)
                  self.enterOuterAlt(localctx, 3)
                  self.state = 365
                  self.exp(0)
                  pass
  
  
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class FieldsepContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
  
          def getRuleIndex(self):
              return LuaParser.RULE_fieldsep
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitFieldsep" ):
                  return visitor.visitFieldsep(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def fieldsep(self):
  
          localctx = LuaParser.FieldsepContext(self, self._ctx, self.state)
          self.enterRule(localctx, 60, self.RULE_fieldsep)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 368
              _la = self._input.LA(1)
              if not(_la==LuaParser.T__1 or _la==LuaParser.T__10):
                  self._errHandler.recoverInline(self)
              else:
                  self._errHandler.reportMatch(self)
                  self.consume()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class NumberContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def INT(self):
              return self.getToken(LuaParser.INT, 0)
  
          def HEX(self):
              return self.getToken(LuaParser.HEX, 0)
  
          def FLOAT(self):
              return self.getToken(LuaParser.FLOAT, 0)
  
          def getRuleIndex(self):
              return LuaParser.RULE_number
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitNumber" ):
                  return visitor.visitNumber(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def number(self):
  
          localctx = LuaParser.NumberContext(self, self._ctx, self.state)
          self.enterRule(localctx, 62, self.RULE_number)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 370
              _la = self._input.LA(1)
              if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.INT) | (1 << LuaParser.HEX) | (1 << LuaParser.FLOAT))) != 0)):
                  self._errHandler.recoverInline(self)
              else:
                  self._errHandler.reportMatch(self)
                  self.consume()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
      class StringContext(ParserRuleContext):
  
          def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
              super().__init__(parent, invokingState)
              self.parser = parser
  
          def NORMALSTRING(self):
              return self.getToken(LuaParser.NORMALSTRING, 0)
  
          def CHARSTRING(self):
              return self.getToken(LuaParser.CHARSTRING, 0)
  
          def LONGSTRING(self):
              return self.getToken(LuaParser.LONGSTRING, 0)
  
          def getRuleIndex(self):
              return LuaParser.RULE_string
  
          def accept(self, visitor:ParseTreeVisitor):
              if hasattr( visitor, "visitString" ):
                  return visitor.visitString(self)
              else:
                  return visitor.visitChildren(self)
  
  
  
  
      def string(self):
  
          localctx = LuaParser.StringContext(self, self._ctx, self.state)
          self.enterRule(localctx, 64, self.RULE_string)
          self._la = 0 # Token type
          try:
              self.enterOuterAlt(localctx, 1)
              self.state = 372
              _la = self._input.LA(1)
              if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << LuaParser.NORMALSTRING) | (1 << LuaParser.CHARSTRING) | (1 << LuaParser.LONGSTRING))) != 0)):
                  self._errHandler.recoverInline(self)
              else:
                  self._errHandler.reportMatch(self)
                  self.consume()
          except RecognitionException as re:
              localctx.exception = re
              self._errHandler.reportError(self, re)
              self._errHandler.recover(self, re)
          finally:
              self.exitRule()
          return localctx
  
  
  
      def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
          if self._predicates == None:
              self._predicates = dict()
          self._predicates[13] = self.exp_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 exp_sempred(self, localctx:ExpContext, predIndex:int):
              if predIndex == 0:
                  return self.precpred(self._ctx, 8)
           
  
              if predIndex == 1:
                  return self.precpred(self._ctx, 6)
           
  
              if predIndex == 2:
                  return self.precpred(self._ctx, 5)
           
  
              if predIndex == 3:
                  return self.precpred(self._ctx, 4)
           
  
              if predIndex == 4:
                  return self.precpred(self._ctx, 3)
           
  
              if predIndex == 5:
                  return self.precpred(self._ctx, 2)
           
  
              if predIndex == 6:
                  return self.precpred(self._ctx, 1)
           
  
  
  
  
  