# Generated from /Users/user/Desktop/HK201/PPL/Ass2/initial/src/main/bkit/parser/BKIT.g4 by ANTLR 4.8
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3F")
        buf.write("\u015d\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\3\2\7\2")
        buf.write("<\n\2\f\2\16\2?\13\2\3\2\7\2B\n\2\f\2\16\2E\13\2\3\2\3")
        buf.write("\2\3\3\3\3\3\3\3\3\3\3\7\3N\n\3\f\3\16\3Q\13\3\3\3\3\3")
        buf.write("\3\4\3\4\5\4W\n\4\3\5\3\5\3\5\3\5\7\5]\n\5\f\5\16\5`\13")
        buf.write("\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\7\6i\n\6\f\6\16\6l\13\6")
        buf.write("\3\7\3\7\3\7\3\7\3\7\5\7s\n\7\3\b\3\b\3\b\3\b\7\by\n\b")
        buf.write("\f\b\16\b|\13\b\5\b~\n\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3")
        buf.write("\t\3\t\3\t\3\t\7\t\u008b\n\t\f\t\16\t\u008e\13\t\5\t\u0090")
        buf.write("\n\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\5\n\u009d")
        buf.write("\n\n\3\13\3\13\3\13\3\13\3\13\3\13\7\13\u00a5\n\13\f\13")
        buf.write("\16\13\u00a8\13\13\3\f\3\f\3\f\3\f\3\f\3\f\7\f\u00b0\n")
        buf.write("\f\f\f\16\f\u00b3\13\f\3\r\3\r\3\r\3\r\3\r\3\r\7\r\u00bb")
        buf.write("\n\r\f\r\16\r\u00be\13\r\3\16\3\16\3\16\5\16\u00c3\n\16")
        buf.write("\3\17\3\17\3\17\5\17\u00c8\n\17\3\20\3\20\3\20\3\20\3")
        buf.write("\20\3\20\3\20\3\20\6\20\u00d2\n\20\r\20\16\20\u00d3\7")
        buf.write("\20\u00d6\n\20\f\20\16\20\u00d9\13\20\3\21\3\21\3\21\3")
        buf.write("\21\3\21\3\21\3\21\5\21\u00e2\n\21\3\22\3\22\3\22\3\22")
        buf.write("\3\22\7\22\u00e9\n\22\f\22\16\22\u00ec\13\22\5\22\u00ee")
        buf.write("\n\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23")
        buf.write("\3\23\5\23\u00fb\n\23\3\24\3\24\3\24\3\24\3\24\3\25\7")
        buf.write("\25\u0103\n\25\f\25\16\25\u0106\13\25\3\25\7\25\u0109")
        buf.write("\n\25\f\25\16\25\u010c\13\25\3\26\3\26\3\26\3\26\3\26")
        buf.write("\3\26\3\26\3\26\3\26\3\26\7\26\u0118\n\26\f\26\16\26\u011b")
        buf.write("\13\26\3\26\3\26\5\26\u011f\n\26\3\26\3\26\3\26\3\27\3")
        buf.write("\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27")
        buf.write("\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30")
        buf.write("\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\33")
        buf.write("\3\33\3\33\3\34\3\34\3\34\3\34\3\34\7\34\u014d\n\34\f")
        buf.write("\34\16\34\u0150\13\34\5\34\u0152\n\34\3\34\3\34\3\34\3")
        buf.write("\35\3\35\5\35\u0159\n\35\3\35\3\35\3\35\2\6\24\26\30\36")
        buf.write("\36\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60")
        buf.write("\62\64\668\2\6\3\2,-\4\2\"#\'(\4\2$&)*\4\2##((\2\u016a")
        buf.write("\2=\3\2\2\2\4H\3\2\2\2\6V\3\2\2\2\bX\3\2\2\2\nd\3\2\2")
        buf.write("\2\fr\3\2\2\2\16t\3\2\2\2\20\u0081\3\2\2\2\22\u009c\3")
        buf.write("\2\2\2\24\u009e\3\2\2\2\26\u00a9\3\2\2\2\30\u00b4\3\2")
        buf.write("\2\2\32\u00c2\3\2\2\2\34\u00c7\3\2\2\2\36\u00c9\3\2\2")
        buf.write("\2 \u00e1\3\2\2\2\"\u00e3\3\2\2\2$\u00fa\3\2\2\2&\u00fc")
        buf.write("\3\2\2\2(\u0104\3\2\2\2*\u010d\3\2\2\2,\u0123\3\2\2\2")
        buf.write(".\u0133\3\2\2\2\60\u013a\3\2\2\2\62\u0141\3\2\2\2\64\u0144")
        buf.write("\3\2\2\2\66\u0147\3\2\2\28\u0156\3\2\2\2:<\5\4\3\2;:\3")
        buf.write("\2\2\2<?\3\2\2\2=;\3\2\2\2=>\3\2\2\2>C\3\2\2\2?=\3\2\2")
        buf.write("\2@B\5\20\t\2A@\3\2\2\2BE\3\2\2\2CA\3\2\2\2CD\3\2\2\2")
        buf.write("DF\3\2\2\2EC\3\2\2\2FG\7\2\2\3G\3\3\2\2\2HI\7\16\2\2I")
        buf.write("J\7\5\2\2JO\5\6\4\2KL\7\3\2\2LN\5\6\4\2MK\3\2\2\2NQ\3")
        buf.write("\2\2\2OM\3\2\2\2OP\3\2\2\2PR\3\2\2\2QO\3\2\2\2RS\7\4\2")
        buf.write("\2S\5\3\2\2\2TW\5\n\6\2UW\5\b\5\2VT\3\2\2\2VU\3\2\2\2")
        buf.write("W\7\3\2\2\2X^\79\2\2YZ\7\n\2\2Z[\7:\2\2[]\7\13\2\2\\Y")
        buf.write("\3\2\2\2]`\3\2\2\2^\\\3\2\2\2^_\3\2\2\2_a\3\2\2\2`^\3")
        buf.write("\2\2\2ab\7\f\2\2bc\5\f\7\2c\t\3\2\2\2dj\79\2\2ef\7\n\2")
        buf.write("\2fg\7:\2\2gi\7\13\2\2he\3\2\2\2il\3\2\2\2jh\3\2\2\2j")
        buf.write("k\3\2\2\2k\13\3\2\2\2lj\3\2\2\2ms\7:\2\2ns\7>\2\2os\7")
        buf.write("?\2\2ps\7@\2\2qs\5\16\b\2rm\3\2\2\2rn\3\2\2\2ro\3\2\2")
        buf.write("\2rp\3\2\2\2rq\3\2\2\2s\r\3\2\2\2t}\7\6\2\2uz\5\f\7\2")
        buf.write("vw\7\3\2\2wy\5\f\7\2xv\3\2\2\2y|\3\2\2\2zx\3\2\2\2z{\3")
        buf.write("\2\2\2{~\3\2\2\2|z\3\2\2\2}u\3\2\2\2}~\3\2\2\2~\177\3")
        buf.write("\2\2\2\177\u0080\7\7\2\2\u0080\17\3\2\2\2\u0081\u0082")
        buf.write("\7\17\2\2\u0082\u0083\7\5\2\2\u0083\u0084\79\2\2\u0084")
        buf.write("\u008f\3\2\2\2\u0085\u0086\7\20\2\2\u0086\u0087\7\5\2")
        buf.write("\2\u0087\u008c\5\n\6\2\u0088\u0089\7\3\2\2\u0089\u008b")
        buf.write("\5\n\6\2\u008a\u0088\3\2\2\2\u008b\u008e\3\2\2\2\u008c")
        buf.write("\u008a\3\2\2\2\u008c\u008d\3\2\2\2\u008d\u0090\3\2\2\2")
        buf.write("\u008e\u008c\3\2\2\2\u008f\u0085\3\2\2\2\u008f\u0090\3")
        buf.write("\2\2\2\u0090\u0091\3\2\2\2\u0091\u0092\7\21\2\2\u0092")
        buf.write("\u0093\7\5\2\2\u0093\u0094\5(\25\2\u0094\u0095\7\22\2")
        buf.write("\2\u0095\u0096\7\r\2\2\u0096\21\3\2\2\2\u0097\u0098\5")
        buf.write("\24\13\2\u0098\u0099\7!\2\2\u0099\u009a\5\24\13\2\u009a")
        buf.write("\u009d\3\2\2\2\u009b\u009d\5\24\13\2\u009c\u0097\3\2\2")
        buf.write("\2\u009c\u009b\3\2\2\2\u009d\23\3\2\2\2\u009e\u009f\b")
        buf.write("\13\1\2\u009f\u00a0\5\26\f\2\u00a0\u00a6\3\2\2\2\u00a1")
        buf.write("\u00a2\f\4\2\2\u00a2\u00a3\t\2\2\2\u00a3\u00a5\5\26\f")
        buf.write("\2\u00a4\u00a1\3\2\2\2\u00a5\u00a8\3\2\2\2\u00a6\u00a4")
        buf.write("\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\25\3\2\2\2\u00a8\u00a6")
        buf.write("\3\2\2\2\u00a9\u00aa\b\f\1\2\u00aa\u00ab\5\30\r\2\u00ab")
        buf.write("\u00b1\3\2\2\2\u00ac\u00ad\f\4\2\2\u00ad\u00ae\t\3\2\2")
        buf.write("\u00ae\u00b0\5\30\r\2\u00af\u00ac\3\2\2\2\u00b0\u00b3")
        buf.write("\3\2\2\2\u00b1\u00af\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2")
        buf.write("\27\3\2\2\2\u00b3\u00b1\3\2\2\2\u00b4\u00b5\b\r\1\2\u00b5")
        buf.write("\u00b6\5\32\16\2\u00b6\u00bc\3\2\2\2\u00b7\u00b8\f\4\2")
        buf.write("\2\u00b8\u00b9\t\4\2\2\u00b9\u00bb\5\32\16\2\u00ba\u00b7")
        buf.write("\3\2\2\2\u00bb\u00be\3\2\2\2\u00bc\u00ba\3\2\2\2\u00bc")
        buf.write("\u00bd\3\2\2\2\u00bd\31\3\2\2\2\u00be\u00bc\3\2\2\2\u00bf")
        buf.write("\u00c0\7+\2\2\u00c0\u00c3\5\32\16\2\u00c1\u00c3\5\34\17")
        buf.write("\2\u00c2\u00bf\3\2\2\2\u00c2\u00c1\3\2\2\2\u00c3\33\3")
        buf.write("\2\2\2\u00c4\u00c5\t\5\2\2\u00c5\u00c8\5\34\17\2\u00c6")
        buf.write("\u00c8\5\36\20\2\u00c7\u00c4\3\2\2\2\u00c7\u00c6\3\2\2")
        buf.write("\2\u00c8\35\3\2\2\2\u00c9\u00ca\b\20\1\2\u00ca\u00cb\5")
        buf.write(" \21\2\u00cb\u00d7\3\2\2\2\u00cc\u00d1\f\4\2\2\u00cd\u00ce")
        buf.write("\7\n\2\2\u00ce\u00cf\5\22\n\2\u00cf\u00d0\7\13\2\2\u00d0")
        buf.write("\u00d2\3\2\2\2\u00d1\u00cd\3\2\2\2\u00d2\u00d3\3\2\2\2")
        buf.write("\u00d3\u00d1\3\2\2\2\u00d3\u00d4\3\2\2\2\u00d4\u00d6\3")
        buf.write("\2\2\2\u00d5\u00cc\3\2\2\2\u00d6\u00d9\3\2\2\2\u00d7\u00d5")
        buf.write("\3\2\2\2\u00d7\u00d8\3\2\2\2\u00d8\37\3\2\2\2\u00d9\u00d7")
        buf.write("\3\2\2\2\u00da\u00e2\79\2\2\u00db\u00e2\5\f\7\2\u00dc")
        buf.write("\u00e2\5\"\22\2\u00dd\u00de\7\b\2\2\u00de\u00df\5\22\n")
        buf.write("\2\u00df\u00e0\7\t\2\2\u00e0\u00e2\3\2\2\2\u00e1\u00da")
        buf.write("\3\2\2\2\u00e1\u00db\3\2\2\2\u00e1\u00dc\3\2\2\2\u00e1")
        buf.write("\u00dd\3\2\2\2\u00e2!\3\2\2\2\u00e3\u00e4\79\2\2\u00e4")
        buf.write("\u00ed\7\b\2\2\u00e5\u00ea\5\22\n\2\u00e6\u00e7\7\3\2")
        buf.write("\2\u00e7\u00e9\5\22\n\2\u00e8\u00e6\3\2\2\2\u00e9\u00ec")
        buf.write("\3\2\2\2\u00ea\u00e8\3\2\2\2\u00ea\u00eb\3\2\2\2\u00eb")
        buf.write("\u00ee\3\2\2\2\u00ec\u00ea\3\2\2\2\u00ed\u00e5\3\2\2\2")
        buf.write("\u00ed\u00ee\3\2\2\2\u00ee\u00ef\3\2\2\2\u00ef\u00f0\7")
        buf.write("\t\2\2\u00f0#\3\2\2\2\u00f1\u00fb\5&\24\2\u00f2\u00fb")
        buf.write("\5*\26\2\u00f3\u00fb\5,\27\2\u00f4\u00fb\5.\30\2\u00f5")
        buf.write("\u00fb\5\60\31\2\u00f6\u00fb\5\66\34\2\u00f7\u00fb\58")
        buf.write("\35\2\u00f8\u00fb\5\62\32\2\u00f9\u00fb\5\64\33\2\u00fa")
        buf.write("\u00f1\3\2\2\2\u00fa\u00f2\3\2\2\2\u00fa\u00f3\3\2\2\2")
        buf.write("\u00fa\u00f4\3\2\2\2\u00fa\u00f5\3\2\2\2\u00fa\u00f6\3")
        buf.write("\2\2\2\u00fa\u00f7\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fa\u00f9")
        buf.write("\3\2\2\2\u00fb%\3\2\2\2\u00fc\u00fd\5\36\20\2\u00fd\u00fe")
        buf.write("\7\f\2\2\u00fe\u00ff\5\22\n\2\u00ff\u0100\7\4\2\2\u0100")
        buf.write("\'\3\2\2\2\u0101\u0103\5\4\3\2\u0102\u0101\3\2\2\2\u0103")
        buf.write("\u0106\3\2\2\2\u0104\u0102\3\2\2\2\u0104\u0105\3\2\2\2")
        buf.write("\u0105\u010a\3\2\2\2\u0106\u0104\3\2\2\2\u0107\u0109\5")
        buf.write("$\23\2\u0108\u0107\3\2\2\2\u0109\u010c\3\2\2\2\u010a\u0108")
        buf.write("\3\2\2\2\u010a\u010b\3\2\2\2\u010b)\3\2\2\2\u010c\u010a")
        buf.write("\3\2\2\2\u010d\u010e\7\23\2\2\u010e\u010f\5\22\n\2\u010f")
        buf.write("\u0110\7\25\2\2\u0110\u0111\5(\25\2\u0111\u0119\3\2\2")
        buf.write("\2\u0112\u0113\7\24\2\2\u0113\u0114\5\22\n\2\u0114\u0115")
        buf.write("\7\25\2\2\u0115\u0116\5(\25\2\u0116\u0118\3\2\2\2\u0117")
        buf.write("\u0112\3\2\2\2\u0118\u011b\3\2\2\2\u0119\u0117\3\2\2\2")
        buf.write("\u0119\u011a\3\2\2\2\u011a\u011e\3\2\2\2\u011b\u0119\3")
        buf.write("\2\2\2\u011c\u011d\7\26\2\2\u011d\u011f\5(\25\2\u011e")
        buf.write("\u011c\3\2\2\2\u011e\u011f\3\2\2\2\u011f\u0120\3\2\2\2")
        buf.write("\u0120\u0121\7\27\2\2\u0121\u0122\7\r\2\2\u0122+\3\2\2")
        buf.write("\2\u0123\u0124\7\30\2\2\u0124\u0125\7\b\2\2\u0125\u0126")
        buf.write("\79\2\2\u0126\u0127\7\f\2\2\u0127\u0128\5\22\n\2\u0128")
        buf.write("\u0129\3\2\2\2\u0129\u012a\7\3\2\2\u012a\u012b\5\22\n")
        buf.write("\2\u012b\u012c\7\3\2\2\u012c\u012d\5\22\n\2\u012d\u012e")
        buf.write("\7\t\2\2\u012e\u012f\7\32\2\2\u012f\u0130\5(\25\2\u0130")
        buf.write("\u0131\7\31\2\2\u0131\u0132\7\r\2\2\u0132-\3\2\2\2\u0133")
        buf.write("\u0134\7\35\2\2\u0134\u0135\5\22\n\2\u0135\u0136\7\32")
        buf.write("\2\2\u0136\u0137\5(\25\2\u0137\u0138\7\36\2\2\u0138\u0139")
        buf.write("\7\r\2\2\u0139/\3\2\2\2\u013a\u013b\7\32\2\2\u013b\u013c")
        buf.write("\5(\25\2\u013c\u013d\7\35\2\2\u013d\u013e\5\22\n\2\u013e")
        buf.write("\u013f\7\33\2\2\u013f\u0140\7\r\2\2\u0140\61\3\2\2\2\u0141")
        buf.write("\u0142\7\34\2\2\u0142\u0143\7\4\2\2\u0143\63\3\2\2\2\u0144")
        buf.write("\u0145\7\37\2\2\u0145\u0146\7\4\2\2\u0146\65\3\2\2\2\u0147")
        buf.write("\u0148\79\2\2\u0148\u0151\7\b\2\2\u0149\u014e\5\22\n\2")
        buf.write("\u014a\u014b\7\3\2\2\u014b\u014d\5\22\n\2\u014c\u014a")
        buf.write("\3\2\2\2\u014d\u0150\3\2\2\2\u014e\u014c\3\2\2\2\u014e")
        buf.write("\u014f\3\2\2\2\u014f\u0152\3\2\2\2\u0150\u014e\3\2\2\2")
        buf.write("\u0151\u0149\3\2\2\2\u0151\u0152\3\2\2\2\u0152\u0153\3")
        buf.write("\2\2\2\u0153\u0154\7\t\2\2\u0154\u0155\7\4\2\2\u0155\67")
        buf.write("\3\2\2\2\u0156\u0158\7 \2\2\u0157\u0159\5\22\n\2\u0158")
        buf.write("\u0157\3\2\2\2\u0158\u0159\3\2\2\2\u0159\u015a\3\2\2\2")
        buf.write("\u015a\u015b\7\4\2\2\u015b9\3\2\2\2 =COV^jrz}\u008c\u008f")
        buf.write("\u009c\u00a6\u00b1\u00bc\u00c2\u00c7\u00d3\u00d7\u00e1")
        buf.write("\u00ea\u00ed\u00fa\u0104\u010a\u0119\u011e\u014e\u0151")
        buf.write("\u0158")
        return buf.getvalue()


