# Generated from src/queryparser/postgresql/PostgreSQLParser.g4 by ANTLR 4.8
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\u00d9")
        buf.write("\u0437\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
        buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
        buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31")
        buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36")
        buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t")
        buf.write("&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.\t.\4")
        buf.write("/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t\64")
        buf.write("\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t")
        buf.write(";\4<\t<\4=\t=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\t")
        buf.write("D\4E\tE\4F\tF\4G\tG\4H\tH\4I\tI\4J\tJ\4K\tK\4L\tL\4M\t")
        buf.write("M\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT\4U\tU\4V\t")
        buf.write("V\4W\tW\4X\tX\4Y\tY\4Z\tZ\3\2\3\2\3\3\3\3\3\3\3\3\5\3")
        buf.write("\u00bb\n\3\3\3\3\3\3\3\3\3\5\3\u00c1\n\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3\u00cd\n\3\3\3\5\3\u00d0")
        buf.write("\n\3\3\3\3\3\3\3\3\3\3\3\5\3\u00d7\n\3\3\4\3\4\3\5\3\5")
        buf.write("\3\6\3\6\3\7\5\7\u00e0\n\7\3\7\3\7\3\b\3\b\3\t\3\t\3\n")
        buf.write("\3\n\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\20")
        buf.write("\3\20\3\20\3\20\3\20\3\20\5\20\u00fa\n\20\3\21\3\21\3")
        buf.write("\21\3\21\3\21\3\21\5\21\u0102\n\21\3\22\3\22\5\22\u0106")
        buf.write("\n\22\3\22\3\22\3\22\3\22\5\22\u010c\n\22\3\22\5\22\u010f")
        buf.write("\n\22\3\22\5\22\u0112\n\22\3\22\5\22\u0115\n\22\5\22\u0117")
        buf.write("\n\22\3\22\5\22\u011a\n\22\3\22\5\22\u011d\n\22\3\22\5")
        buf.write("\22\u0120\n\22\3\22\3\22\5\22\u0124\n\22\3\22\5\22\u0127")
        buf.write("\n\22\3\23\5\23\u012a\n\23\3\23\3\23\3\24\3\24\3\24\5")
        buf.write("\24\u0131\n\24\3\25\3\25\3\25\5\25\u0136\n\25\3\25\3\25")
        buf.write("\5\25\u013a\n\25\3\25\5\25\u013d\n\25\3\25\3\25\5\25\u0141")
        buf.write("\n\25\3\26\3\26\3\26\5\26\u0146\n\26\3\26\3\26\5\26\u014a")
        buf.write("\n\26\3\26\3\26\3\27\3\27\3\27\3\27\3\27\6\27\u0153\n")
        buf.write("\27\r\27\16\27\u0154\3\30\3\30\3\30\3\30\3\30\3\30\6\30")
        buf.write("\u015d\n\30\r\30\16\30\u015e\3\31\3\31\3\31\3\31\7\31")
        buf.write("\u0165\n\31\f\31\16\31\u0168\13\31\3\31\3\31\3\32\3\32")
        buf.write("\3\33\3\33\3\33\5\33\u0171\n\33\3\33\3\33\3\33\5\33\u0176")
        buf.write("\n\33\3\33\3\33\5\33\u017a\n\33\3\34\3\34\3\34\3\34\3")
        buf.write("\34\3\34\5\34\u0182\n\34\3\34\3\34\5\34\u0186\n\34\3\34")
        buf.write("\5\34\u0189\n\34\5\34\u018b\n\34\3\35\3\35\3\35\7\35\u0190")
        buf.write("\n\35\f\35\16\35\u0193\13\35\3\36\5\36\u0196\n\36\3\36")
        buf.write("\3\36\3\37\3\37\3\37\5\37\u019d\n\37\3\37\3\37\3\37\3")
        buf.write("\37\5\37\u01a3\n\37\5\37\u01a5\n\37\3\37\5\37\u01a8\n")
        buf.write("\37\5\37\u01aa\n\37\3 \3 \3 \7 \u01af\n \f \16 \u01b2")
        buf.write("\13 \3!\3!\3!\3!\7!\u01b8\n!\f!\16!\u01bb\13!\3!\3!\3")
        buf.write("\"\3\"\3\"\5\"\u01c2\n\"\3#\3#\3#\5#\u01c7\n#\3$\3$\3")
        buf.write("$\7$\u01cc\n$\f$\16$\u01cf\13$\3%\3%\3%\7%\u01d4\n%\f")
        buf.write("%\16%\u01d7\13%\3&\5&\u01da\n&\3&\3&\5&\u01de\n&\3&\3")
        buf.write("&\5&\u01e2\n&\3\'\3\'\3\'\3\'\3\'\7\'\u01e9\n\'\f\'\16")
        buf.write("\'\u01ec\13\'\5\'\u01ee\n\'\3\'\5\'\u01f1\n\'\3\'\3\'")
        buf.write("\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3")
        buf.write("\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\5\'\u020c\n\'\3")
        buf.write("\'\3\'\5\'\u0210\n\'\5\'\u0212\n\'\3\'\3\'\5\'\u0216\n")
        buf.write("\'\3(\3(\3(\3(\3(\7(\u021d\n(\f(\16(\u0220\13(\3(\3(\5")
        buf.write("(\u0224\n(\3)\3)\3)\5)\u0229\n)\3)\5)\u022c\n)\3*\3*\3")
        buf.write("*\3+\3+\3+\3+\5+\u0235\n+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3")
        buf.write("+\3+\3+\3+\3+\5+\u0245\n+\3,\3,\3,\7,\u024a\n,\f,\16,")
        buf.write("\u024d\13,\3-\3-\3.\3.\3.\7.\u0254\n.\f.\16.\u0257\13")
        buf.write(".\3/\3/\3/\3/\3/\3/\3/\5/\u0260\n/\5/\u0262\n/\3\60\3")
        buf.write("\60\3\60\3\61\3\61\3\61\3\61\5\61\u026b\n\61\3\62\3\62")
        buf.write("\3\62\3\62\5\62\u0271\n\62\3\62\3\62\3\62\3\62\3\62\5")
        buf.write("\62\u0278\n\62\3\63\3\63\3\64\3\64\3\64\3\65\3\65\3\66")
        buf.write("\3\66\3\66\3\66\3\66\7\66\u0286\n\66\f\66\16\66\u0289")
        buf.write("\13\66\3\67\3\67\5\67\u028d\n\67\3\67\3\67\5\67\u0291")
        buf.write("\n\67\5\67\u0293\n\67\3\67\3\67\3\67\3\67\5\67\u0299\n")
        buf.write("\67\38\38\38\38\38\39\39\3:\3:\3:\7:\u02a5\n:\f:\16:\u02a8")
        buf.write("\13:\3;\5;\u02ab\n;\3;\3;\3;\5;\u02b0\n;\3;\3;\3;\3;\5")
        buf.write(";\u02b6\n;\3;\3;\3;\5;\u02bb\n;\3;\3;\5;\u02bf\n;\3;\3")
        buf.write(";\5;\u02c3\n;\3;\3;\3;\5;\u02c8\n;\3<\3<\3<\3<\5<\u02ce")
        buf.write("\n<\3=\3=\5=\u02d2\n=\3=\3=\5=\u02d6\n=\3>\3>\3>\3?\3")
        buf.write("?\3@\3@\3@\7@\u02e0\n@\f@\16@\u02e3\13@\3@\3@\3@\3@\3")
        buf.write("@\7@\u02ea\n@\f@\16@\u02ed\13@\5@\u02ef\n@\5@\u02f1\n")
        buf.write("@\3A\3A\3A\5A\u02f6\nA\3A\7A\u02f9\nA\fA\16A\u02fc\13")
        buf.write("A\3B\3B\3B\3B\3B\3B\3B\3B\3B\3B\3B\5B\u0309\nB\3C\3C\3")
        buf.write("C\3C\5C\u030f\nC\3C\6C\u0312\nC\rC\16C\u0313\3D\3D\3D")
        buf.write("\3D\3E\3E\5E\u031c\nE\3E\5E\u031f\nE\3E\5E\u0322\nE\3")
        buf.write("E\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E\5E\u0334")
        buf.write("\nE\3F\3F\3G\3G\5G\u033a\nG\3G\3G\3G\5G\u033f\nG\7G\u0341")
        buf.write("\nG\fG\16G\u0344\13G\3H\3H\3H\3H\3H\5H\u034b\nH\5H\u034d")
        buf.write("\nH\3I\3I\3I\5I\u0352\nI\3I\3I\3I\3I\7I\u0358\nI\fI\16")
        buf.write("I\u035b\13I\3J\3J\3J\3J\5J\u0361\nJ\5J\u0363\nJ\3J\3J")
        buf.write("\5J\u0367\nJ\3K\3K\3K\3K\3K\3K\3K\5K\u0370\nK\5K\u0372")
        buf.write("\nK\3L\3L\3L\7L\u0377\nL\fL\16L\u037a\13L\3M\3M\3M\5M")
        buf.write("\u037f\nM\3M\3M\3N\3N\3N\3N\7N\u0387\nN\fN\16N\u038a\13")
        buf.write("N\3O\3O\3O\3P\3P\3Q\3Q\5Q\u0393\nQ\3Q\3Q\5Q\u0397\nQ\3")
        buf.write("Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\5Q\u03aa")
        buf.write("\nQ\3Q\3Q\3Q\5Q\u03af\nQ\3Q\3Q\3Q\3Q\5Q\u03b5\nQ\3Q\3")
        buf.write("Q\3Q\3Q\3Q\5Q\u03bc\nQ\3Q\3Q\3Q\3Q\5Q\u03c2\nQ\3Q\3Q\3")
        buf.write("Q\3Q\5Q\u03c8\nQ\3Q\3Q\3Q\3Q\3Q\3Q\3Q\5Q\u03d1\nQ\3Q\5")
        buf.write("Q\u03d4\nQ\3Q\6Q\u03d7\nQ\rQ\16Q\u03d8\5Q\u03db\nQ\3R")
        buf.write("\3R\3R\3R\3R\3R\3R\3S\3S\3S\3S\3S\3S\3S\3T\3T\3T\3T\3")
        buf.write("T\3T\3T\3T\3T\3T\3T\3T\3T\3T\5T\u03f9\nT\3U\3U\3U\3U\3")
        buf.write("U\3U\3U\3U\3U\3U\3U\3V\3V\3V\3V\3V\3V\3V\3W\3W\3W\3W\3")
        buf.write("W\3W\3W\3W\3W\3W\3W\5W\u0418\nW\3X\3X\3X\3X\3X\3X\3X\5")
        buf.write("X\u0421\nX\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Y\3Z\3Z\3Z\3")
        buf.write("Z\3Z\3Z\3Z\5Z\u0435\nZ\3Z\2\2[\2\4\6\b\n\f\16\20\22\24")
        buf.write("\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPRTVX")
        buf.write("Z\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084\u0086\u0088\u008a")
        buf.write("\u008c\u008e\u0090\u0092\u0094\u0096\u0098\u009a\u009c")
        buf.write("\u009e\u00a0\u00a2\u00a4\u00a6\u00a8\u00aa\u00ac\u00ae")
        buf.write("\u00b0\u00b2\2\30\4\2\u00af\u00b2\u00c4\u00c5\4\2\65\65")
        buf.write("\u0089\u0089\3\2\u00be\u00bf\4\2\u00d1\u00d1\u00d4\u00d4")
        buf.write("\13\2\21\21\33\36IJOQmptu\u0082\u0082\u008e\u008e\u009c")
        buf.write("\u009c\13\2\f\f\20\20\22\22\"\"RRUU~\u0080\u0083\u0083")
        buf.write("\u0095\u0097\26\2\3\4\b\b\n\13\27\31 !))++\63\6388MNV")
        buf.write("Vddfgijrryy{{}}\u0085\u0085\u008a\u008a\4\2//SS\b\2$%")
        buf.write("[[vv\u0087\u0088\u0091\u0093\u009b\u009b\4\2\5\5,,\4\2")
        buf.write("DDZZ\3\2\u00b3\u00b4\5\2\u00a9\u00aa\u00b9\u00b9\u00c3")
        buf.write("\u00c3\5\2\17\17\u00ad\u00ae\u00be\u00c0\5\2\5\5,,\u00b9")
        buf.write("\u00b9\4\2\7\7**\4\2??GG\4\2\66\66HH\3\2\u00c4\u00c5\6")
        buf.write("\2##@@IIpp\4\2IIpp\5\2\u00ac\u00ad\u00c0\u00c0\u00c6\u00cc")
        buf.write("\2\u04a2\2\u00b4\3\2\2\2\4\u00d6\3\2\2\2\6\u00d8\3\2\2")
        buf.write("\2\b\u00da\3\2\2\2\n\u00dc\3\2\2\2\f\u00df\3\2\2\2\16")
        buf.write("\u00e3\3\2\2\2\20\u00e5\3\2\2\2\22\u00e7\3\2\2\2\24\u00e9")
        buf.write("\3\2\2\2\26\u00eb\3\2\2\2\30\u00ed\3\2\2\2\32\u00ef\3")
        buf.write("\2\2\2\34\u00f1\3\2\2\2\36\u00f9\3\2\2\2 \u0101\3\2\2")
        buf.write("\2\"\u0103\3\2\2\2$\u0129\3\2\2\2&\u012d\3\2\2\2(\u0140")
        buf.write("\3\2\2\2*\u0142\3\2\2\2,\u0152\3\2\2\2.\u0156\3\2\2\2")
        buf.write("\60\u0160\3\2\2\2\62\u016b\3\2\2\2\64\u0175\3\2\2\2\66")
        buf.write("\u018a\3\2\2\28\u018c\3\2\2\2:\u0195\3\2\2\2<\u0199\3")
        buf.write("\2\2\2>\u01ab\3\2\2\2@\u01b3\3\2\2\2B\u01be\3\2\2\2D\u01c3")
        buf.write("\3\2\2\2F\u01c8\3\2\2\2H\u01d0\3\2\2\2J\u01d9\3\2\2\2")
        buf.write("L\u0215\3\2\2\2N\u0217\3\2\2\2P\u0228\3\2\2\2R\u022d\3")
        buf.write("\2\2\2T\u0244\3\2\2\2V\u0246\3\2\2\2X\u024e\3\2\2\2Z\u0250")
        buf.write("\3\2\2\2\\\u0258\3\2\2\2^\u0263\3\2\2\2`\u026a\3\2\2\2")
        buf.write("b\u0277\3\2\2\2d\u0279\3\2\2\2f\u027b\3\2\2\2h\u027e\3")
        buf.write("\2\2\2j\u0280\3\2\2\2l\u0298\3\2\2\2n\u029a\3\2\2\2p\u029f")
        buf.write("\3\2\2\2r\u02a1\3\2\2\2t\u02aa\3\2\2\2v\u02c9\3\2\2\2")
        buf.write("x\u02d1\3\2\2\2z\u02d7\3\2\2\2|\u02da\3\2\2\2~\u02f0\3")
        buf.write("\2\2\2\u0080\u02f2\3\2\2\2\u0082\u0308\3\2\2\2\u0084\u0311")
        buf.write("\3\2\2\2\u0086\u0315\3\2\2\2\u0088\u0333\3\2\2\2\u008a")
        buf.write("\u0335\3\2\2\2\u008c\u0337\3\2\2\2\u008e\u0345\3\2\2\2")
        buf.write("\u0090\u034e\3\2\2\2\u0092\u035c\3\2\2\2\u0094\u0371\3")
        buf.write("\2\2\2\u0096\u0373\3\2\2\2\u0098\u037e\3\2\2\2\u009a\u0382")
        buf.write("\3\2\2\2\u009c\u038b\3\2\2\2\u009e\u038e\3\2\2\2\u00a0")
        buf.write("\u03da\3\2\2\2\u00a2\u03dc\3\2\2\2\u00a4\u03e3\3\2\2\2")
        buf.write("\u00a6\u03f8\3\2\2\2\u00a8\u03fa\3\2\2\2\u00aa\u0405\3")
        buf.write("\2\2\2\u00ac\u0417\3\2\2\2\u00ae\u0420\3\2\2\2\u00b0\u0422")
        buf.write("\3\2\2\2\u00b2\u0434\3\2\2\2\u00b4\u00b5\t\2\2\2\u00b5")
        buf.write("\3\3\2\2\2\u00b6\u00ba\7\17\2\2\u00b7\u00b8\7\u00bb\2")
        buf.write("\2\u00b8\u00b9\7\u00d1\2\2\u00b9\u00bb\7\u00ba\2\2\u00ba")
        buf.write("\u00b7\3\2\2\2\u00ba\u00bb\3\2\2\2\u00bb\u00d7\3\2\2\2")
        buf.write("\u00bc\u00c0\7\32\2\2\u00bd\u00be\7\u00bb\2\2\u00be\u00bf")
        buf.write("\7\u00d1\2\2\u00bf\u00c1\7\u00ba\2\2\u00c0\u00bd\3\2\2")
        buf.write("\2\u00c0\u00c1\3\2\2\2\u00c1\u00d7\3\2\2\2\u00c2\u00d7")
        buf.write("\7%\2\2\u00c3\u00d7\7&\2\2\u00c4\u00d7\7\u0087\2\2\u00c5")
        buf.write("\u00d7\7\u0088\2\2\u00c6\u00d7\7B\2\2\u00c7\u00cf\7(\2")
        buf.write("\2\u00c8\u00c9\7\u00bb\2\2\u00c9\u00cc\7\u00d1\2\2\u00ca")
        buf.write("\u00cb\7\u00b8\2\2\u00cb\u00cd\7\u00d1\2\2\u00cc\u00ca")
        buf.write("\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00ce\3\2\2\2\u00ce")
        buf.write("\u00d0\7\u00ba\2\2\u00cf\u00c8\3\2\2\2\u00cf\u00d0\3\2")
        buf.write("\2\2\u00d0\u00d7\3\2\2\2\u00d1\u00d7\7A\2\2\u00d2\u00d7")
        buf.write("\7\16\2\2\u00d3\u00d7\7\67\2\2\u00d4\u00d7\7k\2\2\u00d5")
        buf.write("\u00d7\7-\2\2\u00d6\u00b6\3\2\2\2\u00d6\u00bc\3\2\2\2")
        buf.write("\u00d6\u00c2\3\2\2\2\u00d6\u00c3\3\2\2\2\u00d6\u00c4\3")
        buf.write("\2\2\2\u00d6\u00c5\3\2\2\2\u00d6\u00c6\3\2\2\2\u00d6\u00c7")
        buf.write("\3\2\2\2\u00d6\u00d1\3\2\2\2\u00d6\u00d2\3\2\2\2\u00d6")
        buf.write("\u00d3\3\2\2\2\u00d6\u00d4\3\2\2\2\u00d6\u00d5\3\2\2\2")
        buf.write("\u00d7\5\3\2\2\2\u00d8\u00d9\7\u00d3\2\2\u00d9\7\3\2\2")
        buf.write("\2\u00da\u00db\t\3\2\2\u00db\t\3\2\2\2\u00dc\u00dd\7\u00d2")
        buf.write("\2\2\u00dd\13\3\2\2\2\u00de\u00e0\t\4\2\2\u00df\u00de")
        buf.write("\3\2\2\2\u00df\u00e0\3\2\2\2\u00e0\u00e1\3\2\2\2\u00e1")
        buf.write("\u00e2\t\5\2\2\u00e2\r\3\2\2\2\u00e3\u00e4\7\u00d6\2\2")
        buf.write("\u00e4\17\3\2\2\2\u00e5\u00e6\t\6\2\2\u00e6\21\3\2\2\2")
        buf.write("\u00e7\u00e8\t\7\2\2\u00e8\23\3\2\2\2\u00e9\u00ea\t\b")
        buf.write("\2\2\u00ea\25\3\2\2\2\u00eb\u00ec\t\t\2\2\u00ec\27\3\2")
        buf.write("\2\2\u00ed\u00ee\t\n\2\2\u00ee\31\3\2\2\2\u00ef\u00f0")
        buf.write("\7\u00a8\2\2\u00f0\33\3\2\2\2\u00f1\u00f2\7\u00a7\2\2")
        buf.write("\u00f2\35\3\2\2\2\u00f3\u00fa\5\24\13\2\u00f4\u00fa\5")
        buf.write("\20\t\2\u00f5\u00fa\5\30\r\2\u00f6\u00fa\5\26\f\2\u00f7")
        buf.write("\u00fa\5\34\17\2\u00f8\u00fa\5\32\16\2\u00f9\u00f3\3\2")
        buf.write("\2\2\u00f9\u00f4\3\2\2\2\u00f9\u00f5\3\2\2\2\u00f9\u00f6")
        buf.write("\3\2\2\2\u00f9\u00f7\3\2\2\2\u00f9\u00f8\3\2\2\2\u00fa")
        buf.write("\37\3\2\2\2\u00fb\u0102\5\16\b\2\u00fc\u0102\5\f\7\2\u00fd")
        buf.write("\u0102\5\n\6\2\u00fe\u0102\5\b\5\2\u00ff\u0102\5\6\4\2")
        buf.write("\u0100\u0102\7\\\2\2\u0101\u00fb\3\2\2\2\u0101\u00fc\3")
        buf.write("\2\2\2\u0101\u00fd\3\2\2\2\u0101\u00fe\3\2\2\2\u0101\u00ff")
        buf.write("\3\2\2\2\u0101\u0100\3\2\2\2\u0102!\3\2\2\2\u0103\u0105")
        buf.write("\7w\2\2\u0104\u0106\t\13\2\2\u0105\u0104\3\2\2\2\u0105")
        buf.write("\u0106\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u0116\5~@\2\u0108")
        buf.write("\u0109\7;\2\2\u0109\u010b\5\u0096L\2\u010a\u010c\5n8\2")
        buf.write("\u010b\u010a\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u010e\3")
        buf.write("\2\2\2\u010d\u010f\5\u009cO\2\u010e\u010d\3\2\2\2\u010e")
        buf.write("\u010f\3\2\2\2\u010f\u0111\3\2\2\2\u0110\u0112\5N(\2\u0111")
        buf.write("\u0110\3\2\2\2\u0111\u0112\3\2\2\2\u0112\u0114\3\2\2\2")
        buf.write("\u0113\u0115\5R*\2\u0114\u0113\3\2\2\2\u0114\u0115\3\2")
        buf.write("\2\2\u0115\u0117\3\2\2\2\u0116\u0108\3\2\2\2\u0116\u0117")
        buf.write("\3\2\2\2\u0117\u0119\3\2\2\2\u0118\u011a\5j\66\2\u0119")
        buf.write("\u0118\3\2\2\2\u0119\u011a\3\2\2\2\u011a\u011c\3\2\2\2")
        buf.write("\u011b\u011d\5b\62\2\u011c\u011b\3\2\2\2\u011c\u011d\3")
        buf.write("\2\2\2\u011d\u011f\3\2\2\2\u011e\u0120\5f\64\2\u011f\u011e")
        buf.write("\3\2\2\2\u011f\u0120\3\2\2\2\u0120\u0123\3\2\2\2\u0121")
        buf.write("\u0122\79\2\2\u0122\u0124\7\u008d\2\2\u0123\u0121\3\2")
        buf.write("\2\2\u0123\u0124\3\2\2\2\u0124\u0126\3\2\2\2\u0125\u0127")
        buf.write("\7\u00b5\2\2\u0126\u0125\3\2\2\2\u0126\u0127\3\2\2\2\u0127")
        buf.write("#\3\2\2\2\u0128\u012a\7\t\2\2\u0129\u0128\3\2\2\2\u0129")
        buf.write("\u012a\3\2\2\2\u012a\u012b\3\2\2\2\u012b\u012c\7\u00d7")
        buf.write("\2\2\u012c%\3\2\2\2\u012d\u0130\5B\"\2\u012e\u012f\7\u00c1")
        buf.write("\2\2\u012f\u0131\5B\"\2\u0130\u012e\3\2\2\2\u0130\u0131")
        buf.write("\3\2\2\2\u0131\'\3\2\2\2\u0132\u0139\5x=\2\u0133\u0135")
        buf.write("\5\2\2\2\u0134\u0136\7\6\2\2\u0135\u0134\3\2\2\2\u0135")
        buf.write("\u0136\3\2\2\2\u0136\u0137\3\2\2\2\u0137\u0138\5x=\2\u0138")
        buf.write("\u013a\3\2\2\2\u0139\u0133\3\2\2\2\u0139\u013a\3\2\2\2")
        buf.write("\u013a\u0141\3\2\2\2\u013b\u013d\7Y\2\2\u013c\u013b\3")
        buf.write("\2\2\2\u013c\u013d\3\2\2\2\u013d\u013e\3\2\2\2\u013e\u013f")
        buf.write("\7\62\2\2\u013f\u0141\5\u0086D\2\u0140\u0132\3\2\2\2\u0140")
        buf.write("\u013c\3\2\2\2\u0141)\3\2\2\2\u0142\u0145\7\25\2\2\u0143")
        buf.write("\u0146\5,\27\2\u0144\u0146\5.\30\2\u0145\u0143\3\2\2\2")
        buf.write("\u0145\u0144\3\2\2\2\u0146\u0149\3\2\2\2\u0147\u0148\7")
        buf.write(".\2\2\u0148\u014a\5&\24\2\u0149\u0147\3\2\2\2\u0149\u014a")
        buf.write("\3\2\2\2\u014a\u014b\3\2\2\2\u014b\u014c\7\60\2\2\u014c")
        buf.write("+\3\2\2\2\u014d\u014e\7\u0098\2\2\u014e\u014f\5> \2\u014f")
        buf.write("\u0150\7\u0086\2\2\u0150\u0151\5&\24\2\u0151\u0153\3\2")
        buf.write("\2\2\u0152\u014d\3\2\2\2\u0153\u0154\3\2\2\2\u0154\u0152")
        buf.write("\3\2\2\2\u0154\u0155\3\2\2\2\u0155-\3\2\2\2\u0156\u015c")
        buf.write("\5&\24\2\u0157\u0158\7\u0098\2\2\u0158\u0159\5&\24\2\u0159")
        buf.write("\u015a\7\u0086\2\2\u015a\u015b\5&\24\2\u015b\u015d\3\2")
        buf.write("\2\2\u015c\u0157\3\2\2\2\u015d\u015e\3\2\2\2\u015e\u015c")
        buf.write("\3\2\2\2\u015e\u015f\3\2\2\2\u015f/\3\2\2\2\u0160\u0161")
        buf.write("\7\u00bb\2\2\u0161\u0166\5\64\33\2\u0162\u0163\7\u00b8")
        buf.write("\2\2\u0163\u0165\5\64\33\2\u0164\u0162\3\2\2\2\u0165\u0168")
        buf.write("\3\2\2\2\u0166\u0164\3\2\2\2\u0166\u0167\3\2\2\2\u0167")
        buf.write("\u0169\3\2\2\2\u0168\u0166\3\2\2\2\u0169\u016a\7\u00ba")
        buf.write("\2\2\u016a\61\3\2\2\2\u016b\u016c\7\u00d7\2\2\u016c\63")
        buf.write("\3\2\2\2\u016d\u016e\5|?\2\u016e\u016f\7\u00b7\2\2\u016f")
        buf.write("\u0171\3\2\2\2\u0170\u016d\3\2\2\2\u0170\u0171\3\2\2\2")
        buf.write("\u0171\u0172\3\2\2\2\u0172\u0173\5\u008aF\2\u0173\u0174")
        buf.write("\7\u00b7\2\2\u0174\u0176\3\2\2\2\u0175\u0170\3\2\2\2\u0175")
        buf.write("\u0176\3\2\2\2\u0176\u0177\3\2\2\2\u0177\u0179\5\62\32")
        buf.write("\2\u0178\u017a\5\u0084C\2\u0179\u0178\3\2\2\2\u0179\u017a")
        buf.write("\3\2\2\2\u017a\65\3\2\2\2\u017b\u017c\5\u0098M\2\u017c")
        buf.write("\u017d\7\u00b7\2\2\u017d\u017e\7\u00b9\2\2\u017e\u018b")
        buf.write("\3\2\2\2\u017f\u0182\5&\24\2\u0180\u0182\5\u00a0Q\2\u0181")
        buf.write("\u017f\3\2\2\2\u0181\u0180\3\2\2\2\u0182\u0185\3\2\2\2")
        buf.write("\u0183\u0184\7K\2\2\u0184\u0186\7\u00d6\2\2\u0185\u0183")
        buf.write("\3\2\2\2\u0185\u0186\3\2\2\2\u0186\u0188\3\2\2\2\u0187")
        buf.write("\u0189\5$\23\2\u0188\u0187\3\2\2\2\u0188\u0189\3\2\2\2")
        buf.write("\u0189\u018b\3\2\2\2\u018a\u017b\3\2\2\2\u018a\u0181\3")
        buf.write("\2\2\2\u018b\67\3\2\2\2\u018c\u0191\5:\36\2\u018d\u018e")
        buf.write("\7\u00ac\2\2\u018e\u0190\5:\36\2\u018f\u018d\3\2\2\2\u0190")
        buf.write("\u0193\3\2\2\2\u0191\u018f\3\2\2\2\u0191\u0192\3\2\2\2")
        buf.write("\u01929\3\2\2\2\u0193\u0191\3\2\2\2\u0194\u0196\7Y\2\2")
        buf.write("\u0195\u0194\3\2\2\2\u0195\u0196\3\2\2\2\u0196\u0197\3")
        buf.write("\2\2\2\u0197\u0198\5<\37\2\u0198;\3\2\2\2\u0199\u01a9")
        buf.write("\5(\25\2\u019a\u019c\7E\2\2\u019b\u019d\7Y\2\2\u019c\u019b")
        buf.write("\3\2\2\2\u019c\u019d\3\2\2\2\u019d\u01a2\3\2\2\2\u019e")
        buf.write("\u01a3\5\b\5\2\u019f\u01a3\7\\\2\2\u01a0\u01a1\7,\2\2")
        buf.write("\u01a1\u01a3\7;\2\2\u01a2\u019e\3\2\2\2\u01a2\u019f\3")
        buf.write("\2\2\2\u01a2\u01a0\3\2\2\2\u01a3\u01a5\3\2\2\2\u01a4\u019a")
        buf.write("\3\2\2\2\u01a4\u01a5\3\2\2\2\u01a5\u01aa\3\2\2\2\u01a6")
        buf.write("\u01a8\t\f\2\2\u01a7\u01a6\3\2\2\2\u01a7\u01a8\3\2\2\2")
        buf.write("\u01a8\u01aa\3\2\2\2\u01a9\u01a4\3\2\2\2\u01a9\u01a7\3")
        buf.write("\2\2\2\u01aa=\3\2\2\2\u01ab\u01b0\58\35\2\u01ac\u01ad")
        buf.write("\7\u00ab\2\2\u01ad\u01af\58\35\2\u01ae\u01ac\3\2\2\2\u01af")
        buf.write("\u01b2\3\2\2\2\u01b0\u01ae\3\2\2\2\u01b0\u01b1\3\2\2\2")
        buf.write("\u01b1?\3\2\2\2\u01b2\u01b0\3\2\2\2\u01b3\u01b4\7\u00bb")
        buf.write("\2\2\u01b4\u01b9\5> \2\u01b5\u01b6\7\u00b8\2\2\u01b6\u01b8")
        buf.write("\5> \2\u01b7\u01b5\3\2\2\2\u01b8\u01bb\3\2\2\2\u01b9\u01b7")
        buf.write("\3\2\2\2\u01b9\u01ba\3\2\2\2\u01ba\u01bc\3\2\2\2\u01bb")
        buf.write("\u01b9\3\2\2\2\u01bc\u01bd\7\u00ba\2\2\u01bdA\3\2\2\2")
        buf.write("\u01be\u01c1\5D#\2\u01bf\u01c0\7\u00c2\2\2\u01c0\u01c2")
        buf.write("\5D#\2\u01c1\u01bf\3\2\2\2\u01c1\u01c2\3\2\2\2\u01c2C")
        buf.write("\3\2\2\2\u01c3\u01c6\5F$\2\u01c4\u01c5\t\r\2\2\u01c5\u01c7")
        buf.write("\5F$\2\u01c6\u01c4\3\2\2\2\u01c6\u01c7\3\2\2\2\u01c7E")
        buf.write("\3\2\2\2\u01c8\u01cd\5H%\2\u01c9\u01ca\t\4\2\2\u01ca\u01cc")
        buf.write("\5H%\2\u01cb\u01c9\3\2\2\2\u01cc\u01cf\3\2\2\2\u01cd\u01cb")
        buf.write("\3\2\2\2\u01cd\u01ce\3\2\2\2\u01ceG\3\2\2\2\u01cf\u01cd")
        buf.write("\3\2\2\2\u01d0\u01d5\5J&\2\u01d1\u01d2\t\16\2\2\u01d2")
        buf.write("\u01d4\5J&\2\u01d3\u01d1\3\2\2\2\u01d4\u01d7\3\2\2\2\u01d5")
        buf.write("\u01d3\3\2\2\2\u01d5\u01d6\3\2\2\2\u01d6I\3\2\2\2\u01d7")
        buf.write("\u01d5\3\2\2\2\u01d8\u01da\t\17\2\2\u01d9\u01d8\3\2\2")
        buf.write("\2\u01d9\u01da\3\2\2\2\u01da\u01db\3\2\2\2\u01db\u01dd")
        buf.write("\5\u0082B\2\u01dc\u01de\7Y\2\2\u01dd\u01dc\3\2\2\2\u01dd")
        buf.write("\u01de\3\2\2\2\u01de\u01e1\3\2\2\2\u01df\u01e0\t\4\2\2")
        buf.write("\u01e0\u01e2\5^\60\2\u01e1\u01df\3\2\2\2\u01e1\u01e2\3")
        buf.write("\2\2\2\u01e2K\3\2\2\2\u01e3\u01f0\5\36\20\2\u01e4\u01ed")
        buf.write("\7\u00bb\2\2\u01e5\u01ea\5> \2\u01e6\u01e7\7\u00b8\2\2")
        buf.write("\u01e7\u01e9\5> \2\u01e8\u01e6\3\2\2\2\u01e9\u01ec\3\2")
        buf.write("\2\2\u01ea\u01e8\3\2\2\2\u01ea\u01eb\3\2\2\2\u01eb\u01ee")
        buf.write("\3\2\2\2\u01ec\u01ea\3\2\2\2\u01ed\u01e5\3\2\2\2\u01ed")
        buf.write("\u01ee\3\2\2\2\u01ee\u01ef\3\2\2\2\u01ef\u01f1\7\u00ba")
        buf.write("\2\2\u01f0\u01e4\3\2\2\2\u01f0\u01f1\3\2\2\2\u01f1\u0216")
        buf.write("\3\2\2\2\u01f2\u01f3\7\26\2\2\u01f3\u01f4\7\u00bb\2\2")
        buf.write("\u01f4\u01f5\5> \2\u01f5\u01f6\7\t\2\2\u01f6\u01f7\5\4")
        buf.write("\3\2\u01f7\u01f8\7\u00ba\2\2\u01f8\u0216\3\2\2\2\u01f9")
        buf.write("\u01fa\7\37\2\2\u01fa\u01fb\7\u00bb\2\2\u01fb\u01fc\7")
        buf.write("\u00d6\2\2\u01fc\u01fd\7\u00b8\2\2\u01fd\u01fe\7\u00d6")
        buf.write("\2\2\u01fe\u01ff\7\u00b8\2\2\u01ff\u0200\7\u00d6\2\2\u0200")
        buf.write("\u0216\7\u00ba\2\2\u0201\u0202\7e\2\2\u0202\u0203\7\u00bb")
        buf.write("\2\2\u0203\u0204\5> \2\u0204\u0205\7C\2\2\u0205\u0206")
        buf.write("\5> \2\u0206\u0207\7\u00ba\2\2\u0207\u0216\3\2\2\2\u0208")
        buf.write("\u0209\5\22\n\2\u0209\u020b\7\u00bb\2\2\u020a\u020c\t")
        buf.write("\20\2\2\u020b\u020a\3\2\2\2\u020b\u020c\3\2\2\2\u020c")
        buf.write("\u0211\3\2\2\2\u020d\u0210\5&\24\2\u020e\u0210\5\u00a0")
        buf.write("Q\2\u020f\u020d\3\2\2\2\u020f\u020e\3\2\2\2\u0210\u0212")
        buf.write("\3\2\2\2\u0211\u020f\3\2\2\2\u0211\u0212\3\2\2\2\u0212")
        buf.write("\u0213\3\2\2\2\u0213\u0214\7\u00ba\2\2\u0214\u0216\3\2")
        buf.write("\2\2\u0215\u01e3\3\2\2\2\u0215\u01f2\3\2\2\2\u0215\u01f9")
        buf.write("\3\2\2\2\u0215\u0201\3\2\2\2\u0215\u0208\3\2\2\2\u0216")
        buf.write("M\3\2\2\2\u0217\u0218\7<\2\2\u0218\u0219\7\24\2\2\u0219")
        buf.write("\u021e\5P)\2\u021a\u021b\7\u00b8\2\2\u021b\u021d\5P)\2")
        buf.write("\u021c\u021a\3\2\2\2\u021d\u0220\3\2\2\2\u021e\u021c\3")
        buf.write("\2\2\2\u021e\u021f\3\2\2\2\u021f\u0223\3\2\2\2\u0220\u021e")
        buf.write("\3\2\2\2\u0221\u0222\7\u009a\2\2\u0222\u0224\7q\2\2\u0223")
        buf.write("\u0221\3\2\2\2\u0223\u0224\3\2\2\2\u0224O\3\2\2\2\u0225")
        buf.write("\u0229\5\64\33\2\u0226\u0229\7\u00d1\2\2\u0227\u0229\5")
        buf.write("&\24\2\u0228\u0225\3\2\2\2\u0228\u0226\3\2\2\2\u0228\u0227")
        buf.write("\3\2\2\2\u0229\u022b\3\2\2\2\u022a\u022c\t\21\2\2\u022b")
        buf.write("\u022a\3\2\2\2\u022b\u022c\3\2\2\2\u022cQ\3\2\2\2\u022d")
        buf.write("\u022e\7=\2\2\u022e\u022f\5> \2\u022fS\3\2\2\2\u0230\u0231")
        buf.write("\7\u008f\2\2\u0231\u0232\5\\/\2\u0232\u0234\7\u00bb\2")
        buf.write("\2\u0233\u0235\5Z.\2\u0234\u0233\3\2\2\2\u0234\u0235\3")
        buf.write("\2\2\2\u0235\u0236\3\2\2\2\u0236\u0237\7\u00ba\2\2\u0237")
        buf.write("\u0245\3\2\2\2\u0238\u0239\7>\2\2\u0239\u023a\5\\/\2\u023a")
        buf.write("\u023b\7\u00bb\2\2\u023b\u023c\5Z.\2\u023c\u023d\7\u00ba")
        buf.write("\2\2\u023d\u0245\3\2\2\2\u023e\u023f\7:\2\2\u023f\u0240")
        buf.write("\5\\/\2\u0240\u0241\7\u00bb\2\2\u0241\u0242\5Z.\2\u0242")
        buf.write("\u0243\7\u00ba\2\2\u0243\u0245\3\2\2\2\u0244\u0230\3\2")
        buf.write("\2\2\u0244\u0238\3\2\2\2\u0244\u023e\3\2\2\2\u0245U\3")
        buf.write("\2\2\2\u0246\u024b\5T+\2\u0247\u0248\7\u00b8\2\2\u0248")
        buf.write("\u024a\5T+\2\u0249\u0247\3\2\2\2\u024a\u024d\3\2\2\2\u024b")
        buf.write("\u0249\3\2\2\2\u024b\u024c\3\2\2\2\u024cW\3\2\2\2\u024d")
        buf.write("\u024b\3\2\2\2\u024e\u024f\7\u00d7\2\2\u024fY\3\2\2\2")
        buf.write("\u0250\u0255\5X-\2\u0251\u0252\7\u00b8\2\2\u0252\u0254")
        buf.write("\5X-\2\u0253\u0251\3\2\2\2\u0254\u0257\3\2\2\2\u0255\u0253")
        buf.write("\3\2\2\2\u0255\u0256\3\2\2\2\u0256[\3\2\2\2\u0257\u0255")
        buf.write("\3\2\2\2\u0258\u0261\t\22\2\2\u0259\u025f\79\2\2\u025a")
        buf.write("\u0260\7F\2\2\u025b\u025c\7a\2\2\u025c\u0260\7\24\2\2")
        buf.write("\u025d\u025e\7<\2\2\u025e\u0260\7\24\2\2\u025f\u025a\3")
        buf.write("\2\2\2\u025f\u025b\3\2\2\2\u025f\u025d\3\2\2\2\u0260\u0262")
        buf.write("\3\2\2\2\u0261\u0259\3\2\2\2\u0261\u0262\3\2\2\2\u0262")
        buf.write("]\3\2\2\2\u0263\u0264\7B\2\2\u0264\u0265\5\16\b\2\u0265")
        buf.write("_\3\2\2\2\u0266\u0267\7`\2\2\u0267\u026b\5> \2\u0268\u0269")
        buf.write("\7\u0090\2\2\u0269\u026b\5\60\31\2\u026a\u0266\3\2\2\2")
        buf.write("\u026a\u0268\3\2\2\2\u026ba\3\2\2\2\u026c\u026d\7L\2\2")
        buf.write("\u026d\u0270\5h\65\2\u026e\u026f\7^\2\2\u026f\u0271\5")
        buf.write("d\63\2\u0270\u026e\3\2\2\2\u0270\u0271\3\2\2\2\u0271\u0278")
        buf.write("\3\2\2\2\u0272\u0273\7^\2\2\u0273\u0274\5d\63\2\u0274")
        buf.write("\u0275\7L\2\2\u0275\u0276\5h\65\2\u0276\u0278\3\2\2\2")
        buf.write("\u0277\u026c\3\2\2\2\u0277\u0272\3\2\2\2\u0278c\3\2\2")
        buf.write("\2\u0279\u027a\7\u00d1\2\2\u027ae\3\2\2\2\u027b\u027c")
        buf.write("\7^\2\2\u027c\u027d\5d\63\2\u027dg\3\2\2\2\u027e\u027f")
        buf.write("\7\u00d1\2\2\u027fi\3\2\2\2\u0280\u0281\7a\2\2\u0281\u0282")
        buf.write("\7\24\2\2\u0282\u0287\5l\67\2\u0283\u0284\7\u00b8\2\2")
        buf.write("\u0284\u0286\5l\67\2\u0285\u0283\3\2\2\2\u0286\u0289\3")
        buf.write("\2\2\2\u0287\u0285\3\2\2\2\u0287\u0288\3\2\2\2\u0288k")
        buf.write("\3\2\2\2\u0289\u0287\3\2\2\2\u028a\u0292\5P)\2\u028b\u028d")
        buf.write("\t\21\2\2\u028c\u028b\3\2\2\2\u028c\u028d\3\2\2\2\u028d")
        buf.write("\u0293\3\2\2\2\u028e\u028f\7]\2\2\u028f\u0291\t\23\2\2")
        buf.write("\u0290\u028e\3\2\2\2\u0290\u0291\3\2\2\2\u0291\u0293\3")
        buf.write("\2\2\2\u0292\u028c\3\2\2\2\u0292\u0290\3\2\2\2\u0293\u0299")
        buf.write("\3\2\2\2\u0294\u0295\5P)\2\u0295\u0296\7\u0090\2\2\u0296")
        buf.write("\u0297\t\24\2\2\u0297\u0299\3\2\2\2\u0298\u028a\3\2\2")
        buf.write("\2\u0298\u0294\3\2\2\2\u0299m\3\2\2\2\u029a\u029b\7c\2")
        buf.write("\2\u029b\u029c\7\u00bb\2\2\u029c\u029d\5r:\2\u029d\u029e")
        buf.write("\7\u00ba\2\2\u029eo\3\2\2\2\u029f\u02a0\7\u00d7\2\2\u02a0")
        buf.write("q\3\2\2\2\u02a1\u02a6\5p9\2\u02a2\u02a3\7\u00b8\2\2\u02a3")
        buf.write("\u02a5\5p9\2\u02a4\u02a2\3\2\2\2\u02a5\u02a8\3\2\2\2\u02a6")
        buf.write("\u02a4\3\2\2\2\u02a6\u02a7\3\2\2\2\u02a7s\3\2\2\2\u02a8")
        buf.write("\u02a6\3\2\2\2\u02a9\u02ab\7Y\2\2\u02aa\u02a9\3\2\2\2")
        buf.write("\u02aa\u02ab\3\2\2\2\u02ab\u02c7\3\2\2\2\u02ac\u02af\7")
        buf.write("C\2\2\u02ad\u02b0\5\u0086D\2\u02ae\u02b0\5@!\2\u02af\u02ad")
        buf.write("\3\2\2\2\u02af\u02ae\3\2\2\2\u02b0\u02c8\3\2\2\2\u02b1")
        buf.write("\u02b2\7K\2\2\u02b2\u02b5\5\u0082B\2\u02b3\u02b4\7\61")
        buf.write("\2\2\u02b4\u02b6\5\u0082B\2\u02b5\u02b3\3\2\2\2\u02b5")
        buf.write("\u02b6\3\2\2\2\u02b6\u02c8\3\2\2\2\u02b7\u02ba\7l\2\2")
        buf.write("\u02b8\u02bb\5&\24\2\u02b9\u02bb\5\u00a0Q\2\u02ba\u02b8")
        buf.write("\3\2\2\2\u02ba\u02b9\3\2\2\2\u02bb\u02c8\3\2\2\2\u02bc")
        buf.write("\u02be\7\r\2\2\u02bd\u02bf\7\u0084\2\2\u02be\u02bd\3\2")
        buf.write("\2\2\u02be\u02bf\3\2\2\2\u02bf\u02c2\3\2\2\2\u02c0\u02c3")
        buf.write("\5&\24\2\u02c1\u02c3\5\u00a0Q\2\u02c2\u02c0\3\2\2\2\u02c2")
        buf.write("\u02c1\3\2\2\2\u02c3\u02c4\3\2\2\2\u02c4\u02c5\7\u00ac")
        buf.write("\2\2\u02c5\u02c6\5x=\2\u02c6\u02c8\3\2\2\2\u02c7\u02ac")
        buf.write("\3\2\2\2\u02c7\u02b1\3\2\2\2\u02c7\u02b7\3\2\2\2\u02c7")
        buf.write("\u02bc\3\2\2\2\u02c8u\3\2\2\2\u02c9\u02ca\7|\2\2\u02ca")
        buf.write("\u02cd\7K\2\2\u02cb\u02ce\5&\24\2\u02cc\u02ce\5\u00a0")
        buf.write("Q\2\u02cd\u02cb\3\2\2\2\u02cd\u02cc\3\2\2\2\u02cew\3\2")
        buf.write("\2\2\u02cf\u02d2\5&\24\2\u02d0\u02d2\5\u00a0Q\2\u02d1")
        buf.write("\u02cf\3\2\2\2\u02d1\u02d0\3\2\2\2\u02d2\u02d5\3\2\2\2")
        buf.write("\u02d3\u02d6\5t;\2\u02d4\u02d6\5v<\2\u02d5\u02d3\3\2\2")
        buf.write("\2\u02d5\u02d4\3\2\2\2\u02d5\u02d6\3\2\2\2\u02d6y\3\2")
        buf.write("\2\2\u02d7\u02d8\5\u0080A\2\u02d8\u02d9\7\u00b5\2\2\u02d9")
        buf.write("{\3\2\2\2\u02da\u02db\7\u00d7\2\2\u02db}\3\2\2\2\u02dc")
        buf.write("\u02e1\5\66\34\2\u02dd\u02de\7\u00b8\2\2\u02de\u02e0\5")
        buf.write("\66\34\2\u02df\u02dd\3\2\2\2\u02e0\u02e3\3\2\2\2\u02e1")
        buf.write("\u02df\3\2\2\2\u02e1\u02e2\3\2\2\2\u02e2\u02f1\3\2\2\2")
        buf.write("\u02e3\u02e1\3\2\2\2\u02e4\u02ee\7\u00b9\2\2\u02e5\u02e6")
        buf.write("\7\u00b8\2\2\u02e6\u02eb\5\66\34\2\u02e7\u02e8\7\u00b8")
        buf.write("\2\2\u02e8\u02ea\5\66\34\2\u02e9\u02e7\3\2\2\2\u02ea\u02ed")
        buf.write("\3\2\2\2\u02eb\u02e9\3\2\2\2\u02eb\u02ec\3\2\2\2\u02ec")
        buf.write("\u02ef\3\2\2\2\u02ed\u02eb\3\2\2\2\u02ee\u02e5\3\2\2\2")
        buf.write("\u02ee\u02ef\3\2\2\2\u02ef\u02f1\3\2\2\2\u02f0\u02dc\3")
        buf.write("\2\2\2\u02f0\u02e4\3\2\2\2\u02f1\177\3\2\2\2\u02f2\u02fa")
        buf.write("\5\"\22\2\u02f3\u02f5\7\u008b\2\2\u02f4\u02f6\7\5\2\2")
        buf.write("\u02f5\u02f4\3\2\2\2\u02f5\u02f6\3\2\2\2\u02f6\u02f7\3")
        buf.write("\2\2\2\u02f7\u02f9\5\"\22\2\u02f8\u02f3\3\2\2\2\u02f9")
        buf.write("\u02fc\3\2\2\2\u02fa\u02f8\3\2\2\2\u02fa\u02fb\3\2\2\2")
        buf.write("\u02fb\u0081\3\2\2\2\u02fc\u02fa\3\2\2\2\u02fd\u0309\5")
        buf.write(" \21\2\u02fe\u0309\5@!\2\u02ff\u0309\5\64\33\2\u0300\u0309")
        buf.write("\5L\'\2\u0301\u0302\7s\2\2\u0302\u0309\5@!\2\u0303\u0309")
        buf.write("\5\u0086D\2\u0304\u0305\7\62\2\2\u0305\u0309\5\u0086D")
        buf.write("\2\u0306\u0309\5^\60\2\u0307\u0309\5*\26\2\u0308\u02fd")
        buf.write("\3\2\2\2\u0308\u02fe\3\2\2\2\u0308\u02ff\3\2\2\2\u0308")
        buf.write("\u0300\3\2\2\2\u0308\u0301\3\2\2\2\u0308\u0303\3\2\2\2")
        buf.write("\u0308\u0304\3\2\2\2\u0308\u0306\3\2\2\2\u0308\u0307\3")
        buf.write("\2\2\2\u0309\u0083\3\2\2\2\u030a\u030b\7\u00bd\2\2\u030b")
        buf.write("\u030e\7\u00d1\2\2\u030c\u030d\7\u00b6\2\2\u030d\u030f")
        buf.write("\7\u00d1\2\2\u030e\u030c\3\2\2\2\u030e\u030f\3\2\2\2\u030f")
        buf.write("\u0310\3\2\2\2\u0310\u0312\7\u00bc\2\2\u0311\u030a\3\2")
        buf.write("\2\2\u0312\u0313\3\2\2\2\u0313\u0311\3\2\2\2\u0313\u0314")
        buf.write("\3\2\2\2\u0314\u0085\3\2\2\2\u0315\u0316\7\u00bb\2\2\u0316")
        buf.write("\u0317\5\u0080A\2\u0317\u0318\7\u00ba\2\2\u0318\u0087")
        buf.write("\3\2\2\2\u0319\u031b\5\u0098M\2\u031a\u031c\5n8\2\u031b")
        buf.write("\u031a\3\2\2\2\u031b\u031c\3\2\2\2\u031c\u031e\3\2\2\2")
        buf.write("\u031d\u031f\5$\23\2\u031e\u031d\3\2\2\2\u031e\u031f\3")
        buf.write("\2\2\2\u031f\u0321\3\2\2\2\u0320\u0322\5V,\2\u0321\u0320")
        buf.write("\3\2\2\2\u0321\u0322\3\2\2\2\u0322\u0334\3\2\2\2\u0323")
        buf.write("\u0324\5\u0086D\2\u0324\u0325\5$\23\2\u0325\u0334\3\2")
        buf.write("\2\2\u0326\u0327\7\u00bb\2\2\u0327\u0328\5\u0096L\2\u0328")
        buf.write("\u0329\7\u00ba\2\2\u0329\u0334\3\2\2\2\u032a\u032b\7_")
        buf.write("\2\2\u032b\u032c\5\u0094K\2\u032c\u032d\7I\2\2\u032d\u032e")
        buf.write("\7b\2\2\u032e\u032f\7F\2\2\u032f\u0330\5\u0094K\2\u0330")
        buf.write("\u0331\7`\2\2\u0331\u0332\5> \2\u0332\u0334\3\2\2\2\u0333")
        buf.write("\u0319\3\2\2\2\u0333\u0323\3\2\2\2\u0333\u0326\3\2\2\2")
        buf.write("\u0333\u032a\3\2\2\2\u0334\u0089\3\2\2\2\u0335\u0336\7")
        buf.write("\u00d7\2\2\u0336\u008b\3\2\2\2\u0337\u0342\5\u008eH\2")
        buf.write("\u0338\u033a\t\25\2\2\u0339\u0338\3\2\2\2\u0339\u033a")
        buf.write("\3\2\2\2\u033a\u033b\3\2\2\2\u033b\u033c\7F\2\2\u033c")
        buf.write("\u033e\5\u0088E\2\u033d\u033f\5`\61\2\u033e\u033d\3\2")
        buf.write("\2\2\u033e\u033f\3\2\2\2\u033f\u0341\3\2\2\2\u0340\u0339")
        buf.write("\3\2\2\2\u0341\u0344\3\2\2\2\u0342\u0340\3\2\2\2\u0342")
        buf.write("\u0343\3\2\2\2\u0343\u008d\3\2\2\2\u0344\u0342\3\2\2\2")
        buf.write("\u0345\u034c\5\u0090I\2\u0346\u0347\7\u0081\2\2\u0347")
        buf.write("\u034a\5\u0088E\2\u0348\u0349\7`\2\2\u0349\u034b\5> \2")
        buf.write("\u034a\u0348\3\2\2\2\u034a\u034b\3\2\2\2\u034b\u034d\3")
        buf.write("\2\2\2\u034c\u0346\3\2\2\2\u034c\u034d\3\2\2\2\u034d\u008f")
        buf.write("\3\2\2\2\u034e\u0359\5\u0092J\2\u034f\u0351\t\26\2\2\u0350")
        buf.write("\u0352\7b\2\2\u0351\u0350\3\2\2\2\u0351\u0352\3\2\2\2")
        buf.write("\u0352\u0353\3\2\2\2\u0353\u0354\7F\2\2\u0354\u0355\5")
        buf.write("\u0092J\2\u0355\u0356\5`\61\2\u0356\u0358\3\2\2\2\u0357")
        buf.write("\u034f\3\2\2\2\u0358\u035b\3\2\2\2\u0359\u0357\3\2\2\2")
        buf.write("\u0359\u035a\3\2\2\2\u035a\u0091\3\2\2\2\u035b\u0359\3")
        buf.write("\2\2\2\u035c\u0366\5\u0088E\2\u035d\u0362\7X\2\2\u035e")
        buf.write("\u0360\t\26\2\2\u035f\u0361\7b\2\2\u0360\u035f\3\2\2\2")
        buf.write("\u0360\u0361\3\2\2\2\u0361\u0363\3\2\2\2\u0362\u035e\3")
        buf.write("\2\2\2\u0362\u0363\3\2\2\2\u0363\u0364\3\2\2\2\u0364\u0365")
        buf.write("\7F\2\2\u0365\u0367\5\u0088E\2\u0366\u035d\3\2\2\2\u0366")
        buf.write("\u0367\3\2\2\2\u0367\u0093\3\2\2\2\u0368\u0372\5\u008c")
        buf.write("G\2\u0369\u036a\7\u00bb\2\2\u036a\u036b\5\u009aN\2\u036b")
        buf.write("\u036c\7\u00ba\2\2\u036c\u036d\3\2\2\2\u036d\u036f\5$")
        buf.write("\23\2\u036e\u0370\5\60\31\2\u036f\u036e\3\2\2\2\u036f")
        buf.write("\u0370\3\2\2\2\u0370\u0372\3\2\2\2\u0371\u0368\3\2\2\2")
        buf.write("\u0371\u0369\3\2\2\2\u0372\u0095\3\2\2\2\u0373\u0378\5")
        buf.write("\u0094K\2\u0374\u0375\7\u00b8\2\2\u0375\u0377\5\u0094")
        buf.write("K\2\u0376\u0374\3\2\2\2\u0377\u037a\3\2\2\2\u0378\u0376")
        buf.write("\3\2\2\2\u0378\u0379\3\2\2\2\u0379\u0097\3\2\2\2\u037a")
        buf.write("\u0378\3\2\2\2\u037b\u037c\5|?\2\u037c\u037d\7\u00b7\2")
        buf.write("\2\u037d\u037f\3\2\2\2\u037e\u037b\3\2\2\2\u037e\u037f")
        buf.write("\3\2\2\2\u037f\u0380\3\2\2\2\u0380\u0381\5\u008aF\2\u0381")
        buf.write("\u0099\3\2\2\2\u0382\u0383\7\u0094\2\2\u0383\u0388\5@")
        buf.write("!\2\u0384\u0385\7\u00b8\2\2\u0385\u0387\5@!\2\u0386\u0384")
        buf.write("\3\2\2\2\u0387\u038a\3\2\2\2\u0388\u0386\3\2\2\2\u0388")
        buf.write("\u0389\3\2\2\2\u0389\u009b\3\2\2\2\u038a\u0388\3\2\2\2")
        buf.write("\u038b\u038c\7\u0099\2\2\u038c\u038d\5> \2\u038d\u009d")
        buf.write("\3\2\2\2\u038e\u038f\t\27\2\2\u038f\u009f\3\2\2\2\u0390")
        buf.write("\u0393\5\u00b2Z\2\u0391\u0393\5\u00a2R\2\u0392\u0390\3")
        buf.write("\2\2\2\u0392\u0391\3\2\2\2\u0393\u03db\3\2\2\2\u0394\u0397")
        buf.write("\5\u00a2R\2\u0395\u0397\5\u0082B\2\u0396\u0394\3\2\2\2")
        buf.write("\u0396\u0395\3\2\2\2\u0397\u0398\3\2\2\2\u0398\u0399\5")
        buf.write("\u009eP\2\u0399\u039a\5\u00b2Z\2\u039a\u03db\3\2\2\2\u039b")
        buf.write("\u039c\5\u00b2Z\2\u039c\u039d\7\u00af\2\2\u039d\u039e")
        buf.write("\5\u00b2Z\2\u039e\u03db\3\2\2\2\u039f\u03a0\5\u00b2Z\2")
        buf.write("\u03a0\u03a1\5\u009eP\2\u03a1\u03a2\5\u00b2Z\2\u03a2\u03db")
        buf.write("\3\2\2\2\u03a3\u03aa\5\u00a6T\2\u03a4\u03a5\5\u0082B\2")
        buf.write("\u03a5\u03a6\7\u00cd\2\2\u03a6\u03a7\5\u00a6T\2\u03a7")
        buf.write("\u03aa\3\2\2\2\u03a8\u03aa\5\u0082B\2\u03a9\u03a3\3\2")
        buf.write("\2\2\u03a9\u03a4\3\2\2\2\u03a9\u03a8\3\2\2\2\u03aa\u03db")
        buf.write("\3\2\2\2\u03ab\u03af\5\u00a2R\2\u03ac\u03af\5\u00a4S\2")
        buf.write("\u03ad\u03af\5\u0082B\2\u03ae\u03ab\3\2\2\2\u03ae\u03ac")
        buf.write("\3\2\2\2\u03ae\u03ad\3\2\2\2\u03af\u03b0\3\2\2\2\u03b0")
        buf.write("\u03b4\7\u00ce\2\2\u03b1\u03b5\5\u00a2R\2\u03b2\u03b5")
        buf.write("\5\u00a4S\2\u03b3\u03b5\5\u0082B\2\u03b4\u03b1\3\2\2\2")
        buf.write("\u03b4\u03b2\3\2\2\2\u03b4\u03b3\3\2\2\2\u03b5\u03db\3")
        buf.write("\2\2\2\u03b6\u03bb\7\u00cf\2\2\u03b7\u03bc\5\u00a4S\2")
        buf.write("\u03b8\u03bc\5\u00aaV\2\u03b9\u03bc\5\u00acW\2\u03ba\u03bc")
        buf.write("\5\u0082B\2\u03bb\u03b7\3\2\2\2\u03bb\u03b8\3\2\2\2\u03bb")
        buf.write("\u03b9\3\2\2\2\u03bb\u03ba\3\2\2\2\u03bc\u03db\3\2\2\2")
        buf.write("\u03bd\u03c1\7\u00d0\2\2\u03be\u03c2\5\u00a4S\2\u03bf")
        buf.write("\u03c2\5\u00a8U\2\u03c0\u03c2\5\u0082B\2\u03c1\u03be\3")
        buf.write("\2\2\2\u03c1\u03bf\3\2\2\2\u03c1\u03c0\3\2\2\2\u03c2\u03db")
        buf.write("\3\2\2\2\u03c3\u03c7\7\u00bf\2\2\u03c4\u03c8\5\u00a6T")
        buf.write("\2\u03c5\u03c8\5\u00aeX\2\u03c6\u03c8\5\u0082B\2\u03c7")
        buf.write("\u03c4\3\2\2\2\u03c7\u03c5\3\2\2\2\u03c7\u03c6\3\2\2\2")
        buf.write("\u03c8\u03db\3\2\2\2\u03c9\u03d1\5\u00a2R\2\u03ca\u03d1")
        buf.write("\5\u00a4S\2\u03cb\u03d1\5\u00a6T\2\u03cc\u03d1\5\u00a8")
        buf.write("U\2\u03cd\u03d1\5\u00acW\2\u03ce\u03d1\5\u00aeX\2\u03cf")
        buf.write("\u03d1\5\u0082B\2\u03d0\u03c9\3\2\2\2\u03d0\u03ca\3\2")
        buf.write("\2\2\u03d0\u03cb\3\2\2\2\u03d0\u03cc\3\2\2\2\u03d0\u03cd")
        buf.write("\3\2\2\2\u03d0\u03ce\3\2\2\2\u03d0\u03cf\3\2\2\2\u03d1")
        buf.write("\u03d6\3\2\2\2\u03d2\u03d4\t\4\2\2\u03d3\u03d2\3\2\2\2")
        buf.write("\u03d3\u03d4\3\2\2\2\u03d4\u03d5\3\2\2\2\u03d5\u03d7\5")
        buf.write("\u00b0Y\2\u03d6\u03d3\3\2\2\2\u03d7\u03d8\3\2\2\2\u03d8")
        buf.write("\u03d6\3\2\2\2\u03d8\u03d9\3\2\2\2\u03d9\u03db\3\2\2\2")
        buf.write("\u03da\u0392\3\2\2\2\u03da\u0396\3\2\2\2\u03da\u039b\3")
        buf.write("\2\2\2\u03da\u039f\3\2\2\2\u03da\u03a9\3\2\2\2\u03da\u03ae")
        buf.write("\3\2\2\2\u03da\u03b6\3\2\2\2\u03da\u03bd\3\2\2\2\u03da")
        buf.write("\u03c3\3\2\2\2\u03da\u03d0\3\2\2\2\u03db\u00a1\3\2\2\2")
        buf.write("\u03dc\u03dd\7\u009f\2\2\u03dd\u03de\7\u00bb\2\2\u03de")
        buf.write("\u03df\5&\24\2\u03df\u03e0\7\u00b8\2\2\u03e0\u03e1\5&")
        buf.write("\24\2\u03e1\u03e2\7\u00ba\2\2\u03e2\u00a3\3\2\2\2\u03e3")
        buf.write("\u03e4\7\u00a0\2\2\u03e4\u03e5\7\u00bb\2\2\u03e5\u03e6")
        buf.write("\5\u00a2R\2\u03e6\u03e7\7\u00b8\2\2\u03e7\u03e8\5&\24")
        buf.write("\2\u03e8\u03e9\7\u00ba\2\2\u03e9\u00a5\3\2\2\2\u03ea\u03eb")
        buf.write("\7\u00a1\2\2\u03eb\u03ec\7\u00bb\2\2\u03ec\u03ed\5\u00a2")
        buf.write("R\2\u03ed\u03ee\7\u00b8\2\2\u03ee\u03ef\5\u00a2R\2\u03ef")
        buf.write("\u03f0\7\u00ba\2\2\u03f0\u03f9\3\2\2\2\u03f1\u03f2\7\u00a1")
        buf.write("\2\2\u03f2\u03f3\7\u00bb\2\2\u03f3\u03f4\5\u00b0Y\2\u03f4")
        buf.write("\u03f5\7\u00b8\2\2\u03f5\u03f6\5&\24\2\u03f6\u03f7\7\u00ba")
        buf.write("\2\2\u03f7\u03f9\3\2\2\2\u03f8\u03ea\3\2\2\2\u03f8\u03f1")
        buf.write("\3\2\2\2\u03f9\u00a7\3\2\2\2\u03fa\u03fb\7\u00a2\2\2\u03fb")
        buf.write("\u03fc\7\u00bb\2\2\u03fc\u03fd\5\u00a2R\2\u03fd\u03fe")
        buf.write("\7\u00b8\2\2\u03fe\u03ff\5&\24\2\u03ff\u0400\7\u00b8\2")
        buf.write("\2\u0400\u0401\5&\24\2\u0401\u0402\7\u00b8\2\2\u0402\u0403")
        buf.write("\5&\24\2\u0403\u0404\7\u00ba\2\2\u0404\u00a9\3\2\2\2\u0405")
        buf.write("\u0406\7\u00a5\2\2\u0406\u0407\7\u00bb\2\2\u0407\u0408")
        buf.write("\5\u00a2R\2\u0408\u0409\7\u00b8\2\2\u0409\u040a\5\u00a2")
        buf.write("R\2\u040a\u040b\7\u00ba\2\2\u040b\u00ab\3\2\2\2\u040c")
        buf.write("\u040d\7\u00a3\2\2\u040d\u0418\7\u00d6\2\2\u040e\u040f")
        buf.write("\7\u00a3\2\2\u040f\u0410\7\u00bb\2\2\u0410\u0411\5\64")
        buf.write("\33\2\u0411\u0412\7\u00ba\2\2\u0412\u0418\3\2\2\2\u0413")
        buf.write("\u0414\7\u00a3\2\2\u0414\u0415\7\u00bb\2\2\u0415\u0416")
        buf.write("\7\u00d6\2\2\u0416\u0418\7\u00ba\2\2\u0417\u040c\3\2\2")
        buf.write("\2\u0417\u040e\3\2\2\2\u0417\u0413\3\2\2\2\u0418\u00ad")
        buf.write("\3\2\2\2\u0419\u041a\7\u00a4\2\2\u041a\u0421\7\u00d6\2")
        buf.write("\2\u041b\u041c\7\u00a4\2\2\u041c\u041d\7\u00bb\2\2\u041d")
        buf.write("\u041e\5\64\33\2\u041e\u041f\7\u00ba\2\2\u041f\u0421\3")
        buf.write("\2\2\2\u0420\u0419\3\2\2\2\u0420\u041b\3\2\2\2\u0421\u00af")
        buf.write("\3\2\2\2\u0422\u0423\7\u00a6\2\2\u0423\u0424\7\u00bb\2")
        buf.write("\2\u0424\u0425\5&\24\2\u0425\u0426\7\u00b8\2\2\u0426\u0427")
        buf.write("\5&\24\2\u0427\u0428\7\u00b8\2\2\u0428\u0429\5&\24\2\u0429")
        buf.write("\u042a\7\u00b8\2\2\u042a\u042b\7\u00d5\2\2\u042b\u042c")
        buf.write("\7\u00ba\2\2\u042c\u00b1\3\2\2\2\u042d\u0435\5\u00a4S")
        buf.write("\2\u042e\u0435\5\u00a6T\2\u042f\u0435\5\u00a8U\2\u0430")
        buf.write("\u0435\5\u00aaV\2\u0431\u0435\5\u00acW\2\u0432\u0435\5")
        buf.write("\u00aeX\2\u0433\u0435\5\u0082B\2\u0434\u042d\3\2\2\2\u0434")
        buf.write("\u042e\3\2\2\2\u0434\u042f\3\2\2\2\u0434\u0430\3\2\2\2")
        buf.write("\u0434\u0431\3\2\2\2\u0434\u0432\3\2\2\2\u0434\u0433\3")
        buf.write("\2\2\2\u0435\u00b3\3\2\2\2\u0087\u00ba\u00c0\u00cc\u00cf")
        buf.write("\u00d6\u00df\u00f9\u0101\u0105\u010b\u010e\u0111\u0114")
        buf.write("\u0116\u0119\u011c\u011f\u0123\u0126\u0129\u0130\u0135")
        buf.write("\u0139\u013c\u0140\u0145\u0149\u0154\u015e\u0166\u0170")
        buf.write("\u0175\u0179\u0181\u0185\u0188\u018a\u0191\u0195\u019c")
        buf.write("\u01a2\u01a4\u01a7\u01a9\u01b0\u01b9\u01c1\u01c6\u01cd")
        buf.write("\u01d5\u01d9\u01dd\u01e1\u01ea\u01ed\u01f0\u020b\u020f")
        buf.write("\u0211\u0215\u021e\u0223\u0228\u022b\u0234\u0244\u024b")
        buf.write("\u0255\u025f\u0261\u026a\u0270\u0277\u0287\u028c\u0290")
        buf.write("\u0292\u0298\u02a6\u02aa\u02af\u02b5\u02ba\u02be\u02c2")
        buf.write("\u02c7\u02cd\u02d1\u02d5\u02e1\u02eb\u02ee\u02f0\u02f5")
        buf.write("\u02fa\u0308\u030e\u0313\u031b\u031e\u0321\u0333\u0339")
        buf.write("\u033e\u0342\u034a\u034c\u0351\u0359\u0360\u0362\u0366")
        buf.write("\u036f\u0371\u0378\u037e\u0388\u0392\u0396\u03a9\u03ae")
        buf.write("\u03b4\u03bb\u03c1\u03c7\u03d0\u03d3\u03d8\u03da\u03f8")
        buf.write("\u0417\u0420\u0434")
        return buf.getvalue()


class PostgreSQLParser ( Parser ):

    grammarFileName = "PostgreSQLParser.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "'@'", "'!!'", 
                     "<INVALID>", "<INVALID>", "'<='", "'>='", "'<<'", "'>>'", 
                     "';'", "':'", "'.'", "','", "'*'", "')'", "'('", "']'", 
                     "'['", "'+'", "'-'", "'~'", "'|'", "'&'", "'^'", "'>'", 
                     "'<'", "'<@'", "'@>'", "'!@'", "'!<@'", "'!~'", "'!@>'", 
                     "'!&&'", "'#'", "'<->'", "'@-@'", "'@@'" ]

    symbolicNames = [ "<INVALID>", "ABS", "ACOS", "ALL", "ANY", "ASC", "ASIN", 
                      "AS_SYM", "ATAN", "ATAN2", "AVG", "BETWEEN", "BIGINT", 
                      "BINARY", "BIT_AND", "BIT_LENGTH", "BIT_OR", "BOOLEAN_SYM", 
                      "BY_SYM", "CASE_SYM", "CAST_SYM", "CBRT", "CEIL", 
                      "CEILING", "CHAR", "CHR", "CHAR_LENGTH", "CONCAT", 
                      "CONCAT_WS", "CONVERT_SYM", "COS", "COT", "COUNT", 
                      "CROSS", "DATE_PART", "DATE_SYM", "DATETIME", "DAY_SYM", 
                      "DECIMAL_SYM", "DEGREES", "DESC", "DIV", "DISTINCT", 
                      "DOUBLE_PRECISION_SYM", "ELSE_SYM", "ENCODE", "END_SYM", 
                      "ESCAPE_SYM", "EXISTS", "EXP", "EXPANSION_SYM", "FALSE_SYM", 
                      "FIRST_SYM", "FLOAT", "FLOOR", "FOR_SYM", "FORCE_SYM", 
                      "FROM", "GROUP_SYM", "HAVING", "IGNORE_SYM", "INDEX_SYM", 
                      "INNER_SYM", "INTEGER_SYM", "INTERVAL_SYM", "IN_SYM", 
                      "ISNULL", "IS_SYM", "JOIN_SYM", "KEY_SYM", "LAST_SYM", 
                      "LEFT", "LENGTH", "LIKE_SYM", "LIMIT", "LN", "LOG", 
                      "LOWER", "LPAD", "LTRIM", "MAX_SYM", "MD5", "MINUTE", 
                      "MIN_SYM", "MOD", "MODE_SYM", "NATURAL", "NOT_SYM", 
                      "NOTNULL", "NOW", "NULL_SYM", "NULLS_SYM", "OFFSET_SYM", 
                      "OJ_SYM", "ON", "ORDER_SYM", "OUTER", "PARTITION_SYM", 
                      "PI", "POSITION_SYM", "POW", "POWER", "QUERY_SYM", 
                      "RADIANS", "RANDOM", "REAL", "REGEXP", "REPEAT", "REPLACE", 
                      "REVERSE", "RIGHT", "ROLLUP_SYM", "ROUND", "ROW_SYM", 
                      "RPAD", "RTRIM", "SECOND", "SELECT", "SHARE_SYM", 
                      "SIGN", "SIGNED_SYM", "SIN", "SOUNDS_SYM", "SQRT", 
                      "STDDEV", "STDDEV_POP", "STDDEV_SAMP", "STRAIGHT_JOIN", 
                      "SUBSTRING", "SUM", "SYMMETRIC", "TAN", "THEN_SYM", 
                      "TIME_SYM", "TIMESTAMP", "TRUE_SYM", "TRUNCATE", "UNION_SYM", 
                      "UNSIGNED_SYM", "UPDATE", "UPPER", "USE_SYM", "USING_SYM", 
                      "UTC_DATE", "UTC_TIME", "UTC_TIMESTAMP", "VALUES", 
                      "VARIANCE", "VAR_POP", "VAR_SAMP", "WHEN_SYM", "WHERE", 
                      "WITH", "YEAR", "ASCII_SYM", "LATIN1", "UTF8", "SPOINT", 
                      "SCIRCLE", "SLINE", "SELLIPSE", "SPOLY", "SPATH", 
                      "SBOX", "STRANS", "AREA", "ARRAY_LENGTH", "DIVIDE", 
                      "MOD_SYM", "OR_SYM", "AND_SYM", "ABS_VAL_OR_SCONTAINS", 
                      "DFACTORIAL", "EQ", "NOT_EQ", "LET", "GET", "SHIFT_LEFT", 
                      "SHIFT_RIGHT", "SEMI", "COLON", "DOT", "COMMA", "ASTERISK", 
                      "RPAREN", "LPAREN", "RBRACK", "LBRACK", "PLUS", "MINUS", 
                      "NEGATION", "VERTBAR", "BITAND", "POWER_OP", "GTH", 
                      "LTH", "SCONTAINS2", "SLEFTCONTAINS2", "SNOTCONTAINS", 
                      "SNOTCONTAINS2", "SLEFTNOTCONTAINS", "SLEFTNOTCONTAINS2", 
                      "SNOTOVERLAP", "SCROSS", "SDISTANCE", "SLENGTH", "SCENTER", 
                      "INTEGER_NUM", "HEX_DIGIT", "BIT_NUM", "REAL_NUMBER", 
                      "TRANS", "TEXT_STRING", "ID", "COMMENT", "WS" ]

    RULE_relational_op = 0
    RULE_cast_data_type = 1
    RULE_bit_literal = 2
    RULE_boolean_literal = 3
    RULE_hex_literal = 4
    RULE_number_literal = 5
    RULE_string_literal = 6
    RULE_char_functions = 7
    RULE_group_functions = 8
    RULE_number_functions = 9
    RULE_other_functions = 10
    RULE_time_functions = 11
    RULE_array_functions = 12
    RULE_pg_sphere_functions = 13
    RULE_functionList = 14
    RULE_literal_value = 15
    RULE_select_expression = 16
    RULE_alias = 17
    RULE_bit_expr = 18
    RULE_bool_primary = 19
    RULE_case_when_statement = 20
    RULE_case_when_statement1 = 21
    RULE_case_when_statement2 = 22
    RULE_column_list = 23
    RULE_column_name = 24
    RULE_column_spec = 25
    RULE_displayed_column = 26
    RULE_exp_factor1 = 27
    RULE_exp_factor2 = 28
    RULE_exp_factor3 = 29
    RULE_expression = 30
    RULE_expression_list = 31
    RULE_factor1 = 32
    RULE_factor2 = 33
    RULE_factor3 = 34
    RULE_factor4 = 35
    RULE_factor5 = 36
    RULE_function_call = 37
    RULE_groupby_clause = 38
    RULE_groupby_item = 39
    RULE_having_clause = 40
    RULE_index_hint = 41
    RULE_index_hint_list = 42
    RULE_index_name = 43
    RULE_index_list = 44
    RULE_index_options = 45
    RULE_interval_expr = 46
    RULE_join_condition = 47
    RULE_limit_clause = 48
    RULE_offset = 49
    RULE_offset_clause = 50
    RULE_row_count = 51
    RULE_orderby_clause = 52
    RULE_orderby_item = 53
    RULE_partition_clause = 54
    RULE_partition_name = 55
    RULE_partition_names = 56
    RULE_bit_fac1 = 57
    RULE_bit_fac2 = 58
    RULE_predicate = 59
    RULE_query = 60
    RULE_schema_name = 61
    RULE_select_list = 62
    RULE_select_statement = 63
    RULE_simple_expr = 64
    RULE_slice_spec = 65
    RULE_subquery = 66
    RULE_table_atom = 67
    RULE_table_name = 68
    RULE_table_factor1 = 69
    RULE_table_factor2 = 70
    RULE_table_factor3 = 71
    RULE_table_factor4 = 72
    RULE_table_reference = 73
    RULE_table_references = 74
    RULE_table_spec = 75
    RULE_values_list = 76
    RULE_where_clause = 77
    RULE_pg_sphere_op = 78
    RULE_sbit_expr = 79
    RULE_spoint = 80
    RULE_scircle = 81
    RULE_sline = 82
    RULE_sellipse = 83
    RULE_sbox = 84
    RULE_spoly = 85
    RULE_spath = 86
    RULE_strans = 87
    RULE_pg_sphere_object = 88

    ruleNames =  [ "relational_op", "cast_data_type", "bit_literal", "boolean_literal", 
                   "hex_literal", "number_literal", "string_literal", "char_functions", 
                   "group_functions", "number_functions", "other_functions", 
                   "time_functions", "array_functions", "pg_sphere_functions", 
                   "functionList", "literal_value", "select_expression", 
                   "alias", "bit_expr", "bool_primary", "case_when_statement", 
                   "case_when_statement1", "case_when_statement2", "column_list", 
                   "column_name", "column_spec", "displayed_column", "exp_factor1", 
                   "exp_factor2", "exp_factor3", "expression", "expression_list", 
                   "factor1", "factor2", "factor3", "factor4", "factor5", 
                   "function_call", "groupby_clause", "groupby_item", "having_clause", 
                   "index_hint", "index_hint_list", "index_name", "index_list", 
                   "index_options", "interval_expr", "join_condition", "limit_clause", 
                   "offset", "offset_clause", "row_count", "orderby_clause", 
                   "orderby_item", "partition_clause", "partition_name", 
                   "partition_names", "bit_fac1", "bit_fac2", "predicate", 
                   "query", "schema_name", "select_list", "select_statement", 
                   "simple_expr", "slice_spec", "subquery", "table_atom", 
                   "table_name", "table_factor1", "table_factor2", "table_factor3", 
                   "table_factor4", "table_reference", "table_references", 
                   "table_spec", "values_list", "where_clause", "pg_sphere_op", 
                   "sbit_expr", "spoint", "scircle", "sline", "sellipse", 
                   "sbox", "spoly", "spath", "strans", "pg_sphere_object" ]

    EOF = Token.EOF
    ABS=1
    ACOS=2
    ALL=3
    ANY=4
    ASC=5
    ASIN=6
    AS_SYM=7
    ATAN=8
    ATAN2=9
    AVG=10
    BETWEEN=11
    BIGINT=12
    BINARY=13
    BIT_AND=14
    BIT_LENGTH=15
    BIT_OR=16
    BOOLEAN_SYM=17
    BY_SYM=18
    CASE_SYM=19
    CAST_SYM=20
    CBRT=21
    CEIL=22
    CEILING=23
    CHAR=24
    CHR=25
    CHAR_LENGTH=26
    CONCAT=27
    CONCAT_WS=28
    CONVERT_SYM=29
    COS=30
    COT=31
    COUNT=32
    CROSS=33
    DATE_PART=34
    DATE_SYM=35
    DATETIME=36
    DAY_SYM=37
    DECIMAL_SYM=38
    DEGREES=39
    DESC=40
    DIV=41
    DISTINCT=42
    DOUBLE_PRECISION_SYM=43
    ELSE_SYM=44
    ENCODE=45
    END_SYM=46
    ESCAPE_SYM=47
    EXISTS=48
    EXP=49
    EXPANSION_SYM=50
    FALSE_SYM=51
    FIRST_SYM=52
    FLOAT=53
    FLOOR=54
    FOR_SYM=55
    FORCE_SYM=56
    FROM=57
    GROUP_SYM=58
    HAVING=59
    IGNORE_SYM=60
    INDEX_SYM=61
    INNER_SYM=62
    INTEGER_SYM=63
    INTERVAL_SYM=64
    IN_SYM=65
    ISNULL=66
    IS_SYM=67
    JOIN_SYM=68
    KEY_SYM=69
    LAST_SYM=70
    LEFT=71
    LENGTH=72
    LIKE_SYM=73
    LIMIT=74
    LN=75
    LOG=76
    LOWER=77
    LPAD=78
    LTRIM=79
    MAX_SYM=80
    MD5=81
    MINUTE=82
    MIN_SYM=83
    MOD=84
    MODE_SYM=85
    NATURAL=86
    NOT_SYM=87
    NOTNULL=88
    NOW=89
    NULL_SYM=90
    NULLS_SYM=91
    OFFSET_SYM=92
    OJ_SYM=93
    ON=94
    ORDER_SYM=95
    OUTER=96
    PARTITION_SYM=97
    PI=98
    POSITION_SYM=99
    POW=100
    POWER=101
    QUERY_SYM=102
    RADIANS=103
    RANDOM=104
    REAL=105
    REGEXP=106
    REPEAT=107
    REPLACE=108
    REVERSE=109
    RIGHT=110
    ROLLUP_SYM=111
    ROUND=112
    ROW_SYM=113
    RPAD=114
    RTRIM=115
    SECOND=116
    SELECT=117
    SHARE_SYM=118
    SIGN=119
    SIGNED_SYM=120
    SIN=121
    SOUNDS_SYM=122
    SQRT=123
    STDDEV=124
    STDDEV_POP=125
    STDDEV_SAMP=126
    STRAIGHT_JOIN=127
    SUBSTRING=128
    SUM=129
    SYMMETRIC=130
    TAN=131
    THEN_SYM=132
    TIME_SYM=133
    TIMESTAMP=134
    TRUE_SYM=135
    TRUNCATE=136
    UNION_SYM=137
    UNSIGNED_SYM=138
    UPDATE=139
    UPPER=140
    USE_SYM=141
    USING_SYM=142
    UTC_DATE=143
    UTC_TIME=144
    UTC_TIMESTAMP=145
    VALUES=146
    VARIANCE=147
    VAR_POP=148
    VAR_SAMP=149
    WHEN_SYM=150
    WHERE=151
    WITH=152
    YEAR=153
    ASCII_SYM=154
    LATIN1=155
    UTF8=156
    SPOINT=157
    SCIRCLE=158
    SLINE=159
    SELLIPSE=160
    SPOLY=161
    SPATH=162
    SBOX=163
    STRANS=164
    AREA=165
    ARRAY_LENGTH=166
    DIVIDE=167
    MOD_SYM=168
    OR_SYM=169
    AND_SYM=170
    ABS_VAL_OR_SCONTAINS=171
    DFACTORIAL=172
    EQ=173
    NOT_EQ=174
    LET=175
    GET=176
    SHIFT_LEFT=177
    SHIFT_RIGHT=178
    SEMI=179
    COLON=180
    DOT=181
    COMMA=182
    ASTERISK=183
    RPAREN=184
    LPAREN=185
    RBRACK=186
    LBRACK=187
    PLUS=188
    MINUS=189
    NEGATION=190
    VERTBAR=191
    BITAND=192
    POWER_OP=193
    GTH=194
    LTH=195
    SCONTAINS2=196
    SLEFTCONTAINS2=197
    SNOTCONTAINS=198
    SNOTCONTAINS2=199
    SLEFTNOTCONTAINS=200
    SLEFTNOTCONTAINS2=201
    SNOTOVERLAP=202
    SCROSS=203
    SDISTANCE=204
    SLENGTH=205
    SCENTER=206
    INTEGER_NUM=207
    HEX_DIGIT=208
    BIT_NUM=209
    REAL_NUMBER=210
    TRANS=211
    TEXT_STRING=212
    ID=213
    COMMENT=214
    WS=215

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




    class Relational_opContext(ParserRuleContext):

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

        def EQ(self):
            return self.getToken(PostgreSQLParser.EQ, 0)

        def LTH(self):
            return self.getToken(PostgreSQLParser.LTH, 0)

        def GTH(self):
            return self.getToken(PostgreSQLParser.GTH, 0)

        def NOT_EQ(self):
            return self.getToken(PostgreSQLParser.NOT_EQ, 0)

        def LET(self):
            return self.getToken(PostgreSQLParser.LET, 0)

        def GET(self):
            return self.getToken(PostgreSQLParser.GET, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_relational_op

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

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




    def relational_op(self):

        localctx = PostgreSQLParser.Relational_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_relational_op)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 178
            _la = self._input.LA(1)
            if not(((((_la - 173)) & ~0x3f) == 0 and ((1 << (_la - 173)) & ((1 << (PostgreSQLParser.EQ - 173)) | (1 << (PostgreSQLParser.NOT_EQ - 173)) | (1 << (PostgreSQLParser.LET - 173)) | (1 << (PostgreSQLParser.GET - 173)) | (1 << (PostgreSQLParser.GTH - 173)) | (1 << (PostgreSQLParser.LTH - 173)))) != 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 Cast_data_typeContext(ParserRuleContext):

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

        def BINARY(self):
            return self.getToken(PostgreSQLParser.BINARY, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

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

        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def CHAR(self):
            return self.getToken(PostgreSQLParser.CHAR, 0)

        def DATE_SYM(self):
            return self.getToken(PostgreSQLParser.DATE_SYM, 0)

        def DATETIME(self):
            return self.getToken(PostgreSQLParser.DATETIME, 0)

        def TIME_SYM(self):
            return self.getToken(PostgreSQLParser.TIME_SYM, 0)

        def TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.TIMESTAMP, 0)

        def INTERVAL_SYM(self):
            return self.getToken(PostgreSQLParser.INTERVAL_SYM, 0)

        def DECIMAL_SYM(self):
            return self.getToken(PostgreSQLParser.DECIMAL_SYM, 0)

        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def INTEGER_SYM(self):
            return self.getToken(PostgreSQLParser.INTEGER_SYM, 0)

        def BIGINT(self):
            return self.getToken(PostgreSQLParser.BIGINT, 0)

        def FLOAT(self):
            return self.getToken(PostgreSQLParser.FLOAT, 0)

        def REAL(self):
            return self.getToken(PostgreSQLParser.REAL, 0)

        def DOUBLE_PRECISION_SYM(self):
            return self.getToken(PostgreSQLParser.DOUBLE_PRECISION_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_cast_data_type

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

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




    def cast_data_type(self):

        localctx = PostgreSQLParser.Cast_data_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_cast_data_type)
        self._la = 0 # Token type
        try:
            self.state = 212
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.BINARY]:
                self.enterOuterAlt(localctx, 1)
                self.state = 180
                self.match(PostgreSQLParser.BINARY)
                self.state = 184
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.LPAREN:
                    self.state = 181
                    self.match(PostgreSQLParser.LPAREN)
                    self.state = 182
                    self.match(PostgreSQLParser.INTEGER_NUM)
                    self.state = 183
                    self.match(PostgreSQLParser.RPAREN)


                pass
            elif token in [PostgreSQLParser.CHAR]:
                self.enterOuterAlt(localctx, 2)
                self.state = 186
                self.match(PostgreSQLParser.CHAR)
                self.state = 190
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.LPAREN:
                    self.state = 187
                    self.match(PostgreSQLParser.LPAREN)
                    self.state = 188
                    self.match(PostgreSQLParser.INTEGER_NUM)
                    self.state = 189
                    self.match(PostgreSQLParser.RPAREN)


                pass
            elif token in [PostgreSQLParser.DATE_SYM]:
                self.enterOuterAlt(localctx, 3)
                self.state = 192
                self.match(PostgreSQLParser.DATE_SYM)
                pass
            elif token in [PostgreSQLParser.DATETIME]:
                self.enterOuterAlt(localctx, 4)
                self.state = 193
                self.match(PostgreSQLParser.DATETIME)
                pass
            elif token in [PostgreSQLParser.TIME_SYM]:
                self.enterOuterAlt(localctx, 5)
                self.state = 194
                self.match(PostgreSQLParser.TIME_SYM)
                pass
            elif token in [PostgreSQLParser.TIMESTAMP]:
                self.enterOuterAlt(localctx, 6)
                self.state = 195
                self.match(PostgreSQLParser.TIMESTAMP)
                pass
            elif token in [PostgreSQLParser.INTERVAL_SYM]:
                self.enterOuterAlt(localctx, 7)
                self.state = 196
                self.match(PostgreSQLParser.INTERVAL_SYM)
                pass
            elif token in [PostgreSQLParser.DECIMAL_SYM]:
                self.enterOuterAlt(localctx, 8)
                self.state = 197
                self.match(PostgreSQLParser.DECIMAL_SYM)
                self.state = 205
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.LPAREN:
                    self.state = 198
                    self.match(PostgreSQLParser.LPAREN)
                    self.state = 199
                    self.match(PostgreSQLParser.INTEGER_NUM)
                    self.state = 202
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.COMMA:
                        self.state = 200
                        self.match(PostgreSQLParser.COMMA)
                        self.state = 201
                        self.match(PostgreSQLParser.INTEGER_NUM)


                    self.state = 204
                    self.match(PostgreSQLParser.RPAREN)


                pass
            elif token in [PostgreSQLParser.INTEGER_SYM]:
                self.enterOuterAlt(localctx, 9)
                self.state = 207
                self.match(PostgreSQLParser.INTEGER_SYM)
                pass
            elif token in [PostgreSQLParser.BIGINT]:
                self.enterOuterAlt(localctx, 10)
                self.state = 208
                self.match(PostgreSQLParser.BIGINT)
                pass
            elif token in [PostgreSQLParser.FLOAT]:
                self.enterOuterAlt(localctx, 11)
                self.state = 209
                self.match(PostgreSQLParser.FLOAT)
                pass
            elif token in [PostgreSQLParser.REAL]:
                self.enterOuterAlt(localctx, 12)
                self.state = 210
                self.match(PostgreSQLParser.REAL)
                pass
            elif token in [PostgreSQLParser.DOUBLE_PRECISION_SYM]:
                self.enterOuterAlt(localctx, 13)
                self.state = 211
                self.match(PostgreSQLParser.DOUBLE_PRECISION_SYM)
                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 Bit_literalContext(ParserRuleContext):

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

        def BIT_NUM(self):
            return self.getToken(PostgreSQLParser.BIT_NUM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bit_literal

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

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




    def bit_literal(self):

        localctx = PostgreSQLParser.Bit_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_bit_literal)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 214
            self.match(PostgreSQLParser.BIT_NUM)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Boolean_literalContext(ParserRuleContext):

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

        def TRUE_SYM(self):
            return self.getToken(PostgreSQLParser.TRUE_SYM, 0)

        def FALSE_SYM(self):
            return self.getToken(PostgreSQLParser.FALSE_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_boolean_literal

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

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




    def boolean_literal(self):

        localctx = PostgreSQLParser.Boolean_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_boolean_literal)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 216
            _la = self._input.LA(1)
            if not(_la==PostgreSQLParser.FALSE_SYM or _la==PostgreSQLParser.TRUE_SYM):
                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 Hex_literalContext(ParserRuleContext):

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

        def HEX_DIGIT(self):
            return self.getToken(PostgreSQLParser.HEX_DIGIT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_hex_literal

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

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




    def hex_literal(self):

        localctx = PostgreSQLParser.Hex_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_hex_literal)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 218
            self.match(PostgreSQLParser.HEX_DIGIT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Number_literalContext(ParserRuleContext):

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

        def INTEGER_NUM(self):
            return self.getToken(PostgreSQLParser.INTEGER_NUM, 0)

        def REAL_NUMBER(self):
            return self.getToken(PostgreSQLParser.REAL_NUMBER, 0)

        def PLUS(self):
            return self.getToken(PostgreSQLParser.PLUS, 0)

        def MINUS(self):
            return self.getToken(PostgreSQLParser.MINUS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_number_literal

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

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




    def number_literal(self):

        localctx = PostgreSQLParser.Number_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_number_literal)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 221
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.PLUS or _la==PostgreSQLParser.MINUS:
                self.state = 220
                _la = self._input.LA(1)
                if not(_la==PostgreSQLParser.PLUS or _la==PostgreSQLParser.MINUS):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 223
            _la = self._input.LA(1)
            if not(_la==PostgreSQLParser.INTEGER_NUM or _la==PostgreSQLParser.REAL_NUMBER):
                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 String_literalContext(ParserRuleContext):

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

        def TEXT_STRING(self):
            return self.getToken(PostgreSQLParser.TEXT_STRING, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_string_literal

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

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




    def string_literal(self):

        localctx = PostgreSQLParser.String_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_string_literal)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 225
            self.match(PostgreSQLParser.TEXT_STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Char_functionsContext(ParserRuleContext):

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

        def ASCII_SYM(self):
            return self.getToken(PostgreSQLParser.ASCII_SYM, 0)

        def BIT_LENGTH(self):
            return self.getToken(PostgreSQLParser.BIT_LENGTH, 0)

        def CHAR_LENGTH(self):
            return self.getToken(PostgreSQLParser.CHAR_LENGTH, 0)

        def CHR(self):
            return self.getToken(PostgreSQLParser.CHR, 0)

        def CONCAT_WS(self):
            return self.getToken(PostgreSQLParser.CONCAT_WS, 0)

        def CONCAT(self):
            return self.getToken(PostgreSQLParser.CONCAT, 0)

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

        def LENGTH(self):
            return self.getToken(PostgreSQLParser.LENGTH, 0)

        def LOWER(self):
            return self.getToken(PostgreSQLParser.LOWER, 0)

        def LPAD(self):
            return self.getToken(PostgreSQLParser.LPAD, 0)

        def LTRIM(self):
            return self.getToken(PostgreSQLParser.LTRIM, 0)

        def REPEAT(self):
            return self.getToken(PostgreSQLParser.REPEAT, 0)

        def REPLACE(self):
            return self.getToken(PostgreSQLParser.REPLACE, 0)

        def REVERSE(self):
            return self.getToken(PostgreSQLParser.REVERSE, 0)

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

        def RPAD(self):
            return self.getToken(PostgreSQLParser.RPAD, 0)

        def RTRIM(self):
            return self.getToken(PostgreSQLParser.RTRIM, 0)

        def SUBSTRING(self):
            return self.getToken(PostgreSQLParser.SUBSTRING, 0)

        def UPPER(self):
            return self.getToken(PostgreSQLParser.UPPER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_char_functions

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

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




    def char_functions(self):

        localctx = PostgreSQLParser.Char_functionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_char_functions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 227
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << PostgreSQLParser.BIT_LENGTH) | (1 << PostgreSQLParser.CHR) | (1 << PostgreSQLParser.CHAR_LENGTH) | (1 << PostgreSQLParser.CONCAT) | (1 << PostgreSQLParser.CONCAT_WS))) != 0) or ((((_la - 71)) & ~0x3f) == 0 and ((1 << (_la - 71)) & ((1 << (PostgreSQLParser.LEFT - 71)) | (1 << (PostgreSQLParser.LENGTH - 71)) | (1 << (PostgreSQLParser.LOWER - 71)) | (1 << (PostgreSQLParser.LPAD - 71)) | (1 << (PostgreSQLParser.LTRIM - 71)) | (1 << (PostgreSQLParser.REPEAT - 71)) | (1 << (PostgreSQLParser.REPLACE - 71)) | (1 << (PostgreSQLParser.REVERSE - 71)) | (1 << (PostgreSQLParser.RIGHT - 71)) | (1 << (PostgreSQLParser.RPAD - 71)) | (1 << (PostgreSQLParser.RTRIM - 71)) | (1 << (PostgreSQLParser.SUBSTRING - 71)))) != 0) or _la==PostgreSQLParser.UPPER or _la==PostgreSQLParser.ASCII_SYM):
                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 Group_functionsContext(ParserRuleContext):

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

        def AVG(self):
            return self.getToken(PostgreSQLParser.AVG, 0)

        def COUNT(self):
            return self.getToken(PostgreSQLParser.COUNT, 0)

        def MAX_SYM(self):
            return self.getToken(PostgreSQLParser.MAX_SYM, 0)

        def MIN_SYM(self):
            return self.getToken(PostgreSQLParser.MIN_SYM, 0)

        def SUM(self):
            return self.getToken(PostgreSQLParser.SUM, 0)

        def BIT_AND(self):
            return self.getToken(PostgreSQLParser.BIT_AND, 0)

        def BIT_OR(self):
            return self.getToken(PostgreSQLParser.BIT_OR, 0)

        def STDDEV(self):
            return self.getToken(PostgreSQLParser.STDDEV, 0)

        def STDDEV_POP(self):
            return self.getToken(PostgreSQLParser.STDDEV_POP, 0)

        def STDDEV_SAMP(self):
            return self.getToken(PostgreSQLParser.STDDEV_SAMP, 0)

        def VAR_POP(self):
            return self.getToken(PostgreSQLParser.VAR_POP, 0)

        def VAR_SAMP(self):
            return self.getToken(PostgreSQLParser.VAR_SAMP, 0)

        def VARIANCE(self):
            return self.getToken(PostgreSQLParser.VARIANCE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_group_functions

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

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




    def group_functions(self):

        localctx = PostgreSQLParser.Group_functionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_group_functions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 229
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << PostgreSQLParser.AVG) | (1 << PostgreSQLParser.BIT_AND) | (1 << PostgreSQLParser.BIT_OR) | (1 << PostgreSQLParser.COUNT))) != 0) or ((((_la - 80)) & ~0x3f) == 0 and ((1 << (_la - 80)) & ((1 << (PostgreSQLParser.MAX_SYM - 80)) | (1 << (PostgreSQLParser.MIN_SYM - 80)) | (1 << (PostgreSQLParser.STDDEV - 80)) | (1 << (PostgreSQLParser.STDDEV_POP - 80)) | (1 << (PostgreSQLParser.STDDEV_SAMP - 80)) | (1 << (PostgreSQLParser.SUM - 80)))) != 0) or ((((_la - 147)) & ~0x3f) == 0 and ((1 << (_la - 147)) & ((1 << (PostgreSQLParser.VARIANCE - 147)) | (1 << (PostgreSQLParser.VAR_POP - 147)) | (1 << (PostgreSQLParser.VAR_SAMP - 147)))) != 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 Number_functionsContext(ParserRuleContext):

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

        def ABS(self):
            return self.getToken(PostgreSQLParser.ABS, 0)

        def ACOS(self):
            return self.getToken(PostgreSQLParser.ACOS, 0)

        def ASIN(self):
            return self.getToken(PostgreSQLParser.ASIN, 0)

        def ATAN2(self):
            return self.getToken(PostgreSQLParser.ATAN2, 0)

        def ATAN(self):
            return self.getToken(PostgreSQLParser.ATAN, 0)

        def CBRT(self):
            return self.getToken(PostgreSQLParser.CBRT, 0)

        def CEIL(self):
            return self.getToken(PostgreSQLParser.CEIL, 0)

        def CEILING(self):
            return self.getToken(PostgreSQLParser.CEILING, 0)

        def COS(self):
            return self.getToken(PostgreSQLParser.COS, 0)

        def COT(self):
            return self.getToken(PostgreSQLParser.COT, 0)

        def DEGREES(self):
            return self.getToken(PostgreSQLParser.DEGREES, 0)

        def DIV(self):
            return self.getToken(PostgreSQLParser.DIV, 0)

        def EXP(self):
            return self.getToken(PostgreSQLParser.EXP, 0)

        def FLOOR(self):
            return self.getToken(PostgreSQLParser.FLOOR, 0)

        def LN(self):
            return self.getToken(PostgreSQLParser.LN, 0)

        def LOG(self):
            return self.getToken(PostgreSQLParser.LOG, 0)

        def MOD(self):
            return self.getToken(PostgreSQLParser.MOD, 0)

        def PI(self):
            return self.getToken(PostgreSQLParser.PI, 0)

        def POW(self):
            return self.getToken(PostgreSQLParser.POW, 0)

        def POWER(self):
            return self.getToken(PostgreSQLParser.POWER, 0)

        def RADIANS(self):
            return self.getToken(PostgreSQLParser.RADIANS, 0)

        def RANDOM(self):
            return self.getToken(PostgreSQLParser.RANDOM, 0)

        def ROUND(self):
            return self.getToken(PostgreSQLParser.ROUND, 0)

        def SIGN(self):
            return self.getToken(PostgreSQLParser.SIGN, 0)

        def SIN(self):
            return self.getToken(PostgreSQLParser.SIN, 0)

        def SQRT(self):
            return self.getToken(PostgreSQLParser.SQRT, 0)

        def TAN(self):
            return self.getToken(PostgreSQLParser.TAN, 0)

        def TRUNCATE(self):
            return self.getToken(PostgreSQLParser.TRUNCATE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_number_functions

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

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




    def number_functions(self):

        localctx = PostgreSQLParser.Number_functionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_number_functions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 231
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << PostgreSQLParser.ABS) | (1 << PostgreSQLParser.ACOS) | (1 << PostgreSQLParser.ASIN) | (1 << PostgreSQLParser.ATAN) | (1 << PostgreSQLParser.ATAN2) | (1 << PostgreSQLParser.CBRT) | (1 << PostgreSQLParser.CEIL) | (1 << PostgreSQLParser.CEILING) | (1 << PostgreSQLParser.COS) | (1 << PostgreSQLParser.COT) | (1 << PostgreSQLParser.DEGREES) | (1 << PostgreSQLParser.DIV) | (1 << PostgreSQLParser.EXP) | (1 << PostgreSQLParser.FLOOR))) != 0) or ((((_la - 75)) & ~0x3f) == 0 and ((1 << (_la - 75)) & ((1 << (PostgreSQLParser.LN - 75)) | (1 << (PostgreSQLParser.LOG - 75)) | (1 << (PostgreSQLParser.MOD - 75)) | (1 << (PostgreSQLParser.PI - 75)) | (1 << (PostgreSQLParser.POW - 75)) | (1 << (PostgreSQLParser.POWER - 75)) | (1 << (PostgreSQLParser.RADIANS - 75)) | (1 << (PostgreSQLParser.RANDOM - 75)) | (1 << (PostgreSQLParser.ROUND - 75)) | (1 << (PostgreSQLParser.SIGN - 75)) | (1 << (PostgreSQLParser.SIN - 75)) | (1 << (PostgreSQLParser.SQRT - 75)) | (1 << (PostgreSQLParser.TAN - 75)) | (1 << (PostgreSQLParser.TRUNCATE - 75)))) != 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 Other_functionsContext(ParserRuleContext):

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

        def ENCODE(self):
            return self.getToken(PostgreSQLParser.ENCODE, 0)

        def MD5(self):
            return self.getToken(PostgreSQLParser.MD5, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_other_functions

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

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




    def other_functions(self):

        localctx = PostgreSQLParser.Other_functionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_other_functions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 233
            _la = self._input.LA(1)
            if not(_la==PostgreSQLParser.ENCODE or _la==PostgreSQLParser.MD5):
                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 Time_functionsContext(ParserRuleContext):

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

        def DATE_PART(self):
            return self.getToken(PostgreSQLParser.DATE_PART, 0)

        def DATE_SYM(self):
            return self.getToken(PostgreSQLParser.DATE_SYM, 0)

        def NOW(self):
            return self.getToken(PostgreSQLParser.NOW, 0)

        def SECOND(self):
            return self.getToken(PostgreSQLParser.SECOND, 0)

        def TIME_SYM(self):
            return self.getToken(PostgreSQLParser.TIME_SYM, 0)

        def TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.TIMESTAMP, 0)

        def UTC_DATE(self):
            return self.getToken(PostgreSQLParser.UTC_DATE, 0)

        def UTC_TIME(self):
            return self.getToken(PostgreSQLParser.UTC_TIME, 0)

        def UTC_TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.UTC_TIMESTAMP, 0)

        def YEAR(self):
            return self.getToken(PostgreSQLParser.YEAR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_time_functions

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

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




    def time_functions(self):

        localctx = PostgreSQLParser.Time_functionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_time_functions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 235
            _la = self._input.LA(1)
            if not(((((_la - 34)) & ~0x3f) == 0 and ((1 << (_la - 34)) & ((1 << (PostgreSQLParser.DATE_PART - 34)) | (1 << (PostgreSQLParser.DATE_SYM - 34)) | (1 << (PostgreSQLParser.NOW - 34)))) != 0) or ((((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & ((1 << (PostgreSQLParser.SECOND - 116)) | (1 << (PostgreSQLParser.TIME_SYM - 116)) | (1 << (PostgreSQLParser.TIMESTAMP - 116)) | (1 << (PostgreSQLParser.UTC_DATE - 116)) | (1 << (PostgreSQLParser.UTC_TIME - 116)) | (1 << (PostgreSQLParser.UTC_TIMESTAMP - 116)) | (1 << (PostgreSQLParser.YEAR - 116)))) != 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 Array_functionsContext(ParserRuleContext):

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

        def ARRAY_LENGTH(self):
            return self.getToken(PostgreSQLParser.ARRAY_LENGTH, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_array_functions

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

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




    def array_functions(self):

        localctx = PostgreSQLParser.Array_functionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_array_functions)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 237
            self.match(PostgreSQLParser.ARRAY_LENGTH)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Pg_sphere_functionsContext(ParserRuleContext):

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

        def AREA(self):
            return self.getToken(PostgreSQLParser.AREA, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_pg_sphere_functions

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

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




    def pg_sphere_functions(self):

        localctx = PostgreSQLParser.Pg_sphere_functionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_pg_sphere_functions)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 239
            self.match(PostgreSQLParser.AREA)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FunctionListContext(ParserRuleContext):

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

        def number_functions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Number_functionsContext,0)


        def char_functions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Char_functionsContext,0)


        def time_functions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Time_functionsContext,0)


        def other_functions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Other_functionsContext,0)


        def pg_sphere_functions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Pg_sphere_functionsContext,0)


        def array_functions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Array_functionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_functionList

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

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




    def functionList(self):

        localctx = PostgreSQLParser.FunctionListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_functionList)
        try:
            self.state = 247
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.EXP, PostgreSQLParser.FLOOR, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.MOD, PostgreSQLParser.PI, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.ROUND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.TAN, PostgreSQLParser.TRUNCATE]:
                self.enterOuterAlt(localctx, 1)
                self.state = 241
                self.number_functions()
                pass
            elif token in [PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SUBSTRING, PostgreSQLParser.UPPER, PostgreSQLParser.ASCII_SYM]:
                self.enterOuterAlt(localctx, 2)
                self.state = 242
                self.char_functions()
                pass
            elif token in [PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.NOW, PostgreSQLParser.SECOND, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.YEAR]:
                self.enterOuterAlt(localctx, 3)
                self.state = 243
                self.time_functions()
                pass
            elif token in [PostgreSQLParser.ENCODE, PostgreSQLParser.MD5]:
                self.enterOuterAlt(localctx, 4)
                self.state = 244
                self.other_functions()
                pass
            elif token in [PostgreSQLParser.AREA]:
                self.enterOuterAlt(localctx, 5)
                self.state = 245
                self.pg_sphere_functions()
                pass
            elif token in [PostgreSQLParser.ARRAY_LENGTH]:
                self.enterOuterAlt(localctx, 6)
                self.state = 246
                self.array_functions()
                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 Literal_valueContext(ParserRuleContext):

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

        def string_literal(self):
            return self.getTypedRuleContext(PostgreSQLParser.String_literalContext,0)


        def number_literal(self):
            return self.getTypedRuleContext(PostgreSQLParser.Number_literalContext,0)


        def hex_literal(self):
            return self.getTypedRuleContext(PostgreSQLParser.Hex_literalContext,0)


        def boolean_literal(self):
            return self.getTypedRuleContext(PostgreSQLParser.Boolean_literalContext,0)


        def bit_literal(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_literalContext,0)


        def NULL_SYM(self):
            return self.getToken(PostgreSQLParser.NULL_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_literal_value

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

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




    def literal_value(self):

        localctx = PostgreSQLParser.Literal_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_literal_value)
        try:
            self.state = 255
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.TEXT_STRING]:
                self.enterOuterAlt(localctx, 1)
                self.state = 249
                self.string_literal()
                pass
            elif token in [PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.REAL_NUMBER]:
                self.enterOuterAlt(localctx, 2)
                self.state = 250
                self.number_literal()
                pass
            elif token in [PostgreSQLParser.HEX_DIGIT]:
                self.enterOuterAlt(localctx, 3)
                self.state = 251
                self.hex_literal()
                pass
            elif token in [PostgreSQLParser.FALSE_SYM, PostgreSQLParser.TRUE_SYM]:
                self.enterOuterAlt(localctx, 4)
                self.state = 252
                self.boolean_literal()
                pass
            elif token in [PostgreSQLParser.BIT_NUM]:
                self.enterOuterAlt(localctx, 5)
                self.state = 253
                self.bit_literal()
                pass
            elif token in [PostgreSQLParser.NULL_SYM]:
                self.enterOuterAlt(localctx, 6)
                self.state = 254
                self.match(PostgreSQLParser.NULL_SYM)
                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 Select_expressionContext(ParserRuleContext):

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

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

        def select_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_listContext,0)


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

        def table_references(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_referencesContext,0)


        def orderby_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Orderby_clauseContext,0)


        def limit_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Limit_clauseContext,0)


        def offset_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Offset_clauseContext,0)


        def FOR_SYM(self):
            return self.getToken(PostgreSQLParser.FOR_SYM, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

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

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

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

        def partition_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Partition_clauseContext,0)


        def where_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_clauseContext,0)


        def groupby_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Groupby_clauseContext,0)


        def having_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Having_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_expression

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

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




    def select_expression(self):

        localctx = PostgreSQLParser.Select_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_select_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 257
            self.match(PostgreSQLParser.SELECT)
            self.state = 259
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.ALL or _la==PostgreSQLParser.DISTINCT:
                self.state = 258
                _la = self._input.LA(1)
                if not(_la==PostgreSQLParser.ALL or _la==PostgreSQLParser.DISTINCT):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 261
            self.select_list()
            self.state = 276
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.FROM:
                self.state = 262
                self.match(PostgreSQLParser.FROM)
                self.state = 263
                self.table_references()
                self.state = 265
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.PARTITION_SYM:
                    self.state = 264
                    self.partition_clause()


                self.state = 268
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.WHERE:
                    self.state = 267
                    self.where_clause()


                self.state = 271
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.GROUP_SYM:
                    self.state = 270
                    self.groupby_clause()


                self.state = 274
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.HAVING:
                    self.state = 273
                    self.having_clause()




            self.state = 279
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.ORDER_SYM:
                self.state = 278
                self.orderby_clause()


            self.state = 282
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,15,self._ctx)
            if la_ == 1:
                self.state = 281
                self.limit_clause()


            self.state = 285
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.OFFSET_SYM:
                self.state = 284
                self.offset_clause()


            self.state = 289
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.FOR_SYM:
                self.state = 287
                self.match(PostgreSQLParser.FOR_SYM)
                self.state = 288
                self.match(PostgreSQLParser.UPDATE)


            self.state = 292
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
            if la_ == 1:
                self.state = 291
                self.match(PostgreSQLParser.SEMI)


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


    class AliasContext(ParserRuleContext):

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

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

        def AS_SYM(self):
            return self.getToken(PostgreSQLParser.AS_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alias

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

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




    def alias(self):

        localctx = PostgreSQLParser.AliasContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_alias)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 295
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.AS_SYM:
                self.state = 294
                self.match(PostgreSQLParser.AS_SYM)


            self.state = 297
            self.match(PostgreSQLParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Bit_exprContext(ParserRuleContext):

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

        def factor1(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Factor1Context)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Factor1Context,i)


        def VERTBAR(self):
            return self.getToken(PostgreSQLParser.VERTBAR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bit_expr

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

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




    def bit_expr(self):

        localctx = PostgreSQLParser.Bit_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_bit_expr)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 299
            self.factor1()
            self.state = 302
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.VERTBAR:
                self.state = 300
                self.match(PostgreSQLParser.VERTBAR)
                self.state = 301
                self.factor1()


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


    class Bool_primaryContext(ParserRuleContext):

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

        def predicate(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.PredicateContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.PredicateContext,i)


        def relational_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relational_opContext,0)


        def ANY(self):
            return self.getToken(PostgreSQLParser.ANY, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def subquery(self):
            return self.getTypedRuleContext(PostgreSQLParser.SubqueryContext,0)


        def NOT_SYM(self):
            return self.getToken(PostgreSQLParser.NOT_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bool_primary

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

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




    def bool_primary(self):

        localctx = PostgreSQLParser.Bool_primaryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_bool_primary)
        self._la = 0 # Token type
        try:
            self.state = 318
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,24,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 304
                self.predicate()
                self.state = 311
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 173)) & ~0x3f) == 0 and ((1 << (_la - 173)) & ((1 << (PostgreSQLParser.EQ - 173)) | (1 << (PostgreSQLParser.NOT_EQ - 173)) | (1 << (PostgreSQLParser.LET - 173)) | (1 << (PostgreSQLParser.GET - 173)) | (1 << (PostgreSQLParser.GTH - 173)) | (1 << (PostgreSQLParser.LTH - 173)))) != 0):
                    self.state = 305
                    self.relational_op()
                    self.state = 307
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.ANY:
                        self.state = 306
                        self.match(PostgreSQLParser.ANY)


                    self.state = 309
                    self.predicate()


                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 314
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.NOT_SYM:
                    self.state = 313
                    self.match(PostgreSQLParser.NOT_SYM)


                self.state = 316
                self.match(PostgreSQLParser.EXISTS)
                self.state = 317
                self.subquery()
                pass


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


    class Case_when_statementContext(ParserRuleContext):

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

        def CASE_SYM(self):
            return self.getToken(PostgreSQLParser.CASE_SYM, 0)

        def END_SYM(self):
            return self.getToken(PostgreSQLParser.END_SYM, 0)

        def case_when_statement1(self):
            return self.getTypedRuleContext(PostgreSQLParser.Case_when_statement1Context,0)


        def case_when_statement2(self):
            return self.getTypedRuleContext(PostgreSQLParser.Case_when_statement2Context,0)


        def ELSE_SYM(self):
            return self.getToken(PostgreSQLParser.ELSE_SYM, 0)

        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_case_when_statement

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

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




    def case_when_statement(self):

        localctx = PostgreSQLParser.Case_when_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_case_when_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 320
            self.match(PostgreSQLParser.CASE_SYM)
            self.state = 323
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.WHEN_SYM]:
                self.state = 321
                self.case_when_statement1()
                pass
            elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BINARY, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.ABS_VAL_OR_SCONTAINS, PostgreSQLParser.DFACTORIAL, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.NEGATION, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                self.state = 322
                self.case_when_statement2()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 327
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.ELSE_SYM:
                self.state = 325
                self.match(PostgreSQLParser.ELSE_SYM)
                self.state = 326
                self.bit_expr()


            self.state = 329
            self.match(PostgreSQLParser.END_SYM)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Case_when_statement1Context(ParserRuleContext):

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

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

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


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

        def bit_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Bit_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_case_when_statement1

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

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




    def case_when_statement1(self):

        localctx = PostgreSQLParser.Case_when_statement1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_case_when_statement1)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 336 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 331
                self.match(PostgreSQLParser.WHEN_SYM)
                self.state = 332
                self.expression()
                self.state = 333
                self.match(PostgreSQLParser.THEN_SYM)
                self.state = 334
                self.bit_expr()
                self.state = 338 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==PostgreSQLParser.WHEN_SYM):
                    break

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


    class Case_when_statement2Context(ParserRuleContext):

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

        def bit_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Bit_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,i)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_case_when_statement2

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

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




    def case_when_statement2(self):

        localctx = PostgreSQLParser.Case_when_statement2Context(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_case_when_statement2)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 340
            self.bit_expr()
            self.state = 346 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 341
                self.match(PostgreSQLParser.WHEN_SYM)
                self.state = 342
                self.bit_expr()
                self.state = 343
                self.match(PostgreSQLParser.THEN_SYM)
                self.state = 344
                self.bit_expr()
                self.state = 348 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==PostgreSQLParser.WHEN_SYM):
                    break

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


    class Column_listContext(ParserRuleContext):

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

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def column_spec(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Column_specContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Column_specContext,i)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_column_list

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

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




    def column_list(self):

        localctx = PostgreSQLParser.Column_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_column_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 350
            self.match(PostgreSQLParser.LPAREN)
            self.state = 351
            self.column_spec()
            self.state = 356
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.COMMA:
                self.state = 352
                self.match(PostgreSQLParser.COMMA)
                self.state = 353
                self.column_spec()
                self.state = 358
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 359
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Column_nameContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_column_name

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

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




    def column_name(self):

        localctx = PostgreSQLParser.Column_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_column_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 361
            self.match(PostgreSQLParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Column_specContext(ParserRuleContext):

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

        def column_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Column_nameContext,0)


        def table_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_nameContext,0)


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

        def slice_spec(self):
            return self.getTypedRuleContext(PostgreSQLParser.Slice_specContext,0)


        def schema_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Schema_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_column_spec

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

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




    def column_spec(self):

        localctx = PostgreSQLParser.Column_specContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_column_spec)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 371
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,31,self._ctx)
            if la_ == 1:
                self.state = 366
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,30,self._ctx)
                if la_ == 1:
                    self.state = 363
                    self.schema_name()
                    self.state = 364
                    self.match(PostgreSQLParser.DOT)


                self.state = 368
                self.table_name()
                self.state = 369
                self.match(PostgreSQLParser.DOT)


            self.state = 373
            self.column_name()
            self.state = 375
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.LBRACK:
                self.state = 374
                self.slice_spec()


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


    class Displayed_columnContext(ParserRuleContext):

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

        def table_spec(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_specContext,0)


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

        def ASTERISK(self):
            return self.getToken(PostgreSQLParser.ASTERISK, 0)

        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


        def sbit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sbit_exprContext,0)


        def LIKE_SYM(self):
            return self.getToken(PostgreSQLParser.LIKE_SYM, 0)

        def TEXT_STRING(self):
            return self.getToken(PostgreSQLParser.TEXT_STRING, 0)

        def alias(self):
            return self.getTypedRuleContext(PostgreSQLParser.AliasContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_displayed_column

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

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




    def displayed_column(self):

        localctx = PostgreSQLParser.Displayed_columnContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_displayed_column)
        self._la = 0 # Token type
        try:
            self.state = 392
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,36,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 377
                self.table_spec()
                self.state = 378
                self.match(PostgreSQLParser.DOT)
                self.state = 379
                self.match(PostgreSQLParser.ASTERISK)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 383
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,33,self._ctx)
                if la_ == 1:
                    self.state = 381
                    self.bit_expr()
                    pass

                elif la_ == 2:
                    self.state = 382
                    self.sbit_expr()
                    pass


                self.state = 387
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.LIKE_SYM:
                    self.state = 385
                    self.match(PostgreSQLParser.LIKE_SYM)
                    self.state = 386
                    self.match(PostgreSQLParser.TEXT_STRING)


                self.state = 390
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.AS_SYM or _la==PostgreSQLParser.ID:
                    self.state = 389
                    self.alias()


                pass


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


    class Exp_factor1Context(ParserRuleContext):

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

        def exp_factor2(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Exp_factor2Context)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Exp_factor2Context,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_exp_factor1

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

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




    def exp_factor1(self):

        localctx = PostgreSQLParser.Exp_factor1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_exp_factor1)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 394
            self.exp_factor2()
            self.state = 399
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.AND_SYM:
                self.state = 395
                self.match(PostgreSQLParser.AND_SYM)
                self.state = 396
                self.exp_factor2()
                self.state = 401
                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 Exp_factor2Context(ParserRuleContext):

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

        def exp_factor3(self):
            return self.getTypedRuleContext(PostgreSQLParser.Exp_factor3Context,0)


        def NOT_SYM(self):
            return self.getToken(PostgreSQLParser.NOT_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_exp_factor2

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

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




    def exp_factor2(self):

        localctx = PostgreSQLParser.Exp_factor2Context(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_exp_factor2)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 403
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,38,self._ctx)
            if la_ == 1:
                self.state = 402
                self.match(PostgreSQLParser.NOT_SYM)


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


    class Exp_factor3Context(ParserRuleContext):

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

        def bool_primary(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bool_primaryContext,0)


        def IS_SYM(self):
            return self.getToken(PostgreSQLParser.IS_SYM, 0)

        def ISNULL(self):
            return self.getToken(PostgreSQLParser.ISNULL, 0)

        def NOTNULL(self):
            return self.getToken(PostgreSQLParser.NOTNULL, 0)

        def boolean_literal(self):
            return self.getTypedRuleContext(PostgreSQLParser.Boolean_literalContext,0)


        def NULL_SYM(self):
            return self.getToken(PostgreSQLParser.NULL_SYM, 0)

        def NOT_SYM(self):
            return self.getToken(PostgreSQLParser.NOT_SYM, 0)

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_exp_factor3

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

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




    def exp_factor3(self):

        localctx = PostgreSQLParser.Exp_factor3Context(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_exp_factor3)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 407
            self.bool_primary()
            self.state = 423
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
            if la_ == 1:
                self.state = 418
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.IS_SYM:
                    self.state = 408
                    self.match(PostgreSQLParser.IS_SYM)
                    self.state = 410
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.NOT_SYM:
                        self.state = 409
                        self.match(PostgreSQLParser.NOT_SYM)


                    self.state = 416
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [PostgreSQLParser.FALSE_SYM, PostgreSQLParser.TRUE_SYM]:
                        self.state = 412
                        self.boolean_literal()
                        pass
                    elif token in [PostgreSQLParser.NULL_SYM]:
                        self.state = 413
                        self.match(PostgreSQLParser.NULL_SYM)
                        pass
                    elif token in [PostgreSQLParser.DISTINCT]:
                        self.state = 414
                        self.match(PostgreSQLParser.DISTINCT)
                        self.state = 415
                        self.match(PostgreSQLParser.FROM)
                        pass
                    else:
                        raise NoViableAltException(self)



                pass

            elif la_ == 2:
                self.state = 421
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.ISNULL or _la==PostgreSQLParser.NOTNULL:
                    self.state = 420
                    _la = self._input.LA(1)
                    if not(_la==PostgreSQLParser.ISNULL or _la==PostgreSQLParser.NOTNULL):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                pass


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


    class ExpressionContext(ParserRuleContext):

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

        def exp_factor1(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Exp_factor1Context)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Exp_factor1Context,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_expression

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

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




    def expression(self):

        localctx = PostgreSQLParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 425
            self.exp_factor1()
            self.state = 430
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.OR_SYM:
                self.state = 426
                self.match(PostgreSQLParser.OR_SYM)
                self.state = 427
                self.exp_factor1()
                self.state = 432
                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 Expression_listContext(ParserRuleContext):

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

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

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


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_expression_list

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

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




    def expression_list(self):

        localctx = PostgreSQLParser.Expression_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_expression_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 433
            self.match(PostgreSQLParser.LPAREN)
            self.state = 434
            self.expression()
            self.state = 439
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.COMMA:
                self.state = 435
                self.match(PostgreSQLParser.COMMA)
                self.state = 436
                self.expression()
                self.state = 441
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 442
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Factor1Context(ParserRuleContext):

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

        def factor2(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Factor2Context)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Factor2Context,i)


        def BITAND(self):
            return self.getToken(PostgreSQLParser.BITAND, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_factor1

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

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




    def factor1(self):

        localctx = PostgreSQLParser.Factor1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_factor1)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 444
            self.factor2()
            self.state = 447
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.BITAND:
                self.state = 445
                self.match(PostgreSQLParser.BITAND)
                self.state = 446
                self.factor2()


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


    class Factor2Context(ParserRuleContext):

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

        def factor3(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Factor3Context)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Factor3Context,i)


        def SHIFT_LEFT(self):
            return self.getToken(PostgreSQLParser.SHIFT_LEFT, 0)

        def SHIFT_RIGHT(self):
            return self.getToken(PostgreSQLParser.SHIFT_RIGHT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_factor2

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

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




    def factor2(self):

        localctx = PostgreSQLParser.Factor2Context(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_factor2)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 449
            self.factor3()
            self.state = 452
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.SHIFT_LEFT or _la==PostgreSQLParser.SHIFT_RIGHT:
                self.state = 450
                _la = self._input.LA(1)
                if not(_la==PostgreSQLParser.SHIFT_LEFT or _la==PostgreSQLParser.SHIFT_RIGHT):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 451
                self.factor3()


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


    class Factor3Context(ParserRuleContext):

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

        def factor4(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Factor4Context)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Factor4Context,i)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_factor3

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

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




    def factor3(self):

        localctx = PostgreSQLParser.Factor3Context(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_factor3)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 454
            self.factor4()
            self.state = 459
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.PLUS or _la==PostgreSQLParser.MINUS:
                self.state = 455
                _la = self._input.LA(1)
                if not(_la==PostgreSQLParser.PLUS or _la==PostgreSQLParser.MINUS):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 456
                self.factor4()
                self.state = 461
                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 Factor4Context(ParserRuleContext):

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

        def factor5(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Factor5Context)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Factor5Context,i)


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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_factor4

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

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




    def factor4(self):

        localctx = PostgreSQLParser.Factor4Context(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_factor4)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 462
            self.factor5()
            self.state = 467
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 167)) & ~0x3f) == 0 and ((1 << (_la - 167)) & ((1 << (PostgreSQLParser.DIVIDE - 167)) | (1 << (PostgreSQLParser.MOD_SYM - 167)) | (1 << (PostgreSQLParser.ASTERISK - 167)) | (1 << (PostgreSQLParser.POWER_OP - 167)))) != 0):
                self.state = 463
                _la = self._input.LA(1)
                if not(((((_la - 167)) & ~0x3f) == 0 and ((1 << (_la - 167)) & ((1 << (PostgreSQLParser.DIVIDE - 167)) | (1 << (PostgreSQLParser.MOD_SYM - 167)) | (1 << (PostgreSQLParser.ASTERISK - 167)) | (1 << (PostgreSQLParser.POWER_OP - 167)))) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 464
                self.factor5()
                self.state = 469
                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 Factor5Context(ParserRuleContext):

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

        def simple_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Simple_exprContext,0)


        def NOT_SYM(self):
            return self.getToken(PostgreSQLParser.NOT_SYM, 0)

        def interval_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Interval_exprContext,0)


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

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

        def NEGATION(self):
            return self.getToken(PostgreSQLParser.NEGATION, 0)

        def BINARY(self):
            return self.getToken(PostgreSQLParser.BINARY, 0)

        def ABS_VAL_OR_SCONTAINS(self):
            return self.getToken(PostgreSQLParser.ABS_VAL_OR_SCONTAINS, 0)

        def DFACTORIAL(self):
            return self.getToken(PostgreSQLParser.DFACTORIAL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_factor5

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

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




    def factor5(self):

        localctx = PostgreSQLParser.Factor5Context(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_factor5)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 471
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,50,self._ctx)
            if la_ == 1:
                self.state = 470
                _la = self._input.LA(1)
                if not(_la==PostgreSQLParser.BINARY or ((((_la - 171)) & ~0x3f) == 0 and ((1 << (_la - 171)) & ((1 << (PostgreSQLParser.ABS_VAL_OR_SCONTAINS - 171)) | (1 << (PostgreSQLParser.DFACTORIAL - 171)) | (1 << (PostgreSQLParser.PLUS - 171)) | (1 << (PostgreSQLParser.MINUS - 171)) | (1 << (PostgreSQLParser.NEGATION - 171)))) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 473
            self.simple_expr()
            self.state = 475
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,51,self._ctx)
            if la_ == 1:
                self.state = 474
                self.match(PostgreSQLParser.NOT_SYM)


            self.state = 479
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,52,self._ctx)
            if la_ == 1:
                self.state = 477
                _la = self._input.LA(1)
                if not(_la==PostgreSQLParser.PLUS or _la==PostgreSQLParser.MINUS):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 478
                self.interval_expr()


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


    class Function_callContext(ParserRuleContext):

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

        def functionList(self):
            return self.getTypedRuleContext(PostgreSQLParser.FunctionListContext,0)


        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

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


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

        def CAST_SYM(self):
            return self.getToken(PostgreSQLParser.CAST_SYM, 0)

        def AS_SYM(self):
            return self.getToken(PostgreSQLParser.AS_SYM, 0)

        def cast_data_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cast_data_typeContext,0)


        def CONVERT_SYM(self):
            return self.getToken(PostgreSQLParser.CONVERT_SYM, 0)

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

        def POSITION_SYM(self):
            return self.getToken(PostgreSQLParser.POSITION_SYM, 0)

        def IN_SYM(self):
            return self.getToken(PostgreSQLParser.IN_SYM, 0)

        def group_functions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Group_functionsContext,0)


        def ASTERISK(self):
            return self.getToken(PostgreSQLParser.ASTERISK, 0)

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

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

        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


        def sbit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sbit_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_function_call

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

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




    def function_call(self):

        localctx = PostgreSQLParser.Function_callContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_function_call)
        self._la = 0 # Token type
        try:
            self.state = 531
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXP, PostgreSQLParser.FLOOR, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MD5, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.PI, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.SUBSTRING, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH]:
                self.enterOuterAlt(localctx, 1)
                self.state = 481
                self.functionList()
                self.state = 494
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.LPAREN:
                    self.state = 482
                    self.match(PostgreSQLParser.LPAREN)
                    self.state = 491
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << PostgreSQLParser.ABS) | (1 << PostgreSQLParser.ACOS) | (1 << PostgreSQLParser.ASIN) | (1 << PostgreSQLParser.ATAN) | (1 << PostgreSQLParser.ATAN2) | (1 << PostgreSQLParser.AVG) | (1 << PostgreSQLParser.BINARY) | (1 << PostgreSQLParser.BIT_AND) | (1 << PostgreSQLParser.BIT_LENGTH) | (1 << PostgreSQLParser.BIT_OR) | (1 << PostgreSQLParser.CASE_SYM) | (1 << PostgreSQLParser.CAST_SYM) | (1 << PostgreSQLParser.CBRT) | (1 << PostgreSQLParser.CEIL) | (1 << PostgreSQLParser.CEILING) | (1 << PostgreSQLParser.CHR) | (1 << PostgreSQLParser.CHAR_LENGTH) | (1 << PostgreSQLParser.CONCAT) | (1 << PostgreSQLParser.CONCAT_WS) | (1 << PostgreSQLParser.CONVERT_SYM) | (1 << PostgreSQLParser.COS) | (1 << PostgreSQLParser.COT) | (1 << PostgreSQLParser.COUNT) | (1 << PostgreSQLParser.DATE_PART) | (1 << PostgreSQLParser.DATE_SYM) | (1 << PostgreSQLParser.DEGREES) | (1 << PostgreSQLParser.DIV) | (1 << PostgreSQLParser.ENCODE) | (1 << PostgreSQLParser.EXISTS) | (1 << PostgreSQLParser.EXP) | (1 << PostgreSQLParser.FALSE_SYM) | (1 << PostgreSQLParser.FLOOR))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (PostgreSQLParser.INTERVAL_SYM - 64)) | (1 << (PostgreSQLParser.LEFT - 64)) | (1 << (PostgreSQLParser.LENGTH - 64)) | (1 << (PostgreSQLParser.LN - 64)) | (1 << (PostgreSQLParser.LOG - 64)) | (1 << (PostgreSQLParser.LOWER - 64)) | (1 << (PostgreSQLParser.LPAD - 64)) | (1 << (PostgreSQLParser.LTRIM - 64)) | (1 << (PostgreSQLParser.MAX_SYM - 64)) | (1 << (PostgreSQLParser.MD5 - 64)) | (1 << (PostgreSQLParser.MIN_SYM - 64)) | (1 << (PostgreSQLParser.MOD - 64)) | (1 << (PostgreSQLParser.NOT_SYM - 64)) | (1 << (PostgreSQLParser.NOW - 64)) | (1 << (PostgreSQLParser.NULL_SYM - 64)) | (1 << (PostgreSQLParser.PI - 64)) | (1 << (PostgreSQLParser.POSITION_SYM - 64)) | (1 << (PostgreSQLParser.POW - 64)) | (1 << (PostgreSQLParser.POWER - 64)) | (1 << (PostgreSQLParser.RADIANS - 64)) | (1 << (PostgreSQLParser.RANDOM - 64)) | (1 << (PostgreSQLParser.REPEAT - 64)) | (1 << (PostgreSQLParser.REPLACE - 64)) | (1 << (PostgreSQLParser.REVERSE - 64)) | (1 << (PostgreSQLParser.RIGHT - 64)) | (1 << (PostgreSQLParser.ROUND - 64)) | (1 << (PostgreSQLParser.ROW_SYM - 64)) | (1 << (PostgreSQLParser.RPAD - 64)) | (1 << (PostgreSQLParser.RTRIM - 64)) | (1 << (PostgreSQLParser.SECOND - 64)) | (1 << (PostgreSQLParser.SIGN - 64)) | (1 << (PostgreSQLParser.SIN - 64)) | (1 << (PostgreSQLParser.SQRT - 64)) | (1 << (PostgreSQLParser.STDDEV - 64)) | (1 << (PostgreSQLParser.STDDEV_POP - 64)) | (1 << (PostgreSQLParser.STDDEV_SAMP - 64)))) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & ((1 << (PostgreSQLParser.SUBSTRING - 128)) | (1 << (PostgreSQLParser.SUM - 128)) | (1 << (PostgreSQLParser.TAN - 128)) | (1 << (PostgreSQLParser.TIME_SYM - 128)) | (1 << (PostgreSQLParser.TIMESTAMP - 128)) | (1 << (PostgreSQLParser.TRUE_SYM - 128)) | (1 << (PostgreSQLParser.TRUNCATE - 128)) | (1 << (PostgreSQLParser.UPPER - 128)) | (1 << (PostgreSQLParser.UTC_DATE - 128)) | (1 << (PostgreSQLParser.UTC_TIME - 128)) | (1 << (PostgreSQLParser.UTC_TIMESTAMP - 128)) | (1 << (PostgreSQLParser.VARIANCE - 128)) | (1 << (PostgreSQLParser.VAR_POP - 128)) | (1 << (PostgreSQLParser.VAR_SAMP - 128)) | (1 << (PostgreSQLParser.YEAR - 128)) | (1 << (PostgreSQLParser.ASCII_SYM - 128)) | (1 << (PostgreSQLParser.SPOINT - 128)) | (1 << (PostgreSQLParser.SCIRCLE - 128)) | (1 << (PostgreSQLParser.SLINE - 128)) | (1 << (PostgreSQLParser.SELLIPSE - 128)) | (1 << (PostgreSQLParser.SPOLY - 128)) | (1 << (PostgreSQLParser.SPATH - 128)) | (1 << (PostgreSQLParser.SBOX - 128)) | (1 << (PostgreSQLParser.AREA - 128)) | (1 << (PostgreSQLParser.ARRAY_LENGTH - 128)) | (1 << (PostgreSQLParser.ABS_VAL_OR_SCONTAINS - 128)) | (1 << (PostgreSQLParser.DFACTORIAL - 128)) | (1 << (PostgreSQLParser.LPAREN - 128)) | (1 << (PostgreSQLParser.PLUS - 128)) | (1 << (PostgreSQLParser.MINUS - 128)) | (1 << (PostgreSQLParser.NEGATION - 128)))) != 0) or ((((_la - 205)) & ~0x3f) == 0 and ((1 << (_la - 205)) & ((1 << (PostgreSQLParser.SLENGTH - 205)) | (1 << (PostgreSQLParser.SCENTER - 205)) | (1 << (PostgreSQLParser.INTEGER_NUM - 205)) | (1 << (PostgreSQLParser.HEX_DIGIT - 205)) | (1 << (PostgreSQLParser.BIT_NUM - 205)) | (1 << (PostgreSQLParser.REAL_NUMBER - 205)) | (1 << (PostgreSQLParser.TEXT_STRING - 205)) | (1 << (PostgreSQLParser.ID - 205)))) != 0):
                        self.state = 483
                        self.expression()
                        self.state = 488
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        while _la==PostgreSQLParser.COMMA:
                            self.state = 484
                            self.match(PostgreSQLParser.COMMA)
                            self.state = 485
                            self.expression()
                            self.state = 490
                            self._errHandler.sync(self)
                            _la = self._input.LA(1)



                    self.state = 493
                    self.match(PostgreSQLParser.RPAREN)


                pass
            elif token in [PostgreSQLParser.CAST_SYM]:
                self.enterOuterAlt(localctx, 2)
                self.state = 496
                self.match(PostgreSQLParser.CAST_SYM)
                self.state = 497
                self.match(PostgreSQLParser.LPAREN)
                self.state = 498
                self.expression()
                self.state = 499
                self.match(PostgreSQLParser.AS_SYM)
                self.state = 500
                self.cast_data_type()
                self.state = 501
                self.match(PostgreSQLParser.RPAREN)
                pass
            elif token in [PostgreSQLParser.CONVERT_SYM]:
                self.enterOuterAlt(localctx, 3)
                self.state = 503
                self.match(PostgreSQLParser.CONVERT_SYM)
                self.state = 504
                self.match(PostgreSQLParser.LPAREN)
                self.state = 505
                self.match(PostgreSQLParser.TEXT_STRING)
                self.state = 506
                self.match(PostgreSQLParser.COMMA)
                self.state = 507
                self.match(PostgreSQLParser.TEXT_STRING)
                self.state = 508
                self.match(PostgreSQLParser.COMMA)
                self.state = 509
                self.match(PostgreSQLParser.TEXT_STRING)
                self.state = 510
                self.match(PostgreSQLParser.RPAREN)
                pass
            elif token in [PostgreSQLParser.POSITION_SYM]:
                self.enterOuterAlt(localctx, 4)
                self.state = 511
                self.match(PostgreSQLParser.POSITION_SYM)
                self.state = 512
                self.match(PostgreSQLParser.LPAREN)
                self.state = 513
                self.expression()
                self.state = 514
                self.match(PostgreSQLParser.IN_SYM)
                self.state = 515
                self.expression()
                self.state = 516
                self.match(PostgreSQLParser.RPAREN)
                pass
            elif token in [PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_OR, PostgreSQLParser.COUNT, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MIN_SYM, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUM, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP]:
                self.enterOuterAlt(localctx, 5)
                self.state = 518
                self.group_functions()
                self.state = 519
                self.match(PostgreSQLParser.LPAREN)
                self.state = 521
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.ALL or _la==PostgreSQLParser.DISTINCT or _la==PostgreSQLParser.ASTERISK:
                    self.state = 520
                    _la = self._input.LA(1)
                    if not(_la==PostgreSQLParser.ALL or _la==PostgreSQLParser.DISTINCT or _la==PostgreSQLParser.ASTERISK):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 527
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << PostgreSQLParser.ABS) | (1 << PostgreSQLParser.ACOS) | (1 << PostgreSQLParser.ASIN) | (1 << PostgreSQLParser.ATAN) | (1 << PostgreSQLParser.ATAN2) | (1 << PostgreSQLParser.AVG) | (1 << PostgreSQLParser.BINARY) | (1 << PostgreSQLParser.BIT_AND) | (1 << PostgreSQLParser.BIT_LENGTH) | (1 << PostgreSQLParser.BIT_OR) | (1 << PostgreSQLParser.CASE_SYM) | (1 << PostgreSQLParser.CAST_SYM) | (1 << PostgreSQLParser.CBRT) | (1 << PostgreSQLParser.CEIL) | (1 << PostgreSQLParser.CEILING) | (1 << PostgreSQLParser.CHR) | (1 << PostgreSQLParser.CHAR_LENGTH) | (1 << PostgreSQLParser.CONCAT) | (1 << PostgreSQLParser.CONCAT_WS) | (1 << PostgreSQLParser.CONVERT_SYM) | (1 << PostgreSQLParser.COS) | (1 << PostgreSQLParser.COT) | (1 << PostgreSQLParser.COUNT) | (1 << PostgreSQLParser.DATE_PART) | (1 << PostgreSQLParser.DATE_SYM) | (1 << PostgreSQLParser.DEGREES) | (1 << PostgreSQLParser.DIV) | (1 << PostgreSQLParser.ENCODE) | (1 << PostgreSQLParser.EXISTS) | (1 << PostgreSQLParser.EXP) | (1 << PostgreSQLParser.FALSE_SYM) | (1 << PostgreSQLParser.FLOOR))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (PostgreSQLParser.INTERVAL_SYM - 64)) | (1 << (PostgreSQLParser.LEFT - 64)) | (1 << (PostgreSQLParser.LENGTH - 64)) | (1 << (PostgreSQLParser.LN - 64)) | (1 << (PostgreSQLParser.LOG - 64)) | (1 << (PostgreSQLParser.LOWER - 64)) | (1 << (PostgreSQLParser.LPAD - 64)) | (1 << (PostgreSQLParser.LTRIM - 64)) | (1 << (PostgreSQLParser.MAX_SYM - 64)) | (1 << (PostgreSQLParser.MD5 - 64)) | (1 << (PostgreSQLParser.MIN_SYM - 64)) | (1 << (PostgreSQLParser.MOD - 64)) | (1 << (PostgreSQLParser.NOW - 64)) | (1 << (PostgreSQLParser.NULL_SYM - 64)) | (1 << (PostgreSQLParser.PI - 64)) | (1 << (PostgreSQLParser.POSITION_SYM - 64)) | (1 << (PostgreSQLParser.POW - 64)) | (1 << (PostgreSQLParser.POWER - 64)) | (1 << (PostgreSQLParser.RADIANS - 64)) | (1 << (PostgreSQLParser.RANDOM - 64)) | (1 << (PostgreSQLParser.REPEAT - 64)) | (1 << (PostgreSQLParser.REPLACE - 64)) | (1 << (PostgreSQLParser.REVERSE - 64)) | (1 << (PostgreSQLParser.RIGHT - 64)) | (1 << (PostgreSQLParser.ROUND - 64)) | (1 << (PostgreSQLParser.ROW_SYM - 64)) | (1 << (PostgreSQLParser.RPAD - 64)) | (1 << (PostgreSQLParser.RTRIM - 64)) | (1 << (PostgreSQLParser.SECOND - 64)) | (1 << (PostgreSQLParser.SIGN - 64)) | (1 << (PostgreSQLParser.SIN - 64)) | (1 << (PostgreSQLParser.SQRT - 64)) | (1 << (PostgreSQLParser.STDDEV - 64)) | (1 << (PostgreSQLParser.STDDEV_POP - 64)) | (1 << (PostgreSQLParser.STDDEV_SAMP - 64)))) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & ((1 << (PostgreSQLParser.SUBSTRING - 128)) | (1 << (PostgreSQLParser.SUM - 128)) | (1 << (PostgreSQLParser.TAN - 128)) | (1 << (PostgreSQLParser.TIME_SYM - 128)) | (1 << (PostgreSQLParser.TIMESTAMP - 128)) | (1 << (PostgreSQLParser.TRUE_SYM - 128)) | (1 << (PostgreSQLParser.TRUNCATE - 128)) | (1 << (PostgreSQLParser.UPPER - 128)) | (1 << (PostgreSQLParser.UTC_DATE - 128)) | (1 << (PostgreSQLParser.UTC_TIME - 128)) | (1 << (PostgreSQLParser.UTC_TIMESTAMP - 128)) | (1 << (PostgreSQLParser.VARIANCE - 128)) | (1 << (PostgreSQLParser.VAR_POP - 128)) | (1 << (PostgreSQLParser.VAR_SAMP - 128)) | (1 << (PostgreSQLParser.YEAR - 128)) | (1 << (PostgreSQLParser.ASCII_SYM - 128)) | (1 << (PostgreSQLParser.SPOINT - 128)) | (1 << (PostgreSQLParser.SCIRCLE - 128)) | (1 << (PostgreSQLParser.SLINE - 128)) | (1 << (PostgreSQLParser.SELLIPSE - 128)) | (1 << (PostgreSQLParser.SPOLY - 128)) | (1 << (PostgreSQLParser.SPATH - 128)) | (1 << (PostgreSQLParser.SBOX - 128)) | (1 << (PostgreSQLParser.AREA - 128)) | (1 << (PostgreSQLParser.ARRAY_LENGTH - 128)) | (1 << (PostgreSQLParser.ABS_VAL_OR_SCONTAINS - 128)) | (1 << (PostgreSQLParser.DFACTORIAL - 128)) | (1 << (PostgreSQLParser.LPAREN - 128)) | (1 << (PostgreSQLParser.PLUS - 128)) | (1 << (PostgreSQLParser.MINUS - 128)) | (1 << (PostgreSQLParser.NEGATION - 128)))) != 0) or ((((_la - 205)) & ~0x3f) == 0 and ((1 << (_la - 205)) & ((1 << (PostgreSQLParser.SLENGTH - 205)) | (1 << (PostgreSQLParser.SCENTER - 205)) | (1 << (PostgreSQLParser.INTEGER_NUM - 205)) | (1 << (PostgreSQLParser.HEX_DIGIT - 205)) | (1 << (PostgreSQLParser.BIT_NUM - 205)) | (1 << (PostgreSQLParser.REAL_NUMBER - 205)) | (1 << (PostgreSQLParser.TEXT_STRING - 205)) | (1 << (PostgreSQLParser.ID - 205)))) != 0):
                    self.state = 525
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,57,self._ctx)
                    if la_ == 1:
                        self.state = 523
                        self.bit_expr()
                        pass

                    elif la_ == 2:
                        self.state = 524
                        self.sbit_expr()
                        pass




                self.state = 529
                self.match(PostgreSQLParser.RPAREN)
                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 Groupby_clauseContext(ParserRuleContext):

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

        def GROUP_SYM(self):
            return self.getToken(PostgreSQLParser.GROUP_SYM, 0)

        def BY_SYM(self):
            return self.getToken(PostgreSQLParser.BY_SYM, 0)

        def groupby_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Groupby_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Groupby_itemContext,i)


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

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

        def ROLLUP_SYM(self):
            return self.getToken(PostgreSQLParser.ROLLUP_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_groupby_clause

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

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




    def groupby_clause(self):

        localctx = PostgreSQLParser.Groupby_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_groupby_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 533
            self.match(PostgreSQLParser.GROUP_SYM)
            self.state = 534
            self.match(PostgreSQLParser.BY_SYM)
            self.state = 535
            self.groupby_item()
            self.state = 540
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.COMMA:
                self.state = 536
                self.match(PostgreSQLParser.COMMA)
                self.state = 537
                self.groupby_item()
                self.state = 542
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 545
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.WITH:
                self.state = 543
                self.match(PostgreSQLParser.WITH)
                self.state = 544
                self.match(PostgreSQLParser.ROLLUP_SYM)


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


    class Groupby_itemContext(ParserRuleContext):

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

        def column_spec(self):
            return self.getTypedRuleContext(PostgreSQLParser.Column_specContext,0)


        def INTEGER_NUM(self):
            return self.getToken(PostgreSQLParser.INTEGER_NUM, 0)

        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_groupby_item

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

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




    def groupby_item(self):

        localctx = PostgreSQLParser.Groupby_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_groupby_item)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 550
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,62,self._ctx)
            if la_ == 1:
                self.state = 547
                self.column_spec()
                pass

            elif la_ == 2:
                self.state = 548
                self.match(PostgreSQLParser.INTEGER_NUM)
                pass

            elif la_ == 3:
                self.state = 549
                self.bit_expr()
                pass


            self.state = 553
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,63,self._ctx)
            if la_ == 1:
                self.state = 552
                _la = self._input.LA(1)
                if not(_la==PostgreSQLParser.ASC or _la==PostgreSQLParser.DESC):
                    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 Having_clauseContext(ParserRuleContext):

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

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

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_having_clause

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

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




    def having_clause(self):

        localctx = PostgreSQLParser.Having_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_having_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 555
            self.match(PostgreSQLParser.HAVING)
            self.state = 556
            self.expression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Index_hintContext(ParserRuleContext):

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

        def USE_SYM(self):
            return self.getToken(PostgreSQLParser.USE_SYM, 0)

        def index_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_optionsContext,0)


        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def index_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_listContext,0)


        def IGNORE_SYM(self):
            return self.getToken(PostgreSQLParser.IGNORE_SYM, 0)

        def FORCE_SYM(self):
            return self.getToken(PostgreSQLParser.FORCE_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_index_hint

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

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




    def index_hint(self):

        localctx = PostgreSQLParser.Index_hintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_index_hint)
        self._la = 0 # Token type
        try:
            self.state = 578
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.USE_SYM]:
                self.enterOuterAlt(localctx, 1)
                self.state = 558
                self.match(PostgreSQLParser.USE_SYM)
                self.state = 559
                self.index_options()
                self.state = 560
                self.match(PostgreSQLParser.LPAREN)
                self.state = 562
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.ID:
                    self.state = 561
                    self.index_list()


                self.state = 564
                self.match(PostgreSQLParser.RPAREN)
                pass
            elif token in [PostgreSQLParser.IGNORE_SYM]:
                self.enterOuterAlt(localctx, 2)
                self.state = 566
                self.match(PostgreSQLParser.IGNORE_SYM)
                self.state = 567
                self.index_options()
                self.state = 568
                self.match(PostgreSQLParser.LPAREN)
                self.state = 569
                self.index_list()
                self.state = 570
                self.match(PostgreSQLParser.RPAREN)
                pass
            elif token in [PostgreSQLParser.FORCE_SYM]:
                self.enterOuterAlt(localctx, 3)
                self.state = 572
                self.match(PostgreSQLParser.FORCE_SYM)
                self.state = 573
                self.index_options()
                self.state = 574
                self.match(PostgreSQLParser.LPAREN)
                self.state = 575
                self.index_list()
                self.state = 576
                self.match(PostgreSQLParser.RPAREN)
                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 Index_hint_listContext(ParserRuleContext):

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

        def index_hint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Index_hintContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Index_hintContext,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_index_hint_list

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

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




    def index_hint_list(self):

        localctx = PostgreSQLParser.Index_hint_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_index_hint_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 580
            self.index_hint()
            self.state = 585
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,66,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 581
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 582
                    self.index_hint() 
                self.state = 587
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,66,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 Index_nameContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_index_name

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

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




    def index_name(self):

        localctx = PostgreSQLParser.Index_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_index_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 588
            self.match(PostgreSQLParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Index_listContext(ParserRuleContext):

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

        def index_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Index_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Index_nameContext,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_index_list

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

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




    def index_list(self):

        localctx = PostgreSQLParser.Index_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_index_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 590
            self.index_name()
            self.state = 595
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.COMMA:
                self.state = 591
                self.match(PostgreSQLParser.COMMA)
                self.state = 592
                self.index_name()
                self.state = 597
                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 Index_optionsContext(ParserRuleContext):

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

        def INDEX_SYM(self):
            return self.getToken(PostgreSQLParser.INDEX_SYM, 0)

        def KEY_SYM(self):
            return self.getToken(PostgreSQLParser.KEY_SYM, 0)

        def FOR_SYM(self):
            return self.getToken(PostgreSQLParser.FOR_SYM, 0)

        def JOIN_SYM(self):
            return self.getToken(PostgreSQLParser.JOIN_SYM, 0)

        def ORDER_SYM(self):
            return self.getToken(PostgreSQLParser.ORDER_SYM, 0)

        def BY_SYM(self):
            return self.getToken(PostgreSQLParser.BY_SYM, 0)

        def GROUP_SYM(self):
            return self.getToken(PostgreSQLParser.GROUP_SYM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_index_options

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

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




    def index_options(self):

        localctx = PostgreSQLParser.Index_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_index_options)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 598
            _la = self._input.LA(1)
            if not(_la==PostgreSQLParser.INDEX_SYM or _la==PostgreSQLParser.KEY_SYM):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 607
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.FOR_SYM:
                self.state = 599
                self.match(PostgreSQLParser.FOR_SYM)
                self.state = 605
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.JOIN_SYM]:
                    self.state = 600
                    self.match(PostgreSQLParser.JOIN_SYM)
                    pass
                elif token in [PostgreSQLParser.ORDER_SYM]:
                    self.state = 601
                    self.match(PostgreSQLParser.ORDER_SYM)
                    self.state = 602
                    self.match(PostgreSQLParser.BY_SYM)
                    pass
                elif token in [PostgreSQLParser.GROUP_SYM]:
                    self.state = 603
                    self.match(PostgreSQLParser.GROUP_SYM)
                    self.state = 604
                    self.match(PostgreSQLParser.BY_SYM)
                    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 Interval_exprContext(ParserRuleContext):

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

        def INTERVAL_SYM(self):
            return self.getToken(PostgreSQLParser.INTERVAL_SYM, 0)

        def string_literal(self):
            return self.getTypedRuleContext(PostgreSQLParser.String_literalContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_interval_expr

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

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




    def interval_expr(self):

        localctx = PostgreSQLParser.Interval_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_interval_expr)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 609
            self.match(PostgreSQLParser.INTERVAL_SYM)
            self.state = 610
            self.string_literal()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Join_conditionContext(ParserRuleContext):

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

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

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


        def USING_SYM(self):
            return self.getToken(PostgreSQLParser.USING_SYM, 0)

        def column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Column_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_join_condition

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

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




    def join_condition(self):

        localctx = PostgreSQLParser.Join_conditionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_join_condition)
        try:
            self.state = 616
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.ON]:
                self.enterOuterAlt(localctx, 1)
                self.state = 612
                self.match(PostgreSQLParser.ON)
                self.state = 613
                self.expression()
                pass
            elif token in [PostgreSQLParser.USING_SYM]:
                self.enterOuterAlt(localctx, 2)
                self.state = 614
                self.match(PostgreSQLParser.USING_SYM)
                self.state = 615
                self.column_list()
                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 Limit_clauseContext(ParserRuleContext):

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

        def LIMIT(self):
            return self.getToken(PostgreSQLParser.LIMIT, 0)

        def row_count(self):
            return self.getTypedRuleContext(PostgreSQLParser.Row_countContext,0)


        def OFFSET_SYM(self):
            return self.getToken(PostgreSQLParser.OFFSET_SYM, 0)

        def offset(self):
            return self.getTypedRuleContext(PostgreSQLParser.OffsetContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_limit_clause

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

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




    def limit_clause(self):

        localctx = PostgreSQLParser.Limit_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_limit_clause)
        try:
            self.state = 629
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.LIMIT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 618
                self.match(PostgreSQLParser.LIMIT)
                self.state = 619
                self.row_count()
                self.state = 622
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,71,self._ctx)
                if la_ == 1:
                    self.state = 620
                    self.match(PostgreSQLParser.OFFSET_SYM)
                    self.state = 621
                    self.offset()


                pass
            elif token in [PostgreSQLParser.OFFSET_SYM]:
                self.enterOuterAlt(localctx, 2)
                self.state = 624
                self.match(PostgreSQLParser.OFFSET_SYM)
                self.state = 625
                self.offset()
                self.state = 626
                self.match(PostgreSQLParser.LIMIT)
                self.state = 627
                self.row_count()
                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 OffsetContext(ParserRuleContext):

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

        def INTEGER_NUM(self):
            return self.getToken(PostgreSQLParser.INTEGER_NUM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_offset

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

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




    def offset(self):

        localctx = PostgreSQLParser.OffsetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_offset)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 631
            self.match(PostgreSQLParser.INTEGER_NUM)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Offset_clauseContext(ParserRuleContext):

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

        def OFFSET_SYM(self):
            return self.getToken(PostgreSQLParser.OFFSET_SYM, 0)

        def offset(self):
            return self.getTypedRuleContext(PostgreSQLParser.OffsetContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_offset_clause

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

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




    def offset_clause(self):

        localctx = PostgreSQLParser.Offset_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_offset_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 633
            self.match(PostgreSQLParser.OFFSET_SYM)
            self.state = 634
            self.offset()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Row_countContext(ParserRuleContext):

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

        def INTEGER_NUM(self):
            return self.getToken(PostgreSQLParser.INTEGER_NUM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_row_count

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

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




    def row_count(self):

        localctx = PostgreSQLParser.Row_countContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_row_count)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 636
            self.match(PostgreSQLParser.INTEGER_NUM)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Orderby_clauseContext(ParserRuleContext):

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

        def ORDER_SYM(self):
            return self.getToken(PostgreSQLParser.ORDER_SYM, 0)

        def BY_SYM(self):
            return self.getToken(PostgreSQLParser.BY_SYM, 0)

        def orderby_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Orderby_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Orderby_itemContext,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_orderby_clause

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

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




    def orderby_clause(self):

        localctx = PostgreSQLParser.Orderby_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_orderby_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 638
            self.match(PostgreSQLParser.ORDER_SYM)
            self.state = 639
            self.match(PostgreSQLParser.BY_SYM)
            self.state = 640
            self.orderby_item()
            self.state = 645
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.COMMA:
                self.state = 641
                self.match(PostgreSQLParser.COMMA)
                self.state = 642
                self.orderby_item()
                self.state = 647
                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 Orderby_itemContext(ParserRuleContext):

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

        def groupby_item(self):
            return self.getTypedRuleContext(PostgreSQLParser.Groupby_itemContext,0)


        def NULLS_SYM(self):
            return self.getToken(PostgreSQLParser.NULLS_SYM, 0)

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

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

        def FIRST_SYM(self):
            return self.getToken(PostgreSQLParser.FIRST_SYM, 0)

        def LAST_SYM(self):
            return self.getToken(PostgreSQLParser.LAST_SYM, 0)

        def USING_SYM(self):
            return self.getToken(PostgreSQLParser.USING_SYM, 0)

        def GTH(self):
            return self.getToken(PostgreSQLParser.GTH, 0)

        def LTH(self):
            return self.getToken(PostgreSQLParser.LTH, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_orderby_item

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

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




    def orderby_item(self):

        localctx = PostgreSQLParser.Orderby_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_orderby_item)
        self._la = 0 # Token type
        try:
            self.state = 662
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,77,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 648
                self.groupby_item()
                self.state = 656
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,76,self._ctx)
                if la_ == 1:
                    self.state = 650
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.ASC or _la==PostgreSQLParser.DESC:
                        self.state = 649
                        _la = self._input.LA(1)
                        if not(_la==PostgreSQLParser.ASC or _la==PostgreSQLParser.DESC):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()


                    pass

                elif la_ == 2:
                    self.state = 654
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.NULLS_SYM:
                        self.state = 652
                        self.match(PostgreSQLParser.NULLS_SYM)
                        self.state = 653
                        _la = self._input.LA(1)
                        if not(_la==PostgreSQLParser.FIRST_SYM or _la==PostgreSQLParser.LAST_SYM):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()


                    pass


                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 658
                self.groupby_item()
                self.state = 659
                self.match(PostgreSQLParser.USING_SYM)
                self.state = 660
                _la = self._input.LA(1)
                if not(_la==PostgreSQLParser.GTH or _la==PostgreSQLParser.LTH):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass


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


    class Partition_clauseContext(ParserRuleContext):

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

        def PARTITION_SYM(self):
            return self.getToken(PostgreSQLParser.PARTITION_SYM, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def partition_names(self):
            return self.getTypedRuleContext(PostgreSQLParser.Partition_namesContext,0)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_partition_clause

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

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




    def partition_clause(self):

        localctx = PostgreSQLParser.Partition_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_partition_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 664
            self.match(PostgreSQLParser.PARTITION_SYM)
            self.state = 665
            self.match(PostgreSQLParser.LPAREN)
            self.state = 666
            self.partition_names()
            self.state = 667
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Partition_nameContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_partition_name

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

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




    def partition_name(self):

        localctx = PostgreSQLParser.Partition_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_partition_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 669
            self.match(PostgreSQLParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Partition_namesContext(ParserRuleContext):

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

        def partition_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Partition_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Partition_nameContext,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_partition_names

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

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




    def partition_names(self):

        localctx = PostgreSQLParser.Partition_namesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_partition_names)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 671
            self.partition_name()
            self.state = 676
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.COMMA:
                self.state = 672
                self.match(PostgreSQLParser.COMMA)
                self.state = 673
                self.partition_name()
                self.state = 678
                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 Bit_fac1Context(ParserRuleContext):

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

        def NOT_SYM(self):
            return self.getToken(PostgreSQLParser.NOT_SYM, 0)

        def IN_SYM(self):
            return self.getToken(PostgreSQLParser.IN_SYM, 0)

        def LIKE_SYM(self):
            return self.getToken(PostgreSQLParser.LIKE_SYM, 0)

        def simple_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Simple_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Simple_exprContext,i)


        def REGEXP(self):
            return self.getToken(PostgreSQLParser.REGEXP, 0)

        def BETWEEN(self):
            return self.getToken(PostgreSQLParser.BETWEEN, 0)

        def AND_SYM(self):
            return self.getToken(PostgreSQLParser.AND_SYM, 0)

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


        def subquery(self):
            return self.getTypedRuleContext(PostgreSQLParser.SubqueryContext,0)


        def expression_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expression_listContext,0)


        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


        def sbit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sbit_exprContext,0)


        def ESCAPE_SYM(self):
            return self.getToken(PostgreSQLParser.ESCAPE_SYM, 0)

        def SYMMETRIC(self):
            return self.getToken(PostgreSQLParser.SYMMETRIC, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bit_fac1

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

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




    def bit_fac1(self):

        localctx = PostgreSQLParser.Bit_fac1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_bit_fac1)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 680
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.NOT_SYM:
                self.state = 679
                self.match(PostgreSQLParser.NOT_SYM)


            self.state = 709
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.IN_SYM]:
                self.state = 682
                self.match(PostgreSQLParser.IN_SYM)
                self.state = 685
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,80,self._ctx)
                if la_ == 1:
                    self.state = 683
                    self.subquery()
                    pass

                elif la_ == 2:
                    self.state = 684
                    self.expression_list()
                    pass


                pass
            elif token in [PostgreSQLParser.LIKE_SYM]:
                self.state = 687
                self.match(PostgreSQLParser.LIKE_SYM)
                self.state = 688
                self.simple_expr()
                self.state = 691
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.ESCAPE_SYM:
                    self.state = 689
                    self.match(PostgreSQLParser.ESCAPE_SYM)
                    self.state = 690
                    self.simple_expr()


                pass
            elif token in [PostgreSQLParser.REGEXP]:
                self.state = 693
                self.match(PostgreSQLParser.REGEXP)
                self.state = 696
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,82,self._ctx)
                if la_ == 1:
                    self.state = 694
                    self.bit_expr()
                    pass

                elif la_ == 2:
                    self.state = 695
                    self.sbit_expr()
                    pass


                pass
            elif token in [PostgreSQLParser.BETWEEN]:
                self.state = 698
                self.match(PostgreSQLParser.BETWEEN)
                self.state = 700
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.SYMMETRIC:
                    self.state = 699
                    self.match(PostgreSQLParser.SYMMETRIC)


                self.state = 704
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,84,self._ctx)
                if la_ == 1:
                    self.state = 702
                    self.bit_expr()
                    pass

                elif la_ == 2:
                    self.state = 703
                    self.sbit_expr()
                    pass


                self.state = 706
                self.match(PostgreSQLParser.AND_SYM)
                self.state = 707
                self.predicate()
                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 Bit_fac2Context(ParserRuleContext):

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

        def SOUNDS_SYM(self):
            return self.getToken(PostgreSQLParser.SOUNDS_SYM, 0)

        def LIKE_SYM(self):
            return self.getToken(PostgreSQLParser.LIKE_SYM, 0)

        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


        def sbit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sbit_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bit_fac2

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

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




    def bit_fac2(self):

        localctx = PostgreSQLParser.Bit_fac2Context(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_bit_fac2)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 711
            self.match(PostgreSQLParser.SOUNDS_SYM)
            self.state = 712
            self.match(PostgreSQLParser.LIKE_SYM)
            self.state = 715
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,86,self._ctx)
            if la_ == 1:
                self.state = 713
                self.bit_expr()
                pass

            elif la_ == 2:
                self.state = 714
                self.sbit_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 PredicateContext(ParserRuleContext):

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

        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


        def sbit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sbit_exprContext,0)


        def bit_fac1(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_fac1Context,0)


        def bit_fac2(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_fac2Context,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_predicate

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

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




    def predicate(self):

        localctx = PostgreSQLParser.PredicateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 118, self.RULE_predicate)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 719
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,87,self._ctx)
            if la_ == 1:
                self.state = 717
                self.bit_expr()
                pass

            elif la_ == 2:
                self.state = 718
                self.sbit_expr()
                pass


            self.state = 723
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,88,self._ctx)
            if la_ == 1:
                self.state = 721
                self.bit_fac1()

            elif la_ == 2:
                self.state = 722
                self.bit_fac2()


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


    class QueryContext(ParserRuleContext):

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

        def select_statement(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_statementContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_query

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

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




    def query(self):

        localctx = PostgreSQLParser.QueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_query)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 725
            self.select_statement()
            self.state = 726
            self.match(PostgreSQLParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Schema_nameContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_schema_name

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

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




    def schema_name(self):

        localctx = PostgreSQLParser.Schema_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 122, self.RULE_schema_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 728
            self.match(PostgreSQLParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Select_listContext(ParserRuleContext):

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

        def displayed_column(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Displayed_columnContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Displayed_columnContext,i)


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

        def ASTERISK(self):
            return self.getToken(PostgreSQLParser.ASTERISK, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_list

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

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




    def select_list(self):

        localctx = PostgreSQLParser.Select_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_select_list)
        self._la = 0 # Token type
        try:
            self.state = 750
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BINARY, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.SPOINT, PostgreSQLParser.SCIRCLE, PostgreSQLParser.SLINE, PostgreSQLParser.SELLIPSE, PostgreSQLParser.SPOLY, PostgreSQLParser.SPATH, PostgreSQLParser.SBOX, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.ABS_VAL_OR_SCONTAINS, PostgreSQLParser.DFACTORIAL, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.NEGATION, PostgreSQLParser.SLENGTH, PostgreSQLParser.SCENTER, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                self.enterOuterAlt(localctx, 1)
                self.state = 730
                self.displayed_column()
                self.state = 735
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==PostgreSQLParser.COMMA:
                    self.state = 731
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 732
                    self.displayed_column()
                    self.state = 737
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [PostgreSQLParser.ASTERISK]:
                self.enterOuterAlt(localctx, 2)
                self.state = 738
                self.match(PostgreSQLParser.ASTERISK)
                self.state = 748
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.COMMA:
                    self.state = 739
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 740
                    self.displayed_column()
                    self.state = 745
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while _la==PostgreSQLParser.COMMA:
                        self.state = 741
                        self.match(PostgreSQLParser.COMMA)
                        self.state = 742
                        self.displayed_column()
                        self.state = 747
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)



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

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

        def select_expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Select_expressionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Select_expressionContext,i)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_statement

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

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




    def select_statement(self):

        localctx = PostgreSQLParser.Select_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 126, self.RULE_select_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 752
            self.select_expression()
            self.state = 760
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.UNION_SYM:
                self.state = 753
                self.match(PostgreSQLParser.UNION_SYM)
                self.state = 755
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.ALL:
                    self.state = 754
                    self.match(PostgreSQLParser.ALL)


                self.state = 757
                self.select_expression()
                self.state = 762
                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 Simple_exprContext(ParserRuleContext):

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

        def literal_value(self):
            return self.getTypedRuleContext(PostgreSQLParser.Literal_valueContext,0)


        def expression_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expression_listContext,0)


        def column_spec(self):
            return self.getTypedRuleContext(PostgreSQLParser.Column_specContext,0)


        def function_call(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_callContext,0)


        def ROW_SYM(self):
            return self.getToken(PostgreSQLParser.ROW_SYM, 0)

        def subquery(self):
            return self.getTypedRuleContext(PostgreSQLParser.SubqueryContext,0)


        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def interval_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Interval_exprContext,0)


        def case_when_statement(self):
            return self.getTypedRuleContext(PostgreSQLParser.Case_when_statementContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_simple_expr

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

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




    def simple_expr(self):

        localctx = PostgreSQLParser.Simple_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_simple_expr)
        try:
            self.state = 774
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,95,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 763
                self.literal_value()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 764
                self.expression_list()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 765
                self.column_spec()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 766
                self.function_call()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 767
                self.match(PostgreSQLParser.ROW_SYM)
                self.state = 768
                self.expression_list()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 769
                self.subquery()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 770
                self.match(PostgreSQLParser.EXISTS)
                self.state = 771
                self.subquery()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 772
                self.interval_expr()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 773
                self.case_when_statement()
                pass


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


    class Slice_specContext(ParserRuleContext):

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_slice_spec

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

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




    def slice_spec(self):

        localctx = PostgreSQLParser.Slice_specContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_slice_spec)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 783 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 776
                self.match(PostgreSQLParser.LBRACK)
                self.state = 777
                self.match(PostgreSQLParser.INTEGER_NUM)
                self.state = 780
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.COLON:
                    self.state = 778
                    self.match(PostgreSQLParser.COLON)
                    self.state = 779
                    self.match(PostgreSQLParser.INTEGER_NUM)


                self.state = 782
                self.match(PostgreSQLParser.RBRACK)
                self.state = 785 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==PostgreSQLParser.LBRACK):
                    break

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


    class SubqueryContext(ParserRuleContext):

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

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def select_statement(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_statementContext,0)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_subquery

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

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




    def subquery(self):

        localctx = PostgreSQLParser.SubqueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_subquery)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 787
            self.match(PostgreSQLParser.LPAREN)
            self.state = 788
            self.select_statement()
            self.state = 789
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Table_atomContext(ParserRuleContext):

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

        def table_spec(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_specContext,0)


        def partition_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Partition_clauseContext,0)


        def alias(self):
            return self.getTypedRuleContext(PostgreSQLParser.AliasContext,0)


        def index_hint_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_hint_listContext,0)


        def subquery(self):
            return self.getTypedRuleContext(PostgreSQLParser.SubqueryContext,0)


        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def table_references(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_referencesContext,0)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def OJ_SYM(self):
            return self.getToken(PostgreSQLParser.OJ_SYM, 0)

        def table_reference(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_referenceContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_referenceContext,i)


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

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

        def JOIN_SYM(self):
            return self.getToken(PostgreSQLParser.JOIN_SYM, 0)

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_atom

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

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




    def table_atom(self):

        localctx = PostgreSQLParser.Table_atomContext(self, self._ctx, self.state)
        self.enterRule(localctx, 134, self.RULE_table_atom)
        self._la = 0 # Token type
        try:
            self.state = 817
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,101,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 791
                self.table_spec()
                self.state = 793
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,98,self._ctx)
                if la_ == 1:
                    self.state = 792
                    self.partition_clause()


                self.state = 796
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.AS_SYM or _la==PostgreSQLParser.ID:
                    self.state = 795
                    self.alias()


                self.state = 799
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.FORCE_SYM or _la==PostgreSQLParser.IGNORE_SYM or _la==PostgreSQLParser.USE_SYM:
                    self.state = 798
                    self.index_hint_list()


                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 801
                self.subquery()
                self.state = 802
                self.alias()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 804
                self.match(PostgreSQLParser.LPAREN)
                self.state = 805
                self.table_references()
                self.state = 806
                self.match(PostgreSQLParser.RPAREN)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 808
                self.match(PostgreSQLParser.OJ_SYM)
                self.state = 809
                self.table_reference()
                self.state = 810
                self.match(PostgreSQLParser.LEFT)
                self.state = 811
                self.match(PostgreSQLParser.OUTER)
                self.state = 812
                self.match(PostgreSQLParser.JOIN_SYM)
                self.state = 813
                self.table_reference()
                self.state = 814
                self.match(PostgreSQLParser.ON)
                self.state = 815
                self.expression()
                pass


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


    class Table_nameContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_name

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

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




    def table_name(self):

        localctx = PostgreSQLParser.Table_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_table_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 819
            self.match(PostgreSQLParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Table_factor1Context(ParserRuleContext):

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

        def table_factor2(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_factor2Context,0)


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

        def table_atom(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_atomContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_atomContext,i)


        def join_condition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Join_conditionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Join_conditionContext,i)


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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_factor1

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

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




    def table_factor1(self):

        localctx = PostgreSQLParser.Table_factor1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_table_factor1)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 821
            self.table_factor2()
            self.state = 832
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,104,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 823
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.CROSS or _la==PostgreSQLParser.INNER_SYM or _la==PostgreSQLParser.LEFT or _la==PostgreSQLParser.RIGHT:
                        self.state = 822
                        _la = self._input.LA(1)
                        if not(_la==PostgreSQLParser.CROSS or _la==PostgreSQLParser.INNER_SYM or _la==PostgreSQLParser.LEFT or _la==PostgreSQLParser.RIGHT):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()


                    self.state = 825
                    self.match(PostgreSQLParser.JOIN_SYM)
                    self.state = 826
                    self.table_atom()
                    self.state = 828
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,103,self._ctx)
                    if la_ == 1:
                        self.state = 827
                        self.join_condition()

             
                self.state = 834
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,104,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 Table_factor2Context(ParserRuleContext):

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

        def table_factor3(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_factor3Context,0)


        def STRAIGHT_JOIN(self):
            return self.getToken(PostgreSQLParser.STRAIGHT_JOIN, 0)

        def table_atom(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_atomContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_factor2

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

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




    def table_factor2(self):

        localctx = PostgreSQLParser.Table_factor2Context(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_table_factor2)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 835
            self.table_factor3()
            self.state = 842
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.STRAIGHT_JOIN:
                self.state = 836
                self.match(PostgreSQLParser.STRAIGHT_JOIN)
                self.state = 837
                self.table_atom()
                self.state = 840
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,105,self._ctx)
                if la_ == 1:
                    self.state = 838
                    self.match(PostgreSQLParser.ON)
                    self.state = 839
                    self.expression()




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


    class Table_factor3Context(ParserRuleContext):

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

        def table_factor4(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_factor4Context)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_factor4Context,i)


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

        def join_condition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Join_conditionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Join_conditionContext,i)


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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_factor3

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

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




    def table_factor3(self):

        localctx = PostgreSQLParser.Table_factor3Context(self, self._ctx, self.state)
        self.enterRule(localctx, 142, self.RULE_table_factor3)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 844
            self.table_factor4()
            self.state = 855
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,108,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 845
                    _la = self._input.LA(1)
                    if not(_la==PostgreSQLParser.LEFT or _la==PostgreSQLParser.RIGHT):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 847
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.OUTER:
                        self.state = 846
                        self.match(PostgreSQLParser.OUTER)


                    self.state = 849
                    self.match(PostgreSQLParser.JOIN_SYM)
                    self.state = 850
                    self.table_factor4()
                    self.state = 851
                    self.join_condition() 
                self.state = 857
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,108,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 Table_factor4Context(ParserRuleContext):

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

        def table_atom(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_atomContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_atomContext,i)


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

        def JOIN_SYM(self):
            return self.getToken(PostgreSQLParser.JOIN_SYM, 0)

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_factor4

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

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




    def table_factor4(self):

        localctx = PostgreSQLParser.Table_factor4Context(self, self._ctx, self.state)
        self.enterRule(localctx, 144, self.RULE_table_factor4)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 858
            self.table_atom()
            self.state = 868
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==PostgreSQLParser.NATURAL:
                self.state = 859
                self.match(PostgreSQLParser.NATURAL)
                self.state = 864
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.LEFT or _la==PostgreSQLParser.RIGHT:
                    self.state = 860
                    _la = self._input.LA(1)
                    if not(_la==PostgreSQLParser.LEFT or _la==PostgreSQLParser.RIGHT):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 862
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.OUTER:
                        self.state = 861
                        self.match(PostgreSQLParser.OUTER)




                self.state = 866
                self.match(PostgreSQLParser.JOIN_SYM)
                self.state = 867
                self.table_atom()


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


    class Table_referenceContext(ParserRuleContext):

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

        def table_factor1(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_factor1Context,0)


        def alias(self):
            return self.getTypedRuleContext(PostgreSQLParser.AliasContext,0)


        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def values_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Values_listContext,0)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Column_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_reference

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

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




    def table_reference(self):

        localctx = PostgreSQLParser.Table_referenceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 146, self.RULE_table_reference)
        self._la = 0 # Token type
        try:
            self.state = 879
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,113,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 870
                self.table_factor1()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 871
                self.match(PostgreSQLParser.LPAREN)
                self.state = 872
                self.values_list()
                self.state = 873
                self.match(PostgreSQLParser.RPAREN)
                self.state = 875
                self.alias()
                self.state = 877
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==PostgreSQLParser.LPAREN:
                    self.state = 876
                    self.column_list()


                pass


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


    class Table_referencesContext(ParserRuleContext):

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

        def table_reference(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_referenceContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_referenceContext,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_references

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

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




    def table_references(self):

        localctx = PostgreSQLParser.Table_referencesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 148, self.RULE_table_references)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 881
            self.table_reference()
            self.state = 886
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.COMMA:
                self.state = 882
                self.match(PostgreSQLParser.COMMA)
                self.state = 883
                self.table_reference()
                self.state = 888
                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 Table_specContext(ParserRuleContext):

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

        def table_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_nameContext,0)


        def schema_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Schema_nameContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_spec

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

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




    def table_spec(self):

        localctx = PostgreSQLParser.Table_specContext(self, self._ctx, self.state)
        self.enterRule(localctx, 150, self.RULE_table_spec)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 892
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,115,self._ctx)
            if la_ == 1:
                self.state = 889
                self.schema_name()
                self.state = 890
                self.match(PostgreSQLParser.DOT)


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


    class Values_listContext(ParserRuleContext):

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

        def VALUES(self):
            return self.getToken(PostgreSQLParser.VALUES, 0)

        def expression_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Expression_listContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Expression_listContext,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_values_list

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

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




    def values_list(self):

        localctx = PostgreSQLParser.Values_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 152, self.RULE_values_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 896
            self.match(PostgreSQLParser.VALUES)

            self.state = 897
            self.expression_list()
            self.state = 902
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==PostgreSQLParser.COMMA:
                self.state = 898
                self.match(PostgreSQLParser.COMMA)
                self.state = 899
                self.expression_list()
                self.state = 904
                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 Where_clauseContext(ParserRuleContext):

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

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

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_where_clause

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

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




    def where_clause(self):

        localctx = PostgreSQLParser.Where_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 154, self.RULE_where_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 905
            self.match(PostgreSQLParser.WHERE)
            self.state = 906
            self.expression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Pg_sphere_opContext(ParserRuleContext):

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

        def ABS_VAL_OR_SCONTAINS(self):
            return self.getToken(PostgreSQLParser.ABS_VAL_OR_SCONTAINS, 0)

        def SCONTAINS2(self):
            return self.getToken(PostgreSQLParser.SCONTAINS2, 0)

        def NEGATION(self):
            return self.getToken(PostgreSQLParser.NEGATION, 0)

        def SLEFTCONTAINS2(self):
            return self.getToken(PostgreSQLParser.SLEFTCONTAINS2, 0)

        def SNOTCONTAINS(self):
            return self.getToken(PostgreSQLParser.SNOTCONTAINS, 0)

        def SNOTCONTAINS2(self):
            return self.getToken(PostgreSQLParser.SNOTCONTAINS2, 0)

        def SLEFTNOTCONTAINS(self):
            return self.getToken(PostgreSQLParser.SLEFTNOTCONTAINS, 0)

        def SLEFTNOTCONTAINS2(self):
            return self.getToken(PostgreSQLParser.SLEFTNOTCONTAINS2, 0)

        def AND_SYM(self):
            return self.getToken(PostgreSQLParser.AND_SYM, 0)

        def SNOTOVERLAP(self):
            return self.getToken(PostgreSQLParser.SNOTOVERLAP, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_pg_sphere_op

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

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




    def pg_sphere_op(self):

        localctx = PostgreSQLParser.Pg_sphere_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 156, self.RULE_pg_sphere_op)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 908
            _la = self._input.LA(1)
            if not(((((_la - 170)) & ~0x3f) == 0 and ((1 << (_la - 170)) & ((1 << (PostgreSQLParser.AND_SYM - 170)) | (1 << (PostgreSQLParser.ABS_VAL_OR_SCONTAINS - 170)) | (1 << (PostgreSQLParser.NEGATION - 170)) | (1 << (PostgreSQLParser.SCONTAINS2 - 170)) | (1 << (PostgreSQLParser.SLEFTCONTAINS2 - 170)) | (1 << (PostgreSQLParser.SNOTCONTAINS - 170)) | (1 << (PostgreSQLParser.SNOTCONTAINS2 - 170)) | (1 << (PostgreSQLParser.SLEFTNOTCONTAINS - 170)) | (1 << (PostgreSQLParser.SLEFTNOTCONTAINS2 - 170)) | (1 << (PostgreSQLParser.SNOTOVERLAP - 170)))) != 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 Sbit_exprContext(ParserRuleContext):

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

        def pg_sphere_object(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Pg_sphere_objectContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Pg_sphere_objectContext,i)


        def spoint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SpointContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SpointContext,i)


        def pg_sphere_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Pg_sphere_opContext,0)


        def simple_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Simple_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Simple_exprContext,i)


        def EQ(self):
            return self.getToken(PostgreSQLParser.EQ, 0)

        def sline(self):
            return self.getTypedRuleContext(PostgreSQLParser.SlineContext,0)


        def SCROSS(self):
            return self.getToken(PostgreSQLParser.SCROSS, 0)

        def SDISTANCE(self):
            return self.getToken(PostgreSQLParser.SDISTANCE, 0)

        def scircle(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.ScircleContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.ScircleContext,i)


        def SLENGTH(self):
            return self.getToken(PostgreSQLParser.SLENGTH, 0)

        def sbox(self):
            return self.getTypedRuleContext(PostgreSQLParser.SboxContext,0)


        def spoly(self):
            return self.getTypedRuleContext(PostgreSQLParser.SpolyContext,0)


        def SCENTER(self):
            return self.getToken(PostgreSQLParser.SCENTER, 0)

        def sellipse(self):
            return self.getTypedRuleContext(PostgreSQLParser.SellipseContext,0)


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

        def spath(self):
            return self.getTypedRuleContext(PostgreSQLParser.SpathContext,0)


        def strans(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.StransContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.StransContext,i)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sbit_expr

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

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




    def sbit_expr(self):

        localctx = PostgreSQLParser.Sbit_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 158, self.RULE_sbit_expr)
        self._la = 0 # Token type
        try:
            self.state = 984
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,128,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 912
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.SCIRCLE, PostgreSQLParser.SLINE, PostgreSQLParser.SELLIPSE, PostgreSQLParser.SPOLY, PostgreSQLParser.SPATH, PostgreSQLParser.SBOX, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                    self.state = 910
                    self.pg_sphere_object()
                    pass
                elif token in [PostgreSQLParser.SPOINT]:
                    self.state = 911
                    self.spoint()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 916
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.SPOINT]:
                    self.state = 914
                    self.spoint()
                    pass
                elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                    self.state = 915
                    self.simple_expr()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 918
                self.pg_sphere_op()
                self.state = 919
                self.pg_sphere_object()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 921
                self.pg_sphere_object()
                self.state = 922
                self.match(PostgreSQLParser.EQ)
                self.state = 923
                self.pg_sphere_object()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 925
                self.pg_sphere_object()
                self.state = 926
                self.pg_sphere_op()
                self.state = 927
                self.pg_sphere_object()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 935
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,119,self._ctx)
                if la_ == 1:
                    self.state = 929
                    self.sline()
                    pass

                elif la_ == 2:
                    self.state = 930
                    self.simple_expr()
                    self.state = 931
                    self.match(PostgreSQLParser.SCROSS)
                    self.state = 932
                    self.sline()
                    pass

                elif la_ == 3:
                    self.state = 934
                    self.simple_expr()
                    pass


                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 940
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.SPOINT]:
                    self.state = 937
                    self.spoint()
                    pass
                elif token in [PostgreSQLParser.SCIRCLE]:
                    self.state = 938
                    self.scircle()
                    pass
                elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                    self.state = 939
                    self.simple_expr()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 942
                self.match(PostgreSQLParser.SDISTANCE)
                self.state = 946
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.SPOINT]:
                    self.state = 943
                    self.spoint()
                    pass
                elif token in [PostgreSQLParser.SCIRCLE]:
                    self.state = 944
                    self.scircle()
                    pass
                elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                    self.state = 945
                    self.simple_expr()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 948
                self.match(PostgreSQLParser.SLENGTH)
                self.state = 953
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.SCIRCLE]:
                    self.state = 949
                    self.scircle()
                    pass
                elif token in [PostgreSQLParser.SBOX]:
                    self.state = 950
                    self.sbox()
                    pass
                elif token in [PostgreSQLParser.SPOLY]:
                    self.state = 951
                    self.spoly()
                    pass
                elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                    self.state = 952
                    self.simple_expr()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 955
                self.match(PostgreSQLParser.SCENTER)
                self.state = 959
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.SCIRCLE]:
                    self.state = 956
                    self.scircle()
                    pass
                elif token in [PostgreSQLParser.SELLIPSE]:
                    self.state = 957
                    self.sellipse()
                    pass
                elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                    self.state = 958
                    self.simple_expr()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 961
                self.match(PostgreSQLParser.MINUS)
                self.state = 965
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.SLINE]:
                    self.state = 962
                    self.sline()
                    pass
                elif token in [PostgreSQLParser.SPATH]:
                    self.state = 963
                    self.spath()
                    pass
                elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                    self.state = 964
                    self.simple_expr()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 974
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [PostgreSQLParser.SPOINT]:
                    self.state = 967
                    self.spoint()
                    pass
                elif token in [PostgreSQLParser.SCIRCLE]:
                    self.state = 968
                    self.scircle()
                    pass
                elif token in [PostgreSQLParser.SLINE]:
                    self.state = 969
                    self.sline()
                    pass
                elif token in [PostgreSQLParser.SELLIPSE]:
                    self.state = 970
                    self.sellipse()
                    pass
                elif token in [PostgreSQLParser.SPOLY]:
                    self.state = 971
                    self.spoly()
                    pass
                elif token in [PostgreSQLParser.SPATH]:
                    self.state = 972
                    self.spath()
                    pass
                elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                    self.state = 973
                    self.simple_expr()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 980 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 977
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==PostgreSQLParser.PLUS or _la==PostgreSQLParser.MINUS:
                        self.state = 976
                        _la = self._input.LA(1)
                        if not(_la==PostgreSQLParser.PLUS or _la==PostgreSQLParser.MINUS):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()


                    self.state = 979
                    self.strans()
                    self.state = 982 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (((((_la - 164)) & ~0x3f) == 0 and ((1 << (_la - 164)) & ((1 << (PostgreSQLParser.STRANS - 164)) | (1 << (PostgreSQLParser.PLUS - 164)) | (1 << (PostgreSQLParser.MINUS - 164)))) != 0)):
                        break

                pass


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


    class SpointContext(ParserRuleContext):

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

        def SPOINT(self):
            return self.getToken(PostgreSQLParser.SPOINT, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def bit_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Bit_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,i)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_spoint

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

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




    def spoint(self):

        localctx = PostgreSQLParser.SpointContext(self, self._ctx, self.state)
        self.enterRule(localctx, 160, self.RULE_spoint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 986
            self.match(PostgreSQLParser.SPOINT)
            self.state = 987
            self.match(PostgreSQLParser.LPAREN)
            self.state = 988
            self.bit_expr()
            self.state = 989
            self.match(PostgreSQLParser.COMMA)
            self.state = 990
            self.bit_expr()
            self.state = 991
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ScircleContext(ParserRuleContext):

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

        def SCIRCLE(self):
            return self.getToken(PostgreSQLParser.SCIRCLE, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def spoint(self):
            return self.getTypedRuleContext(PostgreSQLParser.SpointContext,0)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_scircle

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

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




    def scircle(self):

        localctx = PostgreSQLParser.ScircleContext(self, self._ctx, self.state)
        self.enterRule(localctx, 162, self.RULE_scircle)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 993
            self.match(PostgreSQLParser.SCIRCLE)
            self.state = 994
            self.match(PostgreSQLParser.LPAREN)
            self.state = 995
            self.spoint()
            self.state = 996
            self.match(PostgreSQLParser.COMMA)
            self.state = 997
            self.bit_expr()
            self.state = 998
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SlineContext(ParserRuleContext):

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

        def SLINE(self):
            return self.getToken(PostgreSQLParser.SLINE, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def spoint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SpointContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SpointContext,i)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def strans(self):
            return self.getTypedRuleContext(PostgreSQLParser.StransContext,0)


        def bit_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sline

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

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




    def sline(self):

        localctx = PostgreSQLParser.SlineContext(self, self._ctx, self.state)
        self.enterRule(localctx, 164, self.RULE_sline)
        try:
            self.state = 1014
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,129,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1000
                self.match(PostgreSQLParser.SLINE)
                self.state = 1001
                self.match(PostgreSQLParser.LPAREN)
                self.state = 1002
                self.spoint()
                self.state = 1003
                self.match(PostgreSQLParser.COMMA)
                self.state = 1004
                self.spoint()
                self.state = 1005
                self.match(PostgreSQLParser.RPAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 1007
                self.match(PostgreSQLParser.SLINE)
                self.state = 1008
                self.match(PostgreSQLParser.LPAREN)
                self.state = 1009
                self.strans()
                self.state = 1010
                self.match(PostgreSQLParser.COMMA)
                self.state = 1011
                self.bit_expr()
                self.state = 1012
                self.match(PostgreSQLParser.RPAREN)
                pass


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


    class SellipseContext(ParserRuleContext):

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

        def SELLIPSE(self):
            return self.getToken(PostgreSQLParser.SELLIPSE, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def spoint(self):
            return self.getTypedRuleContext(PostgreSQLParser.SpointContext,0)


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

        def bit_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Bit_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,i)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sellipse

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

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




    def sellipse(self):

        localctx = PostgreSQLParser.SellipseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 166, self.RULE_sellipse)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1016
            self.match(PostgreSQLParser.SELLIPSE)
            self.state = 1017
            self.match(PostgreSQLParser.LPAREN)
            self.state = 1018
            self.spoint()
            self.state = 1019
            self.match(PostgreSQLParser.COMMA)
            self.state = 1020
            self.bit_expr()
            self.state = 1021
            self.match(PostgreSQLParser.COMMA)
            self.state = 1022
            self.bit_expr()
            self.state = 1023
            self.match(PostgreSQLParser.COMMA)
            self.state = 1024
            self.bit_expr()
            self.state = 1025
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SboxContext(ParserRuleContext):

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

        def SBOX(self):
            return self.getToken(PostgreSQLParser.SBOX, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def spoint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SpointContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SpointContext,i)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sbox

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

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




    def sbox(self):

        localctx = PostgreSQLParser.SboxContext(self, self._ctx, self.state)
        self.enterRule(localctx, 168, self.RULE_sbox)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1027
            self.match(PostgreSQLParser.SBOX)
            self.state = 1028
            self.match(PostgreSQLParser.LPAREN)
            self.state = 1029
            self.spoint()
            self.state = 1030
            self.match(PostgreSQLParser.COMMA)
            self.state = 1031
            self.spoint()
            self.state = 1032
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SpolyContext(ParserRuleContext):

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

        def SPOLY(self):
            return self.getToken(PostgreSQLParser.SPOLY, 0)

        def TEXT_STRING(self):
            return self.getToken(PostgreSQLParser.TEXT_STRING, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def column_spec(self):
            return self.getTypedRuleContext(PostgreSQLParser.Column_specContext,0)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_spoly

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

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




    def spoly(self):

        localctx = PostgreSQLParser.SpolyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 170, self.RULE_spoly)
        try:
            self.state = 1045
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,130,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1034
                self.match(PostgreSQLParser.SPOLY)
                self.state = 1035
                self.match(PostgreSQLParser.TEXT_STRING)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 1036
                self.match(PostgreSQLParser.SPOLY)
                self.state = 1037
                self.match(PostgreSQLParser.LPAREN)
                self.state = 1038
                self.column_spec()
                self.state = 1039
                self.match(PostgreSQLParser.RPAREN)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 1041
                self.match(PostgreSQLParser.SPOLY)
                self.state = 1042
                self.match(PostgreSQLParser.LPAREN)
                self.state = 1043
                self.match(PostgreSQLParser.TEXT_STRING)
                self.state = 1044
                self.match(PostgreSQLParser.RPAREN)
                pass


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


    class SpathContext(ParserRuleContext):

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

        def SPATH(self):
            return self.getToken(PostgreSQLParser.SPATH, 0)

        def TEXT_STRING(self):
            return self.getToken(PostgreSQLParser.TEXT_STRING, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def column_spec(self):
            return self.getTypedRuleContext(PostgreSQLParser.Column_specContext,0)


        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_spath

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

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




    def spath(self):

        localctx = PostgreSQLParser.SpathContext(self, self._ctx, self.state)
        self.enterRule(localctx, 172, self.RULE_spath)
        try:
            self.state = 1054
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,131,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1047
                self.match(PostgreSQLParser.SPATH)
                self.state = 1048
                self.match(PostgreSQLParser.TEXT_STRING)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 1049
                self.match(PostgreSQLParser.SPATH)
                self.state = 1050
                self.match(PostgreSQLParser.LPAREN)
                self.state = 1051
                self.column_spec()
                self.state = 1052
                self.match(PostgreSQLParser.RPAREN)
                pass


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


    class StransContext(ParserRuleContext):

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

        def STRANS(self):
            return self.getToken(PostgreSQLParser.STRANS, 0)

        def LPAREN(self):
            return self.getToken(PostgreSQLParser.LPAREN, 0)

        def bit_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Bit_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Bit_exprContext,i)


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

        def TRANS(self):
            return self.getToken(PostgreSQLParser.TRANS, 0)

        def RPAREN(self):
            return self.getToken(PostgreSQLParser.RPAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_strans

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

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




    def strans(self):

        localctx = PostgreSQLParser.StransContext(self, self._ctx, self.state)
        self.enterRule(localctx, 174, self.RULE_strans)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1056
            self.match(PostgreSQLParser.STRANS)
            self.state = 1057
            self.match(PostgreSQLParser.LPAREN)
            self.state = 1058
            self.bit_expr()
            self.state = 1059
            self.match(PostgreSQLParser.COMMA)
            self.state = 1060
            self.bit_expr()
            self.state = 1061
            self.match(PostgreSQLParser.COMMA)
            self.state = 1062
            self.bit_expr()
            self.state = 1063
            self.match(PostgreSQLParser.COMMA)
            self.state = 1064
            self.match(PostgreSQLParser.TRANS)
            self.state = 1065
            self.match(PostgreSQLParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Pg_sphere_objectContext(ParserRuleContext):

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

        def scircle(self):
            return self.getTypedRuleContext(PostgreSQLParser.ScircleContext,0)


        def sline(self):
            return self.getTypedRuleContext(PostgreSQLParser.SlineContext,0)


        def sellipse(self):
            return self.getTypedRuleContext(PostgreSQLParser.SellipseContext,0)


        def sbox(self):
            return self.getTypedRuleContext(PostgreSQLParser.SboxContext,0)


        def spoly(self):
            return self.getTypedRuleContext(PostgreSQLParser.SpolyContext,0)


        def spath(self):
            return self.getTypedRuleContext(PostgreSQLParser.SpathContext,0)


        def simple_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Simple_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_pg_sphere_object

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

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




    def pg_sphere_object(self):

        localctx = PostgreSQLParser.Pg_sphere_objectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 176, self.RULE_pg_sphere_object)
        try:
            self.state = 1074
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [PostgreSQLParser.SCIRCLE]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1067
                self.scircle()
                pass
            elif token in [PostgreSQLParser.SLINE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1068
                self.sline()
                pass
            elif token in [PostgreSQLParser.SELLIPSE]:
                self.enterOuterAlt(localctx, 3)
                self.state = 1069
                self.sellipse()
                pass
            elif token in [PostgreSQLParser.SBOX]:
                self.enterOuterAlt(localctx, 4)
                self.state = 1070
                self.sbox()
                pass
            elif token in [PostgreSQLParser.SPOLY]:
                self.enterOuterAlt(localctx, 5)
                self.state = 1071
                self.spoly()
                pass
            elif token in [PostgreSQLParser.SPATH]:
                self.enterOuterAlt(localctx, 6)
                self.state = 1072
                self.spath()
                pass
            elif token in [PostgreSQLParser.ABS, PostgreSQLParser.ACOS, PostgreSQLParser.ASIN, PostgreSQLParser.ATAN, PostgreSQLParser.ATAN2, PostgreSQLParser.AVG, PostgreSQLParser.BIT_AND, PostgreSQLParser.BIT_LENGTH, PostgreSQLParser.BIT_OR, PostgreSQLParser.CASE_SYM, PostgreSQLParser.CAST_SYM, PostgreSQLParser.CBRT, PostgreSQLParser.CEIL, PostgreSQLParser.CEILING, PostgreSQLParser.CHR, PostgreSQLParser.CHAR_LENGTH, PostgreSQLParser.CONCAT, PostgreSQLParser.CONCAT_WS, PostgreSQLParser.CONVERT_SYM, PostgreSQLParser.COS, PostgreSQLParser.COT, PostgreSQLParser.COUNT, PostgreSQLParser.DATE_PART, PostgreSQLParser.DATE_SYM, PostgreSQLParser.DEGREES, PostgreSQLParser.DIV, PostgreSQLParser.ENCODE, PostgreSQLParser.EXISTS, PostgreSQLParser.EXP, PostgreSQLParser.FALSE_SYM, PostgreSQLParser.FLOOR, PostgreSQLParser.INTERVAL_SYM, PostgreSQLParser.LEFT, PostgreSQLParser.LENGTH, PostgreSQLParser.LN, PostgreSQLParser.LOG, PostgreSQLParser.LOWER, PostgreSQLParser.LPAD, PostgreSQLParser.LTRIM, PostgreSQLParser.MAX_SYM, PostgreSQLParser.MD5, PostgreSQLParser.MIN_SYM, PostgreSQLParser.MOD, PostgreSQLParser.NOW, PostgreSQLParser.NULL_SYM, PostgreSQLParser.PI, PostgreSQLParser.POSITION_SYM, PostgreSQLParser.POW, PostgreSQLParser.POWER, PostgreSQLParser.RADIANS, PostgreSQLParser.RANDOM, PostgreSQLParser.REPEAT, PostgreSQLParser.REPLACE, PostgreSQLParser.REVERSE, PostgreSQLParser.RIGHT, PostgreSQLParser.ROUND, PostgreSQLParser.ROW_SYM, PostgreSQLParser.RPAD, PostgreSQLParser.RTRIM, PostgreSQLParser.SECOND, PostgreSQLParser.SIGN, PostgreSQLParser.SIN, PostgreSQLParser.SQRT, PostgreSQLParser.STDDEV, PostgreSQLParser.STDDEV_POP, PostgreSQLParser.STDDEV_SAMP, PostgreSQLParser.SUBSTRING, PostgreSQLParser.SUM, PostgreSQLParser.TAN, PostgreSQLParser.TIME_SYM, PostgreSQLParser.TIMESTAMP, PostgreSQLParser.TRUE_SYM, PostgreSQLParser.TRUNCATE, PostgreSQLParser.UPPER, PostgreSQLParser.UTC_DATE, PostgreSQLParser.UTC_TIME, PostgreSQLParser.UTC_TIMESTAMP, PostgreSQLParser.VARIANCE, PostgreSQLParser.VAR_POP, PostgreSQLParser.VAR_SAMP, PostgreSQLParser.YEAR, PostgreSQLParser.ASCII_SYM, PostgreSQLParser.AREA, PostgreSQLParser.ARRAY_LENGTH, PostgreSQLParser.LPAREN, PostgreSQLParser.PLUS, PostgreSQLParser.MINUS, PostgreSQLParser.INTEGER_NUM, PostgreSQLParser.HEX_DIGIT, PostgreSQLParser.BIT_NUM, PostgreSQLParser.REAL_NUMBER, PostgreSQLParser.TEXT_STRING, PostgreSQLParser.ID]:
                self.enterOuterAlt(localctx, 7)
                self.state = 1073
                self.simple_expr()
                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





