# flake8: noqa
# type: ignore
# Generated from SimpleSql.g4 by ANTLR 4.8
# encoding: utf-8
from ...._vendor.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\3D")
        buf.write("\u01a5\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\3\2\3\2\3\2\3")
        buf.write("\3\3\3\3\4\3\4\3\4\3\4\7\4Q\n\4\f\4\16\4T\13\4\5\4V\n")
        buf.write("\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\7\6b\n\6\f")
        buf.write("\6\16\6e\13\6\3\7\3\7\5\7i\n\7\3\7\3\7\3\b\3\b\5\bo\n")
        buf.write("\b\3\b\3\b\3\b\7\bt\n\b\f\b\16\bw\13\b\3\b\3\b\3\b\3\b")
        buf.write("\7\b}\n\b\f\b\16\b\u0080\13\b\5\b\u0082\n\b\3\b\3\b\5")
        buf.write("\b\u0086\n\b\3\b\3\b\3\b\5\b\u008b\n\b\3\b\3\b\5\b\u008f")
        buf.write("\n\b\3\b\3\b\3\b\3\b\3\b\7\b\u0096\n\b\f\b\16\b\u0099")
        buf.write("\13\b\5\b\u009b\n\b\3\t\3\t\3\t\5\t\u00a0\n\t\3\t\5\t")
        buf.write("\u00a3\n\t\5\t\u00a5\n\t\3\n\3\n\3\13\3\13\3\13\5\13\u00ac")
        buf.write("\n\13\3\13\3\13\5\13\u00b0\n\13\3\13\3\13\3\13\3\13\3")
        buf.write("\13\3\13\7\13\u00b8\n\13\f\13\16\13\u00bb\13\13\3\f\3")
        buf.write("\f\3\f\3\f\3\f\5\f\u00c2\n\f\3\f\3\f\5\f\u00c6\n\f\3\f")
        buf.write("\3\f\3\f\3\f\3\f\7\f\u00cd\n\f\f\f\16\f\u00d0\13\f\3\f")
        buf.write("\3\f\3\f\5\f\u00d5\n\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f\u00dd")
        buf.write("\n\f\3\f\3\f\5\f\u00e1\n\f\3\r\3\r\3\r\3\r\3\r\5\r\u00e8")
        buf.write("\n\r\3\r\3\r\3\r\3\r\7\r\u00ee\n\r\f\r\16\r\u00f1\13\r")
        buf.write("\3\16\3\16\3\16\3\16\3\16\7\16\u00f8\n\16\f\16\16\16\u00fb")
        buf.write("\13\16\5\16\u00fd\n\16\3\16\3\16\5\16\u0101\n\16\3\16")
        buf.write("\3\16\3\16\3\16\3\16\5\16\u0108\n\16\3\16\3\16\7\16\u010c")
        buf.write("\n\16\f\16\16\16\u010f\13\16\3\16\3\16\5\16\u0113\n\16")
        buf.write("\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\5\16")
        buf.write("\u011f\n\16\3\17\3\17\3\17\3\17\3\17\3\17\5\17\u0127\n")
        buf.write("\17\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21")
        buf.write("\3\21\3\21\7\21\u0135\n\21\f\21\16\21\u0138\13\21\5\21")
        buf.write("\u013a\n\21\3\21\3\21\3\22\3\22\5\22\u0140\n\22\3\23\3")
        buf.write("\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\5\23\u014c")
        buf.write("\n\23\3\23\3\23\5\23\u0150\n\23\3\23\3\23\3\23\5\23\u0155")
        buf.write("\n\23\3\23\3\23\3\23\3\23\5\23\u015b\n\23\7\23\u015d\n")
        buf.write("\23\f\23\16\23\u0160\13\23\3\24\3\24\3\24\7\24\u0165\n")
        buf.write("\24\f\24\16\24\u0168\13\24\3\25\3\25\3\25\7\25\u016d\n")
        buf.write("\25\f\25\16\25\u0170\13\25\3\26\3\26\3\26\7\26\u0175\n")
        buf.write("\26\f\26\16\26\u0178\13\26\3\27\3\27\5\27\u017c\n\27\3")
        buf.write("\30\3\30\3\31\3\31\3\31\5\31\u0183\n\31\3\32\3\32\3\33")
        buf.write("\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3\37\3\37")
        buf.write("\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\5\37\u019b\n")
        buf.write("\37\3 \3 \3!\3!\3\"\3\"\3#\3#\3#\2\5\24\30$$\2\4\6\b\n")
        buf.write("\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<")
        buf.write(">@BD\2\t\4\2\27\27\60\60\4\2\31\31\35\35\4\2\26\26\36")
        buf.write("\36\3\2\n\20\4\2\7\7\21\25\3\2\21\22\5\2**\64\64@@\2\u01c9")
        buf.write("\2F\3\2\2\2\4J\3\2\2\2\6U\3\2\2\2\bY\3\2\2\2\n_\3\2\2")
        buf.write("\2\ff\3\2\2\2\16l\3\2\2\2\20\u00a4\3\2\2\2\22\u00a6\3")
        buf.write("\2\2\2\24\u00af\3\2\2\2\26\u00e0\3\2\2\2\30\u00e7\3\2")
        buf.write("\2\2\32\u011e\3\2\2\2\34\u0126\3\2\2\2\36\u0128\3\2\2")
        buf.write("\2 \u012d\3\2\2\2\"\u013d\3\2\2\2$\u014b\3\2\2\2&\u0161")
        buf.write("\3\2\2\2(\u0169\3\2\2\2*\u0171\3\2\2\2,\u017b\3\2\2\2")
        buf.write(".\u017d\3\2\2\2\60\u0182\3\2\2\2\62\u0184\3\2\2\2\64\u0186")
        buf.write("\3\2\2\2\66\u0188\3\2\2\28\u018a\3\2\2\2:\u018c\3\2\2")
        buf.write("\2<\u019a\3\2\2\2>\u019c\3\2\2\2@\u019e\3\2\2\2B\u01a0")
        buf.write("\3\2\2\2D\u01a2\3\2\2\2FG\5\4\3\2GH\7\3\2\2HI\7\2\2\3")
        buf.write("I\3\3\2\2\2JK\5\6\4\2K\5\3\2\2\2LM\7;\2\2MR\5\b\5\2NO")
        buf.write("\7\4\2\2OQ\5\b\5\2PN\3\2\2\2QT\3\2\2\2RP\3\2\2\2RS\3\2")
        buf.write("\2\2SV\3\2\2\2TR\3\2\2\2UL\3\2\2\2UV\3\2\2\2VW\3\2\2\2")
        buf.write("WX\5\n\6\2X\7\3\2\2\2YZ\5,\27\2Z[\7\30\2\2[\\\7\5\2\2")
        buf.write("\\]\5\4\3\2]^\7\6\2\2^\t\3\2\2\2_c\5\16\b\2`b\5\f\7\2")
        buf.write("a`\3\2\2\2be\3\2\2\2ca\3\2\2\2cd\3\2\2\2d\13\3\2\2\2e")
        buf.write("c\3\2\2\2fh\78\2\2gi\5:\36\2hg\3\2\2\2hi\3\2\2\2ij\3\2")
        buf.write("\2\2jk\5\16\b\2k\r\3\2\2\2ln\7\65\2\2mo\5:\36\2nm\3\2")
        buf.write("\2\2no\3\2\2\2op\3\2\2\2pu\5\20\t\2qr\7\4\2\2rt\5\20\t")
        buf.write("\2sq\3\2\2\2tw\3\2\2\2us\3\2\2\2uv\3\2\2\2v\u0081\3\2")
        buf.write("\2\2wu\3\2\2\2xy\7\"\2\2y~\5$\23\2z{\7\4\2\2{}\5$\23\2")
        buf.write("|z\3\2\2\2}\u0080\3\2\2\2~|\3\2\2\2~\177\3\2\2\2\177\u0082")
        buf.write("\3\2\2\2\u0080~\3\2\2\2\u0081x\3\2\2\2\u0081\u0082\3\2")
        buf.write("\2\2\u0082\u0085\3\2\2\2\u0083\u0084\7:\2\2\u0084\u0086")
        buf.write("\5\24\13\2\u0085\u0083\3\2\2\2\u0085\u0086\3\2\2\2\u0086")
        buf.write("\u008a\3\2\2\2\u0087\u0088\7$\2\2\u0088\u0089\7\32\2\2")
        buf.write("\u0089\u008b\5&\24\2\u008a\u0087\3\2\2\2\u008a\u008b\3")
        buf.write("\2\2\2\u008b\u008e\3\2\2\2\u008c\u008d\7%\2\2\u008d\u008f")
        buf.write("\5\24\13\2\u008e\u008c\3\2\2\2\u008e\u008f\3\2\2\2\u008f")
        buf.write("\u009a\3\2\2\2\u0090\u0091\7\61\2\2\u0091\u0092\7\32\2")
        buf.write("\2\u0092\u0097\5\"\22\2\u0093\u0094\7\4\2\2\u0094\u0096")
        buf.write("\5\"\22\2\u0095\u0093\3\2\2\2\u0096\u0099\3\2\2\2\u0097")
        buf.write("\u0095\3\2\2\2\u0097\u0098\3\2\2\2\u0098\u009b\3\2\2\2")
        buf.write("\u0099\u0097\3\2\2\2\u009a\u0090\3\2\2\2\u009a\u009b\3")
        buf.write("\2\2\2\u009b\17\3\2\2\2\u009c\u00a5\7\7\2\2\u009d\u00a2")
        buf.write("\5\22\n\2\u009e\u00a0\7\30\2\2\u009f\u009e\3\2\2\2\u009f")
        buf.write("\u00a0\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1\u00a3\5,\27\2")
        buf.write("\u00a2\u009f\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\u00a5\3")
        buf.write("\2\2\2\u00a4\u009c\3\2\2\2\u00a4\u009d\3\2\2\2\u00a5\21")
        buf.write("\3\2\2\2\u00a6\u00a7\5\24\13\2\u00a7\23\3\2\2\2\u00a8")
        buf.write("\u00a9\b\13\1\2\u00a9\u00ab\5\30\r\2\u00aa\u00ac\5\26")
        buf.write("\f\2\u00ab\u00aa\3\2\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00b0")
        buf.write("\3\2\2\2\u00ad\u00ae\7-\2\2\u00ae\u00b0\5\24\13\5\u00af")
        buf.write("\u00a8\3\2\2\2\u00af\u00ad\3\2\2\2\u00b0\u00b9\3\2\2\2")
        buf.write("\u00b1\u00b2\f\4\2\2\u00b2\u00b3\t\2\2\2\u00b3\u00b8\5")
        buf.write("\24\13\5\u00b4\u00b5\f\3\2\2\u00b5\u00b6\7\b\2\2\u00b6")
        buf.write("\u00b8\5,\27\2\u00b7\u00b1\3\2\2\2\u00b7\u00b4\3\2\2\2")
        buf.write("\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3\2\2\2\u00b9\u00ba\3")
        buf.write("\2\2\2\u00ba\25\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bc\u00bd")
        buf.write("\5> \2\u00bd\u00be\5\30\r\2\u00be\u00e1\3\2\2\2\u00bf")
        buf.write("\u00c1\7(\2\2\u00c0\u00c2\7-\2\2\u00c1\u00c0\3\2\2\2\u00c1")
        buf.write("\u00c2\3\2\2\2\u00c2\u00c3\3\2\2\2\u00c3\u00e1\7.\2\2")
        buf.write("\u00c4\u00c6\7-\2\2\u00c5\u00c4\3\2\2\2\u00c5\u00c6\3")
        buf.write("\2\2\2\u00c6\u00c7\3\2\2\2\u00c7\u00c8\7&\2\2\u00c8\u00c9")
        buf.write("\7\5\2\2\u00c9\u00ce\5\22\n\2\u00ca\u00cb\7\4\2\2\u00cb")
        buf.write("\u00cd\5\22\n\2\u00cc\u00ca\3\2\2\2\u00cd\u00d0\3\2\2")
        buf.write("\2\u00ce\u00cc\3\2\2\2\u00ce\u00cf\3\2\2\2\u00cf\u00d1")
        buf.write("\3\2\2\2\u00d0\u00ce\3\2\2\2\u00d1\u00d2\7\6\2\2\u00d2")
        buf.write("\u00e1\3\2\2\2\u00d3\u00d5\7-\2\2\u00d4\u00d3\3\2\2\2")
        buf.write("\u00d4\u00d5\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6\u00d7\7")
        buf.write("&\2\2\u00d7\u00d8\7\5\2\2\u00d8\u00d9\5\4\3\2\u00d9\u00da")
        buf.write("\7\6\2\2\u00da\u00e1\3\2\2\2\u00db\u00dd\7-\2\2\u00dc")
        buf.write("\u00db\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd\u00de\3\2\2\2")
        buf.write("\u00de\u00df\7+\2\2\u00df\u00e1\5\22\n\2\u00e0\u00bc\3")
        buf.write("\2\2\2\u00e0\u00bf\3\2\2\2\u00e0\u00c5\3\2\2\2\u00e0\u00d4")
        buf.write("\3\2\2\2\u00e0\u00dc\3\2\2\2\u00e1\27\3\2\2\2\u00e2\u00e3")
        buf.write("\b\r\1\2\u00e3\u00e8\5\32\16\2\u00e4\u00e5\5B\"\2\u00e5")
        buf.write("\u00e6\5\30\r\4\u00e6\u00e8\3\2\2\2\u00e7\u00e2\3\2\2")
        buf.write("\2\u00e7\u00e4\3\2\2\2\u00e8\u00ef\3\2\2\2\u00e9\u00ea")
        buf.write("\f\3\2\2\u00ea\u00eb\5@!\2\u00eb\u00ec\5\30\r\4\u00ec")
        buf.write("\u00ee\3\2\2\2\u00ed\u00e9\3\2\2\2\u00ee\u00f1\3\2\2\2")
        buf.write("\u00ef\u00ed\3\2\2\2\u00ef\u00f0\3\2\2\2\u00f0\31\3\2")
        buf.write("\2\2\u00f1\u00ef\3\2\2\2\u00f2\u00f3\5(\25\2\u00f3\u00fc")
        buf.write("\7\5\2\2\u00f4\u00f9\5\22\n\2\u00f5\u00f6\7\4\2\2\u00f6")
        buf.write("\u00f8\5\22\n\2\u00f7\u00f5\3\2\2\2\u00f8\u00fb\3\2\2")
        buf.write("\2\u00f9\u00f7\3\2\2\2\u00f9\u00fa\3\2\2\2\u00fa\u00fd")
        buf.write("\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fc\u00f4\3\2\2\2\u00fc")
        buf.write("\u00fd\3\2\2\2\u00fd\u00fe\3\2\2\2\u00fe\u0100\7\6\2\2")
        buf.write("\u00ff\u0101\5 \21\2\u0100\u00ff\3\2\2\2\u0100\u0101\3")
        buf.write("\2\2\2\u0101\u011f\3\2\2\2\u0102\u0103\5(\25\2\u0103\u0104")
        buf.write("\7\5\2\2\u0104\u0105\7\7\2\2\u0105\u0107\7\6\2\2\u0106")
        buf.write("\u0108\5 \21\2\u0107\u0106\3\2\2\2\u0107\u0108\3\2\2\2")
        buf.write("\u0108\u011f\3\2\2\2\u0109\u010d\7\33\2\2\u010a\u010c")
        buf.write("\5\36\20\2\u010b\u010a\3\2\2\2\u010c\u010f\3\2\2\2\u010d")
        buf.write("\u010b\3\2\2\2\u010d\u010e\3\2\2\2\u010e\u0112\3\2\2\2")
        buf.write("\u010f\u010d\3\2\2\2\u0110\u0111\7\37\2\2\u0111\u0113")
        buf.write("\5\22\n\2\u0112\u0110\3\2\2\2\u0112\u0113\3\2\2\2\u0113")
        buf.write("\u0114\3\2\2\2\u0114\u011f\7 \2\2\u0115\u0116\7\5\2\2")
        buf.write("\u0116\u0117\5\4\3\2\u0117\u0118\7\6\2\2\u0118\u011f\3")
        buf.write("\2\2\2\u0119\u011a\7\5\2\2\u011a\u011b\5\22\n\2\u011b")
        buf.write("\u011c\7\6\2\2\u011c\u011f\3\2\2\2\u011d\u011f\5\34\17")
        buf.write("\2\u011e\u00f2\3\2\2\2\u011e\u0102\3\2\2\2\u011e\u0109")
        buf.write("\3\2\2\2\u011e\u0115\3\2\2\2\u011e\u0119\3\2\2\2\u011e")
        buf.write("\u011d\3\2\2\2\u011f\33\3\2\2\2\u0120\u0127\5(\25\2\u0121")
        buf.write("\u0127\5\60\31\2\u0122\u0127\5\62\32\2\u0123\u0127\5\64")
        buf.write("\33\2\u0124\u0127\5\66\34\2\u0125\u0127\58\35\2\u0126")
        buf.write("\u0120\3\2\2\2\u0126\u0121\3\2\2\2\u0126\u0122\3\2\2\2")
        buf.write("\u0126\u0123\3\2\2\2\u0126\u0124\3\2\2\2\u0126\u0125\3")
        buf.write("\2\2\2\u0127\35\3\2\2\2\u0128\u0129\79\2\2\u0129\u012a")
        buf.write("\5\22\n\2\u012a\u012b\7\66\2\2\u012b\u012c\5\22\n\2\u012c")
        buf.write("\37\3\2\2\2\u012d\u012e\7\63\2\2\u012e\u0139\7\5\2\2\u012f")
        buf.write("\u0130\7\61\2\2\u0130\u0131\7\32\2\2\u0131\u0136\5\"\22")
        buf.write("\2\u0132\u0133\7\4\2\2\u0133\u0135\5\"\22\2\u0134\u0132")
        buf.write("\3\2\2\2\u0135\u0138\3\2\2\2\u0136\u0134\3\2\2\2\u0136")
        buf.write("\u0137\3\2\2\2\u0137\u013a\3\2\2\2\u0138\u0136\3\2\2\2")
        buf.write("\u0139\u012f\3\2\2\2\u0139\u013a\3\2\2\2\u013a\u013b\3")
        buf.write("\2\2\2\u013b\u013c\7\6\2\2\u013c!\3\2\2\2\u013d\u013f")
        buf.write("\5\22\n\2\u013e\u0140\t\3\2\2\u013f\u013e\3\2\2\2\u013f")
        buf.write("\u0140\3\2\2\2\u0140#\3\2\2\2\u0141\u0142\b\23\1\2\u0142")
        buf.write("\u0143\7\5\2\2\u0143\u0144\5\4\3\2\u0144\u0145\7\6\2\2")
        buf.write("\u0145\u014c\3\2\2\2\u0146\u0147\7\5\2\2\u0147\u0148\5")
        buf.write("$\23\2\u0148\u0149\7\6\2\2\u0149\u014c\3\2\2\2\u014a\u014c")
        buf.write("\5(\25\2\u014b\u0141\3\2\2\2\u014b\u0146\3\2\2\2\u014b")
        buf.write("\u014a\3\2\2\2\u014c\u015e\3\2\2\2\u014d\u014f\f\7\2\2")
        buf.write("\u014e\u0150\7\30\2\2\u014f\u014e\3\2\2\2\u014f\u0150")
        buf.write("\3\2\2\2\u0150\u0151\3\2\2\2\u0151\u015d\5,\27\2\u0152")
        buf.write("\u0154\f\6\2\2\u0153\u0155\5<\37\2\u0154\u0153\3\2\2\2")
        buf.write("\u0154\u0155\3\2\2\2\u0155\u0156\3\2\2\2\u0156\u0157\7")
        buf.write(")\2\2\u0157\u015a\5$\23\2\u0158\u0159\7/\2\2\u0159\u015b")
        buf.write("\5\24\13\2\u015a\u0158\3\2\2\2\u015a\u015b\3\2\2\2\u015b")
        buf.write("\u015d\3\2\2\2\u015c\u014d\3\2\2\2\u015c\u0152\3\2\2\2")
        buf.write("\u015d\u0160\3\2\2\2\u015e\u015c\3\2\2\2\u015e\u015f\3")
        buf.write("\2\2\2\u015f%\3\2\2\2\u0160\u015e\3\2\2\2\u0161\u0166")
        buf.write("\5\22\n\2\u0162\u0163\7\4\2\2\u0163\u0165\5\22\n\2\u0164")
        buf.write("\u0162\3\2\2\2\u0165\u0168\3\2\2\2\u0166\u0164\3\2\2\2")
        buf.write("\u0166\u0167\3\2\2\2\u0167\'\3\2\2\2\u0168\u0166\3\2\2")
        buf.write("\2\u0169\u016e\5,\27\2\u016a\u016b\7\t\2\2\u016b\u016d")
        buf.write("\5,\27\2\u016c\u016a\3\2\2\2\u016d\u0170\3\2\2\2\u016e")
        buf.write("\u016c\3\2\2\2\u016e\u016f\3\2\2\2\u016f)\3\2\2\2\u0170")
        buf.write("\u016e\3\2\2\2\u0171\u0176\5,\27\2\u0172\u0173\7\4\2\2")
        buf.write("\u0173\u0175\5,\27\2\u0174\u0172\3\2\2\2\u0175\u0178\3")
        buf.write("\2\2\2\u0176\u0174\3\2\2\2\u0176\u0177\3\2\2\2\u0177+")
        buf.write("\3\2\2\2\u0178\u0176\3\2\2\2\u0179\u017c\5D#\2\u017a\u017c")
        buf.write("\5.\30\2\u017b\u0179\3\2\2\2\u017b\u017a\3\2\2\2\u017c")
        buf.write("-\3\2\2\2\u017d\u017e\7A\2\2\u017e/\3\2\2\2\u017f\u0183")
        buf.write("\7=\2\2\u0180\u0183\7>\2\2\u0181\u0183\7?\2\2\u0182\u017f")
        buf.write("\3\2\2\2\u0182\u0180\3\2\2\2\u0182\u0181\3\2\2\2\u0183")
        buf.write("\61\3\2\2\2\u0184\u0185\7<\2\2\u0185\63\3\2\2\2\u0186")
        buf.write("\u0187\7.\2\2\u0187\65\3\2\2\2\u0188\u0189\7\67\2\2\u0189")
        buf.write("\67\3\2\2\2\u018a\u018b\7!\2\2\u018b9\3\2\2\2\u018c\u018d")
        buf.write("\t\4\2\2\u018d;\3\2\2\2\u018e\u019b\7\'\2\2\u018f\u019b")
        buf.write("\7*\2\2\u0190\u0191\7*\2\2\u0191\u019b\7\62\2\2\u0192")
        buf.write("\u019b\7\64\2\2\u0193\u0194\7\64\2\2\u0194\u019b\7\62")
        buf.write("\2\2\u0195\u019b\7#\2\2\u0196\u0197\7#\2\2\u0197\u019b")
        buf.write("\7\62\2\2\u0198\u019b\7\34\2\2\u0199\u019b\7,\2\2\u019a")
        buf.write("\u018e\3\2\2\2\u019a\u018f\3\2\2\2\u019a\u0190\3\2\2\2")
        buf.write("\u019a\u0192\3\2\2\2\u019a\u0193\3\2\2\2\u019a\u0195\3")
        buf.write("\2\2\2\u019a\u0196\3\2\2\2\u019a\u0198\3\2\2\2\u019a\u0199")
        buf.write("\3\2\2\2\u019b=\3\2\2\2\u019c\u019d\t\5\2\2\u019d?\3\2")
        buf.write("\2\2\u019e\u019f\t\6\2\2\u019fA\3\2\2\2\u01a0\u01a1\t")
        buf.write("\7\2\2\u01a1C\3\2\2\2\u01a2\u01a3\t\b\2\2\u01a3E\3\2\2")
        buf.write("\2\65RUchnu~\u0081\u0085\u008a\u008e\u0097\u009a\u009f")
        buf.write("\u00a2\u00a4\u00ab\u00af\u00b7\u00b9\u00c1\u00c5\u00ce")
        buf.write("\u00d4\u00dc\u00e0\u00e7\u00ef\u00f9\u00fc\u0100\u0107")
        buf.write("\u010d\u0112\u011e\u0126\u0136\u0139\u013f\u014b\u014f")
        buf.write("\u0154\u015a\u015c\u015e\u0166\u016e\u0176\u017b\u0182")
        buf.write("\u019a")
        return buf.getvalue()