class BKITParser ( Parser ):

    grammarFileName = "BKIT.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "','", "';'", "':'", "'{'", "'}'", "'('", 
                     "')'", "'['", "']'", "'='", "'.'", "'Var'", "'Function'", 
                     "'Parameter'", "'Body'", "'EndBody'", "'If'", "'ElseIf'", 
                     "'Then'", "'Else'", "'EndIf'", "'For'", "'EndFor'", 
                     "'Do'", "'EndDo'", "'Break'", "'While'", "'EndWhile'", 
                     "'Continue'", "'Return'", "<INVALID>", "'+'", "'-'", 
                     "'*'", "'\\'", "'%'", "'+.'", "'-.'", "'*.'", "'\\.'", 
                     "'!'", "'&&'", "'||'", "'=='", "'!='", "'<'", "'>'", 
                     "'<='", "'>='", "'=/='", "'<.'", "'>.'", "'<=.'", "'>=.'" ]

    symbolicNames = [ "<INVALID>", "CM", "SEMI", "COLON", "LB", "RB", "LP", 
                      "RP", "LSB", "RSB", "ASSIGN", "DOT", "VAR", "FUNC", 
                      "PARAM", "BODY", "END_BODY", "IF", "ELSEIF", "THEN", 
                      "ELSE", "ENDIF", "FOR", "ENDFOR", "DO", "ENDDO", "BREAK", 
                      "WHILE", "ENDWHILE", "CONTINUE", "RETURN", "RELATIONAL", 
                      "ADD", "SUB", "MUL", "DIV", "REMAINDER", "F_ADD", 
                      "F_SUB", "F_MUL", "F_DIV", "BOOL_NEGA", "BOOL_CONJ", 
                      "BOOL_DISJ", "EQUAL", "NOT_EQUAL", "LESS_THAN", "GREATER_THAN", 
                      "LESS_THAN_EQ", "GREATER_THAN_EQ", "F_NOT_EQUAL", 
                      "F_LESS_THAN", "F_GREATER_THAN", "F_LESS_THAN_EQ", 
                      "F_GREATER_THAN_EQ", "ID", "INTLIT", "DEC", "HEX", 
                      "OTC", "FLOATLIT", "BOOLEANLIT", "STRINGLIT", "WS", 
                      "BLOCK_CMT", "ERROR_CHAR", "UNCLOSE_STRING", "ILLEGAL_ESCAPE", 
                      "UNTERMINATED_COMMENT" ]

    RULE_program = 0
    RULE_var_declare = 1
    RULE_var_declare_item = 2
    RULE_var_init = 3
    RULE_var_id = 4
    RULE_all_literal = 5
    RULE_array_literal = 6
    RULE_func_declare = 7
    RULE_expression = 8
    RULE_exp1 = 9
    RULE_exp2 = 10
    RULE_exp3 = 11
    RULE_exp4 = 12
    RULE_exp5 = 13
    RULE_exp6 = 14
    RULE_operand = 15
    RULE_func_call_exp = 16
    RULE_statement = 17
    RULE_assign_stm = 18
    RULE_statement_list = 19
    RULE_if_stm = 20
    RULE_for_stm = 21
    RULE_while_stm = 22
    RULE_dowhile_stm = 23
    RULE_break_stm = 24
    RULE_continue_stm = 25
    RULE_call_stm = 26
    RULE_return_stm = 27

    ruleNames =  [ "program", "var_declare", "var_declare_item", "var_init", 
                   "var_id", "all_literal", "array_literal", "func_declare", 
                   "expression", "exp1", "exp2", "exp3", "exp4", "exp5", 
                   "exp6", "operand", "func_call_exp", "statement", "assign_stm", 
                   "statement_list", "if_stm", "for_stm", "while_stm", "dowhile_stm", 
                   "break_stm", "continue_stm", "call_stm", "return_stm" ]

    EOF = Token.EOF
    CM=1
    SEMI=2
    COLON=3
    LB=4
    RB=5
    LP=6
    RP=7
    LSB=8
    RSB=9
    ASSIGN=10
    DOT=11
    VAR=12
    FUNC=13
    PARAM=14
    BODY=15
    END_BODY=16
    IF=17
    ELSEIF=18
    THEN=19
    ELSE=20
    ENDIF=21
    FOR=22
    ENDFOR=23
    DO=24
    ENDDO=25
    BREAK=26
    WHILE=27
    ENDWHILE=28
    CONTINUE=29
    RETURN=30
    RELATIONAL=31
    ADD=32
    SUB=33
    MUL=34
    DIV=35
    REMAINDER=36
    F_ADD=37
    F_SUB=38
    F_MUL=39
    F_DIV=40
    BOOL_NEGA=41
    BOOL_CONJ=42
    BOOL_DISJ=43
    EQUAL=44
    NOT_EQUAL=45
    LESS_THAN=46
    GREATER_THAN=47
    LESS_THAN_EQ=48
    GREATER_THAN_EQ=49
    F_NOT_EQUAL=50
    F_LESS_THAN=51
    F_GREATER_THAN=52
    F_LESS_THAN_EQ=53
    F_GREATER_THAN_EQ=54
    ID=55
    INTLIT=56
    DEC=57
    HEX=58
    OTC=59
    FLOATLIT=60
    BOOLEANLIT=61
    STRINGLIT=62
    WS=63
    BLOCK_CMT=64
    ERROR_CHAR=65
    UNCLOSE_STRING=66
    ILLEGAL_ESCAPE=67
    UNTERMINATED_COMMENT=68

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




    class ProgramContext(ParserRuleContext):

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

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

        def var_declare(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Var_declareContext)
            else:
                return self.getTypedRuleContext(BKITParser.Var_declareContext,i)


        def func_declare(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Func_declareContext)
            else:
                return self.getTypedRuleContext(BKITParser.Func_declareContext,i)


        def getRuleIndex(self):
            return BKITParser.RULE_program

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

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

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




    def program(self):

        localctx = BKITParser.ProgramContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_program)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 59
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.VAR:
                self.state = 56
                self.var_declare()
                self.state = 61
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 65
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.FUNC:
                self.state = 62
                self.func_declare()
                self.state = 67
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Var_declareContext(ParserRuleContext):

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

        def VAR(self):
            return self.getToken(BKITParser.VAR, 0)

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

        def var_declare_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Var_declare_itemContext)
            else:
                return self.getTypedRuleContext(BKITParser.Var_declare_itemContext,i)


        def SEMI(self):
            return self.getToken(BKITParser.SEMI, 0)

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

        def getRuleIndex(self):
            return BKITParser.RULE_var_declare

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

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

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




    def var_declare(self):

        localctx = BKITParser.Var_declareContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_var_declare)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 70
            self.match(BKITParser.VAR)
            self.state = 71
            self.match(BKITParser.COLON)
            self.state = 72
            self.var_declare_item()
            self.state = 77
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.CM:
                self.state = 73
                self.match(BKITParser.CM)
                self.state = 74
                self.var_declare_item()
                self.state = 79
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 80
            self.match(BKITParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Var_declare_itemContext(ParserRuleContext):

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

        def var_id(self):
            return self.getTypedRuleContext(BKITParser.Var_idContext,0)


        def var_init(self):
            return self.getTypedRuleContext(BKITParser.Var_initContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_var_declare_item

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

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

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




    def var_declare_item(self):

        localctx = BKITParser.Var_declare_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_var_declare_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 84
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,3,self._ctx)
            if la_ == 1:
                self.state = 82
                self.var_id()
                pass

            elif la_ == 2:
                self.state = 83
                self.var_init()
                pass


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


    class Var_initContext(ParserRuleContext):

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

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

        def ASSIGN(self):
            return self.getToken(BKITParser.ASSIGN, 0)

        def all_literal(self):
            return self.getTypedRuleContext(BKITParser.All_literalContext,0)


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

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

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

        def getRuleIndex(self):
            return BKITParser.RULE_var_init

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

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

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




    def var_init(self):

        localctx = BKITParser.Var_initContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_var_init)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 86
            self.match(BKITParser.ID)
            self.state = 92
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.LSB:
                self.state = 87
                self.match(BKITParser.LSB)
                self.state = 88
                self.match(BKITParser.INTLIT)
                self.state = 89
                self.match(BKITParser.RSB)
                self.state = 94
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 95
            self.match(BKITParser.ASSIGN)
            self.state = 96
            self.all_literal()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Var_idContext(ParserRuleContext):

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

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

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

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

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

        def getRuleIndex(self):
            return BKITParser.RULE_var_id

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

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

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




    def var_id(self):

        localctx = BKITParser.Var_idContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_var_id)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 98
            self.match(BKITParser.ID)
            self.state = 104
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.LSB:
                self.state = 99
                self.match(BKITParser.LSB)
                self.state = 100
                self.match(BKITParser.INTLIT)
                self.state = 101
                self.match(BKITParser.RSB)
                self.state = 106
                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 All_literalContext(ParserRuleContext):

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

        def INTLIT(self):
            return self.getToken(BKITParser.INTLIT, 0)

        def FLOATLIT(self):
            return self.getToken(BKITParser.FLOATLIT, 0)

        def BOOLEANLIT(self):
            return self.getToken(BKITParser.BOOLEANLIT, 0)

        def STRINGLIT(self):
            return self.getToken(BKITParser.STRINGLIT, 0)

        def array_literal(self):
            return self.getTypedRuleContext(BKITParser.Array_literalContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_all_literal

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

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

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




    def all_literal(self):

        localctx = BKITParser.All_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_all_literal)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 112
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [BKITParser.INTLIT]:
                self.state = 107
                self.match(BKITParser.INTLIT)
                pass
            elif token in [BKITParser.FLOATLIT]:
                self.state = 108
                self.match(BKITParser.FLOATLIT)
                pass
            elif token in [BKITParser.BOOLEANLIT]:
                self.state = 109
                self.match(BKITParser.BOOLEANLIT)
                pass
            elif token in [BKITParser.STRINGLIT]:
                self.state = 110
                self.match(BKITParser.STRINGLIT)
                pass
            elif token in [BKITParser.LB]:
                self.state = 111
                self.array_literal()
                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 Array_literalContext(ParserRuleContext):

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

        def LB(self):
            return self.getToken(BKITParser.LB, 0)

        def RB(self):
            return self.getToken(BKITParser.RB, 0)

        def all_literal(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.All_literalContext)
            else:
                return self.getTypedRuleContext(BKITParser.All_literalContext,i)


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

        def getRuleIndex(self):
            return BKITParser.RULE_array_literal

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

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

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




    def array_literal(self):

        localctx = BKITParser.Array_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_array_literal)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 114
            self.match(BKITParser.LB)
            self.state = 123
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.LB) | (1 << BKITParser.INTLIT) | (1 << BKITParser.FLOATLIT) | (1 << BKITParser.BOOLEANLIT) | (1 << BKITParser.STRINGLIT))) != 0):
                self.state = 115
                self.all_literal()
                self.state = 120
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==BKITParser.CM:
                    self.state = 116
                    self.match(BKITParser.CM)
                    self.state = 117
                    self.all_literal()
                    self.state = 122
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 125
            self.match(BKITParser.RB)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_declareContext(ParserRuleContext):

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

        def BODY(self):
            return self.getToken(BKITParser.BODY, 0)

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

        def statement_list(self):
            return self.getTypedRuleContext(BKITParser.Statement_listContext,0)


        def END_BODY(self):
            return self.getToken(BKITParser.END_BODY, 0)

        def DOT(self):
            return self.getToken(BKITParser.DOT, 0)

        def FUNC(self):
            return self.getToken(BKITParser.FUNC, 0)

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

        def PARAM(self):
            return self.getToken(BKITParser.PARAM, 0)

        def var_id(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Var_idContext)
            else:
                return self.getTypedRuleContext(BKITParser.Var_idContext,i)


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

        def getRuleIndex(self):
            return BKITParser.RULE_func_declare

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

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

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




    def func_declare(self):

        localctx = BKITParser.Func_declareContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_func_declare)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 127
            self.match(BKITParser.FUNC)
            self.state = 128
            self.match(BKITParser.COLON)
            self.state = 129
            self.match(BKITParser.ID)
            self.state = 141
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==BKITParser.PARAM:
                self.state = 131
                self.match(BKITParser.PARAM)
                self.state = 132
                self.match(BKITParser.COLON)
                self.state = 133
                self.var_id()
                self.state = 138
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==BKITParser.CM:
                    self.state = 134
                    self.match(BKITParser.CM)
                    self.state = 135
                    self.var_id()
                    self.state = 140
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 143
            self.match(BKITParser.BODY)
            self.state = 144
            self.match(BKITParser.COLON)
            self.state = 145
            self.statement_list()
            self.state = 146
            self.match(BKITParser.END_BODY)
            self.state = 147
            self.match(BKITParser.DOT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExpressionContext(ParserRuleContext):

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

        def exp1(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Exp1Context)
            else:
                return self.getTypedRuleContext(BKITParser.Exp1Context,i)


        def RELATIONAL(self):
            return self.getToken(BKITParser.RELATIONAL, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_expression

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

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

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




    def expression(self):

        localctx = BKITParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_expression)
        try:
            self.state = 154
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,11,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 149
                self.exp1(0)
                self.state = 150
                self.match(BKITParser.RELATIONAL)
                self.state = 151
                self.exp1(0)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 153
                self.exp1(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 Exp1Context(ParserRuleContext):

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

        def exp2(self):
            return self.getTypedRuleContext(BKITParser.Exp2Context,0)


        def exp1(self):
            return self.getTypedRuleContext(BKITParser.Exp1Context,0)


        def BOOL_CONJ(self):
            return self.getToken(BKITParser.BOOL_CONJ, 0)

        def BOOL_DISJ(self):
            return self.getToken(BKITParser.BOOL_DISJ, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_exp1

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

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

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



    def exp1(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = BKITParser.Exp1Context(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 18
        self.enterRecursionRule(localctx, 18, self.RULE_exp1, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 157
            self.exp2(0)
            self._ctx.stop = self._input.LT(-1)
            self.state = 164
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,12,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = BKITParser.Exp1Context(self, _parentctx, _parentState)
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_exp1)
                    self.state = 159
                    if not self.precpred(self._ctx, 2):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                    self.state = 160
                    _la = self._input.LA(1)
                    if not(_la==BKITParser.BOOL_CONJ or _la==BKITParser.BOOL_DISJ):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 161
                    self.exp2(0) 
                self.state = 166
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,12,self._ctx)

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


    class Exp2Context(ParserRuleContext):

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

        def exp3(self):
            return self.getTypedRuleContext(BKITParser.Exp3Context,0)


        def exp2(self):
            return self.getTypedRuleContext(BKITParser.Exp2Context,0)


        def ADD(self):
            return self.getToken(BKITParser.ADD, 0)

        def SUB(self):
            return self.getToken(BKITParser.SUB, 0)

        def F_ADD(self):
            return self.getToken(BKITParser.F_ADD, 0)

        def F_SUB(self):
            return self.getToken(BKITParser.F_SUB, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_exp2

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

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

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



    def exp2(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = BKITParser.Exp2Context(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 20
        self.enterRecursionRule(localctx, 20, self.RULE_exp2, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 168
            self.exp3(0)
            self._ctx.stop = self._input.LT(-1)
            self.state = 175
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,13,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = BKITParser.Exp2Context(self, _parentctx, _parentState)
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_exp2)
                    self.state = 170
                    if not self.precpred(self._ctx, 2):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                    self.state = 171
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.ADD) | (1 << BKITParser.SUB) | (1 << BKITParser.F_ADD) | (1 << BKITParser.F_SUB))) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 172
                    self.exp3(0) 
                self.state = 177
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,13,self._ctx)

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


    class Exp3Context(ParserRuleContext):

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

        def exp4(self):
            return self.getTypedRuleContext(BKITParser.Exp4Context,0)


        def exp3(self):
            return self.getTypedRuleContext(BKITParser.Exp3Context,0)


        def MUL(self):
            return self.getToken(BKITParser.MUL, 0)

        def DIV(self):
            return self.getToken(BKITParser.DIV, 0)

        def F_MUL(self):
            return self.getToken(BKITParser.F_MUL, 0)

        def F_DIV(self):
            return self.getToken(BKITParser.F_DIV, 0)

        def REMAINDER(self):
            return self.getToken(BKITParser.REMAINDER, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_exp3

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

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

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



    def exp3(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = BKITParser.Exp3Context(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 22
        self.enterRecursionRule(localctx, 22, self.RULE_exp3, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 179
            self.exp4()
            self._ctx.stop = self._input.LT(-1)
            self.state = 186
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,14,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = BKITParser.Exp3Context(self, _parentctx, _parentState)
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_exp3)
                    self.state = 181
                    if not self.precpred(self._ctx, 2):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                    self.state = 182
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.MUL) | (1 << BKITParser.DIV) | (1 << BKITParser.REMAINDER) | (1 << BKITParser.F_MUL) | (1 << BKITParser.F_DIV))) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 183
                    self.exp4() 
                self.state = 188
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,14,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 Exp4Context(ParserRuleContext):

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

        def BOOL_NEGA(self):
            return self.getToken(BKITParser.BOOL_NEGA, 0)

        def exp4(self):
            return self.getTypedRuleContext(BKITParser.Exp4Context,0)


        def exp5(self):
            return self.getTypedRuleContext(BKITParser.Exp5Context,0)


        def getRuleIndex(self):
            return BKITParser.RULE_exp4

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

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

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




    def exp4(self):

        localctx = BKITParser.Exp4Context(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_exp4)
        try:
            self.state = 192
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [BKITParser.BOOL_NEGA]:
                self.enterOuterAlt(localctx, 1)
                self.state = 189
                self.match(BKITParser.BOOL_NEGA)
                self.state = 190
                self.exp4()
                pass
            elif token in [BKITParser.LB, BKITParser.LP, BKITParser.SUB, BKITParser.F_SUB, BKITParser.ID, BKITParser.INTLIT, BKITParser.FLOATLIT, BKITParser.BOOLEANLIT, BKITParser.STRINGLIT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 191
                self.exp5()
                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 Exp5Context(ParserRuleContext):

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

        def exp5(self):
            return self.getTypedRuleContext(BKITParser.Exp5Context,0)


        def SUB(self):
            return self.getToken(BKITParser.SUB, 0)

        def F_SUB(self):
            return self.getToken(BKITParser.F_SUB, 0)

        def exp6(self):
            return self.getTypedRuleContext(BKITParser.Exp6Context,0)


        def getRuleIndex(self):
            return BKITParser.RULE_exp5

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

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

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




    def exp5(self):

        localctx = BKITParser.Exp5Context(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_exp5)
        self._la = 0 # Token type
        try:
            self.state = 197
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [BKITParser.SUB, BKITParser.F_SUB]:
                self.enterOuterAlt(localctx, 1)
                self.state = 194
                _la = self._input.LA(1)
                if not(_la==BKITParser.SUB or _la==BKITParser.F_SUB):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 195
                self.exp5()
                pass
            elif token in [BKITParser.LB, BKITParser.LP, BKITParser.ID, BKITParser.INTLIT, BKITParser.FLOATLIT, BKITParser.BOOLEANLIT, BKITParser.STRINGLIT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 196
                self.exp6(0)
                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 Exp6Context(ParserRuleContext):

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

        def operand(self):
            return self.getTypedRuleContext(BKITParser.OperandContext,0)


        def exp6(self):
            return self.getTypedRuleContext(BKITParser.Exp6Context,0)


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

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(BKITParser.ExpressionContext,i)


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

        def getRuleIndex(self):
            return BKITParser.RULE_exp6

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

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

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



    def exp6(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = BKITParser.Exp6Context(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 28
        self.enterRecursionRule(localctx, 28, self.RULE_exp6, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 200
            self.operand()
            self._ctx.stop = self._input.LT(-1)
            self.state = 213
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,18,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = BKITParser.Exp6Context(self, _parentctx, _parentState)
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_exp6)
                    self.state = 202
                    if not self.precpred(self._ctx, 2):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                    self.state = 207 
                    self._errHandler.sync(self)
                    _alt = 1
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt == 1:
                            self.state = 203
                            self.match(BKITParser.LSB)
                            self.state = 204
                            self.expression()
                            self.state = 205
                            self.match(BKITParser.RSB)

                        else:
                            raise NoViableAltException(self)
                        self.state = 209 
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,17,self._ctx)
             
                self.state = 215
                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.unrollRecursionContexts(_parentctx)
        return localctx


    class OperandContext(ParserRuleContext):

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

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

        def all_literal(self):
            return self.getTypedRuleContext(BKITParser.All_literalContext,0)


        def func_call_exp(self):
            return self.getTypedRuleContext(BKITParser.Func_call_expContext,0)


        def LP(self):
            return self.getToken(BKITParser.LP, 0)

        def expression(self):
            return self.getTypedRuleContext(BKITParser.ExpressionContext,0)


        def RP(self):
            return self.getToken(BKITParser.RP, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_operand

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

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

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




    def operand(self):

        localctx = BKITParser.OperandContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_operand)
        try:
            self.state = 223
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 216
                self.match(BKITParser.ID)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 217
                self.all_literal()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 218
                self.func_call_exp()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 219
                self.match(BKITParser.LP)
                self.state = 220
                self.expression()
                self.state = 221
                self.match(BKITParser.RP)
                pass


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


    class Func_call_expContext(ParserRuleContext):

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

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

        def LP(self):
            return self.getToken(BKITParser.LP, 0)

        def RP(self):
            return self.getToken(BKITParser.RP, 0)

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(BKITParser.ExpressionContext,i)


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

        def getRuleIndex(self):
            return BKITParser.RULE_func_call_exp

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

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

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




    def func_call_exp(self):

        localctx = BKITParser.Func_call_expContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_func_call_exp)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 225
            self.match(BKITParser.ID)
            self.state = 226
            self.match(BKITParser.LP)
            self.state = 235
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.LB) | (1 << BKITParser.LP) | (1 << BKITParser.SUB) | (1 << BKITParser.F_SUB) | (1 << BKITParser.BOOL_NEGA) | (1 << BKITParser.ID) | (1 << BKITParser.INTLIT) | (1 << BKITParser.FLOATLIT) | (1 << BKITParser.BOOLEANLIT) | (1 << BKITParser.STRINGLIT))) != 0):
                self.state = 227
                self.expression()
                self.state = 232
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==BKITParser.CM:
                    self.state = 228
                    self.match(BKITParser.CM)
                    self.state = 229
                    self.expression()
                    self.state = 234
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 237
            self.match(BKITParser.RP)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StatementContext(ParserRuleContext):

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

        def assign_stm(self):
            return self.getTypedRuleContext(BKITParser.Assign_stmContext,0)


        def if_stm(self):
            return self.getTypedRuleContext(BKITParser.If_stmContext,0)


        def for_stm(self):
            return self.getTypedRuleContext(BKITParser.For_stmContext,0)


        def while_stm(self):
            return self.getTypedRuleContext(BKITParser.While_stmContext,0)


        def dowhile_stm(self):
            return self.getTypedRuleContext(BKITParser.Dowhile_stmContext,0)


        def call_stm(self):
            return self.getTypedRuleContext(BKITParser.Call_stmContext,0)


        def return_stm(self):
            return self.getTypedRuleContext(BKITParser.Return_stmContext,0)


        def break_stm(self):
            return self.getTypedRuleContext(BKITParser.Break_stmContext,0)


        def continue_stm(self):
            return self.getTypedRuleContext(BKITParser.Continue_stmContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_statement

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

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

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




    def statement(self):

        localctx = BKITParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_statement)
        try:
            self.state = 248
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,22,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 239
                self.assign_stm()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 240
                self.if_stm()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 241
                self.for_stm()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 242
                self.while_stm()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 243
                self.dowhile_stm()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 244
                self.call_stm()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 245
                self.return_stm()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 246
                self.break_stm()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 247
                self.continue_stm()
                pass


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


    class Assign_stmContext(ParserRuleContext):

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

        def exp6(self):
            return self.getTypedRuleContext(BKITParser.Exp6Context,0)


        def ASSIGN(self):
            return self.getToken(BKITParser.ASSIGN, 0)

        def expression(self):
            return self.getTypedRuleContext(BKITParser.ExpressionContext,0)


        def SEMI(self):
            return self.getToken(BKITParser.SEMI, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_assign_stm

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

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

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




    def assign_stm(self):

        localctx = BKITParser.Assign_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_assign_stm)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 250
            self.exp6(0)
            self.state = 251
            self.match(BKITParser.ASSIGN)
            self.state = 252
            self.expression()
            self.state = 253
            self.match(BKITParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Statement_listContext(ParserRuleContext):

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

        def var_declare(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Var_declareContext)
            else:
                return self.getTypedRuleContext(BKITParser.Var_declareContext,i)


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


        def getRuleIndex(self):
            return BKITParser.RULE_statement_list

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

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

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




    def statement_list(self):

        localctx = BKITParser.Statement_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_statement_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 258
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.VAR:
                self.state = 255
                self.var_declare()
                self.state = 260
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 264
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,24,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 261
                    self.statement() 
                self.state = 266
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,24,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 If_stmContext(ParserRuleContext):

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

        def ENDIF(self):
            return self.getToken(BKITParser.ENDIF, 0)

        def DOT(self):
            return self.getToken(BKITParser.DOT, 0)

        def IF(self):
            return self.getToken(BKITParser.IF, 0)

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(BKITParser.ExpressionContext,i)


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

        def statement_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Statement_listContext)
            else:
                return self.getTypedRuleContext(BKITParser.Statement_listContext,i)


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

        def ELSE(self):
            return self.getToken(BKITParser.ELSE, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_if_stm

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

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

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




    def if_stm(self):

        localctx = BKITParser.If_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_if_stm)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 267
            self.match(BKITParser.IF)
            self.state = 268
            self.expression()
            self.state = 269
            self.match(BKITParser.THEN)
            self.state = 270
            self.statement_list()
            self.state = 279
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.ELSEIF:
                self.state = 272
                self.match(BKITParser.ELSEIF)
                self.state = 273
                self.expression()
                self.state = 274
                self.match(BKITParser.THEN)
                self.state = 275
                self.statement_list()
                self.state = 281
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 284
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==BKITParser.ELSE:
                self.state = 282
                self.match(BKITParser.ELSE)
                self.state = 283
                self.statement_list()


            self.state = 286
            self.match(BKITParser.ENDIF)
            self.state = 287
            self.match(BKITParser.DOT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class For_stmContext(ParserRuleContext):

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

        def FOR(self):
            return self.getToken(BKITParser.FOR, 0)

        def LP(self):
            return self.getToken(BKITParser.LP, 0)

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

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(BKITParser.ExpressionContext,i)


        def RP(self):
            return self.getToken(BKITParser.RP, 0)

        def DO(self):
            return self.getToken(BKITParser.DO, 0)

        def statement_list(self):
            return self.getTypedRuleContext(BKITParser.Statement_listContext,0)


        def ENDFOR(self):
            return self.getToken(BKITParser.ENDFOR, 0)

        def DOT(self):
            return self.getToken(BKITParser.DOT, 0)

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

        def ASSIGN(self):
            return self.getToken(BKITParser.ASSIGN, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_for_stm

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

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

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




    def for_stm(self):

        localctx = BKITParser.For_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_for_stm)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 289
            self.match(BKITParser.FOR)
            self.state = 290
            self.match(BKITParser.LP)

            self.state = 291
            self.match(BKITParser.ID)
            self.state = 292
            self.match(BKITParser.ASSIGN)
            self.state = 293
            self.expression()
            self.state = 295
            self.match(BKITParser.CM)
            self.state = 296
            self.expression()
            self.state = 297
            self.match(BKITParser.CM)
            self.state = 298
            self.expression()
            self.state = 299
            self.match(BKITParser.RP)
            self.state = 300
            self.match(BKITParser.DO)
            self.state = 301
            self.statement_list()
            self.state = 302
            self.match(BKITParser.ENDFOR)
            self.state = 303
            self.match(BKITParser.DOT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class While_stmContext(ParserRuleContext):

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

        def WHILE(self):
            return self.getToken(BKITParser.WHILE, 0)

        def expression(self):
            return self.getTypedRuleContext(BKITParser.ExpressionContext,0)


        def DO(self):
            return self.getToken(BKITParser.DO, 0)

        def statement_list(self):
            return self.getTypedRuleContext(BKITParser.Statement_listContext,0)


        def ENDWHILE(self):
            return self.getToken(BKITParser.ENDWHILE, 0)

        def DOT(self):
            return self.getToken(BKITParser.DOT, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_while_stm

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

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

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




    def while_stm(self):

        localctx = BKITParser.While_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_while_stm)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 305
            self.match(BKITParser.WHILE)
            self.state = 306
            self.expression()
            self.state = 307
            self.match(BKITParser.DO)
            self.state = 308
            self.statement_list()
            self.state = 309
            self.match(BKITParser.ENDWHILE)
            self.state = 310
            self.match(BKITParser.DOT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Dowhile_stmContext(ParserRuleContext):

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

        def DO(self):
            return self.getToken(BKITParser.DO, 0)

        def statement_list(self):
            return self.getTypedRuleContext(BKITParser.Statement_listContext,0)


        def WHILE(self):
            return self.getToken(BKITParser.WHILE, 0)

        def expression(self):
            return self.getTypedRuleContext(BKITParser.ExpressionContext,0)


        def ENDDO(self):
            return self.getToken(BKITParser.ENDDO, 0)

        def DOT(self):
            return self.getToken(BKITParser.DOT, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_dowhile_stm

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

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

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




    def dowhile_stm(self):

        localctx = BKITParser.Dowhile_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_dowhile_stm)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 312
            self.match(BKITParser.DO)
            self.state = 313
            self.statement_list()
            self.state = 314
            self.match(BKITParser.WHILE)
            self.state = 315
            self.expression()
            self.state = 316
            self.match(BKITParser.ENDDO)
            self.state = 317
            self.match(BKITParser.DOT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Break_stmContext(ParserRuleContext):

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

        def BREAK(self):
            return self.getToken(BKITParser.BREAK, 0)

        def SEMI(self):
            return self.getToken(BKITParser.SEMI, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_break_stm

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

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

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




    def break_stm(self):

        localctx = BKITParser.Break_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_break_stm)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 319
            self.match(BKITParser.BREAK)
            self.state = 320
            self.match(BKITParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Continue_stmContext(ParserRuleContext):

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

        def CONTINUE(self):
            return self.getToken(BKITParser.CONTINUE, 0)

        def SEMI(self):
            return self.getToken(BKITParser.SEMI, 0)

        def getRuleIndex(self):
            return BKITParser.RULE_continue_stm

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

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

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




    def continue_stm(self):

        localctx = BKITParser.Continue_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_continue_stm)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 322
            self.match(BKITParser.CONTINUE)
            self.state = 323
            self.match(BKITParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Call_stmContext(ParserRuleContext):

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

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

        def LP(self):
            return self.getToken(BKITParser.LP, 0)

        def RP(self):
            return self.getToken(BKITParser.RP, 0)

        def SEMI(self):
            return self.getToken(BKITParser.SEMI, 0)

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(BKITParser.ExpressionContext,i)


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

        def getRuleIndex(self):
            return BKITParser.RULE_call_stm

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

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

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




    def call_stm(self):

        localctx = BKITParser.Call_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_call_stm)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 325
            self.match(BKITParser.ID)
            self.state = 326
            self.match(BKITParser.LP)
            self.state = 335
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.LB) | (1 << BKITParser.LP) | (1 << BKITParser.SUB) | (1 << BKITParser.F_SUB) | (1 << BKITParser.BOOL_NEGA) | (1 << BKITParser.ID) | (1 << BKITParser.INTLIT) | (1 << BKITParser.FLOATLIT) | (1 << BKITParser.BOOLEANLIT) | (1 << BKITParser.STRINGLIT))) != 0):
                self.state = 327
                self.expression()
                self.state = 332
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==BKITParser.CM:
                    self.state = 328
                    self.match(BKITParser.CM)
                    self.state = 329
                    self.expression()
                    self.state = 334
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 337
            self.match(BKITParser.RP)
            self.state = 338
            self.match(BKITParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Return_stmContext(ParserRuleContext):

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

        def RETURN(self):
            return self.getToken(BKITParser.RETURN, 0)

        def SEMI(self):
            return self.getToken(BKITParser.SEMI, 0)

        def expression(self):
            return self.getTypedRuleContext(BKITParser.ExpressionContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_return_stm

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

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

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




    def return_stm(self):

        localctx = BKITParser.Return_stmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_return_stm)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 340
            self.match(BKITParser.RETURN)
            self.state = 342
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.LB) | (1 << BKITParser.LP) | (1 << BKITParser.SUB) | (1 << BKITParser.F_SUB) | (1 << BKITParser.BOOL_NEGA) | (1 << BKITParser.ID) | (1 << BKITParser.INTLIT) | (1 << BKITParser.FLOATLIT) | (1 << BKITParser.BOOLEANLIT) | (1 << BKITParser.STRINGLIT))) != 0):
                self.state = 341
                self.expression()


            self.state = 344
            self.match(BKITParser.SEMI)
        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[9] = self.exp1_sempred
        self._predicates[10] = self.exp2_sempred
        self._predicates[11] = self.exp3_sempred
        self._predicates[14] = self.exp6_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 exp1_sempred(self, localctx:Exp1Context, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 2)
         

    def exp2_sempred(self, localctx:Exp2Context, predIndex:int):
            if predIndex == 1:
                return self.precpred(self._ctx, 2)
         

    def exp3_sempred(self, localctx:Exp3Context, predIndex:int):
            if predIndex == 2:
                return self.precpred(self._ctx, 2)
         

    def exp6_sempred(self, localctx:Exp6Context, predIndex:int):
            if predIndex == 3:
                return self.precpred(self._ctx, 2)
         




