# Generated from DSLSQL.g4 by ANTLR 4.7.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing import TextIO
import sys

def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\63")
        buf.write("\u012e\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\3\2\3\2\3\2\7\2\60\n\2")
        buf.write("\f\2\16\2\63\13\2\3\3\3\3\3\3\3\3\3\3\5\3:\n\3\3\3\5\3")
        buf.write("=\n\3\3\3\7\3@\n\3\f\3\16\3C\13\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\7\3M\n\3\f\3\16\3P\13\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\5\3X\n\3\3\3\5\3[\n\3\3\3\7\3^\n\3\f\3\16\3a\13")
        buf.write("\3\3\3\3\3\5\3e\n\3\3\3\3\3\7\3i\n\3\f\3\16\3l\13\3\3")
        buf.write("\3\3\3\3\3\3\3\7\3r\n\3\f\3\16\3u\13\3\3\3\3\3\7\3y\n")
        buf.write("\3\f\3\16\3|\13\3\3\3\3\3\7\3\u0080\n\3\f\3\16\3\u0083")
        buf.write("\13\3\3\3\3\3\7\3\u0087\n\3\f\3\16\3\u008a\13\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\5\3\u0091\n\3\3\3\5\3\u0094\n\3\3\3\7\3")
        buf.write("\u0097\n\3\f\3\16\3\u009a\13\3\3\3\3\3\3\3\5\3\u009f\n")
        buf.write("\3\3\3\5\3\u00a2\n\3\3\3\7\3\u00a5\n\3\f\3\16\3\u00a8")
        buf.write("\13\3\3\3\3\3\5\3\u00ac\n\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\5\3\u00b5\n\3\3\3\5\3\u00b8\n\3\3\3\7\3\u00bb\n\3\f")
        buf.write("\3\16\3\u00be\13\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3\u00c7")
        buf.write("\n\3\3\3\5\3\u00ca\n\3\3\3\7\3\u00cd\n\3\f\3\16\3\u00d0")
        buf.write("\13\3\3\3\3\3\3\3\3\3\3\3\5\3\u00d7\n\3\3\3\5\3\u00da")
        buf.write("\n\3\3\3\7\3\u00dd\n\3\f\3\16\3\u00e0\13\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\5\3\u00e7\n\3\3\3\5\3\u00ea\n\3\3\3\7\3\u00ed")
        buf.write("\n\3\f\3\16\3\u00f0\13\3\3\3\5\3\u00f3\n\3\3\4\3\4\3\5")
        buf.write("\3\5\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\n\3")
        buf.write("\n\3\13\3\13\3\f\3\f\5\f\u010a\n\f\3\r\3\r\3\r\3\r\5\r")
        buf.write("\u0110\n\r\3\16\3\16\3\17\3\17\5\17\u0116\n\17\3\20\3")
        buf.write("\20\3\21\3\21\3\22\3\22\3\23\3\23\3\23\7\23\u0121\n\23")
        buf.write("\f\23\16\23\u0124\13\23\3\24\3\24\3\25\3\25\5\25\u012a")
        buf.write("\n\25\3\26\3\26\3\26\2\2\27\2\4\6\b\n\f\16\20\22\24\26")
        buf.write("\30\32\34\36 \"$&(*\2\21\3\2\3\4\3\2\6\7\3\2\t\n\3\2\f")
        buf.write("\r\3\2\16\16\3\2\17\20\3\2\21\22\3\2\23\24\3\2\25\26\3")
        buf.write("\2\27\30\3\2\32\33\3\2\34\37\3\2 !\3\2\"#\3\2$%\2\u0150")
        buf.write("\2\61\3\2\2\2\4\u00f2\3\2\2\2\6\u00f4\3\2\2\2\b\u00f6")
        buf.write("\3\2\2\2\n\u00f8\3\2\2\2\f\u00fa\3\2\2\2\16\u00fc\3\2")
        buf.write("\2\2\20\u00ff\3\2\2\2\22\u0103\3\2\2\2\24\u0105\3\2\2")
        buf.write("\2\26\u0109\3\2\2\2\30\u010f\3\2\2\2\32\u0111\3\2\2\2")
        buf.write("\34\u0115\3\2\2\2\36\u0117\3\2\2\2 \u0119\3\2\2\2\"\u011b")
        buf.write("\3\2\2\2$\u011d\3\2\2\2&\u0125\3\2\2\2(\u0129\3\2\2\2")
        buf.write("*\u012b\3\2\2\2,-\5\4\3\2-.\5\22\n\2.\60\3\2\2\2/,\3\2")
        buf.write("\2\2\60\63\3\2\2\2\61/\3\2\2\2\61\62\3\2\2\2\62\3\3\2")
        buf.write("\2\2\63\61\3\2\2\2\64\65\t\2\2\2\65\66\5\24\13\2\66\67")
        buf.write("\7\5\2\2\679\5\26\f\28:\t\3\2\298\3\2\2\29:\3\2\2\2:<")
        buf.write("\3\2\2\2;=\5\20\t\2<;\3\2\2\2<=\3\2\2\2=A\3\2\2\2>@\5")
        buf.write("\16\b\2?>\3\2\2\2@C\3\2\2\2A?\3\2\2\2AB\3\2\2\2BD\3\2")
        buf.write("\2\2CA\3\2\2\2DE\7\b\2\2EF\5\36\20\2F\u00f3\3\2\2\2GN")
        buf.write("\t\4\2\2HM\5\6\4\2IM\5\b\5\2JM\5\n\6\2KM\5\f\7\2LH\3\2")
        buf.write("\2\2LI\3\2\2\2LJ\3\2\2\2LK\3\2\2\2MP\3\2\2\2NL\3\2\2\2")
        buf.write("NO\3\2\2\2OQ\3\2\2\2PN\3\2\2\2QR\5\36\20\2RS\7\b\2\2S")
        buf.write("T\5\24\13\2TU\7\5\2\2UW\5\26\f\2VX\t\3\2\2WV\3\2\2\2W")
        buf.write("X\3\2\2\2XZ\3\2\2\2Y[\5\20\t\2ZY\3\2\2\2Z[\3\2\2\2[_\3")
        buf.write("\2\2\2\\^\5\16\b\2]\\\3\2\2\2^a\3\2\2\2_]\3\2\2\2_`\3")
        buf.write("\2\2\2`d\3\2\2\2a_\3\2\2\2bc\7\13\2\2ce\5\"\22\2db\3\2")
        buf.write("\2\2de\3\2\2\2e\u00f3\3\2\2\2fj\t\5\2\2gi\n\6\2\2hg\3")
        buf.write("\2\2\2il\3\2\2\2jh\3\2\2\2jk\3\2\2\2km\3\2\2\2lj\3\2\2")
        buf.write("\2mn\7\b\2\2n\u00f3\5\36\20\2os\t\7\2\2pr\n\6\2\2qp\3")
        buf.write("\2\2\2ru\3\2\2\2sq\3\2\2\2st\3\2\2\2t\u00f3\3\2\2\2us")
        buf.write("\3\2\2\2vz\t\b\2\2wy\n\6\2\2xw\3\2\2\2y|\3\2\2\2zx\3\2")
        buf.write("\2\2z{\3\2\2\2{\u00f3\3\2\2\2|z\3\2\2\2}\u0081\t\t\2\2")
        buf.write("~\u0080\n\6\2\2\177~\3\2\2\2\u0080\u0083\3\2\2\2\u0081")
        buf.write("\177\3\2\2\2\u0081\u0082\3\2\2\2\u0082\u00f3\3\2\2\2\u0083")
        buf.write("\u0081\3\2\2\2\u0084\u0088\t\n\2\2\u0085\u0087\n\6\2\2")
        buf.write("\u0086\u0085\3\2\2\2\u0087\u008a\3\2\2\2\u0088\u0086\3")
        buf.write("\2\2\2\u0088\u0089\3\2\2\2\u0089\u00f3\3\2\2\2\u008a\u0088")
        buf.write("\3\2\2\2\u008b\u008c\t\13\2\2\u008c\u008d\5\32\16\2\u008d")
        buf.write("\u008e\7\31\2\2\u008e\u0090\5\30\r\2\u008f\u0091\t\3\2")
        buf.write("\2\u0090\u008f\3\2\2\2\u0090\u0091\3\2\2\2\u0091\u0093")
        buf.write("\3\2\2\2\u0092\u0094\5\20\t\2\u0093\u0092\3\2\2\2\u0093")
        buf.write("\u0094\3\2\2\2\u0094\u0098\3\2\2\2\u0095\u0097\5\16\b")
        buf.write("\2\u0096\u0095\3\2\2\2\u0097\u009a\3\2\2\2\u0098\u0096")
        buf.write("\3\2\2\2\u0098\u0099\3\2\2\2\u0099\u00f3\3\2\2\2\u009a")
        buf.write("\u0098\3\2\2\2\u009b\u009c\t\f\2\2\u009c\u009e\5\24\13")
        buf.write("\2\u009d\u009f\t\3\2\2\u009e\u009d\3\2\2\2\u009e\u009f")
        buf.write("\3\2\2\2\u009f\u00a1\3\2\2\2\u00a0\u00a2\5\20\t\2\u00a1")
        buf.write("\u00a0\3\2\2\2\u00a1\u00a2\3\2\2\2\u00a2\u00a6\3\2\2\2")
        buf.write("\u00a3\u00a5\5\16\b\2\u00a4\u00a3\3\2\2\2\u00a5\u00a8")
        buf.write("\3\2\2\2\u00a6\u00a4\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7")
        buf.write("\u00ab\3\2\2\2\u00a8\u00a6\3\2\2\2\u00a9\u00aa\7\b\2\2")
        buf.write("\u00aa\u00ac\5\34\17\2\u00ab\u00a9\3\2\2\2\u00ab\u00ac")
        buf.write("\3\2\2\2\u00ac\u00f3\3\2\2\2\u00ad\u00ae\t\r\2\2\u00ae")
        buf.write("\u00af\5\36\20\2\u00af\u00b0\7\b\2\2\u00b0\u00b1\5\24")
        buf.write("\13\2\u00b1\u00b2\7\5\2\2\u00b2\u00b4\5\26\f\2\u00b3\u00b5")
        buf.write("\t\3\2\2\u00b4\u00b3\3\2\2\2\u00b4\u00b5\3\2\2\2\u00b5")
        buf.write("\u00b7\3\2\2\2\u00b6\u00b8\5\20\t\2\u00b7\u00b6\3\2\2")
        buf.write("\2\u00b7\u00b8\3\2\2\2\u00b8\u00bc\3\2\2\2\u00b9\u00bb")
        buf.write("\5\16\b\2\u00ba\u00b9\3\2\2\2\u00bb\u00be\3\2\2\2\u00bc")
        buf.write("\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00f3\3\2\2\2")
        buf.write("\u00be\u00bc\3\2\2\2\u00bf\u00c0\t\16\2\2\u00c0\u00c1")
        buf.write("\5\24\13\2\u00c1\u00c2\7\5\2\2\u00c2\u00c3\5\26\f\2\u00c3")
        buf.write("\u00c4\7\b\2\2\u00c4\u00c6\5 \21\2\u00c5\u00c7\t\3\2\2")
        buf.write("\u00c6\u00c5\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7\u00c9\3")
        buf.write("\2\2\2\u00c8\u00ca\5\20\t\2\u00c9\u00c8\3\2\2\2\u00c9")
        buf.write("\u00ca\3\2\2\2\u00ca\u00ce\3\2\2\2\u00cb\u00cd\5\16\b")
        buf.write("\2\u00cc\u00cb\3\2\2\2\u00cd\u00d0\3\2\2\2\u00ce\u00cc")
        buf.write("\3\2\2\2\u00ce\u00cf\3\2\2\2\u00cf\u00f3\3\2\2\2\u00d0")
        buf.write("\u00ce\3\2\2\2\u00d1\u00d2\t\17\2\2\u00d2\u00d3\5\24\13")
        buf.write("\2\u00d3\u00d4\7\5\2\2\u00d4\u00d6\5\26\f\2\u00d5\u00d7")
        buf.write("\t\3\2\2\u00d6\u00d5\3\2\2\2\u00d6\u00d7\3\2\2\2\u00d7")
        buf.write("\u00d9\3\2\2\2\u00d8\u00da\5\20\t\2\u00d9\u00d8\3\2\2")
        buf.write("\2\u00d9\u00da\3\2\2\2\u00da\u00de\3\2\2\2\u00db\u00dd")
        buf.write("\5\16\b\2\u00dc\u00db\3\2\2\2\u00dd\u00e0\3\2\2\2\u00de")
        buf.write("\u00dc\3\2\2\2\u00de\u00df\3\2\2\2\u00df\u00f3\3\2\2\2")
        buf.write("\u00e0\u00de\3\2\2\2\u00e1\u00e2\t\20\2\2\u00e2\u00e3")
        buf.write("\5\24\13\2\u00e3\u00e4\7\5\2\2\u00e4\u00e6\5\26\f\2\u00e5")
        buf.write("\u00e7\t\3\2\2\u00e6\u00e5\3\2\2\2\u00e6\u00e7\3\2\2\2")
        buf.write("\u00e7\u00e9\3\2\2\2\u00e8\u00ea\5\20\t\2\u00e9\u00e8")
        buf.write("\3\2\2\2\u00e9\u00ea\3\2\2\2\u00ea\u00ee\3\2\2\2\u00eb")
        buf.write("\u00ed\5\16\b\2\u00ec\u00eb\3\2\2\2\u00ed\u00f0\3\2\2")
        buf.write("\2\u00ee\u00ec\3\2\2\2\u00ee\u00ef\3\2\2\2\u00ef\u00f3")
        buf.write("\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f1\u00f3\7/\2\2\u00f2")
        buf.write("\64\3\2\2\2\u00f2G\3\2\2\2\u00f2f\3\2\2\2\u00f2o\3\2\2")
        buf.write("\2\u00f2v\3\2\2\2\u00f2}\3\2\2\2\u00f2\u0084\3\2\2\2\u00f2")
        buf.write("\u008b\3\2\2\2\u00f2\u009b\3\2\2\2\u00f2\u00ad\3\2\2\2")
        buf.write("\u00f2\u00bf\3\2\2\2\u00f2\u00d1\3\2\2\2\u00f2\u00e1\3")
        buf.write("\2\2\2\u00f2\u00f1\3\2\2\2\u00f3\5\3\2\2\2\u00f4\u00f5")
        buf.write("\7&\2\2\u00f5\7\3\2\2\2\u00f6\u00f7\7\'\2\2\u00f7\t\3")
        buf.write("\2\2\2\u00f8\u00f9\7(\2\2\u00f9\13\3\2\2\2\u00fa\u00fb")
        buf.write("\7)\2\2\u00fb\r\3\2\2\2\u00fc\u00fd\7*\2\2\u00fd\u00fe")
        buf.write("\5\20\t\2\u00fe\17\3\2\2\2\u00ff\u0100\5&\24\2\u0100\u0101")
        buf.write("\7\31\2\2\u0101\u0102\7+\2\2\u0102\21\3\2\2\2\u0103\u0104")
        buf.write("\7\16\2\2\u0104\23\3\2\2\2\u0105\u0106\5&\24\2\u0106\25")
        buf.write("\3\2\2\2\u0107\u010a\5*\26\2\u0108\u010a\5&\24\2\u0109")
        buf.write("\u0107\3\2\2\2\u0109\u0108\3\2\2\2\u010a\27\3\2\2\2\u010b")
        buf.write("\u0110\5$\23\2\u010c\u0110\5*\26\2\u010d\u0110\7+\2\2")
        buf.write("\u010e\u0110\7,\2\2\u010f\u010b\3\2\2\2\u010f\u010c\3")
        buf.write("\2\2\2\u010f\u010d\3\2\2\2\u010f\u010e\3\2\2\2\u0110\31")
        buf.write("\3\2\2\2\u0111\u0112\5$\23\2\u0112\33\3\2\2\2\u0113\u0116")
        buf.write("\5$\23\2\u0114\u0116\5&\24\2\u0115\u0113\3\2\2\2\u0115")
        buf.write("\u0114\3\2\2\2\u0116\35\3\2\2\2\u0117\u0118\5&\24\2\u0118")
        buf.write("\37\3\2\2\2\u0119\u011a\5&\24\2\u011a!\3\2\2\2\u011b\u011c")
        buf.write("\5&\24\2\u011c#\3\2\2\2\u011d\u0122\5&\24\2\u011e\u011f")
        buf.write("\7\5\2\2\u011f\u0121\5&\24\2\u0120\u011e\3\2\2\2\u0121")
        buf.write("\u0124\3\2\2\2\u0122\u0120\3\2\2\2\u0122\u0123\3\2\2\2")
        buf.write("\u0123%\3\2\2\2\u0124\u0122\3\2\2\2\u0125\u0126\5(\25")
        buf.write("\2\u0126\'\3\2\2\2\u0127\u012a\7-\2\2\u0128\u012a\5*\26")
        buf.write("\2\u0129\u0127\3\2\2\2\u0129\u0128\3\2\2\2\u012a)\3\2")
        buf.write("\2\2\u012b\u012c\7.\2\2\u012c+\3\2\2\2*\619<ALNWZ_djs")
        buf.write("z\u0081\u0088\u0090\u0093\u0098\u009e\u00a1\u00a6\u00ab")
        buf.write("\u00b4\u00b7\u00bc\u00c6\u00c9\u00ce\u00d6\u00d9\u00de")
        buf.write("\u00e6\u00e9\u00ee\u00f2\u0109\u010f\u0115\u0122\u0129")
        return buf.getvalue()


