# type: ignore
# ruff: noqa
# flake8: noqa
# @omlish-generated
# Generated from Minisql.g4 by ANTLR 4.13.2
# encoding: utf-8
from ....text.antlr._runtime._all 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():
    return [
        4,1,67,419,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,
        6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,
        2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,
        7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,
        2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,
        7,33,1,0,1,0,1,0,1,0,1,1,1,1,1,2,1,2,1,2,1,2,5,2,79,8,2,10,2,12,
        2,82,9,2,3,2,84,8,2,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,3,1,4,1,4,5,4,
        96,8,4,10,4,12,4,99,9,4,1,5,1,5,3,5,103,8,5,1,5,1,5,1,6,1,6,3,6,
        109,8,6,1,6,1,6,1,6,5,6,114,8,6,10,6,12,6,117,9,6,1,6,1,6,1,6,1,
        6,5,6,123,8,6,10,6,12,6,126,9,6,3,6,128,8,6,1,6,1,6,3,6,132,8,6,
        1,6,1,6,1,6,3,6,137,8,6,1,6,1,6,3,6,141,8,6,1,6,1,6,1,6,1,6,1,6,
        5,6,148,8,6,10,6,12,6,151,9,6,3,6,153,8,6,1,7,1,7,1,7,3,7,158,8,
        7,1,7,3,7,161,8,7,3,7,163,8,7,1,8,1,8,1,9,1,9,1,9,3,9,170,8,9,1,
        9,1,9,3,9,174,8,9,1,9,1,9,1,9,1,9,1,9,1,9,5,9,182,8,9,10,9,12,9,
        185,9,9,1,10,1,10,1,10,1,10,1,10,3,10,192,8,10,1,10,1,10,3,10,196,
        8,10,1,10,1,10,1,10,1,10,1,10,5,10,203,8,10,10,10,12,10,206,9,10,
        1,10,1,10,1,10,3,10,211,8,10,1,10,1,10,1,10,1,10,1,10,1,10,3,10,
        219,8,10,1,10,1,10,3,10,223,8,10,1,11,1,11,1,11,1,11,1,11,3,11,230,
        8,11,1,11,1,11,1,11,1,11,5,11,236,8,11,10,11,12,11,239,9,11,1,12,
        1,12,1,12,1,12,1,12,5,12,246,8,12,10,12,12,12,249,9,12,3,12,251,
        8,12,1,12,1,12,3,12,255,8,12,1,12,1,12,1,12,1,12,1,12,3,12,262,8,
        12,1,12,1,12,5,12,266,8,12,10,12,12,12,269,9,12,1,12,1,12,3,12,273,
        8,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,3,12,285,
        8,12,1,13,1,13,1,13,1,13,1,13,1,13,3,13,293,8,13,1,14,1,14,1,14,
        1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,15,5,15,307,8,15,10,15,
        12,15,310,9,15,3,15,312,8,15,1,15,1,15,1,16,1,16,3,16,318,8,16,1,
        17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3,17,330,8,17,1,
        17,1,17,3,17,334,8,17,1,17,1,17,1,17,3,17,339,8,17,1,17,1,17,1,17,
        1,17,3,17,345,8,17,5,17,347,8,17,10,17,12,17,350,9,17,1,18,1,18,
        1,18,5,18,355,8,18,10,18,12,18,358,9,18,1,19,1,19,1,19,5,19,363,
        8,19,10,19,12,19,366,9,19,1,20,1,20,1,20,5,20,371,8,20,10,20,12,
        20,374,9,20,1,21,1,21,3,21,378,8,21,1,22,1,22,1,23,1,23,1,23,3,23,
        385,8,23,1,24,1,24,1,25,1,25,1,26,1,26,1,27,1,27,1,28,1,28,1,29,
        1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,3,29,409,
        8,29,1,30,1,30,1,31,1,31,1,32,1,32,1,33,1,33,1,33,0,3,18,22,34,34,
        0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,
        46,48,50,52,54,56,58,60,62,64,66,0,7,2,0,21,21,46,46,2,0,23,23,27,
        27,2,0,20,20,28,28,1,0,8,14,2,0,5,5,15,19,1,0,15,16,3,0,40,40,50,
        50,62,62,455,0,68,1,0,0,0,2,72,1,0,0,0,4,83,1,0,0,0,6,87,1,0,0,0,
        8,93,1,0,0,0,10,100,1,0,0,0,12,106,1,0,0,0,14,162,1,0,0,0,16,164,
        1,0,0,0,18,173,1,0,0,0,20,222,1,0,0,0,22,229,1,0,0,0,24,284,1,0,
        0,0,26,292,1,0,0,0,28,294,1,0,0,0,30,299,1,0,0,0,32,315,1,0,0,0,
        34,329,1,0,0,0,36,351,1,0,0,0,38,359,1,0,0,0,40,367,1,0,0,0,42,377,
        1,0,0,0,44,379,1,0,0,0,46,384,1,0,0,0,48,386,1,0,0,0,50,388,1,0,
        0,0,52,390,1,0,0,0,54,392,1,0,0,0,56,394,1,0,0,0,58,408,1,0,0,0,
        60,410,1,0,0,0,62,412,1,0,0,0,64,414,1,0,0,0,66,416,1,0,0,0,68,69,
        3,2,1,0,69,70,5,1,0,0,70,71,5,0,0,1,71,1,1,0,0,0,72,73,3,4,2,0,73,
        3,1,0,0,0,74,75,5,57,0,0,75,80,3,6,3,0,76,77,5,2,0,0,77,79,3,6,3,
        0,78,76,1,0,0,0,79,82,1,0,0,0,80,78,1,0,0,0,80,81,1,0,0,0,81,84,
        1,0,0,0,82,80,1,0,0,0,83,74,1,0,0,0,83,84,1,0,0,0,84,85,1,0,0,0,
        85,86,3,8,4,0,86,5,1,0,0,0,87,88,3,42,21,0,88,89,5,22,0,0,89,90,
        5,3,0,0,90,91,3,2,1,0,91,92,5,4,0,0,92,7,1,0,0,0,93,97,3,12,6,0,
        94,96,3,10,5,0,95,94,1,0,0,0,96,99,1,0,0,0,97,95,1,0,0,0,97,98,1,
        0,0,0,98,9,1,0,0,0,99,97,1,0,0,0,100,102,5,54,0,0,101,103,3,56,28,
        0,102,101,1,0,0,0,102,103,1,0,0,0,103,104,1,0,0,0,104,105,3,12,6,
        0,105,11,1,0,0,0,106,108,5,51,0,0,107,109,3,56,28,0,108,107,1,0,
        0,0,108,109,1,0,0,0,109,110,1,0,0,0,110,115,3,14,7,0,111,112,5,2,
        0,0,112,114,3,14,7,0,113,111,1,0,0,0,114,117,1,0,0,0,115,113,1,0,
        0,0,115,116,1,0,0,0,116,127,1,0,0,0,117,115,1,0,0,0,118,119,5,32,
        0,0,119,124,3,34,17,0,120,121,5,2,0,0,121,123,3,34,17,0,122,120,
        1,0,0,0,123,126,1,0,0,0,124,122,1,0,0,0,124,125,1,0,0,0,125,128,
        1,0,0,0,126,124,1,0,0,0,127,118,1,0,0,0,127,128,1,0,0,0,128,131,
        1,0,0,0,129,130,5,56,0,0,130,132,3,18,9,0,131,129,1,0,0,0,131,132,
        1,0,0,0,132,136,1,0,0,0,133,134,5,34,0,0,134,135,5,24,0,0,135,137,
        3,36,18,0,136,133,1,0,0,0,136,137,1,0,0,0,137,140,1,0,0,0,138,139,
        5,35,0,0,139,141,3,18,9,0,140,138,1,0,0,0,140,141,1,0,0,0,141,152,
        1,0,0,0,142,143,5,47,0,0,143,144,5,24,0,0,144,149,3,32,16,0,145,
        146,5,2,0,0,146,148,3,32,16,0,147,145,1,0,0,0,148,151,1,0,0,0,149,
        147,1,0,0,0,149,150,1,0,0,0,150,153,1,0,0,0,151,149,1,0,0,0,152,
        142,1,0,0,0,152,153,1,0,0,0,153,13,1,0,0,0,154,163,5,5,0,0,155,160,
        3,16,8,0,156,158,5,22,0,0,157,156,1,0,0,0,157,158,1,0,0,0,158,159,
        1,0,0,0,159,161,3,42,21,0,160,157,1,0,0,0,160,161,1,0,0,0,161,163,
        1,0,0,0,162,154,1,0,0,0,162,155,1,0,0,0,163,15,1,0,0,0,164,165,3,
        18,9,0,165,17,1,0,0,0,166,167,6,9,-1,0,167,169,3,22,11,0,168,170,
        3,20,10,0,169,168,1,0,0,0,169,170,1,0,0,0,170,174,1,0,0,0,171,172,
        5,43,0,0,172,174,3,18,9,3,173,166,1,0,0,0,173,171,1,0,0,0,174,183,
        1,0,0,0,175,176,10,2,0,0,176,177,7,0,0,0,177,182,3,18,9,3,178,179,
        10,1,0,0,179,180,5,6,0,0,180,182,3,42,21,0,181,175,1,0,0,0,181,178,
        1,0,0,0,182,185,1,0,0,0,183,181,1,0,0,0,183,184,1,0,0,0,184,19,1,
        0,0,0,185,183,1,0,0,0,186,187,3,60,30,0,187,188,3,22,11,0,188,223,
        1,0,0,0,189,191,5,38,0,0,190,192,5,43,0,0,191,190,1,0,0,0,191,192,
        1,0,0,0,192,193,1,0,0,0,193,223,5,44,0,0,194,196,5,43,0,0,195,194,
        1,0,0,0,195,196,1,0,0,0,196,197,1,0,0,0,197,198,5,36,0,0,198,199,
        5,3,0,0,199,204,3,16,8,0,200,201,5,2,0,0,201,203,3,16,8,0,202,200,
        1,0,0,0,203,206,1,0,0,0,204,202,1,0,0,0,204,205,1,0,0,0,205,207,
        1,0,0,0,206,204,1,0,0,0,207,208,5,4,0,0,208,223,1,0,0,0,209,211,
        5,43,0,0,210,209,1,0,0,0,210,211,1,0,0,0,211,212,1,0,0,0,212,213,
        5,36,0,0,213,214,5,3,0,0,214,215,3,2,1,0,215,216,5,4,0,0,216,223,
        1,0,0,0,217,219,5,43,0,0,218,217,1,0,0,0,218,219,1,0,0,0,219,220,
        1,0,0,0,220,221,5,41,0,0,221,223,3,16,8,0,222,186,1,0,0,0,222,189,
        1,0,0,0,222,195,1,0,0,0,222,210,1,0,0,0,222,218,1,0,0,0,223,21,1,
        0,0,0,224,225,6,11,-1,0,225,230,3,24,12,0,226,227,3,64,32,0,227,
        228,3,22,11,2,228,230,1,0,0,0,229,224,1,0,0,0,229,226,1,0,0,0,230,
        237,1,0,0,0,231,232,10,1,0,0,232,233,3,62,31,0,233,234,3,22,11,2,
        234,236,1,0,0,0,235,231,1,0,0,0,236,239,1,0,0,0,237,235,1,0,0,0,
        237,238,1,0,0,0,238,23,1,0,0,0,239,237,1,0,0,0,240,241,3,38,19,0,
        241,250,5,3,0,0,242,247,3,16,8,0,243,244,5,2,0,0,244,246,3,16,8,
        0,245,243,1,0,0,0,246,249,1,0,0,0,247,245,1,0,0,0,247,248,1,0,0,
        0,248,251,1,0,0,0,249,247,1,0,0,0,250,242,1,0,0,0,250,251,1,0,0,
        0,251,252,1,0,0,0,252,254,5,4,0,0,253,255,3,30,15,0,254,253,1,0,
        0,0,254,255,1,0,0,0,255,285,1,0,0,0,256,257,3,38,19,0,257,258,5,
        3,0,0,258,259,5,5,0,0,259,261,5,4,0,0,260,262,3,30,15,0,261,260,
        1,0,0,0,261,262,1,0,0,0,262,285,1,0,0,0,263,267,5,25,0,0,264,266,
        3,28,14,0,265,264,1,0,0,0,266,269,1,0,0,0,267,265,1,0,0,0,267,268,
        1,0,0,0,268,272,1,0,0,0,269,267,1,0,0,0,270,271,5,29,0,0,271,273,
        3,16,8,0,272,270,1,0,0,0,272,273,1,0,0,0,273,274,1,0,0,0,274,285,
        5,30,0,0,275,276,5,3,0,0,276,277,3,2,1,0,277,278,5,4,0,0,278,285,
        1,0,0,0,279,280,5,3,0,0,280,281,3,16,8,0,281,282,5,4,0,0,282,285,
        1,0,0,0,283,285,3,26,13,0,284,240,1,0,0,0,284,256,1,0,0,0,284,263,
        1,0,0,0,284,275,1,0,0,0,284,279,1,0,0,0,284,283,1,0,0,0,285,25,1,
        0,0,0,286,293,3,38,19,0,287,293,3,46,23,0,288,293,3,48,24,0,289,
        293,3,50,25,0,290,293,3,52,26,0,291,293,3,54,27,0,292,286,1,0,0,
        0,292,287,1,0,0,0,292,288,1,0,0,0,292,289,1,0,0,0,292,290,1,0,0,
        0,292,291,1,0,0,0,293,27,1,0,0,0,294,295,5,55,0,0,295,296,3,16,8,
        0,296,297,5,52,0,0,297,298,3,16,8,0,298,29,1,0,0,0,299,300,5,49,
        0,0,300,311,5,3,0,0,301,302,5,47,0,0,302,303,5,24,0,0,303,308,3,
        32,16,0,304,305,5,2,0,0,305,307,3,32,16,0,306,304,1,0,0,0,307,310,
        1,0,0,0,308,306,1,0,0,0,308,309,1,0,0,0,309,312,1,0,0,0,310,308,
        1,0,0,0,311,301,1,0,0,0,311,312,1,0,0,0,312,313,1,0,0,0,313,314,
        5,4,0,0,314,31,1,0,0,0,315,317,3,16,8,0,316,318,7,1,0,0,317,316,
        1,0,0,0,317,318,1,0,0,0,318,33,1,0,0,0,319,320,6,17,-1,0,320,321,
        5,3,0,0,321,322,3,2,1,0,322,323,5,4,0,0,323,330,1,0,0,0,324,325,
        5,3,0,0,325,326,3,34,17,0,326,327,5,4,0,0,327,330,1,0,0,0,328,330,
        3,38,19,0,329,319,1,0,0,0,329,324,1,0,0,0,329,328,1,0,0,0,330,348,
        1,0,0,0,331,333,10,5,0,0,332,334,5,22,0,0,333,332,1,0,0,0,333,334,
        1,0,0,0,334,335,1,0,0,0,335,347,3,42,21,0,336,338,10,4,0,0,337,339,
        3,58,29,0,338,337,1,0,0,0,338,339,1,0,0,0,339,340,1,0,0,0,340,341,
        5,39,0,0,341,344,3,34,17,0,342,343,5,45,0,0,343,345,3,18,9,0,344,
        342,1,0,0,0,344,345,1,0,0,0,345,347,1,0,0,0,346,331,1,0,0,0,346,
        336,1,0,0,0,347,350,1,0,0,0,348,346,1,0,0,0,348,349,1,0,0,0,349,
        35,1,0,0,0,350,348,1,0,0,0,351,356,3,16,8,0,352,353,5,2,0,0,353,
        355,3,16,8,0,354,352,1,0,0,0,355,358,1,0,0,0,356,354,1,0,0,0,356,
        357,1,0,0,0,357,37,1,0,0,0,358,356,1,0,0,0,359,364,3,42,21,0,360,
        361,5,7,0,0,361,363,3,42,21,0,362,360,1,0,0,0,363,366,1,0,0,0,364,
        362,1,0,0,0,364,365,1,0,0,0,365,39,1,0,0,0,366,364,1,0,0,0,367,372,
        3,42,21,0,368,369,5,2,0,0,369,371,3,42,21,0,370,368,1,0,0,0,371,
        374,1,0,0,0,372,370,1,0,0,0,372,373,1,0,0,0,373,41,1,0,0,0,374,372,
        1,0,0,0,375,378,3,66,33,0,376,378,3,44,22,0,377,375,1,0,0,0,377,
        376,1,0,0,0,378,43,1,0,0,0,379,380,5,63,0,0,380,45,1,0,0,0,381,385,
        5,59,0,0,382,385,5,60,0,0,383,385,5,61,0,0,384,381,1,0,0,0,384,382,
        1,0,0,0,384,383,1,0,0,0,385,47,1,0,0,0,386,387,5,58,0,0,387,49,1,
        0,0,0,388,389,5,44,0,0,389,51,1,0,0,0,390,391,5,53,0,0,391,53,1,
        0,0,0,392,393,5,31,0,0,393,55,1,0,0,0,394,395,7,2,0,0,395,57,1,0,
        0,0,396,409,5,37,0,0,397,409,5,40,0,0,398,399,5,40,0,0,399,409,5,
        48,0,0,400,409,5,50,0,0,401,402,5,50,0,0,402,409,5,48,0,0,403,409,
        5,33,0,0,404,405,5,33,0,0,405,409,5,48,0,0,406,409,5,26,0,0,407,
        409,5,42,0,0,408,396,1,0,0,0,408,397,1,0,0,0,408,398,1,0,0,0,408,
        400,1,0,0,0,408,401,1,0,0,0,408,403,1,0,0,0,408,404,1,0,0,0,408,
        406,1,0,0,0,408,407,1,0,0,0,409,59,1,0,0,0,410,411,7,3,0,0,411,61,
        1,0,0,0,412,413,7,4,0,0,413,63,1,0,0,0,414,415,7,5,0,0,415,65,1,
        0,0,0,416,417,7,6,0,0,417,67,1,0,0,0,51,80,83,97,102,108,115,124,
        127,131,136,140,149,152,157,160,162,169,173,181,183,191,195,204,
        210,218,222,229,237,247,250,254,261,267,272,284,292,308,311,317,
        329,333,338,344,346,348,356,364,372,377,384,408
    ]

class MinisqlParser ( Parser ):

    grammarFileName = "Minisql.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", "IDENT", 
                      "QUOTED_IDENT", "COMMENT", "BLOCK_COMMENT", "WS", 
                      "DELIMITER" ]

    RULE_singleStmt = 0
    RULE_select = 1
    RULE_cteSelect = 2
    RULE_cte = 3
    RULE_unionSelect = 4
    RULE_unionItem = 5
    RULE_primarySelect = 6
    RULE_selectItem = 7
    RULE_expr = 8
    RULE_booleanExpr = 9
    RULE_predicate = 10
    RULE_valueExpr = 11
    RULE_primaryExpr = 12
    RULE_simpleExpr = 13
    RULE_caseItem = 14
    RULE_over = 15
    RULE_sortItem = 16
    RULE_relation = 17
    RULE_groupBy = 18
    RULE_qualifiedName = 19
    RULE_identList = 20
    RULE_ident = 21
    RULE_quotedIdent = 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_unquotedIdent = 33

    ruleNames =  [ "singleStmt", "select", "cteSelect", "cte", "unionSelect", 
                   "unionItem", "primarySelect", "selectItem", "expr", "booleanExpr", 
                   "predicate", "valueExpr", "primaryExpr", "simpleExpr", 
                   "caseItem", "over", "sortItem", "relation", "groupBy", 
                   "qualifiedName", "identList", "ident", "quotedIdent", 
                   "number", "string", "null", "true", "false", "setQuantifier", 
                   "joinType", "cmpOp", "arithOp", "unaryOp", "unquotedIdent" ]

    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
    IDENT=62
    QUOTED_IDENT=63
    COMMENT=64
    BLOCK_COMMENT=65
    WS=66
    DELIMITER=67

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




    class SingleStmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


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

        def getRuleIndex(self):
            return MinisqlParser.RULE_singleStmt

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

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

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




    def singleStmt(self):

        localctx = MinisqlParser.SingleStmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_singleStmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 68
            self.select()
            self.state = 69
            self.match(MinisqlParser.T__0)
            self.state = 70
            self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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):
        __slots__ = 'parser'

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

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


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

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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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==57:
                self.state = 74
                self.match(MinisqlParser.WITH)
                self.state = 75
                self.cte()
                self.state = 80
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==2:
                    self.state = 76
                    self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

        def ident(self):
            return self.getTypedRuleContext(MinisqlParser.IdentContext,0)


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

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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.CteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_cte)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 87
            self.ident()
            self.state = 88
            self.match(MinisqlParser.AS)
            self.state = 89
            self.match(MinisqlParser.T__2)
            self.state = 90
            self.select()
            self.state = 91
            self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

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


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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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==54:
                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):
        __slots__ = 'parser'

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

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

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


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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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(MinisqlParser.UNION)
            self.state = 102
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==20 or _la==28:
                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):
        __slots__ = 'parser'

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

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

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


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


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

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


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

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

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

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


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

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

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


        def booleanExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.BooleanExprContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.BooleanExprContext,i)


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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(MinisqlParser.SELECT)
            self.state = 108
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==20 or _la==28:
                self.state = 107
                self.setQuantifier()


            self.state = 110
            self.selectItem()
            self.state = 115
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==2:
                self.state = 111
                self.match(MinisqlParser.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==32:
                self.state = 118
                self.match(MinisqlParser.FROM)
                self.state = 119
                self.relation(0)
                self.state = 124
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==2:
                    self.state = 120
                    self.match(MinisqlParser.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==56:
                self.state = 129
                self.match(MinisqlParser.WHERE)
                self.state = 130
                localctx.where = self.booleanExpr(0)


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


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


            self.state = 152
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==47:
                self.state = 142
                self.match(MinisqlParser.ORDER)
                self.state = 143
                self.match(MinisqlParser.BY)
                self.state = 144
                self.sortItem()
                self.state = 149
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==2:
                    self.state = 145
                    self.match(MinisqlParser.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):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.RULE_selectItem

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



    class ExprSelectItemContext(SelectItemContext):

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

        def expr(self):
            return self.getTypedRuleContext(MinisqlParser.ExprContext,0)

        def ident(self):
            return self.getTypedRuleContext(MinisqlParser.IdentContext,0)

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

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

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

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


    class AllSelectItemContext(SelectItemContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a MinisqlParser.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 = MinisqlParser.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 [5]:
                localctx = MinisqlParser.AllSelectItemContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 154
                self.match(MinisqlParser.T__4)
                pass
            elif token in [3, 15, 16, 25, 31, 40, 43, 44, 50, 53, 58, 59, 60, 61, 62, 63]:
                localctx = MinisqlParser.ExprSelectItemContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 155
                self.expr()
                self.state = 160
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & -4610559019004723200) != 0):
                    self.state = 157
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==22:
                        self.state = 156
                        self.match(MinisqlParser.AS)


                    self.state = 159
                    self.ident()


                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 ExprContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def booleanExpr(self):
            return self.getTypedRuleContext(MinisqlParser.BooleanExprContext,0)


        def getRuleIndex(self):
            return MinisqlParser.RULE_expr

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

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

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




    def expr(self):

        localctx = MinisqlParser.ExprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_expr)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 164
            self.booleanExpr(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BooleanExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.RULE_booleanExpr

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


    class UnaryBooleanExprContext(BooleanExprContext):

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

        def booleanExpr(self):
            return self.getTypedRuleContext(MinisqlParser.BooleanExprContext,0)

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

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

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

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


    class PredicatedBooleanExprContext(BooleanExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a MinisqlParser.BooleanExprContext
            super().__init__(parser)
            self._valueExpr = None # ValueExprContext
            self.copyFrom(ctx)

        def valueExpr(self):
            return self.getTypedRuleContext(MinisqlParser.ValueExprContext,0)

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


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

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

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


    class BinaryBooleanExprContext(BooleanExprContext):

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

        def booleanExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.BooleanExprContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.BooleanExprContext,i)

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

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

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

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


    class CastBooleanExprContext(BooleanExprContext):

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

        def booleanExpr(self):
            return self.getTypedRuleContext(MinisqlParser.BooleanExprContext,0)

        def ident(self):
            return self.getTypedRuleContext(MinisqlParser.IdentContext,0)


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

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

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



    def booleanExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = MinisqlParser.BooleanExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 18
        self.enterRecursionRule(localctx, 18, self.RULE_booleanExpr, _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 [3, 15, 16, 25, 31, 40, 44, 50, 53, 58, 59, 60, 61, 62, 63]:
                localctx = MinisqlParser.PredicatedBooleanExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 167
                localctx._valueExpr = self.valueExpr(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._valueExpr)


                pass
            elif token in [43]:
                localctx = MinisqlParser.UnaryBooleanExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 171
                localctx.op = self.match(MinisqlParser.NOT)
                self.state = 172
                self.booleanExpr(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 = MinisqlParser.BinaryBooleanExprContext(self, MinisqlParser.BooleanExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_booleanExpr)
                        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==21 or _la==46):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 177
                        self.booleanExpr(3)
                        pass

                    elif la_ == 2:
                        localctx = MinisqlParser.CastBooleanExprContext(self, MinisqlParser.BooleanExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_booleanExpr)
                        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(MinisqlParser.T__5)
                        self.state = 180
                        self.ident()
                        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):
        __slots__ = 'parser'

        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 MinisqlParser.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 MinisqlParser.PredicateContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def IS(self):
            return self.getToken(MinisqlParser.IS, 0)
        def NULL(self):
            return self.getToken(MinisqlParser.NULL, 0)
        def NOT(self):
            return self.getToken(MinisqlParser.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 MinisqlParser.PredicateContext
            super().__init__(parser)
            self.right = None # ValueExprContext
            self.copyFrom(ctx)

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

        def valueExpr(self):
            return self.getTypedRuleContext(MinisqlParser.ValueExprContext,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 MinisqlParser.PredicateContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def LIKE(self):
            return self.getToken(MinisqlParser.LIKE, 0)
        def expr(self):
            return self.getTypedRuleContext(MinisqlParser.ExprContext,0)

        def NOT(self):
            return self.getToken(MinisqlParser.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 MinisqlParser.PredicateContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

        def NOT(self):
            return self.getToken(MinisqlParser.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 MinisqlParser.PredicateContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def IN(self):
            return self.getToken(MinisqlParser.IN, 0)
        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.ExprContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.ExprContext,i)

        def NOT(self):
            return self.getToken(MinisqlParser.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 = MinisqlParser.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 = MinisqlParser.CmpPredicateContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 186
                self.cmpOp()
                self.state = 187
                localctx.right = self.valueExpr(0)
                pass

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


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

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


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

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

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


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

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


                self.state = 220
                self.match(MinisqlParser.LIKE)
                self.state = 221
                self.expr()
                pass


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


    class ValueExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.RULE_valueExpr

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


    class ArithValueExprContext(ValueExprContext):

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

        def valueExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.ValueExprContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.ValueExprContext,i)

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


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

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

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


    class UnaryValueExprContext(ValueExprContext):

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

        def valueExpr(self):
            return self.getTypedRuleContext(MinisqlParser.ValueExprContext,0)

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


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

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

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


    class PrimaryValueExprContext(ValueExprContext):

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

        def primaryExpr(self):
            return self.getTypedRuleContext(MinisqlParser.PrimaryExprContext,0)


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

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

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



    def valueExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = MinisqlParser.ValueExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 22
        self.enterRecursionRule(localctx, 22, self.RULE_valueExpr, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 229
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [3, 25, 31, 40, 44, 50, 53, 58, 59, 60, 61, 62, 63]:
                localctx = MinisqlParser.PrimaryValueExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 225
                self.primaryExpr()
                pass
            elif token in [15, 16]:
                localctx = MinisqlParser.UnaryValueExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 226
                localctx.op = self.unaryOp()
                self.state = 227
                self.valueExpr(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 = MinisqlParser.ArithValueExprContext(self, MinisqlParser.ValueExprContext(self, _parentctx, _parentState))
                    localctx.left = _prevctx
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_valueExpr)
                    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.valueExpr(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 PrimaryExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.RULE_primaryExpr

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



    class SelectExprContext(PrimaryExprContext):

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

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


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

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

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


    class SimplePrimaryExprContext(PrimaryExprContext):

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

        def simpleExpr(self):
            return self.getTypedRuleContext(MinisqlParser.SimpleExprContext,0)


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

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

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


    class StarFunctionCallExprContext(PrimaryExprContext):

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

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

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


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

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

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


    class FunctionCallExprContext(PrimaryExprContext):

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

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

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.ExprContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.ExprContext,i)

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


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

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

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


    class CaseExprContext(PrimaryExprContext):

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

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

        def ELSE(self):
            return self.getToken(MinisqlParser.ELSE, 0)
        def expr(self):
            return self.getTypedRuleContext(MinisqlParser.ExprContext,0)


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

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

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


    class ParenExprContext(PrimaryExprContext):

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

        def expr(self):
            return self.getTypedRuleContext(MinisqlParser.ExprContext,0)


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

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

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



    def primaryExpr(self):

        localctx = MinisqlParser.PrimaryExprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_primaryExpr)
        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 = MinisqlParser.FunctionCallExprContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 240
                self.qualifiedName()
                self.state = 241
                self.match(MinisqlParser.T__2)
                self.state = 250
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & -278069787018297336) != 0):
                    self.state = 242
                    self.expr()
                    self.state = 247
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while _la==2:
                        self.state = 243
                        self.match(MinisqlParser.T__1)
                        self.state = 244
                        self.expr()
                        self.state = 249
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)



                self.state = 252
                self.match(MinisqlParser.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 = MinisqlParser.StarFunctionCallExprContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 256
                self.qualifiedName()
                self.state = 257
                self.match(MinisqlParser.T__2)
                self.state = 258
                self.match(MinisqlParser.T__4)
                self.state = 259
                self.match(MinisqlParser.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 = MinisqlParser.CaseExprContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 263
                self.match(MinisqlParser.CASE)
                self.state = 267
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==55:
                    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==29:
                    self.state = 270
                    self.match(MinisqlParser.ELSE)
                    self.state = 271
                    self.expr()


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

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

            elif la_ == 5:
                localctx = MinisqlParser.ParenExprContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 279
                self.match(MinisqlParser.T__2)
                self.state = 280
                self.expr()
                self.state = 281
                self.match(MinisqlParser.T__3)
                pass

            elif la_ == 6:
                localctx = MinisqlParser.SimplePrimaryExprContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 283
                self.simpleExpr()
                pass


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


    class SimpleExprContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


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


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


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


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


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


        def getRuleIndex(self):
            return MinisqlParser.RULE_simpleExpr

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

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

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




    def simpleExpr(self):

        localctx = MinisqlParser.SimpleExprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_simpleExpr)
        try:
            self.state = 292
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [40, 50, 62, 63]:
                self.enterOuterAlt(localctx, 1)
                self.state = 286
                self.qualifiedName()
                pass
            elif token in [59, 60, 61]:
                self.enterOuterAlt(localctx, 2)
                self.state = 287
                self.number()
                pass
            elif token in [58]:
                self.enterOuterAlt(localctx, 3)
                self.state = 288
                self.string()
                pass
            elif token in [44]:
                self.enterOuterAlt(localctx, 4)
                self.state = 289
                self.null()
                pass
            elif token in [53]:
                self.enterOuterAlt(localctx, 5)
                self.state = 290
                self.true()
                pass
            elif token in [31]:
                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):
        __slots__ = 'parser'

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

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

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.ExprContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.ExprContext,i)


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

        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.CaseItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_caseItem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 294
            self.match(MinisqlParser.WHEN)
            self.state = 295
            self.expr()
            self.state = 296
            self.match(MinisqlParser.THEN)
            self.state = 297
            self.expr()
        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):
        __slots__ = 'parser'

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

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

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

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

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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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(MinisqlParser.OVER)
            self.state = 300
            self.match(MinisqlParser.T__2)
            self.state = 311
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==47:
                self.state = 301
                self.match(MinisqlParser.ORDER)
                self.state = 302
                self.match(MinisqlParser.BY)
                self.state = 303
                self.sortItem()
                self.state = 308
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==2:
                    self.state = 304
                    self.match(MinisqlParser.T__1)
                    self.state = 305
                    self.sortItem()
                    self.state = 310
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 313
            self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

        def expr(self):
            return self.getTypedRuleContext(MinisqlParser.ExprContext,0)


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

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

        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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.expr()
            self.state = 317
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==23 or _la==27:
                self.state = 316
                localctx.direction = self._input.LT(1)
                _la = self._input.LA(1)
                if not(_la==23 or _la==27):
                    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):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.RULE_relation

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


    class AliasedRelationContext(RelationContext):

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

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

        def ident(self):
            return self.getTypedRuleContext(MinisqlParser.IdentContext,0)

        def AS(self):
            return self.getToken(MinisqlParser.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 MinisqlParser.RelationContext
            super().__init__(parser)
            self.left = None # RelationContext
            self.ty = None # JoinTypeContext
            self.right = None # RelationContext
            self.cond = None # BooleanExprContext
            self.copyFrom(ctx)

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

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

        def booleanExpr(self):
            return self.getTypedRuleContext(MinisqlParser.BooleanExprContext,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 MinisqlParser.RelationContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def select(self):
            return self.getTypedRuleContext(MinisqlParser.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 MinisqlParser.RelationContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def qualifiedName(self):
            return self.getTypedRuleContext(MinisqlParser.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 MinisqlParser.RelationContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def relation(self):
            return self.getTypedRuleContext(MinisqlParser.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 = MinisqlParser.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 = MinisqlParser.SelectRelationContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

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

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

            elif la_ == 3:
                localctx = MinisqlParser.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 = MinisqlParser.AliasedRelationContext(self, MinisqlParser.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==22:
                            self.state = 332
                            self.match(MinisqlParser.AS)


                        self.state = 335
                        self.ident()
                        pass

                    elif la_ == 2:
                        localctx = MinisqlParser.JoinRelationContext(self, MinisqlParser.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) & 1131543560978432) != 0):
                            self.state = 337
                            localctx.ty = self.joinType()


                        self.state = 340
                        self.match(MinisqlParser.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(MinisqlParser.ON)
                            self.state = 343
                            localctx.cond = self.booleanExpr(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):
        __slots__ = 'parser'

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

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.ExprContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.ExprContext,i)


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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.expr()
            self.state = 356
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==2:
                self.state = 352
                self.match(MinisqlParser.T__1)
                self.state = 353
                self.expr()
                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):
        __slots__ = 'parser'

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

        def ident(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.IdentContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.IdentContext,i)


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.QualifiedNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_qualifiedName)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 359
            self.ident()
            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(MinisqlParser.T__6)
                    self.state = 361
                    self.ident() 
                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 IdentListContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ident(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(MinisqlParser.IdentContext)
            else:
                return self.getTypedRuleContext(MinisqlParser.IdentContext,i)


        def getRuleIndex(self):
            return MinisqlParser.RULE_identList

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

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

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




    def identList(self):

        localctx = MinisqlParser.IdentListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_identList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 367
            self.ident()
            self.state = 372
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==2:
                self.state = 368
                self.match(MinisqlParser.T__1)
                self.state = 369
                self.ident()
                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 IdentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def unquotedIdent(self):
            return self.getTypedRuleContext(MinisqlParser.UnquotedIdentContext,0)


        def quotedIdent(self):
            return self.getTypedRuleContext(MinisqlParser.QuotedIdentContext,0)


        def getRuleIndex(self):
            return MinisqlParser.RULE_ident

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

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

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




    def ident(self):

        localctx = MinisqlParser.IdentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_ident)
        try:
            self.state = 377
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [40, 50, 62]:
                self.enterOuterAlt(localctx, 1)
                self.state = 375
                self.unquotedIdent()
                pass
            elif token in [63]:
                self.enterOuterAlt(localctx, 2)
                self.state = 376
                self.quotedIdent()
                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 QuotedIdentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def QUOTED_IDENT(self):
            return self.getToken(MinisqlParser.QUOTED_IDENT, 0)

        def getRuleIndex(self):
            return MinisqlParser.RULE_quotedIdent

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

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

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




    def quotedIdent(self):

        localctx = MinisqlParser.QuotedIdentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_quotedIdent)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 379
            self.match(MinisqlParser.QUOTED_IDENT)
        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):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.RULE_number

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



    class DecimalNumberContext(NumberContext):

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

        def DECIMAL_VALUE(self):
            return self.getToken(MinisqlParser.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 MinisqlParser.NumberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def INTEGER_VALUE(self):
            return self.getToken(MinisqlParser.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 MinisqlParser.NumberContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def FLOAT_VALUE(self):
            return self.getToken(MinisqlParser.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 = MinisqlParser.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 [59]:
                localctx = MinisqlParser.IntegerNumberContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 381
                self.match(MinisqlParser.INTEGER_VALUE)
                pass
            elif token in [60]:
                localctx = MinisqlParser.DecimalNumberContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 382
                self.match(MinisqlParser.DECIMAL_VALUE)
                pass
            elif token in [61]:
                localctx = MinisqlParser.FloatNumberContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 383
                self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.StringContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_string)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 386
            self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.NullContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_null)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 388
            self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.TrueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_true)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 390
            self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.FalseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_false)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 392
            self.match(MinisqlParser.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):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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==20 or _la==28):
                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):
        __slots__ = 'parser'

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

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

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

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

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

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

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

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

        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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(MinisqlParser.INNER)
                pass

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

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

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

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

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

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

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

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 407
                self.match(MinisqlParser.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):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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) & 32512) != 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):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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) & 1015840) != 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):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return MinisqlParser.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 = MinisqlParser.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==15 or _la==16):
                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 UnquotedIdentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IDENT(self):
            return self.getToken(MinisqlParser.IDENT, 0)

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

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

        def getRuleIndex(self):
            return MinisqlParser.RULE_unquotedIdent

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

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

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




    def unquotedIdent(self):

        localctx = MinisqlParser.UnquotedIdentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_unquotedIdent)
        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) & 4612813017845858304) != 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.booleanExpr_sempred
        self._predicates[11] = self.valueExpr_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 booleanExpr_sempred(self, localctx:BooleanExprContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 2)
         

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

    def valueExpr_sempred(self, localctx:ValueExprContext, 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)
         




