# Generated from main/bkit/parser/BKIT.g4 by ANTLR 4.8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys


from lexererr import *



def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\r")
        buf.write("m\b\1\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\3\2\3\2\3\3\3\3\3\4\3\4\3\4\7\4\'\n\4")
        buf.write("\f\4\16\4*\13\4\3\5\3\5\5\5.\n\5\3\5\6\5\61\n\5\r\5\16")
        buf.write("\5\62\3\6\6\6\66\n\6\r\6\16\6\67\3\6\3\6\3\6\6\6=\n\6")
        buf.write("\r\6\16\6>\3\6\3\6\6\6C\n\6\r\6\16\6D\3\6\5\6H\n\6\5\6")
        buf.write("J\n\6\3\7\3\7\3\7\3\7\7\7P\n\7\f\7\16\7S\13\7\3\7\3\7")
        buf.write("\3\b\3\b\3\t\3\t\3\n\3\n\3\n\3\n\3\13\6\13`\n\13\r\13")
        buf.write("\16\13a\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17")
        buf.write("\2\2\20\3\2\5\2\7\3\t\2\13\4\r\5\17\6\21\7\23\b\25\t\27")
        buf.write("\n\31\13\33\f\35\r\3\2\b\3\2\62;\3\2c|\4\2GGgg\4\2--/")
        buf.write("/\3\2))\5\2\13\f\17\17\"\"\2u\2\7\3\2\2\2\2\13\3\2\2\2")
        buf.write("\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2")
        buf.write("\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35")
        buf.write("\3\2\2\2\3\37\3\2\2\2\5!\3\2\2\2\7#\3\2\2\2\t+\3\2\2\2")
        buf.write("\13I\3\2\2\2\rK\3\2\2\2\17V\3\2\2\2\21X\3\2\2\2\23Z\3")
        buf.write("\2\2\2\25_\3\2\2\2\27e\3\2\2\2\31g\3\2\2\2\33i\3\2\2\2")
        buf.write("\35k\3\2\2\2\37 \t\2\2\2 \4\3\2\2\2!\"\t\3\2\2\"\6\3\2")
        buf.write("\2\2#(\5\5\3\2$\'\5\5\3\2%\'\5\3\2\2&$\3\2\2\2&%\3\2\2")
        buf.write("\2\'*\3\2\2\2(&\3\2\2\2()\3\2\2\2)\b\3\2\2\2*(\3\2\2\2")
        buf.write("+-\t\4\2\2,.\t\5\2\2-,\3\2\2\2-.\3\2\2\2.\60\3\2\2\2/")
        buf.write("\61\5\3\2\2\60/\3\2\2\2\61\62\3\2\2\2\62\60\3\2\2\2\62")
        buf.write("\63\3\2\2\2\63\n\3\2\2\2\64\66\5\3\2\2\65\64\3\2\2\2\66")
        buf.write("\67\3\2\2\2\67\65\3\2\2\2\678\3\2\2\289\3\2\2\29:\5\t")
        buf.write("\5\2:J\3\2\2\2;=\5\3\2\2<;\3\2\2\2=>\3\2\2\2><\3\2\2\2")
        buf.write(">?\3\2\2\2?@\3\2\2\2@B\7\60\2\2AC\5\3\2\2BA\3\2\2\2CD")
        buf.write("\3\2\2\2DB\3\2\2\2DE\3\2\2\2EG\3\2\2\2FH\5\t\5\2GF\3\2")
        buf.write("\2\2GH\3\2\2\2HJ\3\2\2\2I\65\3\2\2\2I<\3\2\2\2J\f\3\2")
        buf.write("\2\2KQ\7)\2\2LP\n\6\2\2MN\7)\2\2NP\7)\2\2OL\3\2\2\2OM")
        buf.write("\3\2\2\2PS\3\2\2\2QO\3\2\2\2QR\3\2\2\2RT\3\2\2\2SQ\3\2")
        buf.write("\2\2TU\7)\2\2U\16\3\2\2\2VW\7=\2\2W\20\3\2\2\2XY\7<\2")
        buf.write("\2Y\22\3\2\2\2Z[\7X\2\2[\\\7c\2\2\\]\7t\2\2]\24\3\2\2")
        buf.write("\2^`\t\7\2\2_^\3\2\2\2`a\3\2\2\2a_\3\2\2\2ab\3\2\2\2b")
        buf.write("c\3\2\2\2cd\b\13\2\2d\26\3\2\2\2ef\13\2\2\2f\30\3\2\2")
        buf.write("\2gh\13\2\2\2h\32\3\2\2\2ij\13\2\2\2j\34\3\2\2\2kl\13")
        buf.write("\2\2\2l\36\3\2\2\2\17\2&(-\62\67>DGIOQa\3\b\2\2")
        return buf.getvalue()


class BKITLexer(Lexer):

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

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

    ID = 1
    REAL = 2
    STRING = 3
    SEMI = 4
    COLON = 5
    VAR = 6
    WS = 7
    ERROR_CHAR = 8
    UNCLOSE_STRING = 9
    ILLEGAL_ESCAPE = 10
    UNTERMINATED_COMMENT = 11

    channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]

    modeNames = [ "DEFAULT_MODE" ]

    literalNames = [ "<INVALID>",
            "';'", "':'", "'Var'" ]

    symbolicNames = [ "<INVALID>",
            "ID", "REAL", "STRING", "SEMI", "COLON", "VAR", "WS", "ERROR_CHAR", 
            "UNCLOSE_STRING", "ILLEGAL_ESCAPE", "UNTERMINATED_COMMENT" ]

    ruleNames = [ "Num", "Letter", "ID", "Part", "REAL", "STRING", "SEMI", 
                  "COLON", "VAR", "WS", "ERROR_CHAR", "UNCLOSE_STRING", 
                  "ILLEGAL_ESCAPE", "UNTERMINATED_COMMENT" ]

    grammarFileName = "BKIT.g4"

    def __init__(self, input=None, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.8")
        self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
        self._actions = None
        self._predicates = None


    def emit(self):
        tk = self.type
        result = super().emit()
        if tk == self.UNCLOSE_STRING:       
            raise UncloseString(result.text)
        elif tk == self.ILLEGAL_ESCAPE:
            raise IllegalEscape(result.text)
        elif tk == self.ERROR_CHAR:
            raise ErrorToken(result.text)
        elif tk == self.UNTERMINATED_COMMENT:
            raise UnterminatedComment()
        else:
            return result;