class DSLSQLParser ( Parser ):

    grammarFileName = "DSLSQL.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'load'", "'LOAD'", "'.'", "'options'",
                     "'where'", "'as'", "'save'", "'SAVE'", "'partitionBy'",
                     "'select'", "'SELECT'", "';'", "'insert'", "'INSERT'",
                     "'create'", "'CREATE'", "'drop'", "'DROP'", "'refresh'",
                     "'REFRESH'", "'set'", "'SET'", "'='", "'connect'",
                     "'CONNECT'", "'train'", "'TRAIN'", "'run'", "'RUN'",
                     "'register'", "'REGISTER'", "'unRegister'", "'UNREGISTER'",
                     "'include'", "'INCLUDE'", "'overwrite'", "'append'",
                     "'errorIfExists'", "'ignore'", "'and'", "<INVALID>",
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                     "'/**/'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
                      "<INVALID>", "STRING", "BLOCK_STRING", "IDENTIFIER",
                      "BACKQUOTED_IDENTIFIER", "SIMPLE_COMMENT", "BRACKETED_EMPTY_COMMENT",
                      "BRACKETED_COMMENT", "WS", "UNRECOGNIZED" ]

    RULE_statement = 0
    RULE_sql = 1
    RULE_overwrite = 2
    RULE_append = 3
    RULE_errorIfExists = 4
    RULE_ignore = 5
    RULE_booleanExpression = 6
    RULE_expression = 7
    RULE_ender = 8
    RULE_format_type = 9
    RULE_path = 10
    RULE_setValue = 11
    RULE_setKey = 12
    RULE_db = 13
    RULE_tableName = 14
    RULE_functionName = 15
    RULE_col = 16
    RULE_qualifiedName = 17
    RULE_identifier = 18
    RULE_strictIdentifier = 19
    RULE_quotedIdentifier = 20

    ruleNames =  [ "statement", "sql", "overwrite", "append", "errorIfExists",
                   "ignore", "booleanExpression", "expression", "ender",
                   "format_type", "path", "setValue", "setKey", "db", "tableName",
                   "functionName", "col", "qualifiedName", "identifier",
                   "strictIdentifier", "quotedIdentifier" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    T__10=11
    T__11=12
    T__12=13
    T__13=14
    T__14=15
    T__15=16
    T__16=17
    T__17=18
    T__18=19
    T__19=20
    T__20=21
    T__21=22
    T__22=23
    T__23=24
    T__24=25
    T__25=26
    T__26=27
    T__27=28
    T__28=29
    T__29=30
    T__30=31
    T__31=32
    T__32=33
    T__33=34
    T__34=35
    T__35=36
    T__36=37
    T__37=38
    T__38=39
    T__39=40
    STRING=41
    BLOCK_STRING=42
    IDENTIFIER=43
    BACKQUOTED_IDENTIFIER=44
    SIMPLE_COMMENT=45
    BRACKETED_EMPTY_COMMENT=46
    BRACKETED_COMMENT=47
    WS=48
    UNRECOGNIZED=49

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



    class StatementContext(ParserRuleContext):

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

        def sql(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DSLSQLParser.SqlContext)
            else:
                return self.getTypedRuleContext(DSLSQLParser.SqlContext,i)


        def ender(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DSLSQLParser.EnderContext)
            else:
                return self.getTypedRuleContext(DSLSQLParser.EnderContext,i)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_statement

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

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

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




    def statement(self):

        localctx = DSLSQLParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 47
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DSLSQLParser.T__0) | (1 << DSLSQLParser.T__1) | (1 << DSLSQLParser.T__6) | (1 << DSLSQLParser.T__7) | (1 << DSLSQLParser.T__9) | (1 << DSLSQLParser.T__10) | (1 << DSLSQLParser.T__12) | (1 << DSLSQLParser.T__13) | (1 << DSLSQLParser.T__14) | (1 << DSLSQLParser.T__15) | (1 << DSLSQLParser.T__16) | (1 << DSLSQLParser.T__17) | (1 << DSLSQLParser.T__18) | (1 << DSLSQLParser.T__19) | (1 << DSLSQLParser.T__20) | (1 << DSLSQLParser.T__21) | (1 << DSLSQLParser.T__23) | (1 << DSLSQLParser.T__24) | (1 << DSLSQLParser.T__25) | (1 << DSLSQLParser.T__26) | (1 << DSLSQLParser.T__27) | (1 << DSLSQLParser.T__28) | (1 << DSLSQLParser.T__29) | (1 << DSLSQLParser.T__30) | (1 << DSLSQLParser.T__31) | (1 << DSLSQLParser.T__32) | (1 << DSLSQLParser.T__33) | (1 << DSLSQLParser.T__34) | (1 << DSLSQLParser.SIMPLE_COMMENT))) != 0):
                self.state = 42
                self.sql()
                self.state = 43
                self.ender()
                self.state = 49
                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 SqlContext(ParserRuleContext):

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

        def format_type(self):
            return self.getTypedRuleContext(DSLSQLParser.Format_typeContext,0)


        def path(self):
            return self.getTypedRuleContext(DSLSQLParser.PathContext,0)


        def tableName(self):
            return self.getTypedRuleContext(DSLSQLParser.TableNameContext,0)


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


        def booleanExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DSLSQLParser.BooleanExpressionContext)
            else:
                return self.getTypedRuleContext(DSLSQLParser.BooleanExpressionContext,i)


        def overwrite(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DSLSQLParser.OverwriteContext)
            else:
                return self.getTypedRuleContext(DSLSQLParser.OverwriteContext,i)


        def append(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DSLSQLParser.AppendContext)
            else:
                return self.getTypedRuleContext(DSLSQLParser.AppendContext,i)


        def errorIfExists(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DSLSQLParser.ErrorIfExistsContext)
            else:
                return self.getTypedRuleContext(DSLSQLParser.ErrorIfExistsContext,i)


        def ignore(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DSLSQLParser.IgnoreContext)
            else:
                return self.getTypedRuleContext(DSLSQLParser.IgnoreContext,i)


        def col(self):
            return self.getTypedRuleContext(DSLSQLParser.ColContext,0)


        def setKey(self):
            return self.getTypedRuleContext(DSLSQLParser.SetKeyContext,0)


        def setValue(self):
            return self.getTypedRuleContext(DSLSQLParser.SetValueContext,0)


        def db(self):
            return self.getTypedRuleContext(DSLSQLParser.DbContext,0)


        def functionName(self):
            return self.getTypedRuleContext(DSLSQLParser.FunctionNameContext,0)


        def SIMPLE_COMMENT(self):
            return self.getToken(DSLSQLParser.SIMPLE_COMMENT, 0)

        def getRuleIndex(self):
            return DSLSQLParser.RULE_sql

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

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

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




    def sql(self):

        localctx = DSLSQLParser.SqlContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_sql)
        self._la = 0 # Token type
        try:
            self.state = 240
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DSLSQLParser.T__0, DSLSQLParser.T__1]:
                self.enterOuterAlt(localctx, 1)
                self.state = 50
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__0 or _la==DSLSQLParser.T__1):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 51
                self.format_type()
                self.state = 52
                self.match(DSLSQLParser.T__2)
                self.state = 53
                self.path()
                self.state = 55
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4:
                    self.state = 54
                    _la = self._input.LA(1)
                    if not(_la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 58
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.IDENTIFIER or _la==DSLSQLParser.BACKQUOTED_IDENTIFIER:
                    self.state = 57
                    self.expression()


                self.state = 63
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==DSLSQLParser.T__39:
                    self.state = 60
                    self.booleanExpression()
                    self.state = 65
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 66
                self.match(DSLSQLParser.T__5)
                self.state = 67
                self.tableName()
                pass
            elif token in [DSLSQLParser.T__6, DSLSQLParser.T__7]:
                self.enterOuterAlt(localctx, 2)
                self.state = 69
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__6 or _la==DSLSQLParser.T__7):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 76
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DSLSQLParser.T__35) | (1 << DSLSQLParser.T__36) | (1 << DSLSQLParser.T__37) | (1 << DSLSQLParser.T__38))) != 0):
                    self.state = 74
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [DSLSQLParser.T__35]:
                        self.state = 70
                        self.overwrite()
                        pass
                    elif token in [DSLSQLParser.T__36]:
                        self.state = 71
                        self.append()
                        pass
                    elif token in [DSLSQLParser.T__37]:
                        self.state = 72
                        self.errorIfExists()
                        pass
                    elif token in [DSLSQLParser.T__38]:
                        self.state = 73
                        self.ignore()
                        pass
                    else:
                        raise NoViableAltException(self)

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

                self.state = 79
                self.tableName()
                self.state = 80
                self.match(DSLSQLParser.T__5)
                self.state = 81
                self.format_type()
                self.state = 82
                self.match(DSLSQLParser.T__2)
                self.state = 83
                self.path()
                self.state = 85
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4:
                    self.state = 84
                    _la = self._input.LA(1)
                    if not(_la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 88
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.IDENTIFIER or _la==DSLSQLParser.BACKQUOTED_IDENTIFIER:
                    self.state = 87
                    self.expression()


                self.state = 93
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==DSLSQLParser.T__39:
                    self.state = 90
                    self.booleanExpression()
                    self.state = 95
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 98
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__8:
                    self.state = 96
                    self.match(DSLSQLParser.T__8)
                    self.state = 97
                    self.col()


                pass
            elif token in [DSLSQLParser.T__9, DSLSQLParser.T__10]:
                self.enterOuterAlt(localctx, 3)
                self.state = 100
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__9 or _la==DSLSQLParser.T__10):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 104
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,10,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 101
                        _la = self._input.LA(1)
                        if _la <= 0 or _la==DSLSQLParser.T__11:
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                    self.state = 106
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,10,self._ctx)

                self.state = 107
                self.match(DSLSQLParser.T__5)
                self.state = 108
                self.tableName()
                pass
            elif token in [DSLSQLParser.T__12, DSLSQLParser.T__13]:
                self.enterOuterAlt(localctx, 4)
                self.state = 109
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__12 or _la==DSLSQLParser.T__13):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 113
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DSLSQLParser.T__0) | (1 << DSLSQLParser.T__1) | (1 << DSLSQLParser.T__2) | (1 << DSLSQLParser.T__3) | (1 << DSLSQLParser.T__4) | (1 << DSLSQLParser.T__5) | (1 << DSLSQLParser.T__6) | (1 << DSLSQLParser.T__7) | (1 << DSLSQLParser.T__8) | (1 << DSLSQLParser.T__9) | (1 << DSLSQLParser.T__10) | (1 << DSLSQLParser.T__12) | (1 << DSLSQLParser.T__13) | (1 << DSLSQLParser.T__14) | (1 << DSLSQLParser.T__15) | (1 << DSLSQLParser.T__16) | (1 << DSLSQLParser.T__17) | (1 << DSLSQLParser.T__18) | (1 << DSLSQLParser.T__19) | (1 << DSLSQLParser.T__20) | (1 << DSLSQLParser.T__21) | (1 << DSLSQLParser.T__22) | (1 << DSLSQLParser.T__23) | (1 << DSLSQLParser.T__24) | (1 << DSLSQLParser.T__25) | (1 << DSLSQLParser.T__26) | (1 << DSLSQLParser.T__27) | (1 << DSLSQLParser.T__28) | (1 << DSLSQLParser.T__29) | (1 << DSLSQLParser.T__30) | (1 << DSLSQLParser.T__31) | (1 << DSLSQLParser.T__32) | (1 << DSLSQLParser.T__33) | (1 << DSLSQLParser.T__34) | (1 << DSLSQLParser.T__35) | (1 << DSLSQLParser.T__36) | (1 << DSLSQLParser.T__37) | (1 << DSLSQLParser.T__38) | (1 << DSLSQLParser.T__39) | (1 << DSLSQLParser.STRING) | (1 << DSLSQLParser.BLOCK_STRING) | (1 << DSLSQLParser.IDENTIFIER) | (1 << DSLSQLParser.BACKQUOTED_IDENTIFIER) | (1 << DSLSQLParser.SIMPLE_COMMENT) | (1 << DSLSQLParser.BRACKETED_EMPTY_COMMENT) | (1 << DSLSQLParser.BRACKETED_COMMENT) | (1 << DSLSQLParser.WS) | (1 << DSLSQLParser.UNRECOGNIZED))) != 0):
                    self.state = 110
                    _la = self._input.LA(1)
                    if _la <= 0 or _la==DSLSQLParser.T__11:
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 115
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.T__14, DSLSQLParser.T__15]:
                self.enterOuterAlt(localctx, 5)
                self.state = 116
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__14 or _la==DSLSQLParser.T__15):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 120
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DSLSQLParser.T__0) | (1 << DSLSQLParser.T__1) | (1 << DSLSQLParser.T__2) | (1 << DSLSQLParser.T__3) | (1 << DSLSQLParser.T__4) | (1 << DSLSQLParser.T__5) | (1 << DSLSQLParser.T__6) | (1 << DSLSQLParser.T__7) | (1 << DSLSQLParser.T__8) | (1 << DSLSQLParser.T__9) | (1 << DSLSQLParser.T__10) | (1 << DSLSQLParser.T__12) | (1 << DSLSQLParser.T__13) | (1 << DSLSQLParser.T__14) | (1 << DSLSQLParser.T__15) | (1 << DSLSQLParser.T__16) | (1 << DSLSQLParser.T__17) | (1 << DSLSQLParser.T__18) | (1 << DSLSQLParser.T__19) | (1 << DSLSQLParser.T__20) | (1 << DSLSQLParser.T__21) | (1 << DSLSQLParser.T__22) | (1 << DSLSQLParser.T__23) | (1 << DSLSQLParser.T__24) | (1 << DSLSQLParser.T__25) | (1 << DSLSQLParser.T__26) | (1 << DSLSQLParser.T__27) | (1 << DSLSQLParser.T__28) | (1 << DSLSQLParser.T__29) | (1 << DSLSQLParser.T__30) | (1 << DSLSQLParser.T__31) | (1 << DSLSQLParser.T__32) | (1 << DSLSQLParser.T__33) | (1 << DSLSQLParser.T__34) | (1 << DSLSQLParser.T__35) | (1 << DSLSQLParser.T__36) | (1 << DSLSQLParser.T__37) | (1 << DSLSQLParser.T__38) | (1 << DSLSQLParser.T__39) | (1 << DSLSQLParser.STRING) | (1 << DSLSQLParser.BLOCK_STRING) | (1 << DSLSQLParser.IDENTIFIER) | (1 << DSLSQLParser.BACKQUOTED_IDENTIFIER) | (1 << DSLSQLParser.SIMPLE_COMMENT) | (1 << DSLSQLParser.BRACKETED_EMPTY_COMMENT) | (1 << DSLSQLParser.BRACKETED_COMMENT) | (1 << DSLSQLParser.WS) | (1 << DSLSQLParser.UNRECOGNIZED))) != 0):
                    self.state = 117
                    _la = self._input.LA(1)
                    if _la <= 0 or _la==DSLSQLParser.T__11:
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 122
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.T__16, DSLSQLParser.T__17]:
                self.enterOuterAlt(localctx, 6)
                self.state = 123
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__16 or _la==DSLSQLParser.T__17):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 127
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DSLSQLParser.T__0) | (1 << DSLSQLParser.T__1) | (1 << DSLSQLParser.T__2) | (1 << DSLSQLParser.T__3) | (1 << DSLSQLParser.T__4) | (1 << DSLSQLParser.T__5) | (1 << DSLSQLParser.T__6) | (1 << DSLSQLParser.T__7) | (1 << DSLSQLParser.T__8) | (1 << DSLSQLParser.T__9) | (1 << DSLSQLParser.T__10) | (1 << DSLSQLParser.T__12) | (1 << DSLSQLParser.T__13) | (1 << DSLSQLParser.T__14) | (1 << DSLSQLParser.T__15) | (1 << DSLSQLParser.T__16) | (1 << DSLSQLParser.T__17) | (1 << DSLSQLParser.T__18) | (1 << DSLSQLParser.T__19) | (1 << DSLSQLParser.T__20) | (1 << DSLSQLParser.T__21) | (1 << DSLSQLParser.T__22) | (1 << DSLSQLParser.T__23) | (1 << DSLSQLParser.T__24) | (1 << DSLSQLParser.T__25) | (1 << DSLSQLParser.T__26) | (1 << DSLSQLParser.T__27) | (1 << DSLSQLParser.T__28) | (1 << DSLSQLParser.T__29) | (1 << DSLSQLParser.T__30) | (1 << DSLSQLParser.T__31) | (1 << DSLSQLParser.T__32) | (1 << DSLSQLParser.T__33) | (1 << DSLSQLParser.T__34) | (1 << DSLSQLParser.T__35) | (1 << DSLSQLParser.T__36) | (1 << DSLSQLParser.T__37) | (1 << DSLSQLParser.T__38) | (1 << DSLSQLParser.T__39) | (1 << DSLSQLParser.STRING) | (1 << DSLSQLParser.BLOCK_STRING) | (1 << DSLSQLParser.IDENTIFIER) | (1 << DSLSQLParser.BACKQUOTED_IDENTIFIER) | (1 << DSLSQLParser.SIMPLE_COMMENT) | (1 << DSLSQLParser.BRACKETED_EMPTY_COMMENT) | (1 << DSLSQLParser.BRACKETED_COMMENT) | (1 << DSLSQLParser.WS) | (1 << DSLSQLParser.UNRECOGNIZED))) != 0):
                    self.state = 124
                    _la = self._input.LA(1)
                    if _la <= 0 or _la==DSLSQLParser.T__11:
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 129
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.T__18, DSLSQLParser.T__19]:
                self.enterOuterAlt(localctx, 7)
                self.state = 130
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__18 or _la==DSLSQLParser.T__19):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 134
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DSLSQLParser.T__0) | (1 << DSLSQLParser.T__1) | (1 << DSLSQLParser.T__2) | (1 << DSLSQLParser.T__3) | (1 << DSLSQLParser.T__4) | (1 << DSLSQLParser.T__5) | (1 << DSLSQLParser.T__6) | (1 << DSLSQLParser.T__7) | (1 << DSLSQLParser.T__8) | (1 << DSLSQLParser.T__9) | (1 << DSLSQLParser.T__10) | (1 << DSLSQLParser.T__12) | (1 << DSLSQLParser.T__13) | (1 << DSLSQLParser.T__14) | (1 << DSLSQLParser.T__15) | (1 << DSLSQLParser.T__16) | (1 << DSLSQLParser.T__17) | (1 << DSLSQLParser.T__18) | (1 << DSLSQLParser.T__19) | (1 << DSLSQLParser.T__20) | (1 << DSLSQLParser.T__21) | (1 << DSLSQLParser.T__22) | (1 << DSLSQLParser.T__23) | (1 << DSLSQLParser.T__24) | (1 << DSLSQLParser.T__25) | (1 << DSLSQLParser.T__26) | (1 << DSLSQLParser.T__27) | (1 << DSLSQLParser.T__28) | (1 << DSLSQLParser.T__29) | (1 << DSLSQLParser.T__30) | (1 << DSLSQLParser.T__31) | (1 << DSLSQLParser.T__32) | (1 << DSLSQLParser.T__33) | (1 << DSLSQLParser.T__34) | (1 << DSLSQLParser.T__35) | (1 << DSLSQLParser.T__36) | (1 << DSLSQLParser.T__37) | (1 << DSLSQLParser.T__38) | (1 << DSLSQLParser.T__39) | (1 << DSLSQLParser.STRING) | (1 << DSLSQLParser.BLOCK_STRING) | (1 << DSLSQLParser.IDENTIFIER) | (1 << DSLSQLParser.BACKQUOTED_IDENTIFIER) | (1 << DSLSQLParser.SIMPLE_COMMENT) | (1 << DSLSQLParser.BRACKETED_EMPTY_COMMENT) | (1 << DSLSQLParser.BRACKETED_COMMENT) | (1 << DSLSQLParser.WS) | (1 << DSLSQLParser.UNRECOGNIZED))) != 0):
                    self.state = 131
                    _la = self._input.LA(1)
                    if _la <= 0 or _la==DSLSQLParser.T__11:
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 136
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.T__20, DSLSQLParser.T__21]:
                self.enterOuterAlt(localctx, 8)
                self.state = 137
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__20 or _la==DSLSQLParser.T__21):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 138
                self.setKey()
                self.state = 139
                self.match(DSLSQLParser.T__22)
                self.state = 140
                self.setValue()
                self.state = 142
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4:
                    self.state = 141
                    _la = self._input.LA(1)
                    if not(_la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 145
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.IDENTIFIER or _la==DSLSQLParser.BACKQUOTED_IDENTIFIER:
                    self.state = 144
                    self.expression()


                self.state = 150
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==DSLSQLParser.T__39:
                    self.state = 147
                    self.booleanExpression()
                    self.state = 152
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.T__23, DSLSQLParser.T__24]:
                self.enterOuterAlt(localctx, 9)
                self.state = 153
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__23 or _la==DSLSQLParser.T__24):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 154
                self.format_type()
                self.state = 156
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4:
                    self.state = 155
                    _la = self._input.LA(1)
                    if not(_la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 159
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.IDENTIFIER or _la==DSLSQLParser.BACKQUOTED_IDENTIFIER:
                    self.state = 158
                    self.expression()


                self.state = 164
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==DSLSQLParser.T__39:
                    self.state = 161
                    self.booleanExpression()
                    self.state = 166
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 169
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__5:
                    self.state = 167
                    self.match(DSLSQLParser.T__5)
                    self.state = 168
                    self.db()


                pass
            elif token in [DSLSQLParser.T__25, DSLSQLParser.T__26, DSLSQLParser.T__27, DSLSQLParser.T__28]:
                self.enterOuterAlt(localctx, 10)
                self.state = 171
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DSLSQLParser.T__25) | (1 << DSLSQLParser.T__26) | (1 << DSLSQLParser.T__27) | (1 << DSLSQLParser.T__28))) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 172
                self.tableName()
                self.state = 173
                self.match(DSLSQLParser.T__5)
                self.state = 174
                self.format_type()
                self.state = 175
                self.match(DSLSQLParser.T__2)
                self.state = 176
                self.path()
                self.state = 178
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4:
                    self.state = 177
                    _la = self._input.LA(1)
                    if not(_la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 181
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.IDENTIFIER or _la==DSLSQLParser.BACKQUOTED_IDENTIFIER:
                    self.state = 180
                    self.expression()


                self.state = 186
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==DSLSQLParser.T__39:
                    self.state = 183
                    self.booleanExpression()
                    self.state = 188
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.T__29, DSLSQLParser.T__30]:
                self.enterOuterAlt(localctx, 11)
                self.state = 189
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__29 or _la==DSLSQLParser.T__30):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 190
                self.format_type()
                self.state = 191
                self.match(DSLSQLParser.T__2)
                self.state = 192
                self.path()
                self.state = 193
                self.match(DSLSQLParser.T__5)
                self.state = 194
                self.functionName()
                self.state = 196
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4:
                    self.state = 195
                    _la = self._input.LA(1)
                    if not(_la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 199
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.IDENTIFIER or _la==DSLSQLParser.BACKQUOTED_IDENTIFIER:
                    self.state = 198
                    self.expression()


                self.state = 204
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==DSLSQLParser.T__39:
                    self.state = 201
                    self.booleanExpression()
                    self.state = 206
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.T__31, DSLSQLParser.T__32]:
                self.enterOuterAlt(localctx, 12)
                self.state = 207
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__31 or _la==DSLSQLParser.T__32):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 208
                self.format_type()
                self.state = 209
                self.match(DSLSQLParser.T__2)
                self.state = 210
                self.path()
                self.state = 212
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4:
                    self.state = 211
                    _la = self._input.LA(1)
                    if not(_la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 215
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.IDENTIFIER or _la==DSLSQLParser.BACKQUOTED_IDENTIFIER:
                    self.state = 214
                    self.expression()


                self.state = 220
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==DSLSQLParser.T__39:
                    self.state = 217
                    self.booleanExpression()
                    self.state = 222
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.T__33, DSLSQLParser.T__34]:
                self.enterOuterAlt(localctx, 13)
                self.state = 223
                _la = self._input.LA(1)
                if not(_la==DSLSQLParser.T__33 or _la==DSLSQLParser.T__34):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 224
                self.format_type()
                self.state = 225
                self.match(DSLSQLParser.T__2)
                self.state = 226
                self.path()
                self.state = 228
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4:
                    self.state = 227
                    _la = self._input.LA(1)
                    if not(_la==DSLSQLParser.T__3 or _la==DSLSQLParser.T__4):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 231
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DSLSQLParser.IDENTIFIER or _la==DSLSQLParser.BACKQUOTED_IDENTIFIER:
                    self.state = 230
                    self.expression()


                self.state = 236
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==DSLSQLParser.T__39:
                    self.state = 233
                    self.booleanExpression()
                    self.state = 238
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [DSLSQLParser.SIMPLE_COMMENT]:
                self.enterOuterAlt(localctx, 14)
                self.state = 239
                self.match(DSLSQLParser.SIMPLE_COMMENT)
                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 OverwriteContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return DSLSQLParser.RULE_overwrite

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

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

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




    def overwrite(self):

        localctx = DSLSQLParser.OverwriteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_overwrite)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 242
            self.match(DSLSQLParser.T__35)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class AppendContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return DSLSQLParser.RULE_append

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

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

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




    def append(self):

        localctx = DSLSQLParser.AppendContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_append)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 244
            self.match(DSLSQLParser.T__36)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ErrorIfExistsContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return DSLSQLParser.RULE_errorIfExists

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

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

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




    def errorIfExists(self):

        localctx = DSLSQLParser.ErrorIfExistsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_errorIfExists)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 246
            self.match(DSLSQLParser.T__37)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class IgnoreContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return DSLSQLParser.RULE_ignore

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

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

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




    def ignore(self):

        localctx = DSLSQLParser.IgnoreContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_ignore)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 248
            self.match(DSLSQLParser.T__38)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class BooleanExpressionContext(ParserRuleContext):

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

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


        def getRuleIndex(self):
            return DSLSQLParser.RULE_booleanExpression

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

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

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




    def booleanExpression(self):

        localctx = DSLSQLParser.BooleanExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_booleanExpression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 250
            self.match(DSLSQLParser.T__39)
            self.state = 251
            self.expression()
        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 identifier(self):
            return self.getTypedRuleContext(DSLSQLParser.IdentifierContext,0)


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

        def getRuleIndex(self):
            return DSLSQLParser.RULE_expression

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

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

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




    def expression(self):

        localctx = DSLSQLParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_expression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 253
            self.identifier()
            self.state = 254
            self.match(DSLSQLParser.T__22)
            self.state = 255
            self.match(DSLSQLParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class EnderContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return DSLSQLParser.RULE_ender

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

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

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




    def ender(self):

        localctx = DSLSQLParser.EnderContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_ender)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 257
            self.match(DSLSQLParser.T__11)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Format_typeContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(DSLSQLParser.IdentifierContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_format_type

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

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

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




    def format_type(self):

        localctx = DSLSQLParser.Format_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_format_type)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 259
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class PathContext(ParserRuleContext):

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

        def quotedIdentifier(self):
            return self.getTypedRuleContext(DSLSQLParser.QuotedIdentifierContext,0)


        def identifier(self):
            return self.getTypedRuleContext(DSLSQLParser.IdentifierContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_path

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

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

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




    def path(self):

        localctx = DSLSQLParser.PathContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_path)
        try:
            self.state = 263
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,35,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 261
                self.quotedIdentifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 262
                self.identifier()
                pass


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

    class SetValueContext(ParserRuleContext):

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

        def qualifiedName(self):
            return self.getTypedRuleContext(DSLSQLParser.QualifiedNameContext,0)


        def quotedIdentifier(self):
            return self.getTypedRuleContext(DSLSQLParser.QuotedIdentifierContext,0)


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

        def BLOCK_STRING(self):
            return self.getToken(DSLSQLParser.BLOCK_STRING, 0)

        def getRuleIndex(self):
            return DSLSQLParser.RULE_setValue

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

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

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




    def setValue(self):

        localctx = DSLSQLParser.SetValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_setValue)
        try:
            self.state = 269
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,36,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 265
                self.qualifiedName()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 266
                self.quotedIdentifier()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 267
                self.match(DSLSQLParser.STRING)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 268
                self.match(DSLSQLParser.BLOCK_STRING)
                pass


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

    class SetKeyContext(ParserRuleContext):

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

        def qualifiedName(self):
            return self.getTypedRuleContext(DSLSQLParser.QualifiedNameContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_setKey

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

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

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




    def setKey(self):

        localctx = DSLSQLParser.SetKeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_setKey)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 271
            self.qualifiedName()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class DbContext(ParserRuleContext):

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

        def qualifiedName(self):
            return self.getTypedRuleContext(DSLSQLParser.QualifiedNameContext,0)


        def identifier(self):
            return self.getTypedRuleContext(DSLSQLParser.IdentifierContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_db

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

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

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




    def db(self):

        localctx = DSLSQLParser.DbContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_db)
        try:
            self.state = 275
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,37,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 273
                self.qualifiedName()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 274
                self.identifier()
                pass


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

    class TableNameContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(DSLSQLParser.IdentifierContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_tableName

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

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

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




    def tableName(self):

        localctx = DSLSQLParser.TableNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_tableName)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 277
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class FunctionNameContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(DSLSQLParser.IdentifierContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_functionName

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

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

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




    def functionName(self):

        localctx = DSLSQLParser.FunctionNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_functionName)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 279
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ColContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(DSLSQLParser.IdentifierContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_col

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

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

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




    def col(self):

        localctx = DSLSQLParser.ColContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_col)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 281
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class QualifiedNameContext(ParserRuleContext):

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

        def identifier(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DSLSQLParser.IdentifierContext)
            else:
                return self.getTypedRuleContext(DSLSQLParser.IdentifierContext,i)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_qualifiedName

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

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

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




    def qualifiedName(self):

        localctx = DSLSQLParser.QualifiedNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_qualifiedName)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 283
            self.identifier()
            self.state = 288
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==DSLSQLParser.T__2:
                self.state = 284
                self.match(DSLSQLParser.T__2)
                self.state = 285
                self.identifier()
                self.state = 290
                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 IdentifierContext(ParserRuleContext):

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

        def strictIdentifier(self):
            return self.getTypedRuleContext(DSLSQLParser.StrictIdentifierContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_identifier

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

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

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




    def identifier(self):

        localctx = DSLSQLParser.IdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_identifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 291
            self.strictIdentifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class StrictIdentifierContext(ParserRuleContext):

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

        def IDENTIFIER(self):
            return self.getToken(DSLSQLParser.IDENTIFIER, 0)

        def quotedIdentifier(self):
            return self.getTypedRuleContext(DSLSQLParser.QuotedIdentifierContext,0)


        def getRuleIndex(self):
            return DSLSQLParser.RULE_strictIdentifier

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

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

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




    def strictIdentifier(self):

        localctx = DSLSQLParser.StrictIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_strictIdentifier)
        try:
            self.state = 295
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DSLSQLParser.IDENTIFIER]:
                self.enterOuterAlt(localctx, 1)
                self.state = 293
                self.match(DSLSQLParser.IDENTIFIER)
                pass
            elif token in [DSLSQLParser.BACKQUOTED_IDENTIFIER]:
                self.enterOuterAlt(localctx, 2)
                self.state = 294
                self.quotedIdentifier()
                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 QuotedIdentifierContext(ParserRuleContext):

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

        def BACKQUOTED_IDENTIFIER(self):
            return self.getToken(DSLSQLParser.BACKQUOTED_IDENTIFIER, 0)

        def getRuleIndex(self):
            return DSLSQLParser.RULE_quotedIdentifier

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

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

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




    def quotedIdentifier(self):

        localctx = DSLSQLParser.QuotedIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_quotedIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 297
            self.match(DSLSQLParser.BACKQUOTED_IDENTIFIER)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx




