# Generated from /home/longbui/Documents/PPL/ass4/assignment4/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\3C")
        buf.write("\u0169\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
        buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
        buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31")
        buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36")
        buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\3\2\7\2H\n\2\f\2")
        buf.write("\16\2K\13\2\3\2\7\2N\n\2\f\2\16\2Q\13\2\3\2\3\2\3\3\3")
        buf.write("\3\3\3\3\3\3\3\7\3Z\n\3\f\3\16\3]\13\3\3\3\3\3\3\4\3\4")
        buf.write("\3\4\5\4d\n\4\3\5\3\5\3\5\3\5\7\5j\n\5\f\5\16\5m\13\5")
        buf.write("\3\6\3\6\3\6\3\6\5\6s\n\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7")
        buf.write("\7\7|\n\7\f\7\16\7\177\13\7\3\b\3\b\3\b\3\b\7\b\u0085")
        buf.write("\n\b\f\b\16\b\u0088\13\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\7")
        buf.write("\n\u0091\n\n\f\n\16\n\u0094\13\n\3\n\7\n\u0097\n\n\f\n")
        buf.write("\16\n\u009a\13\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3")
        buf.write("\13\3\13\5\13\u00a5\n\13\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3")
        buf.write("\r\3\r\3\r\3\r\6\r\u00b2\n\r\r\r\16\r\u00b3\5\r\u00b6")
        buf.write("\n\r\3\16\3\16\7\16\u00ba\n\16\f\16\16\16\u00bd\13\16")
        buf.write("\3\16\5\16\u00c0\n\16\3\16\3\16\3\16\3\17\3\17\3\17\3")
        buf.write("\17\3\17\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\22")
        buf.write("\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22")
        buf.write("\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\24")
        buf.write("\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\26\3\26")
        buf.write("\3\26\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\7\30\u00fd")
        buf.write("\n\30\f\30\16\30\u0100\13\30\5\30\u0102\n\30\3\30\3\30")
        buf.write("\3\31\3\31\5\31\u0108\n\31\3\31\3\31\3\32\3\32\3\32\3")
        buf.write("\32\3\32\5\32\u0111\n\32\3\33\3\33\3\33\3\33\3\33\3\33")
        buf.write("\7\33\u0119\n\33\f\33\16\33\u011c\13\33\3\34\3\34\3\34")
        buf.write("\3\34\3\34\3\34\7\34\u0124\n\34\f\34\16\34\u0127\13\34")
        buf.write("\3\35\3\35\3\35\3\35\3\35\3\35\7\35\u012f\n\35\f\35\16")
        buf.write("\35\u0132\13\35\3\36\3\36\3\36\5\36\u0137\n\36\3\37\3")
        buf.write("\37\3\37\5\37\u013c\n\37\3 \3 \3 \3 \3 \6 \u0143\n \r")
        buf.write(" \16 \u0144\3 \5 \u0148\n \3!\3!\3!\3!\3!\3!\3!\5!\u0151")
        buf.write("\n!\5!\u0153\n!\3\"\3\"\3\"\3\"\7\"\u0159\n\"\f\"\16\"")
        buf.write("\u015c\13\"\5\"\u015e\n\"\3\"\3\"\3#\3#\3#\3#\3#\5#\u0167")
        buf.write("\n#\3#\2\5\64\668$\2\4\6\b\n\f\16\20\22\24\26\30\32\34")
        buf.write("\36 \"$&(*,.\60\62\64\668:<>@BD\2\7\3\2(\62\3\2&\'\3\2")
        buf.write("\34\37\3\2 $\3\2\34\35\2\u0170\2I\3\2\2\2\4T\3\2\2\2\6")
        buf.write("`\3\2\2\2\be\3\2\2\2\nn\3\2\2\2\fv\3\2\2\2\16\u0080\3")
        buf.write("\2\2\2\20\u0089\3\2\2\2\22\u0092\3\2\2\2\24\u00a4\3\2")
        buf.write("\2\2\26\u00a6\3\2\2\2\30\u00b5\3\2\2\2\32\u00b7\3\2\2")
        buf.write("\2\34\u00c4\3\2\2\2\36\u00c9\3\2\2\2 \u00ce\3\2\2\2\"")
        buf.write("\u00d1\3\2\2\2$\u00e0\3\2\2\2&\u00e7\3\2\2\2(\u00ee\3")
        buf.write("\2\2\2*\u00f1\3\2\2\2,\u00f4\3\2\2\2.\u00f7\3\2\2\2\60")
        buf.write("\u0105\3\2\2\2\62\u0110\3\2\2\2\64\u0112\3\2\2\2\66\u011d")
        buf.write("\3\2\2\28\u0128\3\2\2\2:\u0136\3\2\2\2<\u013b\3\2\2\2")
        buf.write(">\u0147\3\2\2\2@\u0152\3\2\2\2B\u0154\3\2\2\2D\u0166\3")
        buf.write("\2\2\2FH\5\4\3\2GF\3\2\2\2HK\3\2\2\2IG\3\2\2\2IJ\3\2\2")
        buf.write("\2JO\3\2\2\2KI\3\2\2\2LN\5\n\6\2ML\3\2\2\2NQ\3\2\2\2O")
        buf.write("M\3\2\2\2OP\3\2\2\2PR\3\2\2\2QO\3\2\2\2RS\7\2\2\3S\3\3")
        buf.write("\2\2\2TU\7\f\2\2UV\7:\2\2V[\5\6\4\2WX\7<\2\2XZ\5\6\4\2")
        buf.write("YW\3\2\2\2Z]\3\2\2\2[Y\3\2\2\2[\\\3\2\2\2\\^\3\2\2\2]")
        buf.write("[\3\2\2\2^_\7;\2\2_\5\3\2\2\2`c\5\b\5\2ab\7\63\2\2bd\5")
        buf.write("D#\2ca\3\2\2\2cd\3\2\2\2d\7\3\2\2\2ek\7\3\2\2fg\7\66\2")
        buf.write("\2gh\7\4\2\2hj\7\67\2\2if\3\2\2\2jm\3\2\2\2ki\3\2\2\2")
        buf.write("kl\3\2\2\2l\t\3\2\2\2mk\3\2\2\2no\7\32\2\2op\7:\2\2pr")
        buf.write("\7\3\2\2qs\5\f\7\2rq\3\2\2\2rs\3\2\2\2st\3\2\2\2tu\5\20")
        buf.write("\t\2u\13\3\2\2\2vw\7\21\2\2wx\7:\2\2x}\5\16\b\2yz\7<\2")
        buf.write("\2z|\5\16\b\2{y\3\2\2\2|\177\3\2\2\2}{\3\2\2\2}~\3\2\2")
        buf.write("\2~\r\3\2\2\2\177}\3\2\2\2\u0080\u0086\7\3\2\2\u0081\u0082")
        buf.write("\7\66\2\2\u0082\u0083\7\4\2\2\u0083\u0085\7\67\2\2\u0084")
        buf.write("\u0081\3\2\2\2\u0085\u0088\3\2\2\2\u0086\u0084\3\2\2\2")
        buf.write("\u0086\u0087\3\2\2\2\u0087\17\3\2\2\2\u0088\u0086\3\2")
        buf.write("\2\2\u0089\u008a\7\b\2\2\u008a\u008b\7:\2\2\u008b\u008c")
        buf.write("\5\22\n\2\u008c\u008d\7\24\2\2\u008d\u008e\7=\2\2\u008e")
        buf.write("\21\3\2\2\2\u008f\u0091\5\4\3\2\u0090\u008f\3\2\2\2\u0091")
        buf.write("\u0094\3\2\2\2\u0092\u0090\3\2\2\2\u0092\u0093\3\2\2\2")
        buf.write("\u0093\u0098\3\2\2\2\u0094\u0092\3\2\2\2\u0095\u0097\5")
        buf.write("\24\13\2\u0096\u0095\3\2\2\2\u0097\u009a\3\2\2\2\u0098")
        buf.write("\u0096\3\2\2\2\u0098\u0099\3\2\2\2\u0099\23\3\2\2\2\u009a")
        buf.write("\u0098\3\2\2\2\u009b\u00a5\5\26\f\2\u009c\u00a5\5\32\16")
        buf.write("\2\u009d\u00a5\5\"\22\2\u009e\u00a5\5$\23\2\u009f\u00a5")
        buf.write("\5&\24\2\u00a0\u00a5\5,\27\2\u00a1\u00a5\5\60\31\2\u00a2")
        buf.write("\u00a5\5(\25\2\u00a3\u00a5\5*\26\2\u00a4\u009b\3\2\2\2")
        buf.write("\u00a4\u009c\3\2\2\2\u00a4\u009d\3\2\2\2\u00a4\u009e\3")
        buf.write("\2\2\2\u00a4\u009f\3\2\2\2\u00a4\u00a0\3\2\2\2\u00a4\u00a1")
        buf.write("\3\2\2\2\u00a4\u00a2\3\2\2\2\u00a4\u00a3\3\2\2\2\u00a5")
        buf.write("\25\3\2\2\2\u00a6\u00a7\5\30\r\2\u00a7\u00a8\7\63\2\2")
        buf.write("\u00a8\u00a9\5\62\32\2\u00a9\u00aa\7;\2\2\u00aa\27\3\2")
        buf.write("\2\2\u00ab\u00b6\7\3\2\2\u00ac\u00b1\5@!\2\u00ad\u00ae")
        buf.write("\7\66\2\2\u00ae\u00af\5\62\32\2\u00af\u00b0\7\67\2\2\u00b0")
        buf.write("\u00b2\3\2\2\2\u00b1\u00ad\3\2\2\2\u00b2\u00b3\3\2\2\2")
        buf.write("\u00b3\u00b1\3\2\2\2\u00b3\u00b4\3\2\2\2\u00b4\u00b6\3")
        buf.write("\2\2\2\u00b5\u00ab\3\2\2\2\u00b5\u00ac\3\2\2\2\u00b6\31")
        buf.write("\3\2\2\2\u00b7\u00bb\5\34\17\2\u00b8\u00ba\5\36\20\2\u00b9")
        buf.write("\u00b8\3\2\2\2\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3\2\2\2")
        buf.write("\u00bb\u00bc\3\2\2\2\u00bc\u00bf\3\2\2\2\u00bd\u00bb\3")
        buf.write("\2\2\2\u00be\u00c0\5 \21\2\u00bf\u00be\3\2\2\2\u00bf\u00c0")
        buf.write("\3\2\2\2\u00c0\u00c1\3\2\2\2\u00c1\u00c2\7\31\2\2\u00c2")
        buf.write("\u00c3\7=\2\2\u00c3\33\3\2\2\2\u00c4\u00c5\7\13\2\2\u00c5")
        buf.write("\u00c6\5\62\32\2\u00c6\u00c7\7\33\2\2\u00c7\u00c8\5\22")
        buf.write("\n\2\u00c8\35\3\2\2\2\u00c9\u00ca\7\17\2\2\u00ca\u00cb")
        buf.write("\5\62\32\2\u00cb\u00cc\7\33\2\2\u00cc\u00cd\5\22\n\2\u00cd")
        buf.write("\37\3\2\2\2\u00ce\u00cf\7\t\2\2\u00cf\u00d0\5\22\n\2\u00d0")
        buf.write("!\3\2\2\2\u00d1\u00d2\7\25\2\2\u00d2\u00d3\7\64\2\2\u00d3")
        buf.write("\u00d4\7\3\2\2\u00d4\u00d5\7\63\2\2\u00d5\u00d6\5\62\32")
        buf.write("\2\u00d6\u00d7\7<\2\2\u00d7\u00d8\5\62\32\2\u00d8\u00d9")
        buf.write("\7<\2\2\u00d9\u00da\5\62\32\2\u00da\u00db\7\65\2\2\u00db")
        buf.write("\u00dc\7\30\2\2\u00dc\u00dd\5\22\n\2\u00dd\u00de\7\n\2")
        buf.write("\2\u00de\u00df\7=\2\2\u00df#\3\2\2\2\u00e0\u00e1\7\22")
        buf.write("\2\2\u00e1\u00e2\5\62\32\2\u00e2\u00e3\7\30\2\2\u00e3")
        buf.write("\u00e4\5\22\n\2\u00e4\u00e5\7\20\2\2\u00e5\u00e6\7=\2")
        buf.write("\2\u00e6%\3\2\2\2\u00e7\u00e8\7\30\2\2\u00e8\u00e9\5\22")
        buf.write("\n\2\u00e9\u00ea\7\22\2\2\u00ea\u00eb\5\62\32\2\u00eb")
        buf.write("\u00ec\7\r\2\2\u00ec\u00ed\7=\2\2\u00ed\'\3\2\2\2\u00ee")
        buf.write("\u00ef\7\16\2\2\u00ef\u00f0\7;\2\2\u00f0)\3\2\2\2\u00f1")
        buf.write("\u00f2\7\23\2\2\u00f2\u00f3\7;\2\2\u00f3+\3\2\2\2\u00f4")
        buf.write("\u00f5\5.\30\2\u00f5\u00f6\7;\2\2\u00f6-\3\2\2\2\u00f7")
        buf.write("\u00f8\7\3\2\2\u00f8\u0101\7\64\2\2\u00f9\u00fe\5\62\32")
        buf.write("\2\u00fa\u00fb\7<\2\2\u00fb\u00fd\5\62\32\2\u00fc\u00fa")
        buf.write("\3\2\2\2\u00fd\u0100\3\2\2\2\u00fe\u00fc\3\2\2\2\u00fe")
        buf.write("\u00ff\3\2\2\2\u00ff\u0102\3\2\2\2\u0100\u00fe\3\2\2\2")
        buf.write("\u0101\u00f9\3\2\2\2\u0101\u0102\3\2\2\2\u0102\u0103\3")
        buf.write("\2\2\2\u0103\u0104\7\65\2\2\u0104/\3\2\2\2\u0105\u0107")
        buf.write("\7\26\2\2\u0106\u0108\5\62\32\2\u0107\u0106\3\2\2\2\u0107")
        buf.write("\u0108\3\2\2\2\u0108\u0109\3\2\2\2\u0109\u010a\7;\2\2")
        buf.write("\u010a\61\3\2\2\2\u010b\u010c\5\64\33\2\u010c\u010d\t")
        buf.write("\2\2\2\u010d\u010e\5\64\33\2\u010e\u0111\3\2\2\2\u010f")
        buf.write("\u0111\5\64\33\2\u0110\u010b\3\2\2\2\u0110\u010f\3\2\2")
        buf.write("\2\u0111\63\3\2\2\2\u0112\u0113\b\33\1\2\u0113\u0114\5")
        buf.write("\66\34\2\u0114\u011a\3\2\2\2\u0115\u0116\f\4\2\2\u0116")
        buf.write("\u0117\t\3\2\2\u0117\u0119\5\66\34\2\u0118\u0115\3\2\2")
        buf.write("\2\u0119\u011c\3\2\2\2\u011a\u0118\3\2\2\2\u011a\u011b")
        buf.write("\3\2\2\2\u011b\65\3\2\2\2\u011c\u011a\3\2\2\2\u011d\u011e")
        buf.write("\b\34\1\2\u011e\u011f\58\35\2\u011f\u0125\3\2\2\2\u0120")
        buf.write("\u0121\f\4\2\2\u0121\u0122\t\4\2\2\u0122\u0124\58\35\2")
        buf.write("\u0123\u0120\3\2\2\2\u0124\u0127\3\2\2\2\u0125\u0123\3")
        buf.write("\2\2\2\u0125\u0126\3\2\2\2\u0126\67\3\2\2\2\u0127\u0125")
        buf.write("\3\2\2\2\u0128\u0129\b\35\1\2\u0129\u012a\5:\36\2\u012a")
        buf.write("\u0130\3\2\2\2\u012b\u012c\f\4\2\2\u012c\u012d\t\5\2\2")
        buf.write("\u012d\u012f\5:\36\2\u012e\u012b\3\2\2\2\u012f\u0132\3")
        buf.write("\2\2\2\u0130\u012e\3\2\2\2\u0130\u0131\3\2\2\2\u01319")
        buf.write("\3\2\2\2\u0132\u0130\3\2\2\2\u0133\u0134\7%\2\2\u0134")
        buf.write("\u0137\5:\36\2\u0135\u0137\5<\37\2\u0136\u0133\3\2\2\2")
        buf.write("\u0136\u0135\3\2\2\2\u0137;\3\2\2\2\u0138\u0139\t\6\2")
        buf.write("\2\u0139\u013c\5<\37\2\u013a\u013c\5> \2\u013b\u0138\3")
        buf.write("\2\2\2\u013b\u013a\3\2\2\2\u013c=\3\2\2\2\u013d\u0142")
        buf.write("\5@!\2\u013e\u013f\7\66\2\2\u013f\u0140\5\62\32\2\u0140")
        buf.write("\u0141\7\67\2\2\u0141\u0143\3\2\2\2\u0142\u013e\3\2\2")
        buf.write("\2\u0143\u0144\3\2\2\2\u0144\u0142\3\2\2\2\u0144\u0145")
        buf.write("\3\2\2\2\u0145\u0148\3\2\2\2\u0146\u0148\5@!\2\u0147\u013d")
        buf.write("\3\2\2\2\u0147\u0146\3\2\2\2\u0148?\3\2\2\2\u0149\u014a")
        buf.write("\7\64\2\2\u014a\u014b\5\62\32\2\u014b\u014c\7\65\2\2\u014c")
        buf.write("\u0153\3\2\2\2\u014d\u0153\5.\30\2\u014e\u0151\7\3\2\2")
        buf.write("\u014f\u0151\5D#\2\u0150\u014e\3\2\2\2\u0150\u014f\3\2")
        buf.write("\2\2\u0151\u0153\3\2\2\2\u0152\u0149\3\2\2\2\u0152\u014d")
        buf.write("\3\2\2\2\u0152\u0150\3\2\2\2\u0153A\3\2\2\2\u0154\u015d")
        buf.write("\78\2\2\u0155\u015a\5D#\2\u0156\u0157\7<\2\2\u0157\u0159")
        buf.write("\5D#\2\u0158\u0156\3\2\2\2\u0159\u015c\3\2\2\2\u015a\u0158")
        buf.write("\3\2\2\2\u015a\u015b\3\2\2\2\u015b\u015e\3\2\2\2\u015c")
        buf.write("\u015a\3\2\2\2\u015d\u0155\3\2\2\2\u015d\u015e\3\2\2\2")
        buf.write("\u015e\u015f\3\2\2\2\u015f\u0160\79\2\2\u0160C\3\2\2\2")
        buf.write("\u0161\u0167\7\4\2\2\u0162\u0167\7\5\2\2\u0163\u0167\7")
        buf.write("\6\2\2\u0164\u0167\7\7\2\2\u0165\u0167\5B\"\2\u0166\u0161")
        buf.write("\3\2\2\2\u0166\u0162\3\2\2\2\u0166\u0163\3\2\2\2\u0166")
        buf.write("\u0164\3\2\2\2\u0166\u0165\3\2\2\2\u0167E\3\2\2\2!IO[")
        buf.write("ckr}\u0086\u0092\u0098\u00a4\u00b3\u00b5\u00bb\u00bf\u00fe")
        buf.write("\u0101\u0107\u0110\u011a\u0125\u0130\u0136\u013b\u0144")
        buf.write("\u0147\u0150\u0152\u015a\u015d\u0166")
        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>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "'Body'", "'Else'", "'EndFor'", 
                     "'If'", "'Var'", "'EndDo'", "'Break'", "'ElseIf'", 
                     "'EndWhile'", "'Parameter'", "'While'", "'Continue'", 
                     "'EndBody'", "'For'", "'Return'", "'Operators'", "'Do'", 
                     "'EndIf'", "'Function'", "'Then'", "'-'", "'-.'", "'+'", 
                     "'+.'", "'*'", "'*.'", "'\\'", "'\\.'", "'%'", "'!'", 
                     "'&&'", "'||'", "'=='", "'!='", "'<'", "'>'", "'<='", 
                     "'>='", "'=/='", "'<.'", "'>.'", "'<=.'", "'>=.'", 
                     "'='", "'('", "')'", "'['", "']'", "'{'", "'}'", "':'", 
                     "';'", "','", "'.'" ]

    symbolicNames = [ "<INVALID>", "ID", "INTLIT", "FLOATLIT", "BOOLEANLIT", 
                      "STRINGLIT", "BODY", "ELSE", "END_FOR", "IF", "VAR", 
                      "END_DO", "BREAK", "ELSE_IF", "END_WHILE", "PARAMETER", 
                      "WHILE", "CONTINUE", "END_BODY", "FOR", "RETURN", 
                      "OPERATORS", "DO", "END_IF", "FUNCTION", "THEN", "INT_SUB_OP", 
                      "FLOAT_SUB_OP", "INT_ADD_OP", "FLOAT_ADD_OP", "INT_MUL_OP", 
                      "FLOAT_MUL_OP", "INT_DIV_OP", "FLOAT_DIV_OP", "INT_REMAINDER_OP", 
                      "NEG_OP", "CONJ_OP", "DISJ_OP", "EQ_OP", "INT_NEQ_OP", 
                      "INT_LT_OP", "INT_GT_OP", "INT_LTE_OP", "INT_GTE_OP", 
                      "FLOAT_NEQ_OP", "FLOAT_LT_OP", "FLOAT_GT_OP", "FLOAT_LTE_OP", 
                      "FLOAT_GTE_OP", "ASSIGN_OP", "LP", "RP", "LSB", "RSB", 
                      "LCB", "RCB", "COLON", "SEMI", "COMMA", "DOT", "COMMENT", 
                      "WS", "ERROR_CHAR", "UNCLOSE_STRING", "ILLEGAL_ESCAPE", 
                      "UNTERMINATED_COMMENT" ]

    RULE_program = 0
    RULE_var_dcl = 1
    RULE_var_init = 2
    RULE_var = 3
    RULE_func_dcl = 4
    RULE_param_list = 5
    RULE_param = 6
    RULE_body = 7
    RULE_statement_list = 8
    RULE_statement = 9
    RULE_assign_stmt = 10
    RULE_lhs = 11
    RULE_if_stmt = 12
    RULE_if_then_part = 13
    RULE_elif_then_part = 14
    RULE_else_part = 15
    RULE_for_stmt = 16
    RULE_while_stmt = 17
    RULE_do_while_stmt = 18
    RULE_break_stmt = 19
    RULE_continue_stmt = 20
    RULE_call_stmt = 21
    RULE_func_call = 22
    RULE_return_stmt = 23
    RULE_expression = 24
    RULE_exp1 = 25
    RULE_exp2 = 26
    RULE_exp3 = 27
    RULE_exp4 = 28
    RULE_exp5 = 29
    RULE_exp6 = 30
    RULE_exp7 = 31
    RULE_arraylit = 32
    RULE_literal = 33

    ruleNames =  [ "program", "var_dcl", "var_init", "var", "func_dcl", 
                   "param_list", "param", "body", "statement_list", "statement", 
                   "assign_stmt", "lhs", "if_stmt", "if_then_part", "elif_then_part", 
                   "else_part", "for_stmt", "while_stmt", "do_while_stmt", 
                   "break_stmt", "continue_stmt", "call_stmt", "func_call", 
                   "return_stmt", "expression", "exp1", "exp2", "exp3", 
                   "exp4", "exp5", "exp6", "exp7", "arraylit", "literal" ]

    EOF = Token.EOF
    ID=1
    INTLIT=2
    FLOATLIT=3
    BOOLEANLIT=4
    STRINGLIT=5
    BODY=6
    ELSE=7
    END_FOR=8
    IF=9
    VAR=10
    END_DO=11
    BREAK=12
    ELSE_IF=13
    END_WHILE=14
    PARAMETER=15
    WHILE=16
    CONTINUE=17
    END_BODY=18
    FOR=19
    RETURN=20
    OPERATORS=21
    DO=22
    END_IF=23
    FUNCTION=24
    THEN=25
    INT_SUB_OP=26
    FLOAT_SUB_OP=27
    INT_ADD_OP=28
    FLOAT_ADD_OP=29
    INT_MUL_OP=30
    FLOAT_MUL_OP=31
    INT_DIV_OP=32
    FLOAT_DIV_OP=33
    INT_REMAINDER_OP=34
    NEG_OP=35
    CONJ_OP=36
    DISJ_OP=37
    EQ_OP=38
    INT_NEQ_OP=39
    INT_LT_OP=40
    INT_GT_OP=41
    INT_LTE_OP=42
    INT_GTE_OP=43
    FLOAT_NEQ_OP=44
    FLOAT_LT_OP=45
    FLOAT_GT_OP=46
    FLOAT_LTE_OP=47
    FLOAT_GTE_OP=48
    ASSIGN_OP=49
    LP=50
    RP=51
    LSB=52
    RSB=53
    LCB=54
    RCB=55
    COLON=56
    SEMI=57
    COMMA=58
    DOT=59
    COMMENT=60
    WS=61
    ERROR_CHAR=62
    UNCLOSE_STRING=63
    ILLEGAL_ESCAPE=64
    UNTERMINATED_COMMENT=65

    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_dcl(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Var_dclContext)
            else:
                return self.getTypedRuleContext(BKITParser.Var_dclContext,i)


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


        def getRuleIndex(self):
            return BKITParser.RULE_program




    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 = 71
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.VAR:
                self.state = 68
                self.var_dcl()
                self.state = 73
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 77
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.FUNCTION:
                self.state = 74
                self.func_dcl()
                self.state = 79
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 80
            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_dclContext(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_init(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Var_initContext)
            else:
                return self.getTypedRuleContext(BKITParser.Var_initContext,i)


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

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

        def getRuleIndex(self):
            return BKITParser.RULE_var_dcl




    def var_dcl(self):

        localctx = BKITParser.Var_dclContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_var_dcl)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 82
            self.match(BKITParser.VAR)
            self.state = 83
            self.match(BKITParser.COLON)
            self.state = 84
            self.var_init()
            self.state = 89
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.COMMA:
                self.state = 85
                self.match(BKITParser.COMMA)
                self.state = 86
                self.var_init()
                self.state = 91
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 92
            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_initContext(ParserRuleContext):

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

        def var(self):
            return self.getTypedRuleContext(BKITParser.VarContext,0)


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

        def literal(self):
            return self.getTypedRuleContext(BKITParser.LiteralContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_var_init




    def var_init(self):

        localctx = BKITParser.Var_initContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_var_init)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 94
            self.var()
            self.state = 97
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==BKITParser.ASSIGN_OP:
                self.state = 95
                self.match(BKITParser.ASSIGN_OP)
                self.state = 96
                self.literal()


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


    class VarContext(ParserRuleContext):

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

        def 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




    def var(self):

        localctx = BKITParser.VarContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_var)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 99
            self.match(BKITParser.ID)
            self.state = 105
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.LSB:
                self.state = 100
                self.match(BKITParser.LSB)
                self.state = 101
                self.match(BKITParser.INTLIT)
                self.state = 102
                self.match(BKITParser.RSB)
                self.state = 107
                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 Func_dclContext(ParserRuleContext):

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

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

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

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

        def body(self):
            return self.getTypedRuleContext(BKITParser.BodyContext,0)


        def param_list(self):
            return self.getTypedRuleContext(BKITParser.Param_listContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_func_dcl




    def func_dcl(self):

        localctx = BKITParser.Func_dclContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_func_dcl)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 108
            self.match(BKITParser.FUNCTION)
            self.state = 109
            self.match(BKITParser.COLON)
            self.state = 110
            self.match(BKITParser.ID)
            self.state = 112
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==BKITParser.PARAMETER:
                self.state = 111
                self.param_list()


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


    class Param_listContext(ParserRuleContext):

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

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

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

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


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

        def getRuleIndex(self):
            return BKITParser.RULE_param_list




    def param_list(self):

        localctx = BKITParser.Param_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_param_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 116
            self.match(BKITParser.PARAMETER)
            self.state = 117
            self.match(BKITParser.COLON)
            self.state = 118
            self.param()
            self.state = 123
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.COMMA:
                self.state = 119
                self.match(BKITParser.COMMA)
                self.state = 120
                self.param()
                self.state = 125
                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 ParamContext(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_param




    def param(self):

        localctx = BKITParser.ParamContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_param)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 126
            self.match(BKITParser.ID)
            self.state = 132
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.LSB:
                self.state = 127
                self.match(BKITParser.LSB)
                self.state = 128
                self.match(BKITParser.INTLIT)
                self.state = 129
                self.match(BKITParser.RSB)
                self.state = 134
                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 BodyContext(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):
            return self.getToken(BKITParser.COLON, 0)

        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 getRuleIndex(self):
            return BKITParser.RULE_body




    def body(self):

        localctx = BKITParser.BodyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_body)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 135
            self.match(BKITParser.BODY)
            self.state = 136
            self.match(BKITParser.COLON)
            self.state = 137
            self.statement_list()
            self.state = 138
            self.match(BKITParser.END_BODY)
            self.state = 139
            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 Statement_listContext(ParserRuleContext):

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

        def var_dcl(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(BKITParser.Var_dclContext)
            else:
                return self.getTypedRuleContext(BKITParser.Var_dclContext,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 statement_list(self):

        localctx = BKITParser.Statement_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_statement_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 144
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.VAR:
                self.state = 141
                self.var_dcl()
                self.state = 146
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 150
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,9,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 147
                    self.statement() 
                self.state = 152
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,9,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 StatementContext(ParserRuleContext):

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

        def assign_stmt(self):
            return self.getTypedRuleContext(BKITParser.Assign_stmtContext,0)


        def if_stmt(self):
            return self.getTypedRuleContext(BKITParser.If_stmtContext,0)


        def for_stmt(self):
            return self.getTypedRuleContext(BKITParser.For_stmtContext,0)


        def while_stmt(self):
            return self.getTypedRuleContext(BKITParser.While_stmtContext,0)


        def do_while_stmt(self):
            return self.getTypedRuleContext(BKITParser.Do_while_stmtContext,0)


        def call_stmt(self):
            return self.getTypedRuleContext(BKITParser.Call_stmtContext,0)


        def return_stmt(self):
            return self.getTypedRuleContext(BKITParser.Return_stmtContext,0)


        def break_stmt(self):
            return self.getTypedRuleContext(BKITParser.Break_stmtContext,0)


        def continue_stmt(self):
            return self.getTypedRuleContext(BKITParser.Continue_stmtContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_statement




    def statement(self):

        localctx = BKITParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_statement)
        try:
            self.state = 162
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,10,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 153
                self.assign_stmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 154
                self.if_stmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 155
                self.for_stmt()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 156
                self.while_stmt()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 157
                self.do_while_stmt()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 158
                self.call_stmt()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 159
                self.return_stmt()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 160
                self.break_stmt()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 161
                self.continue_stmt()
                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_stmtContext(ParserRuleContext):

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

        def lhs(self):
            return self.getTypedRuleContext(BKITParser.LhsContext,0)


        def ASSIGN_OP(self):
            return self.getToken(BKITParser.ASSIGN_OP, 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_stmt




    def assign_stmt(self):

        localctx = BKITParser.Assign_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_assign_stmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 164
            self.lhs()
            self.state = 165
            self.match(BKITParser.ASSIGN_OP)
            self.state = 166
            self.expression()
            self.state = 167
            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 LhsContext(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 exp7(self):
            return self.getTypedRuleContext(BKITParser.Exp7Context,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_lhs




    def lhs(self):

        localctx = BKITParser.LhsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_lhs)
        self._la = 0 # Token type
        try:
            self.state = 179
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 169
                self.match(BKITParser.ID)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 170
                self.exp7()
                self.state = 175 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 171
                    self.match(BKITParser.LSB)
                    self.state = 172
                    self.expression()
                    self.state = 173
                    self.match(BKITParser.RSB)
                    self.state = 177 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==BKITParser.LSB):
                        break

                pass


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


    class If_stmtContext(ParserRuleContext):

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

        def if_then_part(self):
            return self.getTypedRuleContext(BKITParser.If_then_partContext,0)


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

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

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


        def else_part(self):
            return self.getTypedRuleContext(BKITParser.Else_partContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_if_stmt




    def if_stmt(self):

        localctx = BKITParser.If_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_if_stmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 181
            self.if_then_part()
            self.state = 185
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==BKITParser.ELSE_IF:
                self.state = 182
                self.elif_then_part()
                self.state = 187
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 189
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==BKITParser.ELSE:
                self.state = 188
                self.else_part()


            self.state = 191
            self.match(BKITParser.END_IF)
            self.state = 192
            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 If_then_partContext(ParserRuleContext):

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

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

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


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

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


        def getRuleIndex(self):
            return BKITParser.RULE_if_then_part




    def if_then_part(self):

        localctx = BKITParser.If_then_partContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_if_then_part)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 194
            self.match(BKITParser.IF)
            self.state = 195
            self.expression()
            self.state = 196
            self.match(BKITParser.THEN)
            self.state = 197
            self.statement_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Elif_then_partContext(ParserRuleContext):

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

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

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


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

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


        def getRuleIndex(self):
            return BKITParser.RULE_elif_then_part




    def elif_then_part(self):

        localctx = BKITParser.Elif_then_partContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_elif_then_part)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 199
            self.match(BKITParser.ELSE_IF)
            self.state = 200
            self.expression()
            self.state = 201
            self.match(BKITParser.THEN)
            self.state = 202
            self.statement_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Else_partContext(ParserRuleContext):

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

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

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


        def getRuleIndex(self):
            return BKITParser.RULE_else_part




    def else_part(self):

        localctx = BKITParser.Else_partContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_else_part)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 204
            self.match(BKITParser.ELSE)
            self.state = 205
            self.statement_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class For_stmtContext(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 ID(self):
            return self.getToken(BKITParser.ID, 0)

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

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


        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(BKITParser.COMMA)
            else:
                return self.getToken(BKITParser.COMMA, 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 END_FOR(self):
            return self.getToken(BKITParser.END_FOR, 0)

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

        def getRuleIndex(self):
            return BKITParser.RULE_for_stmt




    def for_stmt(self):

        localctx = BKITParser.For_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_for_stmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 207
            self.match(BKITParser.FOR)
            self.state = 208
            self.match(BKITParser.LP)
            self.state = 209
            self.match(BKITParser.ID)
            self.state = 210
            self.match(BKITParser.ASSIGN_OP)
            self.state = 211
            self.expression()
            self.state = 212
            self.match(BKITParser.COMMA)
            self.state = 213
            self.expression()
            self.state = 214
            self.match(BKITParser.COMMA)
            self.state = 215
            self.expression()
            self.state = 216
            self.match(BKITParser.RP)
            self.state = 217
            self.match(BKITParser.DO)
            self.state = 218
            self.statement_list()
            self.state = 219
            self.match(BKITParser.END_FOR)
            self.state = 220
            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_stmtContext(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 END_WHILE(self):
            return self.getToken(BKITParser.END_WHILE, 0)

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

        def getRuleIndex(self):
            return BKITParser.RULE_while_stmt




    def while_stmt(self):

        localctx = BKITParser.While_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_while_stmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 222
            self.match(BKITParser.WHILE)
            self.state = 223
            self.expression()
            self.state = 224
            self.match(BKITParser.DO)
            self.state = 225
            self.statement_list()
            self.state = 226
            self.match(BKITParser.END_WHILE)
            self.state = 227
            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 Do_while_stmtContext(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 END_DO(self):
            return self.getToken(BKITParser.END_DO, 0)

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

        def getRuleIndex(self):
            return BKITParser.RULE_do_while_stmt




    def do_while_stmt(self):

        localctx = BKITParser.Do_while_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_do_while_stmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 229
            self.match(BKITParser.DO)
            self.state = 230
            self.statement_list()
            self.state = 231
            self.match(BKITParser.WHILE)
            self.state = 232
            self.expression()
            self.state = 233
            self.match(BKITParser.END_DO)
            self.state = 234
            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_stmtContext(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_stmt




    def break_stmt(self):

        localctx = BKITParser.Break_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_break_stmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 236
            self.match(BKITParser.BREAK)
            self.state = 237
            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_stmtContext(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_stmt




    def continue_stmt(self):

        localctx = BKITParser.Continue_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_continue_stmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 239
            self.match(BKITParser.CONTINUE)
            self.state = 240
            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_stmtContext(ParserRuleContext):

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

        def func_call(self):
            return self.getTypedRuleContext(BKITParser.Func_callContext,0)


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

        def getRuleIndex(self):
            return BKITParser.RULE_call_stmt




    def call_stmt(self):

        localctx = BKITParser.Call_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_call_stmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 242
            self.func_call()
            self.state = 243
            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 Func_callContext(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 COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(BKITParser.COMMA)
            else:
                return self.getToken(BKITParser.COMMA, i)

        def getRuleIndex(self):
            return BKITParser.RULE_func_call




    def func_call(self):

        localctx = BKITParser.Func_callContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_func_call)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 245
            self.match(BKITParser.ID)
            self.state = 246
            self.match(BKITParser.LP)
            self.state = 255
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.ID) | (1 << BKITParser.INTLIT) | (1 << BKITParser.FLOATLIT) | (1 << BKITParser.BOOLEANLIT) | (1 << BKITParser.STRINGLIT) | (1 << BKITParser.INT_SUB_OP) | (1 << BKITParser.FLOAT_SUB_OP) | (1 << BKITParser.NEG_OP) | (1 << BKITParser.LP) | (1 << BKITParser.LCB))) != 0):
                self.state = 247
                self.expression()
                self.state = 252
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==BKITParser.COMMA:
                    self.state = 248
                    self.match(BKITParser.COMMA)
                    self.state = 249
                    self.expression()
                    self.state = 254
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 257
            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 Return_stmtContext(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_stmt




    def return_stmt(self):

        localctx = BKITParser.Return_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_return_stmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 259
            self.match(BKITParser.RETURN)
            self.state = 261
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.ID) | (1 << BKITParser.INTLIT) | (1 << BKITParser.FLOATLIT) | (1 << BKITParser.BOOLEANLIT) | (1 << BKITParser.STRINGLIT) | (1 << BKITParser.INT_SUB_OP) | (1 << BKITParser.FLOAT_SUB_OP) | (1 << BKITParser.NEG_OP) | (1 << BKITParser.LP) | (1 << BKITParser.LCB))) != 0):
                self.state = 260
                self.expression()


            self.state = 263
            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 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 EQ_OP(self):
            return self.getToken(BKITParser.EQ_OP, 0)

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

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

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

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

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

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

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

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

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

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

        def getRuleIndex(self):
            return BKITParser.RULE_expression




    def expression(self):

        localctx = BKITParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_expression)
        self._la = 0 # Token type
        try:
            self.state = 270
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 265
                self.exp1(0)
                self.state = 266
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.EQ_OP) | (1 << BKITParser.INT_NEQ_OP) | (1 << BKITParser.INT_LT_OP) | (1 << BKITParser.INT_GT_OP) | (1 << BKITParser.INT_LTE_OP) | (1 << BKITParser.INT_GTE_OP) | (1 << BKITParser.FLOAT_NEQ_OP) | (1 << BKITParser.FLOAT_LT_OP) | (1 << BKITParser.FLOAT_GT_OP) | (1 << BKITParser.FLOAT_LTE_OP) | (1 << BKITParser.FLOAT_GTE_OP))) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 267
                self.exp1(0)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 269
                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 CONJ_OP(self):
            return self.getToken(BKITParser.CONJ_OP, 0)

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

        def getRuleIndex(self):
            return BKITParser.RULE_exp1



    def exp1(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = BKITParser.Exp1Context(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 50
        self.enterRecursionRule(localctx, 50, self.RULE_exp1, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 273
            self.exp2(0)
            self._ctx.stop = self._input.LT(-1)
            self.state = 280
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,19,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 = 275
                    if not self.precpred(self._ctx, 2):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                    self.state = 276
                    _la = self._input.LA(1)
                    if not(_la==BKITParser.CONJ_OP or _la==BKITParser.DISJ_OP):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 277
                    self.exp2(0) 
                self.state = 282
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,19,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 INT_ADD_OP(self):
            return self.getToken(BKITParser.INT_ADD_OP, 0)

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

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

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

        def getRuleIndex(self):
            return BKITParser.RULE_exp2



    def exp2(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = BKITParser.Exp2Context(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 52
        self.enterRecursionRule(localctx, 52, self.RULE_exp2, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 284
            self.exp3(0)
            self._ctx.stop = self._input.LT(-1)
            self.state = 291
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,20,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = BKITParser.Exp2Context(self, _parentctx, _parentState)
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_exp2)
                    self.state = 286
                    if not self.precpred(self._ctx, 2):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                    self.state = 287
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.INT_SUB_OP) | (1 << BKITParser.FLOAT_SUB_OP) | (1 << BKITParser.INT_ADD_OP) | (1 << BKITParser.FLOAT_ADD_OP))) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 288
                    self.exp3(0) 
                self.state = 293
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,20,self._ctx)

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


    class 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 INT_MUL_OP(self):
            return self.getToken(BKITParser.INT_MUL_OP, 0)

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

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

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

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

        def getRuleIndex(self):
            return BKITParser.RULE_exp3



    def exp3(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = BKITParser.Exp3Context(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 54
        self.enterRecursionRule(localctx, 54, self.RULE_exp3, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 295
            self.exp4()
            self._ctx.stop = self._input.LT(-1)
            self.state = 302
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,21,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 = 297
                    if not self.precpred(self._ctx, 2):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                    self.state = 298
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.INT_MUL_OP) | (1 << BKITParser.FLOAT_MUL_OP) | (1 << BKITParser.INT_DIV_OP) | (1 << BKITParser.FLOAT_DIV_OP) | (1 << BKITParser.INT_REMAINDER_OP))) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 299
                    self.exp4() 
                self.state = 304
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,21,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 NEG_OP(self):
            return self.getToken(BKITParser.NEG_OP, 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 exp4(self):

        localctx = BKITParser.Exp4Context(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_exp4)
        try:
            self.state = 308
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [BKITParser.NEG_OP]:
                self.enterOuterAlt(localctx, 1)
                self.state = 305
                self.match(BKITParser.NEG_OP)
                self.state = 306
                self.exp4()
                pass
            elif token in [BKITParser.ID, BKITParser.INTLIT, BKITParser.FLOATLIT, BKITParser.BOOLEANLIT, BKITParser.STRINGLIT, BKITParser.INT_SUB_OP, BKITParser.FLOAT_SUB_OP, BKITParser.LP, BKITParser.LCB]:
                self.enterOuterAlt(localctx, 2)
                self.state = 307
                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 INT_SUB_OP(self):
            return self.getToken(BKITParser.INT_SUB_OP, 0)

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

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


        def getRuleIndex(self):
            return BKITParser.RULE_exp5




    def exp5(self):

        localctx = BKITParser.Exp5Context(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_exp5)
        self._la = 0 # Token type
        try:
            self.state = 313
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [BKITParser.INT_SUB_OP, BKITParser.FLOAT_SUB_OP]:
                self.enterOuterAlt(localctx, 1)
                self.state = 310
                _la = self._input.LA(1)
                if not(_la==BKITParser.INT_SUB_OP or _la==BKITParser.FLOAT_SUB_OP):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 311
                self.exp5()
                pass
            elif token in [BKITParser.ID, BKITParser.INTLIT, BKITParser.FLOATLIT, BKITParser.BOOLEANLIT, BKITParser.STRINGLIT, BKITParser.LP, BKITParser.LCB]:
                self.enterOuterAlt(localctx, 2)
                self.state = 312
                self.exp6()
                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 exp7(self):
            return self.getTypedRuleContext(BKITParser.Exp7Context,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 exp6(self):

        localctx = BKITParser.Exp6Context(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_exp6)
        try:
            self.state = 325
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,25,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 315
                self.exp7()
                self.state = 320 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 316
                        self.match(BKITParser.LSB)
                        self.state = 317
                        self.expression()
                        self.state = 318
                        self.match(BKITParser.RSB)

                    else:
                        raise NoViableAltException(self)
                    self.state = 322 
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,24,self._ctx)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 324
                self.exp7()
                pass


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


    class Exp7Context(ParserRuleContext):

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

        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 func_call(self):
            return self.getTypedRuleContext(BKITParser.Func_callContext,0)


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

        def literal(self):
            return self.getTypedRuleContext(BKITParser.LiteralContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_exp7




    def exp7(self):

        localctx = BKITParser.Exp7Context(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_exp7)
        try:
            self.state = 336
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,27,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 327
                self.match(BKITParser.LP)
                self.state = 328
                self.expression()
                self.state = 329
                self.match(BKITParser.RP)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 331
                self.func_call()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 334
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [BKITParser.ID]:
                    self.state = 332
                    self.match(BKITParser.ID)
                    pass
                elif token in [BKITParser.INTLIT, BKITParser.FLOATLIT, BKITParser.BOOLEANLIT, BKITParser.STRINGLIT, BKITParser.LCB]:
                    self.state = 333
                    self.literal()
                    pass
                else:
                    raise NoViableAltException(self)

                pass


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


    class ArraylitContext(ParserRuleContext):

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

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

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

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


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

        def getRuleIndex(self):
            return BKITParser.RULE_arraylit




    def arraylit(self):

        localctx = BKITParser.ArraylitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_arraylit)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 338
            self.match(BKITParser.LCB)
            self.state = 347
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BKITParser.INTLIT) | (1 << BKITParser.FLOATLIT) | (1 << BKITParser.BOOLEANLIT) | (1 << BKITParser.STRINGLIT) | (1 << BKITParser.LCB))) != 0):
                self.state = 339
                self.literal()
                self.state = 344
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==BKITParser.COMMA:
                    self.state = 340
                    self.match(BKITParser.COMMA)
                    self.state = 341
                    self.literal()
                    self.state = 346
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



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


    class 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 arraylit(self):
            return self.getTypedRuleContext(BKITParser.ArraylitContext,0)


        def getRuleIndex(self):
            return BKITParser.RULE_literal




    def literal(self):

        localctx = BKITParser.LiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_literal)
        try:
            self.state = 356
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [BKITParser.INTLIT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 351
                self.match(BKITParser.INTLIT)
                pass
            elif token in [BKITParser.FLOATLIT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 352
                self.match(BKITParser.FLOATLIT)
                pass
            elif token in [BKITParser.BOOLEANLIT]:
                self.enterOuterAlt(localctx, 3)
                self.state = 353
                self.match(BKITParser.BOOLEANLIT)
                pass
            elif token in [BKITParser.STRINGLIT]:
                self.enterOuterAlt(localctx, 4)
                self.state = 354
                self.match(BKITParser.STRINGLIT)
                pass
            elif token in [BKITParser.LCB]:
                self.enterOuterAlt(localctx, 5)
                self.state = 355
                self.arraylit()
                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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[25] = self.exp1_sempred
        self._predicates[26] = self.exp2_sempred
        self._predicates[27] = self.exp3_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)
         