class SimpleSqlParser ( Parser ):

    grammarFileName = "SimpleSql.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "';'", "','", "'('", "')'", "'*'", "'::'", 
                     "'.'", "'='", "'!='", "'<>'", "'<'", "'<='", "'>'", 
                     "'>='", "'+'", "'-'", "'/'", "'%'", "'||'", "'all'", 
                     "'and'", "'as'", "'asc'", "'by'", "'case'", "'cross'", 
                     "'desc'", "'distinct'", "'else'", "'end'", "'false'", 
                     "'from'", "'full'", "'group'", "'having'", "'in'", 
                     "'inner'", "'is'", "'join'", "'left'", "'like'", "'natural'", 
                     "'not'", "'null'", "'on'", "'or'", "'order'", "'outer'", 
                     "'over'", "'right'", "'select'", "'then'", "'true'", 
                     "'union'", "'when'", "'where'", "'with'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "ALL", "AND", "AS", "ASC", "BY", "CASE", "CROSS", 
                      "DESC", "DISTINCT", "ELSE", "END", "FALSE", "FROM", 
                      "FULL", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", 
                      "LEFT", "LIKE", "NATURAL", "NOT", "NULL", "ON", "OR", 
                      "ORDER", "OUTER", "OVER", "RIGHT", "SELECT", "THEN", 
                      "TRUE", "UNION", "WHEN", "WHERE", "WITH", "STRING", 
                      "INTEGER_VALUE", "DECIMAL_VALUE", "FLOAT_VALUE", "IDENTIFIER", 
                      "QUOTED_IDENTIFIER", "COMMENT", "BLOCK_COMMENT", "WS" ]

    RULE_singleStatement = 0
    RULE_select = 1
    RULE_cteSelect = 2
    RULE_cte = 3
    RULE_unionSelect = 4
    RULE_unionItem = 5
    RULE_primarySelect = 6
    RULE_selectItem = 7
    RULE_expression = 8
    RULE_booleanExpression = 9
    RULE_predicate = 10
    RULE_valueExpression = 11
    RULE_primaryExpression = 12
    RULE_simpleExpression = 13
    RULE_caseItem = 14
    RULE_over = 15
    RULE_sortItem = 16
    RULE_relation = 17
    RULE_groupBy = 18
    RULE_qualifiedName = 19
    RULE_identifierList = 20
    RULE_identifier = 21
    RULE_quotedIdentifier = 22
    RULE_number = 23
    RULE_string = 24
    RULE_null = 25
    RULE_true = 26
    RULE_false = 27
    RULE_setQuantifier = 28
    RULE_joinType = 29
    RULE_cmpOp = 30
    RULE_arithOp = 31
    RULE_unaryOp = 32
    RULE_unquotedIdentifier = 33

    ruleNames =  [ "singleStatement", "select", "cteSelect", "cte", "unionSelect", 
                   "unionItem", "primarySelect", "selectItem", "expression", 
                   "booleanExpression", "predicate", "valueExpression", 
                   "primaryExpression", "simpleExpression", "caseItem", 
                   "over", "sortItem", "relation", "groupBy", "qualifiedName", 
                   "identifierList", "identifier", "quotedIdentifier", "number", 
                   "string", "null", "true", "false", "setQuantifier", "joinType", 
                   "cmpOp", "arithOp", "unaryOp", "unquotedIdentifier" ]

    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
    ALL=20
    AND=21
    AS=22
    ASC=23
    BY=24
    CASE=25
    CROSS=26
    DESC=27
    DISTINCT=28
    ELSE=29
    END=30
    FALSE=31
    FROM=32
    FULL=33
    GROUP=34
    HAVING=35
    IN=36
    INNER=37
    IS=38
    JOIN=39
    LEFT=40
    LIKE=41
    NATURAL=42
    NOT=43
    NULL=44
    ON=45
    OR=46
    ORDER=47
    OUTER=48
    OVER=49
    RIGHT=50
    SELECT=51
    THEN=52
    TRUE=53
    UNION=54
    WHEN=55
    WHERE=56
    WITH=57
    STRING=58
    INTEGER_VALUE=59
    DECIMAL_VALUE=60
    FLOAT_VALUE=61
    IDENTIFIER=62
    QUOTED_IDENTIFIER=63
    COMMENT=64
    BLOCK_COMMENT=65
    WS=66

    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 SingleStatementContext(ParserRuleContext):

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

        def select(self):
            return self.getTypedRuleContext(SimpleSqlParser.SelectContext,0)


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

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_singleStatement

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

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

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




    def singleStatement(self):

        localctx = SimpleSqlParser.SingleStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_singleStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 68
            self.select()
            self.state = 69
            self.match(SimpleSqlParser.T__0)
            self.state = 70
            self.match(SimpleSqlParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SelectContext(ParserRuleContext):

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

        def cteSelect(self):
            return self.getTypedRuleContext(SimpleSqlParser.CteSelectContext,0)


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_select

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

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

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




    def select(self):

        localctx = SimpleSqlParser.SelectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_select)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 72
            self.cteSelect()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CteSelectContext(ParserRuleContext):

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

        def unionSelect(self):
            return self.getTypedRuleContext(SimpleSqlParser.UnionSelectContext,0)


        def WITH(self):
            return self.getToken(SimpleSqlParser.WITH, 0)

        def cte(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.CteContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.CteContext,i)


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_cteSelect

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

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

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




    def cteSelect(self):

        localctx = SimpleSqlParser.CteSelectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_cteSelect)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 83
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.WITH:
                self.state = 74
                self.match(SimpleSqlParser.WITH)
                self.state = 75
                self.cte()
                self.state = 80
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==SimpleSqlParser.T__1:
                    self.state = 76
                    self.match(SimpleSqlParser.T__1)
                    self.state = 77
                    self.cte()
                    self.state = 82
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



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


    class CteContext(ParserRuleContext):

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

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


        def AS(self):
            return self.getToken(SimpleSqlParser.AS, 0)

        def select(self):
            return self.getTypedRuleContext(SimpleSqlParser.SelectContext,0)


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_cte

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

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

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




    def cte(self):

        localctx = SimpleSqlParser.CteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_cte)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 87
            self.identifier()
            self.state = 88
            self.match(SimpleSqlParser.AS)
            self.state = 89
            self.match(SimpleSqlParser.T__2)
            self.state = 90
            self.select()
            self.state = 91
            self.match(SimpleSqlParser.T__3)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UnionSelectContext(ParserRuleContext):

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

        def primarySelect(self):
            return self.getTypedRuleContext(SimpleSqlParser.PrimarySelectContext,0)


        def unionItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.UnionItemContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.UnionItemContext,i)


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_unionSelect

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

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

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




    def unionSelect(self):

        localctx = SimpleSqlParser.UnionSelectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_unionSelect)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 93
            self.primarySelect()
            self.state = 97
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SimpleSqlParser.UNION:
                self.state = 94
                self.unionItem()
                self.state = 99
                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 UnionItemContext(ParserRuleContext):

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

        def UNION(self):
            return self.getToken(SimpleSqlParser.UNION, 0)

        def primarySelect(self):
            return self.getTypedRuleContext(SimpleSqlParser.PrimarySelectContext,0)


        def setQuantifier(self):
            return self.getTypedRuleContext(SimpleSqlParser.SetQuantifierContext,0)


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_unionItem

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

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

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




    def unionItem(self):

        localctx = SimpleSqlParser.UnionItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_unionItem)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 100
            self.match(SimpleSqlParser.UNION)
            self.state = 102
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.ALL or _la==SimpleSqlParser.DISTINCT:
                self.state = 101
                self.setQuantifier()


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


    class PrimarySelectContext(ParserRuleContext):

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

        def SELECT(self):
            return self.getToken(SimpleSqlParser.SELECT, 0)

        def selectItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.SelectItemContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.SelectItemContext,i)


        def setQuantifier(self):
            return self.getTypedRuleContext(SimpleSqlParser.SetQuantifierContext,0)


        def FROM(self):
            return self.getToken(SimpleSqlParser.FROM, 0)

        def relation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.RelationContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.RelationContext,i)


        def WHERE(self):
            return self.getToken(SimpleSqlParser.WHERE, 0)

        def GROUP(self):
            return self.getToken(SimpleSqlParser.GROUP, 0)

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

        def groupBy(self):
            return self.getTypedRuleContext(SimpleSqlParser.GroupByContext,0)


        def HAVING(self):
            return self.getToken(SimpleSqlParser.HAVING, 0)

        def ORDER(self):
            return self.getToken(SimpleSqlParser.ORDER, 0)

        def sortItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.SortItemContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.SortItemContext,i)


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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_primarySelect

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

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

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




    def primarySelect(self):

        localctx = SimpleSqlParser.PrimarySelectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_primarySelect)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 106
            self.match(SimpleSqlParser.SELECT)
            self.state = 108
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.ALL or _la==SimpleSqlParser.DISTINCT:
                self.state = 107
                self.setQuantifier()


            self.state = 110
            self.selectItem()
            self.state = 115
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SimpleSqlParser.T__1:
                self.state = 111
                self.match(SimpleSqlParser.T__1)
                self.state = 112
                self.selectItem()
                self.state = 117
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 127
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.FROM:
                self.state = 118
                self.match(SimpleSqlParser.FROM)
                self.state = 119
                self.relation(0)
                self.state = 124
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==SimpleSqlParser.T__1:
                    self.state = 120
                    self.match(SimpleSqlParser.T__1)
                    self.state = 121
                    self.relation(0)
                    self.state = 126
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 131
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.WHERE:
                self.state = 129
                self.match(SimpleSqlParser.WHERE)
                self.state = 130
                localctx.where = self.booleanExpression(0)


            self.state = 136
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.GROUP:
                self.state = 133
                self.match(SimpleSqlParser.GROUP)
                self.state = 134
                self.match(SimpleSqlParser.BY)
                self.state = 135
                self.groupBy()


            self.state = 140
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.HAVING:
                self.state = 138
                self.match(SimpleSqlParser.HAVING)
                self.state = 139
                localctx.having = self.booleanExpression(0)


            self.state = 152
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.ORDER:
                self.state = 142
                self.match(SimpleSqlParser.ORDER)
                self.state = 143
                self.match(SimpleSqlParser.BY)
                self.state = 144
                self.sortItem()
                self.state = 149
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==SimpleSqlParser.T__1:
                    self.state = 145
                    self.match(SimpleSqlParser.T__1)
                    self.state = 146
                    self.sortItem()
                    self.state = 151
                    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 SelectItemContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_selectItem

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class ExpressionSelectItemContext(SelectItemContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.SelectItemContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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

        def AS(self):
            return self.getToken(SimpleSqlParser.AS, 0)

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

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

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


    class AllSelectItemContext(SelectItemContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.SelectItemContext
            super().__init__(parser)
            self.copyFrom(ctx)


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

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

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



    def selectItem(self):

        localctx = SimpleSqlParser.SelectItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_selectItem)
        self._la = 0 # Token type
        try:
            self.state = 162
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SimpleSqlParser.T__4]:
                localctx = SimpleSqlParser.AllSelectItemContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 154
                self.match(SimpleSqlParser.T__4)
                pass
            elif token in [SimpleSqlParser.T__2, SimpleSqlParser.T__14, SimpleSqlParser.T__15, SimpleSqlParser.CASE, SimpleSqlParser.FALSE, SimpleSqlParser.LEFT, SimpleSqlParser.NOT, SimpleSqlParser.NULL, SimpleSqlParser.RIGHT, SimpleSqlParser.TRUE, SimpleSqlParser.STRING, SimpleSqlParser.INTEGER_VALUE, SimpleSqlParser.DECIMAL_VALUE, SimpleSqlParser.FLOAT_VALUE, SimpleSqlParser.IDENTIFIER, SimpleSqlParser.QUOTED_IDENTIFIER]:
                localctx = SimpleSqlParser.ExpressionSelectItemContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 155
                self.expression()
                self.state = 160
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SimpleSqlParser.AS) | (1 << SimpleSqlParser.LEFT) | (1 << SimpleSqlParser.RIGHT) | (1 << SimpleSqlParser.IDENTIFIER) | (1 << SimpleSqlParser.QUOTED_IDENTIFIER))) != 0):
                    self.state = 157
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==SimpleSqlParser.AS:
                        self.state = 156
                        self.match(SimpleSqlParser.AS)


                    self.state = 159
                    self.identifier()


                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 ExpressionContext(ParserRuleContext):

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

        def booleanExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.BooleanExpressionContext,0)


        def getRuleIndex(self):
            return SimpleSqlParser.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 = SimpleSqlParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_expression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 164
            self.booleanExpression(0)
        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 getRuleIndex(self):
            return SimpleSqlParser.RULE_booleanExpression

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class BinaryBooleanExpressionContext(BooleanExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.BooleanExpressionContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

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

        def AND(self):
            return self.getToken(SimpleSqlParser.AND, 0)
        def OR(self):
            return self.getToken(SimpleSqlParser.OR, 0)

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

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

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


    class PredicatedBooleanExpressionContext(BooleanExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.BooleanExpressionContext
            super().__init__(parser)
            self._valueExpression = None # ValueExpressionContext
            self.copyFrom(ctx)

        def valueExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.ValueExpressionContext,0)

        def predicate(self):
            return self.getTypedRuleContext(SimpleSqlParser.PredicateContext,0)


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

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

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


    class UnaryBooleanExpressionContext(BooleanExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.BooleanExpressionContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def booleanExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.BooleanExpressionContext,0)

        def NOT(self):
            return self.getToken(SimpleSqlParser.NOT, 0)

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

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

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


    class CastBooleanExpressionContext(BooleanExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.BooleanExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def booleanExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.BooleanExpressionContext,0)

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


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

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

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



    def booleanExpression(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = SimpleSqlParser.BooleanExpressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 18
        self.enterRecursionRule(localctx, 18, self.RULE_booleanExpression, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 173
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SimpleSqlParser.T__2, SimpleSqlParser.T__14, SimpleSqlParser.T__15, SimpleSqlParser.CASE, SimpleSqlParser.FALSE, SimpleSqlParser.LEFT, SimpleSqlParser.NULL, SimpleSqlParser.RIGHT, SimpleSqlParser.TRUE, SimpleSqlParser.STRING, SimpleSqlParser.INTEGER_VALUE, SimpleSqlParser.DECIMAL_VALUE, SimpleSqlParser.FLOAT_VALUE, SimpleSqlParser.IDENTIFIER, SimpleSqlParser.QUOTED_IDENTIFIER]:
                localctx = SimpleSqlParser.PredicatedBooleanExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 167
                localctx._valueExpression = self.valueExpression(0)
                self.state = 169
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,16,self._ctx)
                if la_ == 1:
                    self.state = 168
                    self.predicate(localctx._valueExpression)


                pass
            elif token in [SimpleSqlParser.NOT]:
                localctx = SimpleSqlParser.UnaryBooleanExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 171
                localctx.op = self.match(SimpleSqlParser.NOT)
                self.state = 172
                self.booleanExpression(3)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 183
            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
                    self.state = 181
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
                    if la_ == 1:
                        localctx = SimpleSqlParser.BinaryBooleanExpressionContext(self, SimpleSqlParser.BooleanExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_booleanExpression)
                        self.state = 175
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 176
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==SimpleSqlParser.AND or _la==SimpleSqlParser.OR):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 177
                        self.booleanExpression(3)
                        pass

                    elif la_ == 2:
                        localctx = SimpleSqlParser.CastBooleanExpressionContext(self, SimpleSqlParser.BooleanExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_booleanExpression)
                        self.state = 178
                        if not self.precpred(self._ctx, 1):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                        self.state = 179
                        self.match(SimpleSqlParser.T__5)
                        self.state = 180
                        self.identifier()
                        pass

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

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_predicate

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)
            self.value = ctx.value



    class IsNullPredicateContext(PredicateContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PredicateContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def IS(self):
            return self.getToken(SimpleSqlParser.IS, 0)
        def NULL(self):
            return self.getToken(SimpleSqlParser.NULL, 0)
        def NOT(self):
            return self.getToken(SimpleSqlParser.NOT, 0)

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

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

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


    class CmpPredicateContext(PredicateContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PredicateContext
            super().__init__(parser)
            self.right = None # ValueExpressionContext
            self.copyFrom(ctx)

        def cmpOp(self):
            return self.getTypedRuleContext(SimpleSqlParser.CmpOpContext,0)

        def valueExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.ValueExpressionContext,0)


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

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

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


    class LikePredicateContext(PredicateContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PredicateContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def LIKE(self):
            return self.getToken(SimpleSqlParser.LIKE, 0)
        def expression(self):
            return self.getTypedRuleContext(SimpleSqlParser.ExpressionContext,0)

        def NOT(self):
            return self.getToken(SimpleSqlParser.NOT, 0)

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

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

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


    class InSelectPredicateContext(PredicateContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PredicateContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def IN(self):
            return self.getToken(SimpleSqlParser.IN, 0)
        def select(self):
            return self.getTypedRuleContext(SimpleSqlParser.SelectContext,0)

        def NOT(self):
            return self.getToken(SimpleSqlParser.NOT, 0)

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

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

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


    class InListPredicateContext(PredicateContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PredicateContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def IN(self):
            return self.getToken(SimpleSqlParser.IN, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.ExpressionContext,i)

        def NOT(self):
            return self.getToken(SimpleSqlParser.NOT, 0)

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

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

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



    def predicate(self, value:ParserRuleContext):

        localctx = SimpleSqlParser.PredicateContext(self, self._ctx, self.state, value)
        self.enterRule(localctx, 20, self.RULE_predicate)
        self._la = 0 # Token type
        try:
            self.state = 222
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,25,self._ctx)
            if la_ == 1:
                localctx = SimpleSqlParser.CmpPredicateContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 186
                self.cmpOp()
                self.state = 187
                localctx.right = self.valueExpression(0)
                pass

            elif la_ == 2:
                localctx = SimpleSqlParser.IsNullPredicateContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 189
                self.match(SimpleSqlParser.IS)
                self.state = 191
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SimpleSqlParser.NOT:
                    self.state = 190
                    self.match(SimpleSqlParser.NOT)


                self.state = 193
                self.match(SimpleSqlParser.NULL)
                pass

            elif la_ == 3:
                localctx = SimpleSqlParser.InListPredicateContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 195
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SimpleSqlParser.NOT:
                    self.state = 194
                    self.match(SimpleSqlParser.NOT)


                self.state = 197
                self.match(SimpleSqlParser.IN)
                self.state = 198
                self.match(SimpleSqlParser.T__2)
                self.state = 199
                self.expression()
                self.state = 204
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==SimpleSqlParser.T__1:
                    self.state = 200
                    self.match(SimpleSqlParser.T__1)
                    self.state = 201
                    self.expression()
                    self.state = 206
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 207
                self.match(SimpleSqlParser.T__3)
                pass

            elif la_ == 4:
                localctx = SimpleSqlParser.InSelectPredicateContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 210
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SimpleSqlParser.NOT:
                    self.state = 209
                    self.match(SimpleSqlParser.NOT)


                self.state = 212
                self.match(SimpleSqlParser.IN)
                self.state = 213
                self.match(SimpleSqlParser.T__2)
                self.state = 214
                self.select()
                self.state = 215
                self.match(SimpleSqlParser.T__3)
                pass

            elif la_ == 5:
                localctx = SimpleSqlParser.LikePredicateContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 218
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SimpleSqlParser.NOT:
                    self.state = 217
                    self.match(SimpleSqlParser.NOT)


                self.state = 220
                self.match(SimpleSqlParser.LIKE)
                self.state = 221
                self.expression()
                pass


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


    class ValueExpressionContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_valueExpression

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class PrimaryValueExpressionContext(ValueExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.ValueExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def primaryExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.PrimaryExpressionContext,0)


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

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

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


    class UnaryValueExpressionContext(ValueExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.ValueExpressionContext
            super().__init__(parser)
            self.op = None # UnaryOpContext
            self.copyFrom(ctx)

        def valueExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.ValueExpressionContext,0)

        def unaryOp(self):
            return self.getTypedRuleContext(SimpleSqlParser.UnaryOpContext,0)


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

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

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


    class ArithValueExpressionContext(ValueExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.ValueExpressionContext
            super().__init__(parser)
            self.left = None # ValueExpressionContext
            self.op = None # ArithOpContext
            self.right = None # ValueExpressionContext
            self.copyFrom(ctx)

        def valueExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.ValueExpressionContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.ValueExpressionContext,i)

        def arithOp(self):
            return self.getTypedRuleContext(SimpleSqlParser.ArithOpContext,0)


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

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

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



    def valueExpression(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = SimpleSqlParser.ValueExpressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 22
        self.enterRecursionRule(localctx, 22, self.RULE_valueExpression, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 229
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SimpleSqlParser.T__2, SimpleSqlParser.CASE, SimpleSqlParser.FALSE, SimpleSqlParser.LEFT, SimpleSqlParser.NULL, SimpleSqlParser.RIGHT, SimpleSqlParser.TRUE, SimpleSqlParser.STRING, SimpleSqlParser.INTEGER_VALUE, SimpleSqlParser.DECIMAL_VALUE, SimpleSqlParser.FLOAT_VALUE, SimpleSqlParser.IDENTIFIER, SimpleSqlParser.QUOTED_IDENTIFIER]:
                localctx = SimpleSqlParser.PrimaryValueExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 225
                self.primaryExpression()
                pass
            elif token in [SimpleSqlParser.T__14, SimpleSqlParser.T__15]:
                localctx = SimpleSqlParser.UnaryValueExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 226
                localctx.op = self.unaryOp()
                self.state = 227
                self.valueExpression(2)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 237
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,27,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 = SimpleSqlParser.ArithValueExpressionContext(self, SimpleSqlParser.ValueExpressionContext(self, _parentctx, _parentState))
                    localctx.left = _prevctx
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_valueExpression)
                    self.state = 231
                    if not self.precpred(self._ctx, 1):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                    self.state = 232
                    localctx.op = self.arithOp()
                    self.state = 233
                    localctx.right = self.valueExpression(2) 
                self.state = 239
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,27,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 PrimaryExpressionContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_primaryExpression

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class StarFunctionCallExpressionContext(PrimaryExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PrimaryExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

        def over(self):
            return self.getTypedRuleContext(SimpleSqlParser.OverContext,0)


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

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

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


    class SimplePrimaryExpressionContext(PrimaryExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PrimaryExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def simpleExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.SimpleExpressionContext,0)


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

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

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


    class CaseExpressionContext(PrimaryExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PrimaryExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def CASE(self):
            return self.getToken(SimpleSqlParser.CASE, 0)
        def END(self):
            return self.getToken(SimpleSqlParser.END, 0)
        def caseItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.CaseItemContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.CaseItemContext,i)

        def ELSE(self):
            return self.getToken(SimpleSqlParser.ELSE, 0)
        def expression(self):
            return self.getTypedRuleContext(SimpleSqlParser.ExpressionContext,0)


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

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

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


    class FunctionCallExpressionContext(PrimaryExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PrimaryExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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

        def over(self):
            return self.getTypedRuleContext(SimpleSqlParser.OverContext,0)


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

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

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


    class ParenExpressionContext(PrimaryExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PrimaryExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

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


    class SelectExpressionContext(PrimaryExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.PrimaryExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def select(self):
            return self.getTypedRuleContext(SimpleSqlParser.SelectContext,0)


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

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

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



    def primaryExpression(self):

        localctx = SimpleSqlParser.PrimaryExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_primaryExpression)
        self._la = 0 # Token type
        try:
            self.state = 284
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,34,self._ctx)
            if la_ == 1:
                localctx = SimpleSqlParser.FunctionCallExpressionContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 240
                self.qualifiedName()
                self.state = 241
                self.match(SimpleSqlParser.T__2)
                self.state = 250
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SimpleSqlParser.T__2) | (1 << SimpleSqlParser.T__14) | (1 << SimpleSqlParser.T__15) | (1 << SimpleSqlParser.CASE) | (1 << SimpleSqlParser.FALSE) | (1 << SimpleSqlParser.LEFT) | (1 << SimpleSqlParser.NOT) | (1 << SimpleSqlParser.NULL) | (1 << SimpleSqlParser.RIGHT) | (1 << SimpleSqlParser.TRUE) | (1 << SimpleSqlParser.STRING) | (1 << SimpleSqlParser.INTEGER_VALUE) | (1 << SimpleSqlParser.DECIMAL_VALUE) | (1 << SimpleSqlParser.FLOAT_VALUE) | (1 << SimpleSqlParser.IDENTIFIER) | (1 << SimpleSqlParser.QUOTED_IDENTIFIER))) != 0):
                    self.state = 242
                    self.expression()
                    self.state = 247
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while _la==SimpleSqlParser.T__1:
                        self.state = 243
                        self.match(SimpleSqlParser.T__1)
                        self.state = 244
                        self.expression()
                        self.state = 249
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)



                self.state = 252
                self.match(SimpleSqlParser.T__3)
                self.state = 254
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,30,self._ctx)
                if la_ == 1:
                    self.state = 253
                    self.over()


                pass

            elif la_ == 2:
                localctx = SimpleSqlParser.StarFunctionCallExpressionContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 256
                self.qualifiedName()
                self.state = 257
                self.match(SimpleSqlParser.T__2)
                self.state = 258
                self.match(SimpleSqlParser.T__4)
                self.state = 259
                self.match(SimpleSqlParser.T__3)
                self.state = 261
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,31,self._ctx)
                if la_ == 1:
                    self.state = 260
                    self.over()


                pass

            elif la_ == 3:
                localctx = SimpleSqlParser.CaseExpressionContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 263
                self.match(SimpleSqlParser.CASE)
                self.state = 267
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==SimpleSqlParser.WHEN:
                    self.state = 264
                    self.caseItem()
                    self.state = 269
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 272
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SimpleSqlParser.ELSE:
                    self.state = 270
                    self.match(SimpleSqlParser.ELSE)
                    self.state = 271
                    self.expression()


                self.state = 274
                self.match(SimpleSqlParser.END)
                pass

            elif la_ == 4:
                localctx = SimpleSqlParser.SelectExpressionContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 275
                self.match(SimpleSqlParser.T__2)
                self.state = 276
                self.select()
                self.state = 277
                self.match(SimpleSqlParser.T__3)
                pass

            elif la_ == 5:
                localctx = SimpleSqlParser.ParenExpressionContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 279
                self.match(SimpleSqlParser.T__2)
                self.state = 280
                self.expression()
                self.state = 281
                self.match(SimpleSqlParser.T__3)
                pass

            elif la_ == 6:
                localctx = SimpleSqlParser.SimplePrimaryExpressionContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 283
                self.simpleExpression()
                pass


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


    class SimpleExpressionContext(ParserRuleContext):

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

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


        def number(self):
            return self.getTypedRuleContext(SimpleSqlParser.NumberContext,0)


        def string(self):
            return self.getTypedRuleContext(SimpleSqlParser.StringContext,0)


        def null(self):
            return self.getTypedRuleContext(SimpleSqlParser.NullContext,0)


        def true(self):
            return self.getTypedRuleContext(SimpleSqlParser.TrueContext,0)


        def false(self):
            return self.getTypedRuleContext(SimpleSqlParser.FalseContext,0)


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_simpleExpression

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

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

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




    def simpleExpression(self):

        localctx = SimpleSqlParser.SimpleExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_simpleExpression)
        try:
            self.state = 292
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SimpleSqlParser.LEFT, SimpleSqlParser.RIGHT, SimpleSqlParser.IDENTIFIER, SimpleSqlParser.QUOTED_IDENTIFIER]:
                self.enterOuterAlt(localctx, 1)
                self.state = 286
                self.qualifiedName()
                pass
            elif token in [SimpleSqlParser.INTEGER_VALUE, SimpleSqlParser.DECIMAL_VALUE, SimpleSqlParser.FLOAT_VALUE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 287
                self.number()
                pass
            elif token in [SimpleSqlParser.STRING]:
                self.enterOuterAlt(localctx, 3)
                self.state = 288
                self.string()
                pass
            elif token in [SimpleSqlParser.NULL]:
                self.enterOuterAlt(localctx, 4)
                self.state = 289
                self.null()
                pass
            elif token in [SimpleSqlParser.TRUE]:
                self.enterOuterAlt(localctx, 5)
                self.state = 290
                self.true()
                pass
            elif token in [SimpleSqlParser.FALSE]:
                self.enterOuterAlt(localctx, 6)
                self.state = 291
                self.false()
                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 CaseItemContext(ParserRuleContext):

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

        def WHEN(self):
            return self.getToken(SimpleSqlParser.WHEN, 0)

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


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

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_caseItem

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

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

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




    def caseItem(self):

        localctx = SimpleSqlParser.CaseItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_caseItem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 294
            self.match(SimpleSqlParser.WHEN)
            self.state = 295
            self.expression()
            self.state = 296
            self.match(SimpleSqlParser.THEN)
            self.state = 297
            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 OverContext(ParserRuleContext):

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

        def OVER(self):
            return self.getToken(SimpleSqlParser.OVER, 0)

        def ORDER(self):
            return self.getToken(SimpleSqlParser.ORDER, 0)

        def BY(self):
            return self.getToken(SimpleSqlParser.BY, 0)

        def sortItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.SortItemContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.SortItemContext,i)


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_over

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

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

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




    def over(self):

        localctx = SimpleSqlParser.OverContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_over)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 299
            self.match(SimpleSqlParser.OVER)
            self.state = 300
            self.match(SimpleSqlParser.T__2)
            self.state = 311
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.ORDER:
                self.state = 301
                self.match(SimpleSqlParser.ORDER)
                self.state = 302
                self.match(SimpleSqlParser.BY)
                self.state = 303
                self.sortItem()
                self.state = 308
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==SimpleSqlParser.T__1:
                    self.state = 304
                    self.match(SimpleSqlParser.T__1)
                    self.state = 305
                    self.sortItem()
                    self.state = 310
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 313
            self.match(SimpleSqlParser.T__3)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SortItemContext(ParserRuleContext):

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

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


        def ASC(self):
            return self.getToken(SimpleSqlParser.ASC, 0)

        def DESC(self):
            return self.getToken(SimpleSqlParser.DESC, 0)

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_sortItem

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

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

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




    def sortItem(self):

        localctx = SimpleSqlParser.SortItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_sortItem)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 315
            self.expression()
            self.state = 317
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SimpleSqlParser.ASC or _la==SimpleSqlParser.DESC:
                self.state = 316
                localctx.direction = self._input.LT(1)
                _la = self._input.LA(1)
                if not(_la==SimpleSqlParser.ASC or _la==SimpleSqlParser.DESC):
                    localctx.direction = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


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


    class RelationContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_relation

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class AliasedRelationContext(RelationContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.RelationContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def relation(self):
            return self.getTypedRuleContext(SimpleSqlParser.RelationContext,0)

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

        def AS(self):
            return self.getToken(SimpleSqlParser.AS, 0)

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

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

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


    class JoinRelationContext(RelationContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.RelationContext
            super().__init__(parser)
            self.left = None # RelationContext
            self.ty = None # JoinTypeContext
            self.right = None # RelationContext
            self.cond = None # BooleanExpressionContext
            self.copyFrom(ctx)

        def JOIN(self):
            return self.getToken(SimpleSqlParser.JOIN, 0)
        def relation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SimpleSqlParser.RelationContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.RelationContext,i)

        def ON(self):
            return self.getToken(SimpleSqlParser.ON, 0)
        def joinType(self):
            return self.getTypedRuleContext(SimpleSqlParser.JoinTypeContext,0)

        def booleanExpression(self):
            return self.getTypedRuleContext(SimpleSqlParser.BooleanExpressionContext,0)


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

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

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


    class SelectRelationContext(RelationContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.RelationContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def select(self):
            return self.getTypedRuleContext(SimpleSqlParser.SelectContext,0)


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

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

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


    class TableRelationContext(RelationContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.RelationContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

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


    class ParenRelationContext(RelationContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.RelationContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def relation(self):
            return self.getTypedRuleContext(SimpleSqlParser.RelationContext,0)


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

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

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



    def relation(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = SimpleSqlParser.RelationContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 34
        self.enterRecursionRule(localctx, 34, self.RULE_relation, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 329
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,39,self._ctx)
            if la_ == 1:
                localctx = SimpleSqlParser.SelectRelationContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 320
                self.match(SimpleSqlParser.T__2)
                self.state = 321
                self.select()
                self.state = 322
                self.match(SimpleSqlParser.T__3)
                pass

            elif la_ == 2:
                localctx = SimpleSqlParser.ParenRelationContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 324
                self.match(SimpleSqlParser.T__2)
                self.state = 325
                self.relation(0)
                self.state = 326
                self.match(SimpleSqlParser.T__3)
                pass

            elif la_ == 3:
                localctx = SimpleSqlParser.TableRelationContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 328
                self.qualifiedName()
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 348
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,44,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 346
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
                    if la_ == 1:
                        localctx = SimpleSqlParser.AliasedRelationContext(self, SimpleSqlParser.RelationContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relation)
                        self.state = 331
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 333
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==SimpleSqlParser.AS:
                            self.state = 332
                            self.match(SimpleSqlParser.AS)


                        self.state = 335
                        self.identifier()
                        pass

                    elif la_ == 2:
                        localctx = SimpleSqlParser.JoinRelationContext(self, SimpleSqlParser.RelationContext(self, _parentctx, _parentState))
                        localctx.left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_relation)
                        self.state = 336
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 338
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SimpleSqlParser.CROSS) | (1 << SimpleSqlParser.FULL) | (1 << SimpleSqlParser.INNER) | (1 << SimpleSqlParser.LEFT) | (1 << SimpleSqlParser.NATURAL) | (1 << SimpleSqlParser.RIGHT))) != 0):
                            self.state = 337
                            localctx.ty = self.joinType()


                        self.state = 340
                        self.match(SimpleSqlParser.JOIN)
                        self.state = 341
                        localctx.right = self.relation(0)
                        self.state = 344
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,42,self._ctx)
                        if la_ == 1:
                            self.state = 342
                            self.match(SimpleSqlParser.ON)
                            self.state = 343
                            localctx.cond = self.booleanExpression(0)


                        pass

             
                self.state = 350
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,44,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 GroupByContext(ParserRuleContext):

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

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_groupBy

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

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

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




    def groupBy(self):

        localctx = SimpleSqlParser.GroupByContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_groupBy)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 351
            self.expression()
            self.state = 356
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SimpleSqlParser.T__1:
                self.state = 352
                self.match(SimpleSqlParser.T__1)
                self.state = 353
                self.expression()
                self.state = 358
                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 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(SimpleSqlParser.IdentifierContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.IdentifierContext,i)


        def getRuleIndex(self):
            return SimpleSqlParser.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 = SimpleSqlParser.QualifiedNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_qualifiedName)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 359
            self.identifier()
            self.state = 364
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,46,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 360
                    self.match(SimpleSqlParser.T__6)
                    self.state = 361
                    self.identifier() 
                self.state = 366
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,46,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 IdentifierListContext(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(SimpleSqlParser.IdentifierContext)
            else:
                return self.getTypedRuleContext(SimpleSqlParser.IdentifierContext,i)


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_identifierList

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

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

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




    def identifierList(self):

        localctx = SimpleSqlParser.IdentifierListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_identifierList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 367
            self.identifier()
            self.state = 372
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SimpleSqlParser.T__1:
                self.state = 368
                self.match(SimpleSqlParser.T__1)
                self.state = 369
                self.identifier()
                self.state = 374
                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 unquotedIdentifier(self):
            return self.getTypedRuleContext(SimpleSqlParser.UnquotedIdentifierContext,0)


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


        def getRuleIndex(self):
            return SimpleSqlParser.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 = SimpleSqlParser.IdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_identifier)
        try:
            self.state = 377
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SimpleSqlParser.LEFT, SimpleSqlParser.RIGHT, SimpleSqlParser.IDENTIFIER]:
                self.enterOuterAlt(localctx, 1)
                self.state = 375
                self.unquotedIdentifier()
                pass
            elif token in [SimpleSqlParser.QUOTED_IDENTIFIER]:
                self.enterOuterAlt(localctx, 2)
                self.state = 376
                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 QUOTED_IDENTIFIER(self):
            return self.getToken(SimpleSqlParser.QUOTED_IDENTIFIER, 0)

        def getRuleIndex(self):
            return SimpleSqlParser.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 = SimpleSqlParser.QuotedIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_quotedIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 379
            self.match(SimpleSqlParser.QUOTED_IDENTIFIER)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NumberContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_number

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class DecimalNumberContext(NumberContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.NumberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def DECIMAL_VALUE(self):
            return self.getToken(SimpleSqlParser.DECIMAL_VALUE, 0)

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

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

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


    class IntegerNumberContext(NumberContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.NumberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def INTEGER_VALUE(self):
            return self.getToken(SimpleSqlParser.INTEGER_VALUE, 0)

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

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

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


    class FloatNumberContext(NumberContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a SimpleSqlParser.NumberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def FLOAT_VALUE(self):
            return self.getToken(SimpleSqlParser.FLOAT_VALUE, 0)

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

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

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



    def number(self):

        localctx = SimpleSqlParser.NumberContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_number)
        try:
            self.state = 384
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SimpleSqlParser.INTEGER_VALUE]:
                localctx = SimpleSqlParser.IntegerNumberContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 381
                self.match(SimpleSqlParser.INTEGER_VALUE)
                pass
            elif token in [SimpleSqlParser.DECIMAL_VALUE]:
                localctx = SimpleSqlParser.DecimalNumberContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 382
                self.match(SimpleSqlParser.DECIMAL_VALUE)
                pass
            elif token in [SimpleSqlParser.FLOAT_VALUE]:
                localctx = SimpleSqlParser.FloatNumberContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 383
                self.match(SimpleSqlParser.FLOAT_VALUE)
                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 StringContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_string

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

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

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




    def string(self):

        localctx = SimpleSqlParser.StringContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_string)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 386
            self.match(SimpleSqlParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NullContext(ParserRuleContext):

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

        def NULL(self):
            return self.getToken(SimpleSqlParser.NULL, 0)

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_null

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

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

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




    def null(self):

        localctx = SimpleSqlParser.NullContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_null)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 388
            self.match(SimpleSqlParser.NULL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TrueContext(ParserRuleContext):

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

        def TRUE(self):
            return self.getToken(SimpleSqlParser.TRUE, 0)

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_true

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

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

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




    def true(self):

        localctx = SimpleSqlParser.TrueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_true)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 390
            self.match(SimpleSqlParser.TRUE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FalseContext(ParserRuleContext):

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

        def FALSE(self):
            return self.getToken(SimpleSqlParser.FALSE, 0)

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_false

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

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

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




    def false(self):

        localctx = SimpleSqlParser.FalseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_false)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 392
            self.match(SimpleSqlParser.FALSE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SetQuantifierContext(ParserRuleContext):

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

        def DISTINCT(self):
            return self.getToken(SimpleSqlParser.DISTINCT, 0)

        def ALL(self):
            return self.getToken(SimpleSqlParser.ALL, 0)

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_setQuantifier

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

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

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




    def setQuantifier(self):

        localctx = SimpleSqlParser.SetQuantifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_setQuantifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 394
            _la = self._input.LA(1)
            if not(_la==SimpleSqlParser.ALL or _la==SimpleSqlParser.DISTINCT):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class JoinTypeContext(ParserRuleContext):

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

        def INNER(self):
            return self.getToken(SimpleSqlParser.INNER, 0)

        def LEFT(self):
            return self.getToken(SimpleSqlParser.LEFT, 0)

        def OUTER(self):
            return self.getToken(SimpleSqlParser.OUTER, 0)

        def RIGHT(self):
            return self.getToken(SimpleSqlParser.RIGHT, 0)

        def FULL(self):
            return self.getToken(SimpleSqlParser.FULL, 0)

        def CROSS(self):
            return self.getToken(SimpleSqlParser.CROSS, 0)

        def NATURAL(self):
            return self.getToken(SimpleSqlParser.NATURAL, 0)

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_joinType

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

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

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




    def joinType(self):

        localctx = SimpleSqlParser.JoinTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_joinType)
        try:
            self.state = 408
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,50,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 396
                self.match(SimpleSqlParser.INNER)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 397
                self.match(SimpleSqlParser.LEFT)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 398
                self.match(SimpleSqlParser.LEFT)
                self.state = 399
                self.match(SimpleSqlParser.OUTER)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 400
                self.match(SimpleSqlParser.RIGHT)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 401
                self.match(SimpleSqlParser.RIGHT)
                self.state = 402
                self.match(SimpleSqlParser.OUTER)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 403
                self.match(SimpleSqlParser.FULL)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 404
                self.match(SimpleSqlParser.FULL)
                self.state = 405
                self.match(SimpleSqlParser.OUTER)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 406
                self.match(SimpleSqlParser.CROSS)
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 407
                self.match(SimpleSqlParser.NATURAL)
                pass


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


    class CmpOpContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_cmpOp

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

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

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




    def cmpOp(self):

        localctx = SimpleSqlParser.CmpOpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_cmpOp)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 410
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SimpleSqlParser.T__7) | (1 << SimpleSqlParser.T__8) | (1 << SimpleSqlParser.T__9) | (1 << SimpleSqlParser.T__10) | (1 << SimpleSqlParser.T__11) | (1 << SimpleSqlParser.T__12) | (1 << SimpleSqlParser.T__13))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ArithOpContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_arithOp

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

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

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




    def arithOp(self):

        localctx = SimpleSqlParser.ArithOpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_arithOp)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 412
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SimpleSqlParser.T__4) | (1 << SimpleSqlParser.T__14) | (1 << SimpleSqlParser.T__15) | (1 << SimpleSqlParser.T__16) | (1 << SimpleSqlParser.T__17) | (1 << SimpleSqlParser.T__18))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UnaryOpContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return SimpleSqlParser.RULE_unaryOp

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

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

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




    def unaryOp(self):

        localctx = SimpleSqlParser.UnaryOpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_unaryOp)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 414
            _la = self._input.LA(1)
            if not(_la==SimpleSqlParser.T__14 or _la==SimpleSqlParser.T__15):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UnquotedIdentifierContext(ParserRuleContext):

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

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

        def LEFT(self):
            return self.getToken(SimpleSqlParser.LEFT, 0)

        def RIGHT(self):
            return self.getToken(SimpleSqlParser.RIGHT, 0)

        def getRuleIndex(self):
            return SimpleSqlParser.RULE_unquotedIdentifier

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

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

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




    def unquotedIdentifier(self):

        localctx = SimpleSqlParser.UnquotedIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_unquotedIdentifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 416
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SimpleSqlParser.LEFT) | (1 << SimpleSqlParser.RIGHT) | (1 << SimpleSqlParser.IDENTIFIER))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[9] = self.booleanExpression_sempred
        self._predicates[11] = self.valueExpression_sempred
        self._predicates[17] = self.relation_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 booleanExpression_sempred(self, localctx:BooleanExpressionContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 2)
         

            if predIndex == 1:
                return self.precpred(self._ctx, 1)
         

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

    def relation_sempred(self, localctx:RelationContext, predIndex:int):
            if predIndex == 3:
                return self.precpred(self._ctx, 5)
         

            if predIndex == 4:
                return self.precpred(self._ctx, 4)
         
