# Generated from /data/Coding/LLM4DB/antlr_gram/pg/PostgreSQLParser.g4 by ANTLR 4.13.1
# 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():
    return [
        4,1,679,10695,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,
        6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,
        7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,
        2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,
        7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,
        2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,
        7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,
        2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,
        7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,
        2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2,65,
        7,65,2,66,7,66,2,67,7,67,2,68,7,68,2,69,7,69,2,70,7,70,2,71,7,71,
        2,72,7,72,2,73,7,73,2,74,7,74,2,75,7,75,2,76,7,76,2,77,7,77,2,78,
        7,78,2,79,7,79,2,80,7,80,2,81,7,81,2,82,7,82,2,83,7,83,2,84,7,84,
        2,85,7,85,2,86,7,86,2,87,7,87,2,88,7,88,2,89,7,89,2,90,7,90,2,91,
        7,91,2,92,7,92,2,93,7,93,2,94,7,94,2,95,7,95,2,96,7,96,2,97,7,97,
        2,98,7,98,2,99,7,99,2,100,7,100,2,101,7,101,2,102,7,102,2,103,7,
        103,2,104,7,104,2,105,7,105,2,106,7,106,2,107,7,107,2,108,7,108,
        2,109,7,109,2,110,7,110,2,111,7,111,2,112,7,112,2,113,7,113,2,114,
        7,114,2,115,7,115,2,116,7,116,2,117,7,117,2,118,7,118,2,119,7,119,
        2,120,7,120,2,121,7,121,2,122,7,122,2,123,7,123,2,124,7,124,2,125,
        7,125,2,126,7,126,2,127,7,127,2,128,7,128,2,129,7,129,2,130,7,130,
        2,131,7,131,2,132,7,132,2,133,7,133,2,134,7,134,2,135,7,135,2,136,
        7,136,2,137,7,137,2,138,7,138,2,139,7,139,2,140,7,140,2,141,7,141,
        2,142,7,142,2,143,7,143,2,144,7,144,2,145,7,145,2,146,7,146,2,147,
        7,147,2,148,7,148,2,149,7,149,2,150,7,150,2,151,7,151,2,152,7,152,
        2,153,7,153,2,154,7,154,2,155,7,155,2,156,7,156,2,157,7,157,2,158,
        7,158,2,159,7,159,2,160,7,160,2,161,7,161,2,162,7,162,2,163,7,163,
        2,164,7,164,2,165,7,165,2,166,7,166,2,167,7,167,2,168,7,168,2,169,
        7,169,2,170,7,170,2,171,7,171,2,172,7,172,2,173,7,173,2,174,7,174,
        2,175,7,175,2,176,7,176,2,177,7,177,2,178,7,178,2,179,7,179,2,180,
        7,180,2,181,7,181,2,182,7,182,2,183,7,183,2,184,7,184,2,185,7,185,
        2,186,7,186,2,187,7,187,2,188,7,188,2,189,7,189,2,190,7,190,2,191,
        7,191,2,192,7,192,2,193,7,193,2,194,7,194,2,195,7,195,2,196,7,196,
        2,197,7,197,2,198,7,198,2,199,7,199,2,200,7,200,2,201,7,201,2,202,
        7,202,2,203,7,203,2,204,7,204,2,205,7,205,2,206,7,206,2,207,7,207,
        2,208,7,208,2,209,7,209,2,210,7,210,2,211,7,211,2,212,7,212,2,213,
        7,213,2,214,7,214,2,215,7,215,2,216,7,216,2,217,7,217,2,218,7,218,
        2,219,7,219,2,220,7,220,2,221,7,221,2,222,7,222,2,223,7,223,2,224,
        7,224,2,225,7,225,2,226,7,226,2,227,7,227,2,228,7,228,2,229,7,229,
        2,230,7,230,2,231,7,231,2,232,7,232,2,233,7,233,2,234,7,234,2,235,
        7,235,2,236,7,236,2,237,7,237,2,238,7,238,2,239,7,239,2,240,7,240,
        2,241,7,241,2,242,7,242,2,243,7,243,2,244,7,244,2,245,7,245,2,246,
        7,246,2,247,7,247,2,248,7,248,2,249,7,249,2,250,7,250,2,251,7,251,
        2,252,7,252,2,253,7,253,2,254,7,254,2,255,7,255,2,256,7,256,2,257,
        7,257,2,258,7,258,2,259,7,259,2,260,7,260,2,261,7,261,2,262,7,262,
        2,263,7,263,2,264,7,264,2,265,7,265,2,266,7,266,2,267,7,267,2,268,
        7,268,2,269,7,269,2,270,7,270,2,271,7,271,2,272,7,272,2,273,7,273,
        2,274,7,274,2,275,7,275,2,276,7,276,2,277,7,277,2,278,7,278,2,279,
        7,279,2,280,7,280,2,281,7,281,2,282,7,282,2,283,7,283,2,284,7,284,
        2,285,7,285,2,286,7,286,2,287,7,287,2,288,7,288,2,289,7,289,2,290,
        7,290,2,291,7,291,2,292,7,292,2,293,7,293,2,294,7,294,2,295,7,295,
        2,296,7,296,2,297,7,297,2,298,7,298,2,299,7,299,2,300,7,300,2,301,
        7,301,2,302,7,302,2,303,7,303,2,304,7,304,2,305,7,305,2,306,7,306,
        2,307,7,307,2,308,7,308,2,309,7,309,2,310,7,310,2,311,7,311,2,312,
        7,312,2,313,7,313,2,314,7,314,2,315,7,315,2,316,7,316,2,317,7,317,
        2,318,7,318,2,319,7,319,2,320,7,320,2,321,7,321,2,322,7,322,2,323,
        7,323,2,324,7,324,2,325,7,325,2,326,7,326,2,327,7,327,2,328,7,328,
        2,329,7,329,2,330,7,330,2,331,7,331,2,332,7,332,2,333,7,333,2,334,
        7,334,2,335,7,335,2,336,7,336,2,337,7,337,2,338,7,338,2,339,7,339,
        2,340,7,340,2,341,7,341,2,342,7,342,2,343,7,343,2,344,7,344,2,345,
        7,345,2,346,7,346,2,347,7,347,2,348,7,348,2,349,7,349,2,350,7,350,
        2,351,7,351,2,352,7,352,2,353,7,353,2,354,7,354,2,355,7,355,2,356,
        7,356,2,357,7,357,2,358,7,358,2,359,7,359,2,360,7,360,2,361,7,361,
        2,362,7,362,2,363,7,363,2,364,7,364,2,365,7,365,2,366,7,366,2,367,
        7,367,2,368,7,368,2,369,7,369,2,370,7,370,2,371,7,371,2,372,7,372,
        2,373,7,373,2,374,7,374,2,375,7,375,2,376,7,376,2,377,7,377,2,378,
        7,378,2,379,7,379,2,380,7,380,2,381,7,381,2,382,7,382,2,383,7,383,
        2,384,7,384,2,385,7,385,2,386,7,386,2,387,7,387,2,388,7,388,2,389,
        7,389,2,390,7,390,2,391,7,391,2,392,7,392,2,393,7,393,2,394,7,394,
        2,395,7,395,2,396,7,396,2,397,7,397,2,398,7,398,2,399,7,399,2,400,
        7,400,2,401,7,401,2,402,7,402,2,403,7,403,2,404,7,404,2,405,7,405,
        2,406,7,406,2,407,7,407,2,408,7,408,2,409,7,409,2,410,7,410,2,411,
        7,411,2,412,7,412,2,413,7,413,2,414,7,414,2,415,7,415,2,416,7,416,
        2,417,7,417,2,418,7,418,2,419,7,419,2,420,7,420,2,421,7,421,2,422,
        7,422,2,423,7,423,2,424,7,424,2,425,7,425,2,426,7,426,2,427,7,427,
        2,428,7,428,2,429,7,429,2,430,7,430,2,431,7,431,2,432,7,432,2,433,
        7,433,2,434,7,434,2,435,7,435,2,436,7,436,2,437,7,437,2,438,7,438,
        2,439,7,439,2,440,7,440,2,441,7,441,2,442,7,442,2,443,7,443,2,444,
        7,444,2,445,7,445,2,446,7,446,2,447,7,447,2,448,7,448,2,449,7,449,
        2,450,7,450,2,451,7,451,2,452,7,452,2,453,7,453,2,454,7,454,2,455,
        7,455,2,456,7,456,2,457,7,457,2,458,7,458,2,459,7,459,2,460,7,460,
        2,461,7,461,2,462,7,462,2,463,7,463,2,464,7,464,2,465,7,465,2,466,
        7,466,2,467,7,467,2,468,7,468,2,469,7,469,2,470,7,470,2,471,7,471,
        2,472,7,472,2,473,7,473,2,474,7,474,2,475,7,475,2,476,7,476,2,477,
        7,477,2,478,7,478,2,479,7,479,2,480,7,480,2,481,7,481,2,482,7,482,
        2,483,7,483,2,484,7,484,2,485,7,485,2,486,7,486,2,487,7,487,2,488,
        7,488,2,489,7,489,2,490,7,490,2,491,7,491,2,492,7,492,2,493,7,493,
        2,494,7,494,2,495,7,495,2,496,7,496,2,497,7,497,2,498,7,498,2,499,
        7,499,2,500,7,500,2,501,7,501,2,502,7,502,2,503,7,503,2,504,7,504,
        2,505,7,505,2,506,7,506,2,507,7,507,2,508,7,508,2,509,7,509,2,510,
        7,510,2,511,7,511,2,512,7,512,2,513,7,513,2,514,7,514,2,515,7,515,
        2,516,7,516,2,517,7,517,2,518,7,518,2,519,7,519,2,520,7,520,2,521,
        7,521,2,522,7,522,2,523,7,523,2,524,7,524,2,525,7,525,2,526,7,526,
        2,527,7,527,2,528,7,528,2,529,7,529,2,530,7,530,2,531,7,531,2,532,
        7,532,2,533,7,533,2,534,7,534,2,535,7,535,2,536,7,536,2,537,7,537,
        2,538,7,538,2,539,7,539,2,540,7,540,2,541,7,541,2,542,7,542,2,543,
        7,543,2,544,7,544,2,545,7,545,2,546,7,546,2,547,7,547,2,548,7,548,
        2,549,7,549,2,550,7,550,2,551,7,551,2,552,7,552,2,553,7,553,2,554,
        7,554,2,555,7,555,2,556,7,556,2,557,7,557,2,558,7,558,2,559,7,559,
        2,560,7,560,2,561,7,561,2,562,7,562,2,563,7,563,2,564,7,564,2,565,
        7,565,2,566,7,566,2,567,7,567,2,568,7,568,2,569,7,569,2,570,7,570,
        2,571,7,571,2,572,7,572,2,573,7,573,2,574,7,574,2,575,7,575,2,576,
        7,576,2,577,7,577,2,578,7,578,2,579,7,579,2,580,7,580,2,581,7,581,
        2,582,7,582,2,583,7,583,2,584,7,584,2,585,7,585,2,586,7,586,2,587,
        7,587,2,588,7,588,2,589,7,589,2,590,7,590,2,591,7,591,2,592,7,592,
        2,593,7,593,2,594,7,594,2,595,7,595,2,596,7,596,2,597,7,597,2,598,
        7,598,2,599,7,599,2,600,7,600,2,601,7,601,2,602,7,602,2,603,7,603,
        2,604,7,604,2,605,7,605,2,606,7,606,2,607,7,607,2,608,7,608,2,609,
        7,609,2,610,7,610,2,611,7,611,2,612,7,612,2,613,7,613,2,614,7,614,
        2,615,7,615,2,616,7,616,2,617,7,617,2,618,7,618,2,619,7,619,2,620,
        7,620,2,621,7,621,2,622,7,622,2,623,7,623,2,624,7,624,2,625,7,625,
        2,626,7,626,2,627,7,627,2,628,7,628,2,629,7,629,2,630,7,630,2,631,
        7,631,2,632,7,632,2,633,7,633,2,634,7,634,2,635,7,635,2,636,7,636,
        2,637,7,637,2,638,7,638,2,639,7,639,2,640,7,640,2,641,7,641,2,642,
        7,642,2,643,7,643,2,644,7,644,2,645,7,645,2,646,7,646,2,647,7,647,
        2,648,7,648,2,649,7,649,2,650,7,650,2,651,7,651,2,652,7,652,2,653,
        7,653,2,654,7,654,2,655,7,655,2,656,7,656,2,657,7,657,2,658,7,658,
        2,659,7,659,2,660,7,660,2,661,7,661,2,662,7,662,2,663,7,663,2,664,
        7,664,2,665,7,665,2,666,7,666,2,667,7,667,2,668,7,668,2,669,7,669,
        2,670,7,670,2,671,7,671,2,672,7,672,2,673,7,673,2,674,7,674,2,675,
        7,675,2,676,7,676,2,677,7,677,2,678,7,678,2,679,7,679,2,680,7,680,
        2,681,7,681,2,682,7,682,2,683,7,683,2,684,7,684,2,685,7,685,2,686,
        7,686,2,687,7,687,2,688,7,688,2,689,7,689,2,690,7,690,2,691,7,691,
        2,692,7,692,2,693,7,693,2,694,7,694,2,695,7,695,2,696,7,696,2,697,
        7,697,2,698,7,698,2,699,7,699,2,700,7,700,2,701,7,701,2,702,7,702,
        2,703,7,703,2,704,7,704,2,705,7,705,2,706,7,706,2,707,7,707,2,708,
        7,708,2,709,7,709,2,710,7,710,2,711,7,711,2,712,7,712,2,713,7,713,
        2,714,7,714,2,715,7,715,2,716,7,716,2,717,7,717,2,718,7,718,2,719,
        7,719,2,720,7,720,2,721,7,721,2,722,7,722,2,723,7,723,2,724,7,724,
        2,725,7,725,2,726,7,726,2,727,7,727,2,728,7,728,2,729,7,729,2,730,
        7,730,2,731,7,731,2,732,7,732,2,733,7,733,2,734,7,734,2,735,7,735,
        2,736,7,736,2,737,7,737,2,738,7,738,2,739,7,739,2,740,7,740,2,741,
        7,741,2,742,7,742,2,743,7,743,2,744,7,744,2,745,7,745,2,746,7,746,
        2,747,7,747,2,748,7,748,2,749,7,749,2,750,7,750,2,751,7,751,2,752,
        7,752,2,753,7,753,2,754,7,754,2,755,7,755,2,756,7,756,2,757,7,757,
        2,758,7,758,2,759,7,759,2,760,7,760,2,761,7,761,2,762,7,762,2,763,
        7,763,2,764,7,764,2,765,7,765,2,766,7,766,2,767,7,767,2,768,7,768,
        2,769,7,769,2,770,7,770,2,771,7,771,2,772,7,772,2,773,7,773,2,774,
        7,774,2,775,7,775,2,776,7,776,2,777,7,777,2,778,7,778,2,779,7,779,
        2,780,7,780,2,781,7,781,2,782,7,782,2,783,7,783,2,784,7,784,2,785,
        7,785,2,786,7,786,2,787,7,787,2,788,7,788,2,789,7,789,2,790,7,790,
        2,791,7,791,2,792,7,792,2,793,7,793,2,794,7,794,2,795,7,795,2,796,
        7,796,2,797,7,797,2,798,7,798,2,799,7,799,2,800,7,800,2,801,7,801,
        2,802,7,802,2,803,7,803,2,804,7,804,2,805,7,805,2,806,7,806,2,807,
        7,807,2,808,7,808,2,809,7,809,2,810,7,810,2,811,7,811,1,0,1,0,1,
        0,1,1,1,1,1,2,1,2,1,3,1,3,3,3,1634,8,3,5,3,1636,8,3,10,3,12,3,1639,
        9,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,
        1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,
        1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,
        1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,
        1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,
        1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,
        1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,
        1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,1766,
        8,4,1,5,1,5,3,5,1770,8,5,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,7,1,8,
        1,8,3,8,1783,8,8,1,9,5,9,1786,8,9,10,9,12,9,1789,9,9,1,10,5,10,1792,
        8,10,10,10,12,10,1795,9,10,1,11,1,11,1,11,3,11,1800,8,11,1,11,1,
        11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,3,11,1815,
        8,11,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,3,12,1827,
        8,12,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,
        1,15,1,15,1,15,1,15,3,15,1845,8,15,1,16,1,16,1,16,3,16,1850,8,16,
        1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,3,17,1860,8,17,1,17,1,17,
        1,18,1,18,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,
        1,20,1,20,1,21,1,21,1,21,1,21,1,21,3,21,1884,8,21,1,21,1,21,1,21,
        1,21,1,21,3,21,1891,8,21,1,21,1,21,1,22,1,22,3,22,1897,8,22,1,23,
        5,23,1900,8,23,10,23,12,23,1903,9,23,1,24,1,24,1,24,1,24,1,24,1,
        24,3,24,1911,8,24,1,25,1,25,3,25,1915,8,25,1,25,1,25,1,26,1,26,1,
        26,1,26,1,26,1,26,1,26,1,26,3,26,1927,8,26,1,27,1,27,1,27,1,27,1,
        28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,
        28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,1958,
        8,28,1,29,1,29,1,29,5,29,1963,8,29,10,29,12,29,1966,9,29,1,30,1,
        30,1,30,5,30,1971,8,30,10,30,12,30,1974,9,30,1,31,1,31,3,31,1978,
        8,31,1,32,1,32,1,32,1,32,1,32,3,32,1985,8,32,1,33,1,33,1,33,1,33,
        3,33,1991,8,33,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,
        1,34,1,34,1,34,1,34,1,34,3,34,2008,8,34,1,35,1,35,1,35,3,35,2013,
        8,35,1,36,1,36,3,36,2017,8,36,1,37,1,37,1,37,1,38,1,38,1,38,1,38,
        1,38,1,38,1,38,1,38,3,38,2030,8,38,1,39,1,39,3,39,2034,8,39,1,40,
        1,40,1,40,3,40,2039,8,40,1,41,1,41,1,41,3,41,2044,8,41,1,42,1,42,
        1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,3,42,2056,8,42,1,43,1,43,
        1,43,1,43,1,43,1,44,1,44,3,44,2065,8,44,1,45,1,45,1,46,1,46,1,47,
        1,47,1,47,1,48,1,48,1,48,1,48,3,48,2078,8,48,1,48,1,48,1,48,3,48,
        2083,8,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,3,48,2094,
        8,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,3,48,2105,8,48,
        1,48,1,48,1,48,3,48,2110,8,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,
        1,48,1,48,3,48,2121,8,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,
        1,48,3,48,2132,8,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,3,48,2141,
        8,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,3,48,2151,8,48,1,48,
        1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,3,48,
        2166,8,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,1,48,3,48,
        2178,8,48,1,48,1,48,1,48,3,48,2183,8,48,1,49,1,49,1,49,5,49,2188,
        8,49,10,49,12,49,2191,9,49,1,50,1,50,1,50,1,50,1,50,1,50,1,50,1,
        50,3,50,2201,8,50,1,51,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,
        52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,3,
        52,2459,8,52,1,53,1,53,1,53,1,53,1,53,3,53,2466,8,53,1,54,1,54,1,
        54,3,54,2471,8,54,1,55,1,55,1,55,3,55,2476,8,55,1,56,1,56,1,56,3,
        56,2481,8,56,1,57,1,57,1,57,1,57,1,57,1,57,3,57,2489,8,57,1,58,1,
        58,1,58,1,58,1,59,1,59,1,59,3,59,2498,8,59,1,60,1,60,1,60,5,60,2503,
        8,60,10,60,12,60,2506,9,60,1,61,1,61,1,61,1,61,1,61,1,61,1,61,3,
        61,2515,8,61,3,61,2517,8,61,1,62,4,62,2520,8,62,11,62,12,62,2521,
        1,63,1,63,1,63,1,63,3,63,2528,8,63,1,63,1,63,1,63,1,63,3,63,2534,
        8,63,3,63,2536,8,63,1,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,
        1,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,1,64,
        1,64,1,64,1,64,1,64,3,64,2564,8,64,1,65,1,65,1,65,1,66,1,66,1,66,
        5,66,2572,8,66,10,66,12,66,2575,9,66,1,67,1,67,1,67,1,67,1,67,1,
        68,1,68,1,68,5,68,2585,8,68,10,68,12,68,2588,9,68,1,69,1,69,1,69,
        1,69,1,69,1,69,1,69,1,69,1,69,3,69,2599,8,69,1,69,1,69,1,69,1,69,
        1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,3,69,2613,8,69,1,70,1,70,
        1,70,3,70,2618,8,70,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,
        1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,1,71,
        3,71,2642,8,71,1,72,1,72,1,73,1,73,3,73,2648,8,73,1,74,1,74,1,74,
        3,74,2653,8,74,1,75,1,75,1,75,1,75,1,75,3,75,2660,8,75,1,76,5,76,
        2663,8,76,10,76,12,76,2666,9,76,1,77,1,77,1,77,1,77,1,77,1,77,1,
        77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,
        77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,77,1,
        77,1,77,1,77,3,77,2703,8,77,1,78,1,78,3,78,2707,8,78,1,79,1,79,1,
        79,1,79,1,79,3,79,2714,8,79,1,80,1,80,3,80,2718,8,80,1,81,1,81,1,
        81,5,81,2723,8,81,10,81,12,81,2726,9,81,1,82,1,82,1,82,1,83,1,83,
        1,83,1,83,1,83,1,83,1,83,1,83,3,83,2739,8,83,1,84,1,84,1,84,5,84,
        2744,8,84,10,84,12,84,2747,9,84,1,85,1,85,1,86,1,86,1,86,1,86,1,
        86,1,86,3,86,2757,8,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,
        86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,
        86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,1,86,3,86,2790,8,86,1,
        87,1,87,1,87,1,87,1,87,1,87,1,87,1,87,3,87,2800,8,87,1,88,1,88,3,
        88,2804,8,88,1,89,1,89,1,89,1,89,1,89,3,89,2811,8,89,1,90,1,90,1,
        90,5,90,2816,8,90,10,90,12,90,2819,9,90,1,91,1,91,1,91,5,91,2824,
        8,91,10,91,12,91,2827,9,91,1,92,1,92,1,92,3,92,2832,8,92,1,93,1,
        93,3,93,2836,8,93,1,94,1,94,1,94,1,94,1,94,1,95,1,95,1,95,3,95,2846,
        8,95,1,95,1,95,1,96,5,96,2851,8,96,10,96,12,96,2854,9,96,1,97,1,
        97,1,97,1,97,1,97,1,97,1,97,1,97,3,97,2864,8,97,1,98,1,98,1,98,1,
        98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,
        98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,98,1,
        98,3,98,2896,8,98,1,98,1,98,1,98,1,98,1,98,1,98,3,98,2904,8,98,1,
        99,1,99,1,99,3,99,2909,8,99,1,100,1,100,1,100,1,100,1,100,3,100,
        2916,8,100,1,101,1,101,1,101,1,101,1,102,1,102,5,102,2924,8,102,
        10,102,12,102,2927,9,102,1,103,1,103,1,104,1,104,1,104,1,104,1,104,
        3,104,2936,8,104,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,
        1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,3,105,
        2956,8,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,
        1,105,1,105,1,105,1,105,3,105,2971,8,105,1,105,1,105,1,105,1,105,
        1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,
        1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,105,3,105,2996,8,105,
        1,106,1,106,1,106,3,106,3001,8,106,1,107,1,107,1,107,1,107,1,107,
        3,107,3008,8,107,1,108,1,108,1,108,5,108,3013,8,108,10,108,12,108,
        3016,9,108,1,109,1,109,1,110,1,110,1,110,1,110,1,110,1,110,3,110,
        3026,8,110,1,111,1,111,1,111,3,111,3031,8,111,1,112,1,112,1,112,
        5,112,3036,8,112,10,112,12,112,3039,9,112,1,113,1,113,1,113,1,113,
        1,113,1,113,1,113,1,113,3,113,3049,8,113,1,114,1,114,1,114,1,114,
        1,114,1,114,3,114,3057,8,114,1,115,1,115,1,115,1,115,1,115,1,115,
        1,115,1,115,1,115,3,115,3068,8,115,1,116,1,116,1,116,1,116,1,117,
        1,117,1,117,1,117,1,118,1,118,1,118,1,118,1,118,1,118,3,118,3084,
        8,118,1,119,1,119,1,119,1,119,1,119,1,119,3,119,3092,8,119,1,120,
        1,120,3,120,3096,8,120,1,121,1,121,1,121,1,121,1,121,1,121,1,121,
        1,122,1,122,1,122,5,122,3108,8,122,10,122,12,122,3111,9,122,1,123,
        1,123,1,123,1,123,1,123,1,123,1,123,1,123,1,123,1,123,1,123,1,123,
        1,123,1,123,3,123,3127,8,123,1,124,1,124,1,124,3,124,3132,8,124,
        1,125,1,125,1,125,1,125,1,125,3,125,3139,8,125,1,126,1,126,1,126,
        1,126,1,126,1,126,1,126,3,126,3148,8,126,1,126,3,126,3151,8,126,
        1,127,1,127,1,127,3,127,3156,8,127,1,128,1,128,1,128,1,128,1,128,
        3,128,3163,8,128,1,129,1,129,1,129,1,129,1,130,1,130,1,130,1,130,
        1,130,3,130,3174,8,130,1,130,1,130,1,130,1,130,1,130,1,130,1,130,
        1,131,1,131,1,131,1,131,3,131,3187,8,131,1,131,1,131,1,131,1,131,
        1,131,1,132,1,132,1,132,1,132,1,132,1,132,3,132,3200,8,132,1,132,
        1,132,1,132,1,132,1,132,1,133,1,133,1,133,1,133,1,133,1,133,1,133,
        1,134,1,134,1,134,1,134,3,134,3218,8,134,1,134,3,134,3221,8,134,
        1,135,1,135,1,135,1,135,1,135,1,135,1,135,3,135,3230,8,135,1,135,
        1,135,1,135,1,135,1,135,1,136,1,136,1,136,1,136,1,136,1,136,1,137,
        1,137,3,137,3245,8,137,1,138,1,138,1,138,1,138,1,138,1,138,1,138,
        1,139,1,139,1,139,1,139,1,139,1,139,3,139,3260,8,139,1,139,1,139,
        1,139,1,140,1,140,1,140,1,140,3,140,3269,8,140,1,140,1,140,1,140,
        1,141,1,141,3,141,3276,8,141,1,142,1,142,1,142,1,142,1,142,3,142,
        3283,8,142,1,143,4,143,3286,8,143,11,143,12,143,3287,1,144,1,144,
        1,144,1,144,1,144,1,144,1,144,1,144,1,144,1,144,1,144,1,144,1,144,
        1,144,1,144,1,144,1,144,1,144,1,144,1,144,1,144,1,144,1,144,1,144,
        1,144,1,144,1,144,1,144,3,144,3318,8,144,3,144,3320,8,144,1,145,
        1,145,3,145,3324,8,145,1,146,1,146,1,146,1,146,1,146,1,146,3,146,
        3332,8,146,1,147,1,147,1,147,5,147,3337,8,147,10,147,12,147,3340,
        9,147,1,148,1,148,1,148,1,148,1,148,1,148,1,148,1,148,1,148,1,148,
        1,148,3,148,3353,8,148,1,149,1,149,3,149,3357,8,149,1,150,1,150,
        3,150,3361,8,150,1,151,1,151,1,151,3,151,3366,8,151,1,152,1,152,
        1,152,1,152,3,152,3372,8,152,1,153,1,153,3,153,3376,8,153,1,154,
        1,154,3,154,3380,8,154,1,155,1,155,1,155,1,155,1,155,1,155,1,155,
        1,155,1,156,1,156,1,156,3,156,3393,8,156,1,157,1,157,1,157,1,157,
        3,157,3399,8,157,1,157,1,157,1,158,1,158,1,158,1,158,1,158,3,158,
        3408,8,158,1,158,1,158,1,158,1,158,1,159,5,159,3415,8,159,10,159,
        12,159,3418,9,159,1,160,1,160,1,160,1,160,1,160,1,160,1,160,3,160,
        3427,8,160,1,161,1,161,1,161,1,161,1,161,1,161,1,162,5,162,3436,
        8,162,10,162,12,162,3439,9,162,1,163,1,163,1,163,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,1,164,
        1,164,1,164,3,164,3548,8,164,1,165,1,165,1,165,1,165,1,165,1,165,
        1,165,1,165,1,166,1,166,1,166,1,166,1,166,1,166,1,166,1,166,3,166,
        3566,8,166,1,167,4,167,3569,8,167,11,167,12,167,3570,1,168,1,168,
        3,168,3575,8,168,1,169,1,169,1,169,1,169,1,169,1,169,1,169,1,169,
        1,169,1,169,1,169,1,169,1,169,1,169,1,169,3,169,3592,8,169,1,170,
        1,170,1,170,1,170,1,170,1,170,3,170,3600,8,170,1,171,1,171,1,171,
        5,171,3605,8,171,10,171,12,171,3608,9,171,1,172,1,172,1,172,1,172,
        1,172,1,173,1,173,1,173,5,173,3618,8,173,10,173,12,173,3621,9,173,
        1,174,1,174,1,174,1,174,1,174,1,174,1,174,3,174,3630,8,174,1,175,
        1,175,1,175,1,176,1,176,1,177,1,177,1,178,1,178,1,178,1,178,1,178,
        1,178,1,178,1,178,1,178,1,178,1,178,1,178,1,178,1,178,1,178,1,178,
        1,178,1,178,1,178,1,178,1,178,1,178,1,178,1,178,1,178,3,178,3664,
        8,178,1,179,1,179,1,179,3,179,3669,8,179,1,180,1,180,1,180,3,180,
        3674,8,180,1,181,1,181,3,181,3678,8,181,1,182,1,182,1,182,1,182,
        1,182,1,182,3,182,3686,8,182,3,182,3688,8,182,1,183,1,183,1,183,
        1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,
        1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,
        1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,
        1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,
        1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,1,183,3,183,3746,
        8,183,1,184,1,184,1,184,1,184,1,184,1,184,1,184,1,184,1,184,1,184,
        1,184,1,184,1,185,1,185,1,185,3,185,3763,8,185,1,186,1,186,1,186,
        1,186,1,186,1,186,3,186,3771,8,186,1,187,1,187,1,187,1,187,1,187,
        1,187,1,187,1,187,1,187,1,187,1,187,1,187,1,187,1,187,1,187,1,187,
        1,187,1,187,1,187,1,187,1,187,3,187,3794,8,187,1,188,1,188,3,188,
        3798,8,188,1,189,1,189,1,189,1,189,1,189,1,189,1,189,1,189,1,189,
        1,189,1,189,1,189,1,189,1,189,1,189,1,189,1,189,1,189,3,189,3818,
        8,189,1,190,1,190,1,190,1,190,1,190,1,190,1,190,1,190,1,190,1,191,
        1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,192,
        1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,193,1,193,1,193,
        1,193,1,193,1,193,3,193,3855,8,193,1,194,1,194,1,194,1,194,1,194,
        1,194,1,194,3,194,3864,8,194,1,195,1,195,1,195,3,195,3869,8,195,
        1,196,1,196,1,196,3,196,3874,8,196,1,197,1,197,1,197,3,197,3879,
        8,197,1,198,1,198,1,198,3,198,3884,8,198,1,199,1,199,1,200,1,200,
        1,200,1,200,1,200,1,200,1,200,1,200,1,200,1,201,1,201,1,202,1,202,
        1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,
        1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,
        1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,1,202,
        1,202,1,202,1,202,3,202,3937,8,202,1,203,1,203,1,203,1,203,3,203,
        3943,8,203,1,204,1,204,1,204,5,204,3948,8,204,10,204,12,204,3951,
        9,204,1,205,1,205,1,205,1,205,1,205,1,205,1,205,3,205,3960,8,205,
        1,206,1,206,1,206,3,206,3965,8,206,1,207,4,207,3968,8,207,11,207,
        12,207,3969,1,208,1,208,1,208,1,208,1,208,1,209,1,209,1,210,1,210,
        1,211,1,211,1,212,1,212,1,212,1,212,1,212,3,212,3988,8,212,1,213,
        1,213,3,213,3992,8,213,1,214,1,214,1,215,1,215,1,215,1,215,1,215,
        1,215,3,215,4002,8,215,1,216,1,216,1,217,1,217,3,217,4008,8,217,
        1,217,1,217,5,217,4012,8,217,10,217,12,217,4015,9,217,1,218,1,218,
        1,218,1,218,3,218,4021,8,218,1,219,1,219,1,219,3,219,4026,8,219,
        1,220,5,220,4029,8,220,10,220,12,220,4032,9,220,1,221,1,221,1,221,
        1,221,1,221,1,221,1,221,1,221,1,221,1,221,1,221,3,221,4045,8,221,
        1,222,1,222,1,222,1,222,1,222,1,222,1,222,1,222,1,222,1,222,1,222,
        1,222,1,222,1,222,1,222,1,222,1,222,1,222,1,222,1,222,1,222,1,222,
        1,222,1,222,1,222,1,222,3,222,4073,8,222,1,223,1,223,1,223,5,223,
        4078,8,223,10,223,12,223,4081,9,223,1,224,1,224,1,224,1,224,1,224,
        1,224,1,225,1,225,1,225,5,225,4092,8,225,10,225,12,225,4095,9,225,
        1,226,1,226,1,226,1,226,1,226,1,226,1,227,1,227,1,227,1,227,1,227,
        1,227,3,227,4109,8,227,1,228,1,228,1,228,1,228,1,228,1,228,1,228,
        1,228,1,228,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,
        1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,1,229,3,229,4226,
        8,229,1,230,1,230,1,230,1,230,1,231,1,231,1,231,5,231,4235,8,231,
        10,231,12,231,4238,9,231,1,232,1,232,1,232,3,232,4243,8,232,1,233,
        1,233,1,233,1,233,1,233,1,233,3,233,4251,8,233,1,234,1,234,1,234,
        1,234,1,235,1,235,1,235,5,235,4260,8,235,10,235,12,235,4263,9,235,
        1,236,1,236,1,236,1,236,1,237,1,237,3,237,4271,8,237,1,238,1,238,
        1,238,5,238,4276,8,238,10,238,12,238,4279,9,238,1,239,1,239,1,239,
        1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,
        1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,
        1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,1,239,
        1,239,3,239,4318,8,239,1,240,1,240,1,240,1,240,3,240,4324,8,240,
        1,241,1,241,1,241,1,241,1,241,1,241,1,241,1,241,1,241,1,241,1,241,
        1,241,1,241,1,241,1,242,1,242,1,242,5,242,4343,8,242,10,242,12,242,
        4346,9,242,1,243,1,243,1,243,1,243,1,243,1,243,1,243,1,243,1,243,
        1,243,1,243,1,243,1,243,1,243,1,243,1,243,1,243,1,243,1,243,1,243,
        1,243,1,243,1,243,1,243,1,243,3,243,4373,8,243,1,244,1,244,3,244,
        4377,8,244,1,245,1,245,1,245,3,245,4382,8,245,1,246,1,246,1,246,
        1,246,1,246,1,246,1,246,3,246,4391,8,246,1,247,1,247,3,247,4395,
        8,247,1,248,1,248,1,248,1,248,1,248,1,248,1,248,1,249,1,249,1,249,
        1,249,1,249,1,249,1,249,1,249,1,249,1,249,1,249,1,249,1,249,1,249,
        1,249,1,249,1,249,1,249,3,249,4422,8,249,1,250,1,250,1,250,5,250,
        4427,8,250,10,250,12,250,4430,9,250,1,251,1,251,1,251,1,251,1,251,
        1,251,1,251,1,251,1,251,1,251,1,251,1,251,3,251,4444,8,251,1,252,
        1,252,1,252,1,252,1,252,1,252,1,252,1,252,1,252,1,252,1,252,1,252,
        1,252,1,252,1,252,1,252,1,252,1,252,3,252,4464,8,252,1,253,1,253,
        1,253,1,253,1,253,1,253,1,253,1,253,1,253,1,253,1,253,1,253,1,253,
        1,253,1,253,1,253,1,253,1,253,3,253,4484,8,253,1,254,1,254,1,254,
        1,254,1,254,1,254,1,255,1,255,1,255,1,255,1,255,1,255,1,255,1,256,
        1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,
        1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,
        1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,
        1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,
        1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,
        1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,
        1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,1,256,
        3,256,4577,8,256,1,257,1,257,1,257,1,257,1,257,1,257,1,257,1,257,
        1,257,1,257,1,257,1,257,1,257,1,257,1,257,1,257,1,257,1,257,1,257,
        1,257,1,257,1,257,1,257,3,257,4602,8,257,1,258,1,258,1,258,1,258,
        1,258,3,258,4609,8,258,1,259,1,259,1,259,1,259,1,259,1,259,1,259,
        1,259,1,259,1,259,1,259,1,259,1,259,1,259,3,259,4625,8,259,1,260,
        1,260,1,261,1,261,1,261,5,261,4632,8,261,10,261,12,261,4635,9,261,
        1,262,1,262,3,262,4639,8,262,1,263,1,263,4,263,4643,8,263,11,263,
        12,263,4644,1,264,1,264,1,264,5,264,4650,8,264,10,264,12,264,4653,
        9,264,1,265,1,265,1,265,1,265,1,265,1,265,1,266,1,266,1,266,1,266,
        1,266,3,266,4666,8,266,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,
        1,267,1,267,1,267,1,267,1,267,1,267,1,267,1,267,3,267,4815,8,267,
        1,268,1,268,3,268,4819,8,268,1,269,1,269,1,269,1,269,1,269,1,269,
        1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,
        1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,
        1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,
        1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,
        1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,
        1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,
        1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,
        1,269,1,269,1,269,1,269,1,269,1,269,1,269,1,269,3,269,4912,8,269,
        1,270,1,270,1,270,3,270,4917,8,270,1,271,1,271,3,271,4921,8,271,
        1,272,1,272,1,272,1,272,3,272,4927,8,272,1,273,1,273,1,273,1,273,
        1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,
        1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,
        1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,
        1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,
        1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,1,273,
        1,273,1,273,1,273,1,273,1,273,1,273,1,273,3,273,4995,8,273,1,274,
        1,274,1,275,1,275,3,275,5001,8,275,1,276,1,276,1,276,1,276,1,276,
        1,276,1,276,1,276,1,277,1,277,1,277,1,277,1,277,1,277,1,277,1,277,
        1,277,1,277,1,277,1,277,1,277,1,277,1,277,1,277,1,277,1,277,1,277,
        3,277,5030,8,277,1,278,1,278,1,278,1,278,1,278,1,278,1,278,1,278,
        1,278,1,278,1,278,1,278,1,278,1,278,1,278,3,278,5047,8,278,1,279,
        1,279,1,279,5,279,5052,8,279,10,279,12,279,5055,9,279,1,280,1,280,
        1,280,1,280,1,280,1,280,1,280,1,280,1,280,3,280,5066,8,280,1,281,
        1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,
        1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,
        1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,
        1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,
        1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,1,281,
        1,281,1,281,3,281,5126,8,281,1,282,1,282,1,282,5,282,5131,8,282,
        10,282,12,282,5134,9,282,1,283,1,283,1,283,3,283,5139,8,283,1,284,
        1,284,1,284,1,284,3,284,5145,8,284,1,285,1,285,1,285,1,285,1,285,
        1,285,1,285,1,286,1,286,1,286,1,286,1,286,1,286,1,286,1,286,1,286,
        1,286,1,286,1,286,1,286,1,286,1,286,1,286,1,286,3,286,5171,8,286,
        1,287,1,287,1,287,1,287,3,287,5177,8,287,1,288,1,288,1,288,1,288,
        3,288,5183,8,288,1,289,1,289,1,289,1,289,1,289,1,289,1,290,5,290,
        5192,8,290,10,290,12,290,5195,9,290,1,291,1,291,1,291,1,291,1,291,
        1,291,1,291,1,291,1,291,3,291,5206,8,291,1,292,1,292,1,292,1,292,
        1,292,1,292,1,292,1,292,1,292,1,292,1,292,1,292,1,292,1,292,1,292,
        1,292,1,292,1,292,1,292,1,292,1,292,1,292,1,292,1,292,1,292,1,292,
        1,292,3,292,5235,8,292,1,293,1,293,1,294,1,294,1,294,1,294,1,294,
        1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,
        1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,
        1,294,1,294,1,294,1,294,1,294,1,294,1,294,1,294,3,294,5274,8,294,
        1,295,1,295,3,295,5278,8,295,1,296,1,296,3,296,5282,8,296,1,297,
        1,297,3,297,5286,8,297,1,298,1,298,1,298,3,298,5291,8,298,1,299,
        1,299,1,299,5,299,5296,8,299,10,299,12,299,5299,9,299,1,300,1,300,
        1,300,1,300,1,300,1,300,1,300,1,300,1,300,1,300,1,300,3,300,5312,
        8,300,1,301,1,301,1,301,1,301,1,301,1,301,1,301,1,301,1,301,1,301,
        1,301,3,301,5325,8,301,1,302,1,302,1,302,1,302,1,302,1,302,3,302,
        5333,8,302,1,303,1,303,1,303,5,303,5338,8,303,10,303,12,303,5341,
        9,303,1,304,1,304,1,304,3,304,5346,8,304,1,305,1,305,3,305,5350,
        8,305,1,306,1,306,1,306,3,306,5355,8,306,1,307,1,307,1,307,1,307,
        1,307,3,307,5362,8,307,1,308,1,308,1,308,1,308,1,308,1,308,1,308,
        1,308,1,308,1,308,1,308,1,308,3,308,5376,8,308,3,308,5378,8,308,
        1,308,1,308,1,309,1,309,1,309,3,309,5385,8,309,1,310,1,310,3,310,
        5389,8,310,1,310,1,310,1,311,1,311,1,311,5,311,5396,8,311,10,311,
        12,311,5399,9,311,1,312,1,312,1,312,5,312,5404,8,312,10,312,12,312,
        5407,9,312,1,313,1,313,1,313,1,313,1,313,1,313,3,313,5415,8,313,
        3,313,5417,8,313,1,314,1,314,3,314,5421,8,314,1,314,1,314,1,315,
        1,315,1,315,5,315,5428,8,315,10,315,12,315,5431,9,315,1,316,1,316,
        3,316,5435,8,316,1,316,1,316,1,316,1,316,3,316,5441,8,316,1,316,
        1,316,1,316,3,316,5446,8,316,1,317,1,317,3,317,5450,8,317,1,317,
        1,317,1,317,3,317,5455,8,317,1,318,1,318,1,318,1,318,3,318,5461,
        8,318,1,319,1,319,1,320,1,320,3,320,5467,8,320,1,320,1,320,1,320,
        1,320,3,320,5473,8,320,1,320,1,320,1,320,1,320,3,320,5479,8,320,
        1,321,1,321,1,321,3,321,5484,8,321,1,322,1,322,1,323,1,323,1,323,
        1,323,1,323,1,323,1,323,1,323,1,323,1,323,1,323,3,323,5499,8,323,
        1,323,1,323,1,324,1,324,1,324,5,324,5506,8,324,10,324,12,324,5509,
        9,324,1,325,1,325,1,325,1,326,1,326,1,326,5,326,5517,8,326,10,326,
        12,326,5520,9,326,1,327,4,327,5523,8,327,11,327,12,327,5524,1,327,
        1,327,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,
        1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,
        1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,1,328,
        1,328,1,328,1,328,3,328,5564,8,328,1,329,1,329,1,329,1,329,1,329,
        1,329,1,329,1,329,3,329,5574,8,329,1,330,1,330,1,330,1,330,1,330,
        3,330,5581,8,330,1,331,1,331,1,331,1,331,1,331,1,331,1,331,5,331,
        5590,8,331,10,331,12,331,5593,9,331,1,332,1,332,1,332,3,332,5598,
        8,332,1,333,1,333,1,333,1,334,1,334,1,334,5,334,5606,8,334,10,334,
        12,334,5609,9,334,1,335,1,335,1,335,1,335,1,335,1,335,1,336,4,336,
        5618,8,336,11,336,12,336,5619,1,337,1,337,3,337,5624,8,337,1,338,
        1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,
        1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,
        1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,1,338,
        1,338,1,338,3,338,5662,8,338,1,339,1,339,1,339,1,339,1,339,1,339,
        1,339,1,339,1,339,1,339,1,339,1,339,3,339,5676,8,339,1,340,1,340,
        1,340,1,340,1,340,1,340,1,340,1,340,1,340,1,340,1,340,1,340,3,340,
        5690,8,340,1,341,1,341,1,341,1,341,1,341,1,341,1,341,1,341,1,341,
        1,341,1,341,1,341,1,341,1,341,1,341,1,341,1,341,1,341,1,341,1,341,
        1,341,1,341,3,341,5714,8,341,1,342,1,342,1,342,5,342,5719,8,342,
        10,342,12,342,5722,9,342,1,342,1,342,1,343,1,343,1,343,5,343,5729,
        8,343,10,343,12,343,5732,9,343,1,344,1,344,1,344,1,345,1,345,1,345,
        1,346,4,346,5741,8,346,11,346,12,346,5742,1,347,1,347,1,347,3,347,
        5748,8,347,1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,
        1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,
        1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,1,348,
        1,348,1,348,1,348,3,348,5784,8,348,1,349,1,349,1,349,1,349,1,349,
        3,349,5791,8,349,1,350,1,350,1,350,1,350,1,350,1,350,1,350,1,350,
        1,350,1,350,1,351,1,351,1,351,3,351,5806,8,351,1,352,1,352,1,352,
        1,352,1,352,1,352,1,352,1,352,1,352,1,352,1,352,1,353,1,353,1,353,
        1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,
        1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,
        1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,1,353,3,353,5853,
        8,353,1,354,1,354,1,354,1,354,1,354,1,354,1,354,1,354,1,354,1,355,
        1,355,1,355,1,355,1,355,1,355,1,355,1,355,1,355,1,355,1,355,1,355,
        1,355,1,355,1,355,1,355,1,355,1,355,1,355,1,355,1,355,1,355,1,355,
        1,355,1,355,1,355,3,355,5890,8,355,1,356,1,356,1,357,1,357,1,358,
        1,358,1,358,5,358,5899,8,358,10,358,12,358,5902,9,358,1,359,1,359,
        1,360,1,360,1,360,1,360,1,360,1,360,1,360,1,360,1,360,1,360,1,360,
        1,360,3,360,5918,8,360,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,
        1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,1,361,3,361,
        6388,8,361,1,362,1,362,3,362,6392,8,362,1,363,1,363,1,363,3,363,
        6397,8,363,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,
        1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,
        1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,
        1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,
        1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,1,364,
        1,364,1,364,1,364,1,364,3,364,6456,8,364,1,365,1,365,3,365,6460,
        8,365,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,
        1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,1,366,3,366,6679,
        8,366,1,367,1,367,1,367,1,367,1,367,1,367,1,367,1,367,1,368,1,368,
        1,368,5,368,6692,8,368,10,368,12,368,6695,9,368,1,369,1,369,1,369,
        1,369,1,369,1,369,1,369,1,369,3,369,6705,8,369,1,370,1,370,1,370,
        1,370,1,370,3,370,6712,8,370,1,371,1,371,1,371,1,371,1,371,1,371,
        1,371,1,371,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,
        1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,1,372,3,372,6905,
        8,372,1,373,1,373,1,373,1,373,1,373,1,373,1,374,1,374,3,374,6915,
        8,374,1,375,1,375,1,375,1,375,1,375,1,375,3,375,6923,8,375,1,376,
        1,376,1,376,1,376,1,376,1,376,1,376,1,376,1,376,1,376,1,376,1,376,
        1,376,1,376,1,376,1,376,1,376,1,376,1,376,1,376,1,376,1,376,1,376,
        1,376,1,376,1,376,1,376,3,376,6952,8,376,1,377,1,377,1,377,1,377,
        1,377,1,377,1,377,1,377,1,377,1,378,1,378,1,378,5,378,6966,8,378,
        10,378,12,378,6969,9,378,1,379,1,379,1,380,1,380,1,380,1,380,1,380,
        1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,
        1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,
        1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,1,380,3,380,
        7010,8,380,1,381,1,381,1,381,1,381,1,381,1,381,1,381,1,381,1,381,
        1,381,1,381,1,381,3,381,7024,8,381,1,382,1,382,1,382,1,382,1,382,
        1,382,1,382,1,382,1,382,1,382,1,382,1,382,1,382,1,382,1,383,1,383,
        1,383,1,383,1,383,1,383,3,383,7046,8,383,1,384,1,384,1,384,5,384,
        7051,8,384,10,384,12,384,7054,9,384,1,385,1,385,1,385,1,385,1,385,
        3,385,7061,8,385,1,386,1,386,3,386,7065,8,386,1,387,1,387,1,388,
        1,388,1,388,3,388,7072,8,388,1,389,1,389,1,389,1,389,1,390,1,390,
        1,390,3,390,7081,8,390,1,391,1,391,1,391,1,392,1,392,1,392,1,392,
        3,392,7090,8,392,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,
        1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,
        1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,
        1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,
        1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,1,393,3,393,7142,
        8,393,1,394,1,394,1,394,3,394,7147,8,394,1,395,1,395,1,395,1,395,
        1,395,1,395,1,395,1,395,1,395,1,395,3,395,7159,8,395,1,396,1,396,
        3,396,7163,8,396,1,396,5,396,7166,8,396,10,396,12,396,7169,9,396,
        1,397,1,397,3,397,7173,8,397,1,398,1,398,3,398,7177,8,398,1,398,
        1,398,3,398,7181,8,398,1,399,1,399,1,399,3,399,7186,8,399,1,399,
        1,399,1,399,1,399,1,399,1,399,1,399,1,399,1,399,1,399,1,399,1,399,
        1,399,1,399,3,399,7202,8,399,1,399,1,399,1,399,1,399,1,400,1,400,
        3,400,7210,8,400,1,400,1,400,1,400,3,400,7215,8,400,1,401,1,401,
        1,401,1,402,1,402,1,402,1,402,1,402,1,402,1,403,1,403,3,403,7228,
        8,403,1,404,4,404,7231,8,404,11,404,12,404,7232,1,405,1,405,1,405,
        1,405,1,405,3,405,7240,8,405,1,406,1,406,1,406,1,406,1,406,1,406,
        1,406,1,406,3,406,7250,8,406,1,407,1,407,3,407,7254,8,407,1,408,
        1,408,1,408,1,408,1,408,1,408,1,408,1,408,1,408,3,408,7265,8,408,
        1,409,1,409,1,409,1,409,1,409,1,410,1,410,1,410,1,410,3,410,7276,
        8,410,1,410,1,410,1,410,1,410,1,410,1,410,3,410,7284,8,410,1,411,
        1,411,1,411,5,411,7289,8,411,10,411,12,411,7292,9,411,1,412,1,412,
        1,413,1,413,1,413,1,413,1,413,1,413,1,414,1,414,1,414,1,414,1,414,
        1,415,1,415,1,415,1,415,1,415,1,415,1,415,1,416,1,416,1,416,1,416,
        1,416,1,416,1,416,1,416,1,416,1,416,1,416,1,416,1,416,1,416,1,416,
        1,416,3,416,7330,8,416,1,416,1,416,1,416,1,416,1,416,1,416,3,416,
        7338,8,416,1,417,1,417,3,417,7342,8,417,1,418,1,418,1,418,1,418,
        1,418,1,418,1,418,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,
        1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,
        1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,
        1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,
        1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,
        1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,
        1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,1,419,3,419,7423,
        8,419,1,420,1,420,1,421,1,421,1,421,1,421,1,421,1,421,1,421,1,421,
        1,421,1,421,1,421,1,422,1,422,1,422,1,422,1,422,1,422,1,422,1,422,
        1,422,1,422,1,422,1,422,1,422,3,422,7451,8,422,1,423,1,423,1,423,
        3,423,7456,8,423,1,424,1,424,1,424,1,424,1,424,1,424,1,424,1,424,
        1,424,1,424,1,424,1,424,1,424,3,424,7471,8,424,1,425,1,425,1,425,
        1,425,1,425,1,425,1,425,1,425,1,425,1,425,3,425,7483,8,425,1,426,
        1,426,1,426,5,426,7488,8,426,10,426,12,426,7491,9,426,1,427,1,427,
        1,428,1,428,1,428,1,429,1,429,3,429,7500,8,429,1,430,1,430,1,430,
        3,430,7505,8,430,1,431,1,431,3,431,7509,8,431,1,432,1,432,3,432,
        7513,8,432,1,433,1,433,3,433,7517,8,433,1,434,1,434,3,434,7521,8,
        434,1,435,1,435,1,435,1,435,1,435,3,435,7528,8,435,1,436,1,436,1,
        436,1,437,1,437,1,437,5,437,7536,8,437,10,437,12,437,7539,9,437,
        1,438,1,438,3,438,7543,8,438,1,439,1,439,1,439,1,439,1,439,1,439,
        1,439,1,439,1,439,1,439,1,439,1,439,1,439,1,439,1,439,1,439,3,439,
        7561,8,439,1,440,1,440,1,440,1,440,1,440,1,440,1,440,1,440,1,440,
        3,440,7572,8,440,1,441,1,441,1,441,5,441,7577,8,441,10,441,12,441,
        7580,9,441,1,442,1,442,1,442,1,443,1,443,3,443,7587,8,443,1,444,
        1,444,1,444,3,444,7592,8,444,1,445,1,445,1,445,1,445,1,445,1,445,
        1,446,1,446,1,446,1,446,1,446,3,446,7605,8,446,1,447,1,447,1,447,
        1,447,3,447,7611,8,447,1,448,1,448,1,448,1,448,1,448,1,448,1,448,
        1,448,1,448,1,448,1,448,1,448,1,448,1,448,1,448,1,448,1,448,1,448,
        1,448,1,448,1,448,1,448,1,448,1,448,1,448,1,448,1,448,3,448,7640,
        8,448,1,449,1,449,1,449,1,449,1,449,3,449,7647,8,449,1,450,1,450,
        1,450,1,450,1,450,1,450,1,450,1,450,1,450,1,450,3,450,7659,8,450,
        1,451,1,451,1,451,1,451,1,451,1,451,1,451,1,451,1,452,1,452,1,452,
        3,452,7672,8,452,1,453,1,453,1,453,1,453,1,453,1,453,1,453,1,453,
        1,453,1,453,1,453,1,453,1,453,3,453,7687,8,453,1,453,1,453,1,453,
        1,453,3,453,7693,8,453,1,454,1,454,1,455,1,455,1,455,5,455,7700,
        8,455,10,455,12,455,7703,9,455,1,456,1,456,1,456,1,457,1,457,1,457,
        1,457,1,457,1,457,1,457,1,457,1,457,1,457,3,457,7718,8,457,1,457,
        3,457,7721,8,457,1,458,1,458,1,458,1,458,1,458,1,458,1,458,1,458,
        1,458,3,458,7732,8,458,1,459,1,459,1,459,3,459,7737,8,459,1,460,
        1,460,3,460,7741,8,460,1,460,1,460,3,460,7745,8,460,1,460,1,460,
        1,460,3,460,7750,8,460,1,460,3,460,7753,8,460,1,460,1,460,1,460,
        1,460,3,460,7759,8,460,1,460,1,460,3,460,7763,8,460,3,460,7765,8,
        460,1,460,3,460,7768,8,460,1,461,1,461,1,461,1,461,1,461,3,461,7775,
        8,461,1,461,3,461,7778,8,461,1,461,1,461,1,461,1,461,1,461,3,461,
        7785,8,461,1,461,1,461,1,462,1,462,1,462,1,462,3,462,7793,8,462,
        1,462,3,462,7796,8,462,1,462,1,462,1,462,1,462,1,463,1,463,1,463,
        3,463,7805,8,463,1,463,1,463,1,464,1,464,1,464,1,464,1,464,1,464,
        1,464,1,464,1,465,1,465,1,465,3,465,7820,8,465,1,466,1,466,1,466,
        1,466,1,466,1,466,1,467,1,467,1,467,1,467,1,467,3,467,7833,8,467,
        1,468,1,468,1,468,1,468,1,468,1,468,1,468,1,468,1,468,3,468,7844,
        8,468,1,468,3,468,7847,8,468,1,469,1,469,3,469,7851,8,469,1,470,
        1,470,1,470,1,470,3,470,7857,8,470,1,471,1,471,1,471,1,471,1,471,
        1,471,1,471,1,471,1,471,1,472,1,472,1,472,5,472,7871,8,472,10,472,
        12,472,7874,9,472,1,473,1,473,1,473,1,473,1,473,1,473,1,473,1,473,
        1,473,1,473,3,473,7886,8,473,1,474,1,474,1,474,1,475,1,475,1,475,
        5,475,7894,8,475,10,475,12,475,7897,9,475,1,476,1,476,1,476,1,476,
        1,476,1,476,1,476,1,476,1,477,1,477,1,478,1,478,1,478,1,478,1,478,
        5,478,7914,8,478,10,478,12,478,7917,9,478,1,479,1,479,1,479,1,479,
        1,479,3,479,7924,8,479,1,480,1,480,3,480,7928,8,480,1,481,1,481,
        1,481,1,481,1,481,1,481,1,481,1,481,3,481,7938,8,481,1,482,1,482,
        1,482,1,482,1,482,1,482,1,482,1,482,3,482,7948,8,482,1,482,1,482,
        1,482,1,482,1,482,1,482,1,482,1,482,1,482,3,482,7959,8,482,3,482,
        7961,8,482,1,483,1,483,1,483,1,483,1,483,5,483,7968,8,483,10,483,
        12,483,7971,9,483,1,484,1,484,1,484,1,484,1,484,5,484,7978,8,484,
        10,484,12,484,7981,9,484,1,485,1,485,1,485,1,485,1,485,1,485,1,485,
        1,485,3,485,7991,8,485,1,485,1,485,1,485,1,485,1,485,1,485,1,485,
        1,485,1,485,1,485,1,485,3,485,8004,8,485,1,486,1,486,3,486,8008,
        8,486,1,486,1,486,1,487,1,487,1,487,5,487,8015,8,487,10,487,12,487,
        8018,9,487,1,488,1,488,1,488,1,488,1,488,1,488,1,488,1,488,1,489,
        1,489,1,489,1,489,3,489,8032,8,489,1,490,1,490,3,490,8036,8,490,
        1,491,1,491,1,491,1,491,1,491,3,491,8043,8,491,1,491,3,491,8046,
        8,491,1,492,1,492,3,492,8050,8,492,1,493,3,493,8053,8,493,1,493,
        1,493,1,493,1,493,1,493,1,493,1,493,1,493,1,493,1,493,1,493,3,493,
        8066,8,493,1,494,1,494,3,494,8070,8,494,1,495,1,495,1,495,3,495,
        8075,8,495,1,496,1,496,1,496,1,496,1,496,1,496,3,496,8083,8,496,
        1,497,1,497,3,497,8087,8,497,1,498,1,498,3,498,8091,8,498,1,499,
        1,499,1,499,1,499,1,500,1,500,1,500,5,500,8100,8,500,10,500,12,500,
        8103,9,500,1,501,1,501,1,501,1,501,3,501,8109,8,501,1,501,1,501,
        1,502,1,502,3,502,8115,8,502,1,502,1,502,3,502,8119,8,502,3,502,
        8121,8,502,1,503,1,503,3,503,8125,8,503,1,504,1,504,1,504,1,504,
        3,504,8131,8,504,1,504,1,504,1,504,1,504,1,504,1,504,1,504,3,504,
        8140,8,504,1,504,1,504,1,504,1,504,3,504,8146,8,504,3,504,8148,8,
        504,3,504,8150,8,504,1,505,1,505,1,505,1,505,1,505,3,505,8157,8,
        505,1,506,1,506,3,506,8161,8,506,1,507,1,507,1,508,1,508,1,508,1,
        508,1,508,3,508,8170,8,508,1,509,1,509,3,509,8174,8,509,1,510,1,
        510,1,511,1,511,1,512,1,512,1,512,1,512,3,512,8184,8,512,1,513,1,
        513,1,513,5,513,8189,8,513,10,513,12,513,8192,9,513,1,514,1,514,
        1,514,1,514,1,514,3,514,8199,8,514,1,515,1,515,1,515,1,516,1,516,
        1,516,1,516,1,516,1,517,1,517,1,517,1,517,1,517,1,518,1,518,1,518,
        1,518,1,518,1,518,1,519,1,519,1,519,3,519,8223,8,519,1,520,1,520,
        1,520,1,520,3,520,8229,8,520,1,521,1,521,3,521,8233,8,521,1,522,
        4,522,8236,8,522,11,522,12,522,8237,1,523,1,523,1,523,1,523,1,524,
        1,524,1,524,3,524,8247,8,524,1,524,1,524,3,524,8251,8,524,1,524,
        3,524,8254,8,524,1,525,1,525,1,525,3,525,8259,8,525,1,526,1,526,
        1,526,1,526,1,526,1,526,1,526,1,526,1,526,5,526,8270,8,526,10,526,
        12,526,8273,9,526,1,527,1,527,1,527,3,527,8278,8,527,1,528,1,528,
        1,528,1,528,5,528,8284,8,528,10,528,12,528,8287,9,528,3,528,8289,
        8,528,1,529,1,529,1,529,4,529,8294,8,529,11,529,12,529,8295,1,530,
        1,530,1,530,3,530,8301,8,530,1,530,1,530,1,530,1,530,1,530,1,530,
        1,530,1,530,1,530,1,530,1,530,1,530,1,530,1,530,1,530,1,530,1,530,
        1,530,1,530,3,530,8322,8,530,1,530,1,530,1,530,1,530,1,530,1,530,
        1,530,3,530,8331,8,530,1,530,1,530,1,530,3,530,8336,8,530,1,530,
        1,530,1,530,1,530,3,530,8342,8,530,1,530,1,530,1,530,3,530,8347,
        8,530,1,530,1,530,1,530,1,530,1,530,3,530,8354,8,530,1,530,1,530,
        1,530,3,530,8359,8,530,1,530,1,530,1,530,1,530,5,530,8365,8,530,
        10,530,12,530,8368,9,530,1,531,3,531,8371,8,531,1,531,1,531,1,531,
        1,531,1,531,3,531,8378,8,531,1,532,1,532,3,532,8382,8,532,1,533,
        3,533,8385,8,533,1,533,1,533,1,533,1,533,1,533,3,533,8392,8,533,
        1,534,1,534,1,534,3,534,8397,8,534,1,534,3,534,8400,8,534,1,534,
        1,534,1,534,1,534,1,534,3,534,8407,8,534,1,535,1,535,3,535,8411,
        8,535,1,536,1,536,1,536,1,536,1,536,1,536,1,536,3,536,8420,8,536,
        1,537,1,537,3,537,8424,8,537,1,537,1,537,1,537,1,537,1,537,1,537,
        3,537,8432,8,537,3,537,8434,8,537,1,538,1,538,1,538,5,538,8439,8,
        538,10,538,12,538,8442,9,538,1,539,1,539,3,539,8446,8,539,1,539,
        3,539,8449,8,539,1,540,1,540,1,540,1,540,1,540,1,540,1,540,1,541,
        1,541,1,541,1,541,1,541,1,541,3,541,8464,8,541,1,542,1,542,1,542,
        1,542,1,542,1,542,1,542,1,542,1,542,1,542,3,542,8476,8,542,1,543,
        1,543,1,543,1,544,1,544,1,544,5,544,8484,8,544,10,544,12,544,8487,
        9,544,1,545,1,545,1,545,1,545,1,545,1,545,3,545,8495,8,545,1,546,
        1,546,1,546,3,546,8500,8,546,1,547,1,547,1,547,3,547,8505,8,547,
        1,548,1,548,1,548,1,548,1,548,3,548,8512,8,548,1,548,3,548,8515,
        8,548,1,549,1,549,3,549,8519,8,549,1,550,1,550,1,550,5,550,8524,
        8,550,10,550,12,550,8527,9,550,1,551,1,551,1,551,1,551,1,552,1,552,
        1,552,1,552,1,552,1,552,1,552,1,552,1,552,1,552,1,552,1,552,1,552,
        1,552,1,552,1,552,1,552,3,552,8550,8,552,1,552,1,552,1,553,1,553,
        1,553,5,553,8557,8,553,10,553,12,553,8560,9,553,1,554,1,554,1,554,
        3,554,8565,8,554,1,554,1,554,3,554,8569,8,554,1,555,4,555,8572,8,
        555,11,555,12,555,8573,1,556,1,556,1,556,1,556,1,556,1,556,1,556,
        1,556,3,556,8584,8,556,1,557,1,557,1,557,5,557,8589,8,557,10,557,
        12,557,8592,9,557,1,558,1,558,1,558,1,558,1,558,1,558,3,558,8600,
        8,558,1,559,3,559,8603,8,559,1,559,1,559,1,559,1,559,1,559,1,559,
        1,559,3,559,8612,8,559,3,559,8614,8,559,1,559,1,559,1,559,1,559,
        3,559,8620,8,559,1,560,1,560,3,560,8624,8,560,1,560,5,560,8627,8,
        560,10,560,12,560,8630,9,560,1,561,1,561,1,561,1,561,1,561,1,561,
        1,561,1,561,1,561,1,561,1,561,3,561,8643,8,561,3,561,8645,8,561,
        1,562,1,562,1,562,1,562,3,562,8651,8,562,1,563,1,563,1,563,1,563,
        3,563,8657,8,563,1,563,3,563,8660,8,563,1,563,1,563,1,564,1,564,
        1,564,1,564,1,564,3,564,8669,8,564,1,565,1,565,1,565,1,565,1,565,
        1,565,1,565,1,565,1,565,1,565,1,565,1,565,1,565,1,565,1,565,1,565,
        3,565,8687,8,565,1,566,1,566,1,566,1,566,1,566,3,566,8694,8,566,
        1,567,1,567,3,567,8698,8,567,1,568,1,568,3,568,8702,8,568,1,569,
        1,569,1,569,1,569,1,569,1,569,1,570,1,570,1,570,1,571,1,571,1,571,
        1,571,1,571,3,571,8718,8,571,1,572,1,572,1,572,1,572,1,572,3,572,
        8725,8,572,1,573,1,573,1,573,1,573,1,573,1,573,3,573,8733,8,573,
        1,574,1,574,3,574,8737,8,574,1,575,1,575,1,575,1,575,1,575,3,575,
        8744,8,575,1,575,1,575,1,576,1,576,1,577,1,577,1,577,1,577,1,577,
        1,577,1,577,3,577,8757,8,577,1,578,1,578,1,578,1,578,1,578,1,578,
        1,578,1,578,1,578,1,578,1,578,1,578,1,578,1,578,3,578,8773,8,578,
        1,578,1,578,1,578,1,578,3,578,8779,8,578,1,578,1,578,1,578,1,578,
        3,578,8785,8,578,1,579,1,579,1,579,1,579,1,579,3,579,8792,8,579,
        1,580,1,580,1,580,3,580,8797,8,580,1,581,1,581,1,582,1,582,3,582,
        8803,8,582,1,583,1,583,1,583,5,583,8808,8,583,10,583,12,583,8811,
        9,583,1,584,1,584,1,584,5,584,8816,8,584,10,584,12,584,8819,9,584,
        1,585,1,585,1,585,5,585,8824,8,585,10,585,12,585,8827,9,585,1,586,
        1,586,3,586,8831,8,586,1,586,1,586,3,586,8835,8,586,1,586,1,586,
        1,586,1,586,3,586,8841,8,586,1,587,1,587,3,587,8845,8,587,1,587,
        1,587,3,587,8849,8,587,1,588,3,588,8852,8,588,1,588,1,588,1,589,
        1,589,3,589,8858,8,589,1,590,1,590,1,590,3,590,8863,8,590,1,590,
        1,590,1,590,1,590,1,590,1,590,1,590,1,590,1,590,1,590,1,590,1,590,
        1,590,1,590,3,590,8879,8,590,1,590,3,590,8882,8,590,3,590,8884,8,
        590,1,591,1,591,1,591,1,591,1,591,1,591,1,591,1,591,1,591,1,591,
        3,591,8896,8,591,3,591,8898,8,591,1,592,1,592,3,592,8902,8,592,1,
        592,1,592,1,592,1,592,3,592,8908,8,592,1,592,1,592,1,592,3,592,8913,
        8,592,1,593,1,593,1,593,1,593,5,593,8919,8,593,10,593,12,593,8922,
        9,593,1,594,3,594,8925,8,594,1,594,1,594,1,595,1,595,1,595,5,595,
        8932,8,595,10,595,12,595,8935,9,595,1,596,1,596,1,596,5,596,8940,
        8,596,10,596,12,596,8943,9,596,1,597,1,597,1,597,3,597,8948,8,597,
        1,598,3,598,8951,8,598,1,598,1,598,1,599,1,599,1,599,1,599,1,599,
        3,599,8960,8,599,1,600,1,600,1,600,3,600,8965,8,600,1,601,1,601,
        1,601,5,601,8970,8,601,10,601,12,601,8973,9,601,1,602,1,602,1,602,
        1,602,1,602,1,602,1,602,3,602,8982,8,602,1,602,1,602,1,602,1,602,
        1,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,
        1,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,3,602,9008,
        8,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,1,602,3,602,
        9019,8,602,5,602,9021,8,602,10,602,12,602,9024,9,602,1,603,1,603,
        1,603,1,603,1,603,3,603,9031,8,603,1,603,1,603,1,603,1,603,1,603,
        1,603,1,603,1,603,1,603,1,603,1,603,1,603,1,603,1,603,1,603,1,603,
        1,603,1,603,1,603,1,603,1,603,3,603,9054,8,603,1,603,1,603,1,603,
        1,603,1,603,1,603,3,603,9062,8,603,1,604,1,604,1,605,1,605,1,605,
        1,605,1,605,1,605,3,605,9072,8,605,1,605,1,605,1,605,1,605,1,605,
        1,605,1,605,1,605,1,605,1,605,1,605,1,605,3,605,9086,8,605,1,605,
        1,605,1,606,1,606,1,606,1,606,1,606,1,606,3,606,9096,8,606,1,607,
        1,607,3,607,9100,8,607,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,1,608,3,608,9114,8,608,1,608,1,608,1,608,
        1,608,1,608,3,608,9121,8,608,1,608,1,608,1,608,1,608,1,608,3,608,
        9128,8,608,1,608,1,608,1,608,1,608,1,608,3,608,9135,8,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        3,608,9160,8,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,3,608,9189,8,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,3,608,9228,8,608,3,608,9230,8,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,3,608,9258,8,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,1,608,
        1,608,1,608,1,608,3,608,9279,8,608,1,609,1,609,1,609,1,609,1,609,
        3,609,9286,8,609,1,610,1,610,1,610,1,610,1,610,1,610,1,610,1,610,
        1,610,1,610,1,610,3,610,9299,8,610,1,611,1,611,1,611,1,611,1,611,
        1,612,1,612,1,612,5,612,9309,8,612,10,612,12,612,9312,9,612,1,613,
        1,613,1,613,3,613,9317,8,613,1,614,1,614,1,615,1,615,1,615,1,615,
        1,615,3,615,9326,8,615,1,616,1,616,1,616,1,616,1,616,1,616,1,616,
        1,616,1,616,1,616,1,616,1,616,1,616,1,616,1,616,3,616,9343,8,616,
        1,617,1,617,1,617,1,618,1,618,1,618,1,618,1,618,1,618,1,618,3,618,
        9355,8,618,1,619,1,619,1,619,1,619,1,619,1,619,1,619,3,619,9364,
        8,619,1,620,1,620,1,620,3,620,9369,8,620,1,621,1,621,1,621,5,621,
        9374,8,621,10,621,12,621,9377,9,621,1,622,1,622,1,622,1,622,1,623,
        1,623,1,623,3,623,9386,8,623,1,623,3,623,9389,8,623,1,624,1,624,
        1,624,1,624,1,624,1,624,1,624,1,625,1,625,3,625,9400,8,625,1,626,
        1,626,1,626,1,626,3,626,9406,8,626,1,627,1,627,1,627,1,627,1,627,
        1,627,1,627,1,627,1,627,1,627,1,627,1,627,1,627,3,627,9421,8,627,
        1,628,1,628,1,628,1,628,1,628,1,628,3,628,9429,8,628,1,629,1,629,
        1,629,1,629,1,629,1,629,1,629,3,629,9438,8,629,1,630,1,630,1,630,
        1,630,1,630,1,630,1,630,3,630,9447,8,630,1,630,3,630,9450,8,630,
        1,631,1,631,1,631,3,631,9455,8,631,1,631,1,631,1,631,1,631,1,631,
        1,631,1,631,3,631,9464,8,631,1,632,1,632,1,632,3,632,9469,8,632,
        1,632,1,632,1,633,1,633,1,633,1,633,1,633,1,633,1,634,1,634,1,635,
        1,635,3,635,9483,8,635,1,636,1,636,1,637,1,637,1,637,1,637,1,637,
        1,637,3,637,9493,8,637,1,638,1,638,1,638,1,638,1,638,1,638,3,638,
        9501,8,638,1,639,1,639,1,639,1,639,1,639,1,639,1,639,1,639,1,639,
        1,639,1,639,1,639,3,639,9515,8,639,1,640,1,640,1,640,5,640,9520,
        8,640,10,640,12,640,9523,9,640,1,641,1,641,1,641,5,641,9528,8,641,
        10,641,12,641,9531,9,641,1,642,1,642,1,642,1,642,1,642,3,642,9538,
        8,642,1,643,1,643,1,643,5,643,9543,8,643,10,643,12,643,9546,9,643,
        1,644,1,644,1,644,3,644,9551,8,644,1,644,1,644,1,645,1,645,1,645,
        5,645,9558,8,645,10,645,12,645,9561,9,645,1,646,1,646,1,646,1,646,
        1,646,3,646,9568,8,646,1,647,1,647,1,647,1,647,1,647,1,647,1,647,
        1,647,3,647,9578,8,647,1,648,1,648,1,649,1,649,1,649,1,649,1,649,
        1,649,1,649,3,649,9589,8,649,1,650,1,650,1,650,1,650,1,650,3,650,
        9596,8,650,1,651,1,651,1,651,1,651,1,651,1,651,1,651,1,651,1,651,
        1,651,1,651,1,651,1,651,1,651,1,651,1,651,1,651,1,651,1,651,1,651,
        1,651,1,651,1,651,1,651,1,651,1,651,1,651,3,651,9625,8,651,1,652,
        1,652,1,652,1,652,1,652,1,652,1,652,3,652,9634,8,652,1,653,1,653,
        1,653,1,653,1,653,3,653,9641,8,653,1,654,1,654,1,654,1,654,1,654,
        1,654,1,655,4,655,9650,8,655,11,655,12,655,9651,1,656,1,656,1,656,
        1,656,1,656,1,657,1,657,1,657,3,657,9662,8,657,1,658,1,658,3,658,
        9666,8,658,1,659,1,659,3,659,9670,8,659,1,660,1,660,1,660,3,660,
        9675,8,660,1,660,1,660,1,660,1,660,1,660,1,660,3,660,9683,8,660,
        1,660,1,660,3,660,9687,8,660,1,661,1,661,3,661,9691,8,661,1,662,
        4,662,9694,8,662,11,662,12,662,9695,1,663,5,663,9699,8,663,10,663,
        12,663,9702,9,663,1,664,1,664,3,664,9706,8,664,1,665,1,665,1,665,
        5,665,9711,8,665,10,665,12,665,9714,9,665,1,666,1,666,1,666,1,666,
        1,666,3,666,9721,8,666,1,666,3,666,9724,8,666,1,667,1,667,1,667,
        5,667,9729,8,667,10,667,12,667,9732,9,667,1,668,1,668,3,668,9736,
        8,668,1,669,1,669,1,669,5,669,9741,8,669,10,669,12,669,9744,9,669,
        1,670,1,670,1,671,1,671,1,672,1,672,1,673,1,673,1,673,1,673,1,673,
        1,673,1,673,3,673,9759,8,673,1,674,1,674,1,674,1,674,1,674,1,674,
        1,674,1,674,1,674,1,674,1,674,1,674,1,674,3,674,9774,8,674,1,674,
        1,674,1,674,1,674,1,674,1,674,1,674,1,674,1,674,1,674,1,674,1,674,
        3,674,9788,8,674,1,674,1,674,1,674,3,674,9793,8,674,1,675,1,675,
        1,676,1,676,1,677,1,677,1,678,1,678,1,679,1,679,1,679,1,680,1,680,
        1,680,1,680,5,680,9810,8,680,10,680,12,680,9813,9,680,1,680,1,680,
        3,680,9817,8,680,1,681,1,681,1,681,3,681,9822,8,681,1,682,1,682,
        1,682,1,682,1,682,3,682,9829,8,682,1,683,1,683,1,684,1,684,1,684,
        3,684,9836,8,684,1,685,1,685,1,685,5,685,9841,8,685,10,685,12,685,
        9844,9,685,1,686,1,686,1,686,1,686,1,686,1,686,3,686,9852,8,686,
        1,687,1,687,1,687,1,687,3,687,9858,8,687,1,688,1,688,1,688,1,688,
        3,688,9864,8,688,1,689,1,689,1,689,1,689,3,689,9870,8,689,1,690,
        1,690,1,690,1,690,1,690,1,690,3,690,9878,8,690,1,691,1,691,1,691,
        1,691,1,691,1,691,1,691,3,691,9887,8,691,1,692,1,692,1,693,1,693,
        1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,
        1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,
        1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,
        1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,
        1,694,1,694,1,694,1,694,1,694,1,694,1,694,1,694,3,694,9945,8,694,
        1,695,1,695,1,696,1,696,1,697,1,697,1,698,1,698,1,698,1,698,1,699,
        5,699,9958,8,699,10,699,12,699,9961,9,699,1,700,1,700,1,700,1,700,
        1,700,1,700,1,700,1,700,1,700,1,700,1,700,1,700,1,700,1,700,1,700,
        1,700,1,700,1,700,1,700,1,700,3,700,9983,8,700,1,701,1,701,1,702,
        1,702,1,702,1,702,3,702,9991,8,702,1,703,1,703,3,703,9995,8,703,
        1,704,1,704,1,704,1,704,1,704,1,704,1,704,1,705,1,705,1,705,3,705,
        10007,8,705,3,705,10009,8,705,1,706,1,706,1,707,4,707,10014,8,707,
        11,707,12,707,10015,1,708,1,708,1,708,1,708,1,709,1,709,1,709,3,
        709,10025,8,709,1,710,1,710,1,710,1,710,1,710,1,710,1,710,1,710,
        1,710,1,710,1,710,1,710,1,710,1,710,1,710,1,710,3,710,10043,8,710,
        1,710,1,710,1,711,1,711,1,711,1,711,3,711,10051,8,711,1,712,1,712,
        1,713,1,713,1,713,1,713,1,713,3,713,10060,8,713,1,714,1,714,1,714,
        5,714,10065,8,714,10,714,12,714,10068,9,714,1,715,1,715,1,715,1,
        716,1,716,1,717,1,717,3,717,10077,8,717,1,718,1,718,1,719,1,719,
        3,719,10083,8,719,1,720,1,720,1,721,1,721,1,721,3,721,10090,8,721,
        1,722,1,722,1,722,3,722,10095,8,722,1,723,1,723,1,723,1,723,3,723,
        10101,8,723,1,724,1,724,3,724,10105,8,724,1,725,1,725,1,726,5,726,
        10110,8,726,10,726,12,726,10113,9,726,1,727,1,727,1,727,1,727,1,
        727,1,727,1,727,1,727,1,727,1,727,1,727,1,727,1,727,1,727,1,727,
        1,727,1,727,1,727,1,727,1,727,1,727,1,727,1,727,1,727,1,727,1,727,
        1,727,3,727,10142,8,727,1,728,1,728,1,728,1,728,1,729,1,729,1,729,
        1,729,1,729,1,729,1,729,1,729,1,729,1,729,1,729,1,729,1,729,1,729,
        3,729,10162,8,729,1,730,1,730,3,730,10166,8,730,1,731,1,731,1,731,
        1,731,1,731,1,732,1,732,1,732,1,732,1,732,1,732,1,733,1,733,1,733,
        3,733,10182,8,733,1,734,1,734,1,734,5,734,10187,8,734,10,734,12,
        734,10190,9,734,1,735,1,735,1,735,1,735,1,736,1,736,1,737,1,737,
        1,738,1,738,3,738,10202,8,738,1,738,1,738,1,738,1,738,5,738,10208,
        8,738,10,738,12,738,10211,9,738,1,739,1,739,1,739,1,739,1,739,1,
        739,1,739,1,739,1,739,1,739,1,740,1,740,1,740,1,740,1,740,5,740,
        10228,8,740,10,740,12,740,10231,9,740,1,741,1,741,1,741,3,741,10236,
        8,741,1,742,1,742,1,742,1,742,1,742,1,742,1,742,1,742,1,743,1,743,
        3,743,10248,8,743,1,744,4,744,10251,8,744,11,744,12,744,10252,1,
        745,1,745,1,745,1,745,1,745,1,746,1,746,1,746,3,746,10263,8,746,
        1,747,1,747,1,747,1,748,1,748,1,748,1,748,1,748,1,749,1,749,1,749,
        1,749,1,749,1,750,1,750,1,750,1,750,1,750,1,750,1,750,1,750,1,750,
        1,750,1,750,1,750,1,750,1,750,1,750,1,750,1,750,3,750,10295,8,750,
        1,751,1,751,1,751,3,751,10300,8,751,1,752,1,752,1,752,1,752,1,752,
        5,752,10307,8,752,10,752,12,752,10310,9,752,1,752,1,752,3,752,10314,
        8,752,1,753,1,753,3,753,10318,8,753,1,754,1,754,1,754,3,754,10323,
        8,754,1,755,1,755,1,756,1,756,1,756,1,756,1,756,1,756,1,756,1,756,
        1,756,1,757,1,757,1,757,3,757,10339,8,757,1,758,1,758,1,758,1,758,
        1,758,1,759,1,759,1,760,1,760,1,760,1,760,1,760,1,760,1,760,1,760,
        1,760,3,760,10357,8,760,1,760,3,760,10360,8,760,1,760,1,760,1,761,
        1,761,3,761,10366,8,761,1,762,1,762,1,762,1,762,1,762,1,762,1,762,
        1,762,1,762,1,762,1,762,1,762,1,762,1,762,1,762,1,762,1,762,1,762,
        1,762,1,762,1,762,1,762,1,762,1,762,1,762,1,762,3,762,10394,8,762,
        1,763,1,763,1,763,1,763,1,763,1,763,1,763,1,763,3,763,10404,8,763,
        1,764,1,764,1,764,4,764,10409,8,764,11,764,12,764,10410,3,764,10413,
        8,764,1,765,1,765,1,765,3,765,10418,8,765,1,766,1,766,1,766,1,766,
        1,767,1,767,1,767,5,767,10427,8,767,10,767,12,767,10430,9,767,1,
        768,1,768,1,768,1,768,1,768,1,769,1,769,1,769,3,769,10440,8,769,
        1,770,1,770,1,770,1,770,1,770,1,770,1,770,1,771,1,771,1,771,1,772,
        1,772,1,772,1,772,1,772,1,772,1,772,1,772,1,772,3,772,10461,8,772,
        1,772,1,772,1,773,1,773,1,773,3,773,10468,8,773,1,774,1,774,1,774,
        5,774,10473,8,774,10,774,12,774,10476,9,774,1,775,1,775,1,775,3,
        775,10481,8,775,1,775,3,775,10484,8,775,1,776,1,776,1,776,1,776,
        1,776,1,776,1,776,1,776,1,776,3,776,10495,8,776,1,776,1,776,1,776,
        1,776,1,776,3,776,10502,8,776,3,776,10504,8,776,1,776,1,776,1,777,
        1,777,1,777,1,777,1,777,3,777,10513,8,777,1,778,1,778,1,778,5,778,
        10518,8,778,10,778,12,778,10521,9,778,1,779,1,779,1,779,3,779,10526,
        8,779,1,780,1,780,1,780,1,780,3,780,10532,8,780,1,781,1,781,3,781,
        10536,8,781,1,782,1,782,1,782,1,782,1,782,1,782,1,782,1,782,1,783,
        1,783,1,784,1,784,1,784,3,784,10551,8,784,1,785,1,785,1,785,1,785,
        1,785,1,785,1,785,1,785,1,785,1,785,1,785,1,785,1,785,1,785,1,785,
        3,785,10568,8,785,3,785,10570,8,785,1,786,1,786,1,786,1,786,1,786,
        1,787,1,787,1,787,1,787,1,788,1,788,1,788,1,789,1,789,1,789,1,789,
        1,790,1,790,1,790,1,790,1,791,1,791,3,791,10594,8,791,1,791,1,791,
        3,791,10598,8,791,1,792,1,792,1,792,1,792,1,792,1,792,1,792,1,792,
        1,792,3,792,10609,8,792,1,792,3,792,10612,8,792,1,793,1,793,3,793,
        10616,8,793,1,794,1,794,1,794,3,794,10621,8,794,1,795,4,795,10624,
        8,795,11,795,12,795,10625,1,796,1,796,1,796,1,796,1,796,1,797,1,
        797,1,797,5,797,10636,8,797,10,797,12,797,10639,9,797,1,798,1,798,
        1,798,3,798,10644,8,798,1,799,1,799,3,799,10648,8,799,1,800,1,800,
        3,800,10652,8,800,1,801,1,801,3,801,10656,8,801,1,802,1,802,1,802,
        3,802,10661,8,802,1,803,1,803,3,803,10665,8,803,1,804,1,804,1,805,
        1,805,1,805,1,805,1,805,1,805,1,805,1,805,1,806,1,806,1,807,1,807,
        1,808,1,808,1,809,1,809,1,810,1,810,1,810,1,811,1,811,1,811,1,811,
        1,811,3,811,10693,8,811,1,811,0,1,1204,812,0,2,4,6,8,10,12,14,16,
        18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,
        62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,
        104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,
        136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,
        168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,
        200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,
        232,234,236,238,240,242,244,246,248,250,252,254,256,258,260,262,
        264,266,268,270,272,274,276,278,280,282,284,286,288,290,292,294,
        296,298,300,302,304,306,308,310,312,314,316,318,320,322,324,326,
        328,330,332,334,336,338,340,342,344,346,348,350,352,354,356,358,
        360,362,364,366,368,370,372,374,376,378,380,382,384,386,388,390,
        392,394,396,398,400,402,404,406,408,410,412,414,416,418,420,422,
        424,426,428,430,432,434,436,438,440,442,444,446,448,450,452,454,
        456,458,460,462,464,466,468,470,472,474,476,478,480,482,484,486,
        488,490,492,494,496,498,500,502,504,506,508,510,512,514,516,518,
        520,522,524,526,528,530,532,534,536,538,540,542,544,546,548,550,
        552,554,556,558,560,562,564,566,568,570,572,574,576,578,580,582,
        584,586,588,590,592,594,596,598,600,602,604,606,608,610,612,614,
        616,618,620,622,624,626,628,630,632,634,636,638,640,642,644,646,
        648,650,652,654,656,658,660,662,664,666,668,670,672,674,676,678,
        680,682,684,686,688,690,692,694,696,698,700,702,704,706,708,710,
        712,714,716,718,720,722,724,726,728,730,732,734,736,738,740,742,
        744,746,748,750,752,754,756,758,760,762,764,766,768,770,772,774,
        776,778,780,782,784,786,788,790,792,794,796,798,800,802,804,806,
        808,810,812,814,816,818,820,822,824,826,828,830,832,834,836,838,
        840,842,844,846,848,850,852,854,856,858,860,862,864,866,868,870,
        872,874,876,878,880,882,884,886,888,890,892,894,896,898,900,902,
        904,906,908,910,912,914,916,918,920,922,924,926,928,930,932,934,
        936,938,940,942,944,946,948,950,952,954,956,958,960,962,964,966,
        968,970,972,974,976,978,980,982,984,986,988,990,992,994,996,998,
        1000,1002,1004,1006,1008,1010,1012,1014,1016,1018,1020,1022,1024,
        1026,1028,1030,1032,1034,1036,1038,1040,1042,1044,1046,1048,1050,
        1052,1054,1056,1058,1060,1062,1064,1066,1068,1070,1072,1074,1076,
        1078,1080,1082,1084,1086,1088,1090,1092,1094,1096,1098,1100,1102,
        1104,1106,1108,1110,1112,1114,1116,1118,1120,1122,1124,1126,1128,
        1130,1132,1134,1136,1138,1140,1142,1144,1146,1148,1150,1152,1154,
        1156,1158,1160,1162,1164,1166,1168,1170,1172,1174,1176,1178,1180,
        1182,1184,1186,1188,1190,1192,1194,1196,1198,1200,1202,1204,1206,
        1208,1210,1212,1214,1216,1218,1220,1222,1224,1226,1228,1230,1232,
        1234,1236,1238,1240,1242,1244,1246,1248,1250,1252,1254,1256,1258,
        1260,1262,1264,1266,1268,1270,1272,1274,1276,1278,1280,1282,1284,
        1286,1288,1290,1292,1294,1296,1298,1300,1302,1304,1306,1308,1310,
        1312,1314,1316,1318,1320,1322,1324,1326,1328,1330,1332,1334,1336,
        1338,1340,1342,1344,1346,1348,1350,1352,1354,1356,1358,1360,1362,
        1364,1366,1368,1370,1372,1374,1376,1378,1380,1382,1384,1386,1388,
        1390,1392,1394,1396,1398,1400,1402,1404,1406,1408,1410,1412,1414,
        1416,1418,1420,1422,1424,1426,1428,1430,1432,1434,1436,1438,1440,
        1442,1444,1446,1448,1450,1452,1454,1456,1458,1460,1462,1464,1466,
        1468,1470,1472,1474,1476,1478,1480,1482,1484,1486,1488,1490,1492,
        1494,1496,1498,1500,1502,1504,1506,1508,1510,1512,1514,1516,1518,
        1520,1522,1524,1526,1528,1530,1532,1534,1536,1538,1540,1542,1544,
        1546,1548,1550,1552,1554,1556,1558,1560,1562,1564,1566,1568,1570,
        1572,1574,1576,1578,1580,1582,1584,1586,1588,1590,1592,1594,1596,
        1598,1600,1602,1604,1606,1608,1610,1612,1614,1616,1618,1620,1622,
        0,69,2,0,195,195,357,357,2,0,66,66,311,311,2,0,99,99,311,311,3,0,
        66,66,99,99,311,311,2,0,133,133,191,191,2,0,245,245,325,325,2,0,
        10,10,94,94,2,0,162,162,356,356,2,0,180,180,221,221,5,0,30,30,281,
        281,322,322,345,345,347,347,2,0,64,64,94,94,2,0,345,345,347,347,
        2,0,200,200,224,224,9,0,30,30,160,160,165,165,179,179,219,219,227,
        227,335,335,338,338,438,438,3,0,113,113,277,277,329,329,2,0,53,53,
        78,78,3,0,173,173,252,252,255,255,5,0,30,30,88,88,182,182,232,232,
        362,362,2,0,92,92,226,226,1,0,448,449,2,0,92,92,407,407,2,0,334,
        334,407,407,2,0,211,211,289,289,3,0,314,314,350,350,445,445,2,0,
        64,64,68,68,5,0,212,212,322,322,343,343,354,354,455,456,2,0,10,10,
        53,53,3,0,211,211,289,289,442,442,5,0,92,92,175,175,226,226,316,
        316,342,342,3,0,175,175,316,316,342,342,3,0,109,109,128,128,344,
        344,4,0,88,88,182,182,232,232,362,362,2,0,151,151,245,245,2,0,306,
        306,326,326,1,0,31,32,2,0,99,99,342,342,2,0,201,201,327,327,2,0,
        59,59,97,97,2,0,213,213,245,245,2,0,313,313,407,407,2,0,207,207,
        261,261,4,0,113,113,115,115,119,119,126,126,2,0,353,353,477,477,
        2,0,384,385,399,399,1,0,384,385,1,0,411,412,1,0,18,19,2,0,117,117,
        122,122,5,0,10,10,16,17,21,21,23,23,25,25,1,0,12,13,3,0,9,9,14,14,
        27,27,2,0,30,30,56,56,3,0,39,39,73,73,95,95,2,0,166,166,188,188,
        2,0,297,297,450,450,2,0,208,208,282,282,3,0,30,30,34,34,90,90,6,
        0,9,10,12,17,21,21,23,23,25,25,27,27,2,0,20,20,22,22,1,0,483,486,
        11,0,124,124,129,249,251,252,254,303,305,379,433,452,455,469,471,
        471,473,473,475,475,478,488,5,0,106,118,120,123,125,125,127,128,
        472,472,4,0,30,52,54,70,72,105,454,454,5,0,304,304,418,424,504,504,
        513,513,521,635,2,0,62,62,116,116,2,0,10,10,20,20,2,0,167,167,507,
        507,2,0,144,144,210,210,36,0,33,33,35,35,43,45,53,53,57,57,61,61,
        92,92,116,116,123,123,130,130,144,144,153,153,157,157,161,161,167,
        167,172,172,207,207,210,210,232,232,240,240,258,258,261,262,272,
        272,286,286,300,300,306,306,312,312,316,317,326,326,353,353,433,
        434,477,477,490,502,506,512,514,518,520,520,11556,0,1624,1,0,0,0,
        2,1627,1,0,0,0,4,1629,1,0,0,0,6,1637,1,0,0,0,8,1765,1,0,0,0,10,1767,
        1,0,0,0,12,1771,1,0,0,0,14,1774,1,0,0,0,16,1782,1,0,0,0,18,1787,
        1,0,0,0,20,1793,1,0,0,0,22,1814,1,0,0,0,24,1826,1,0,0,0,26,1828,
        1,0,0,0,28,1834,1,0,0,0,30,1844,1,0,0,0,32,1846,1,0,0,0,34,1855,
        1,0,0,0,36,1863,1,0,0,0,38,1869,1,0,0,0,40,1876,1,0,0,0,42,1878,
        1,0,0,0,44,1896,1,0,0,0,46,1901,1,0,0,0,48,1910,1,0,0,0,50,1912,
        1,0,0,0,52,1926,1,0,0,0,54,1928,1,0,0,0,56,1957,1,0,0,0,58,1959,
        1,0,0,0,60,1967,1,0,0,0,62,1977,1,0,0,0,64,1984,1,0,0,0,66,1990,
        1,0,0,0,68,2007,1,0,0,0,70,2012,1,0,0,0,72,2016,1,0,0,0,74,2018,
        1,0,0,0,76,2029,1,0,0,0,78,2033,1,0,0,0,80,2038,1,0,0,0,82,2043,
        1,0,0,0,84,2045,1,0,0,0,86,2057,1,0,0,0,88,2064,1,0,0,0,90,2066,
        1,0,0,0,92,2068,1,0,0,0,94,2070,1,0,0,0,96,2182,1,0,0,0,98,2184,
        1,0,0,0,100,2200,1,0,0,0,102,2202,1,0,0,0,104,2458,1,0,0,0,106,2465,
        1,0,0,0,108,2470,1,0,0,0,110,2475,1,0,0,0,112,2480,1,0,0,0,114,2488,
        1,0,0,0,116,2490,1,0,0,0,118,2497,1,0,0,0,120,2499,1,0,0,0,122,2507,
        1,0,0,0,124,2519,1,0,0,0,126,2535,1,0,0,0,128,2563,1,0,0,0,130,2565,
        1,0,0,0,132,2568,1,0,0,0,134,2576,1,0,0,0,136,2581,1,0,0,0,138,2612,
        1,0,0,0,140,2614,1,0,0,0,142,2641,1,0,0,0,144,2643,1,0,0,0,146,2647,
        1,0,0,0,148,2652,1,0,0,0,150,2659,1,0,0,0,152,2664,1,0,0,0,154,2702,
        1,0,0,0,156,2706,1,0,0,0,158,2713,1,0,0,0,160,2717,1,0,0,0,162,2719,
        1,0,0,0,164,2727,1,0,0,0,166,2738,1,0,0,0,168,2740,1,0,0,0,170,2748,
        1,0,0,0,172,2750,1,0,0,0,174,2799,1,0,0,0,176,2803,1,0,0,0,178,2810,
        1,0,0,0,180,2812,1,0,0,0,182,2820,1,0,0,0,184,2831,1,0,0,0,186,2835,
        1,0,0,0,188,2837,1,0,0,0,190,2842,1,0,0,0,192,2852,1,0,0,0,194,2863,
        1,0,0,0,196,2903,1,0,0,0,198,2908,1,0,0,0,200,2915,1,0,0,0,202,2917,
        1,0,0,0,204,2925,1,0,0,0,206,2928,1,0,0,0,208,2935,1,0,0,0,210,2995,
        1,0,0,0,212,3000,1,0,0,0,214,3007,1,0,0,0,216,3009,1,0,0,0,218,3017,
        1,0,0,0,220,3025,1,0,0,0,222,3030,1,0,0,0,224,3032,1,0,0,0,226,3040,
        1,0,0,0,228,3056,1,0,0,0,230,3067,1,0,0,0,232,3069,1,0,0,0,234,3073,
        1,0,0,0,236,3083,1,0,0,0,238,3091,1,0,0,0,240,3095,1,0,0,0,242,3097,
        1,0,0,0,244,3104,1,0,0,0,246,3126,1,0,0,0,248,3131,1,0,0,0,250,3138,
        1,0,0,0,252,3150,1,0,0,0,254,3155,1,0,0,0,256,3162,1,0,0,0,258,3164,
        1,0,0,0,260,3168,1,0,0,0,262,3182,1,0,0,0,264,3193,1,0,0,0,266,3206,
        1,0,0,0,268,3220,1,0,0,0,270,3222,1,0,0,0,272,3236,1,0,0,0,274,3244,
        1,0,0,0,276,3246,1,0,0,0,278,3253,1,0,0,0,280,3264,1,0,0,0,282,3275,
        1,0,0,0,284,3282,1,0,0,0,286,3285,1,0,0,0,288,3319,1,0,0,0,290,3323,
        1,0,0,0,292,3331,1,0,0,0,294,3333,1,0,0,0,296,3341,1,0,0,0,298,3356,
        1,0,0,0,300,3358,1,0,0,0,302,3365,1,0,0,0,304,3371,1,0,0,0,306,3375,
        1,0,0,0,308,3379,1,0,0,0,310,3381,1,0,0,0,312,3392,1,0,0,0,314,3394,
        1,0,0,0,316,3402,1,0,0,0,318,3416,1,0,0,0,320,3426,1,0,0,0,322,3428,
        1,0,0,0,324,3437,1,0,0,0,326,3440,1,0,0,0,328,3547,1,0,0,0,330,3549,
        1,0,0,0,332,3565,1,0,0,0,334,3568,1,0,0,0,336,3574,1,0,0,0,338,3591,
        1,0,0,0,340,3599,1,0,0,0,342,3601,1,0,0,0,344,3609,1,0,0,0,346,3614,
        1,0,0,0,348,3629,1,0,0,0,350,3631,1,0,0,0,352,3634,1,0,0,0,354,3636,
        1,0,0,0,356,3663,1,0,0,0,358,3668,1,0,0,0,360,3670,1,0,0,0,362,3677,
        1,0,0,0,364,3679,1,0,0,0,366,3745,1,0,0,0,368,3747,1,0,0,0,370,3762,
        1,0,0,0,372,3770,1,0,0,0,374,3793,1,0,0,0,376,3797,1,0,0,0,378,3817,
        1,0,0,0,380,3819,1,0,0,0,382,3828,1,0,0,0,384,3839,1,0,0,0,386,3854,
        1,0,0,0,388,3863,1,0,0,0,390,3868,1,0,0,0,392,3873,1,0,0,0,394,3878,
        1,0,0,0,396,3883,1,0,0,0,398,3885,1,0,0,0,400,3887,1,0,0,0,402,3896,
        1,0,0,0,404,3936,1,0,0,0,406,3942,1,0,0,0,408,3944,1,0,0,0,410,3959,
        1,0,0,0,412,3964,1,0,0,0,414,3967,1,0,0,0,416,3971,1,0,0,0,418,3976,
        1,0,0,0,420,3978,1,0,0,0,422,3980,1,0,0,0,424,3987,1,0,0,0,426,3991,
        1,0,0,0,428,3993,1,0,0,0,430,4001,1,0,0,0,432,4003,1,0,0,0,434,4007,
        1,0,0,0,436,4020,1,0,0,0,438,4025,1,0,0,0,440,4030,1,0,0,0,442,4044,
        1,0,0,0,444,4072,1,0,0,0,446,4074,1,0,0,0,448,4082,1,0,0,0,450,4088,
        1,0,0,0,452,4096,1,0,0,0,454,4108,1,0,0,0,456,4110,1,0,0,0,458,4225,
        1,0,0,0,460,4227,1,0,0,0,462,4231,1,0,0,0,464,4239,1,0,0,0,466,4250,
        1,0,0,0,468,4252,1,0,0,0,470,4256,1,0,0,0,472,4264,1,0,0,0,474,4270,
        1,0,0,0,476,4272,1,0,0,0,478,4317,1,0,0,0,480,4323,1,0,0,0,482,4325,
        1,0,0,0,484,4339,1,0,0,0,486,4372,1,0,0,0,488,4376,1,0,0,0,490,4381,
        1,0,0,0,492,4390,1,0,0,0,494,4394,1,0,0,0,496,4396,1,0,0,0,498,4421,
        1,0,0,0,500,4423,1,0,0,0,502,4443,1,0,0,0,504,4463,1,0,0,0,506,4483,
        1,0,0,0,508,4485,1,0,0,0,510,4491,1,0,0,0,512,4576,1,0,0,0,514,4601,
        1,0,0,0,516,4608,1,0,0,0,518,4624,1,0,0,0,520,4626,1,0,0,0,522,4628,
        1,0,0,0,524,4636,1,0,0,0,526,4642,1,0,0,0,528,4646,1,0,0,0,530,4654,
        1,0,0,0,532,4665,1,0,0,0,534,4814,1,0,0,0,536,4818,1,0,0,0,538,4911,
        1,0,0,0,540,4916,1,0,0,0,542,4920,1,0,0,0,544,4926,1,0,0,0,546,4994,
        1,0,0,0,548,4996,1,0,0,0,550,5000,1,0,0,0,552,5002,1,0,0,0,554,5029,
        1,0,0,0,556,5046,1,0,0,0,558,5048,1,0,0,0,560,5065,1,0,0,0,562,5125,
        1,0,0,0,564,5127,1,0,0,0,566,5138,1,0,0,0,568,5144,1,0,0,0,570,5146,
        1,0,0,0,572,5170,1,0,0,0,574,5176,1,0,0,0,576,5182,1,0,0,0,578,5184,
        1,0,0,0,580,5193,1,0,0,0,582,5205,1,0,0,0,584,5234,1,0,0,0,586,5236,
        1,0,0,0,588,5273,1,0,0,0,590,5277,1,0,0,0,592,5281,1,0,0,0,594,5285,
        1,0,0,0,596,5290,1,0,0,0,598,5292,1,0,0,0,600,5311,1,0,0,0,602,5324,
        1,0,0,0,604,5332,1,0,0,0,606,5334,1,0,0,0,608,5345,1,0,0,0,610,5349,
        1,0,0,0,612,5354,1,0,0,0,614,5361,1,0,0,0,616,5363,1,0,0,0,618,5384,
        1,0,0,0,620,5386,1,0,0,0,622,5392,1,0,0,0,624,5400,1,0,0,0,626,5416,
        1,0,0,0,628,5418,1,0,0,0,630,5424,1,0,0,0,632,5445,1,0,0,0,634,5454,
        1,0,0,0,636,5460,1,0,0,0,638,5462,1,0,0,0,640,5478,1,0,0,0,642,5480,
        1,0,0,0,644,5485,1,0,0,0,646,5487,1,0,0,0,648,5502,1,0,0,0,650,5510,
        1,0,0,0,652,5513,1,0,0,0,654,5522,1,0,0,0,656,5563,1,0,0,0,658,5573,
        1,0,0,0,660,5580,1,0,0,0,662,5582,1,0,0,0,664,5597,1,0,0,0,666,5599,
        1,0,0,0,668,5602,1,0,0,0,670,5610,1,0,0,0,672,5617,1,0,0,0,674,5623,
        1,0,0,0,676,5661,1,0,0,0,678,5675,1,0,0,0,680,5689,1,0,0,0,682,5713,
        1,0,0,0,684,5720,1,0,0,0,686,5725,1,0,0,0,688,5733,1,0,0,0,690,5736,
        1,0,0,0,692,5740,1,0,0,0,694,5747,1,0,0,0,696,5783,1,0,0,0,698,5790,
        1,0,0,0,700,5792,1,0,0,0,702,5805,1,0,0,0,704,5807,1,0,0,0,706,5852,
        1,0,0,0,708,5854,1,0,0,0,710,5889,1,0,0,0,712,5891,1,0,0,0,714,5893,
        1,0,0,0,716,5895,1,0,0,0,718,5903,1,0,0,0,720,5917,1,0,0,0,722,6387,
        1,0,0,0,724,6391,1,0,0,0,726,6396,1,0,0,0,728,6455,1,0,0,0,730,6459,
        1,0,0,0,732,6678,1,0,0,0,734,6680,1,0,0,0,736,6688,1,0,0,0,738,6704,
        1,0,0,0,740,6711,1,0,0,0,742,6713,1,0,0,0,744,6904,1,0,0,0,746,6906,
        1,0,0,0,748,6914,1,0,0,0,750,6922,1,0,0,0,752,6951,1,0,0,0,754,6953,
        1,0,0,0,756,6962,1,0,0,0,758,6970,1,0,0,0,760,7009,1,0,0,0,762,7023,
        1,0,0,0,764,7025,1,0,0,0,766,7045,1,0,0,0,768,7047,1,0,0,0,770,7060,
        1,0,0,0,772,7064,1,0,0,0,774,7066,1,0,0,0,776,7071,1,0,0,0,778,7073,
        1,0,0,0,780,7080,1,0,0,0,782,7082,1,0,0,0,784,7089,1,0,0,0,786,7141,
        1,0,0,0,788,7146,1,0,0,0,790,7158,1,0,0,0,792,7160,1,0,0,0,794,7172,
        1,0,0,0,796,7180,1,0,0,0,798,7182,1,0,0,0,800,7214,1,0,0,0,802,7216,
        1,0,0,0,804,7219,1,0,0,0,806,7227,1,0,0,0,808,7230,1,0,0,0,810,7234,
        1,0,0,0,812,7249,1,0,0,0,814,7253,1,0,0,0,816,7255,1,0,0,0,818,7266,
        1,0,0,0,820,7271,1,0,0,0,822,7285,1,0,0,0,824,7293,1,0,0,0,826,7295,
        1,0,0,0,828,7301,1,0,0,0,830,7306,1,0,0,0,832,7313,1,0,0,0,834,7341,
        1,0,0,0,836,7343,1,0,0,0,838,7422,1,0,0,0,840,7424,1,0,0,0,842,7426,
        1,0,0,0,844,7450,1,0,0,0,846,7455,1,0,0,0,848,7470,1,0,0,0,850,7482,
        1,0,0,0,852,7484,1,0,0,0,854,7492,1,0,0,0,856,7494,1,0,0,0,858,7499,
        1,0,0,0,860,7504,1,0,0,0,862,7508,1,0,0,0,864,7512,1,0,0,0,866,7516,
        1,0,0,0,868,7520,1,0,0,0,870,7527,1,0,0,0,872,7529,1,0,0,0,874,7532,
        1,0,0,0,876,7542,1,0,0,0,878,7560,1,0,0,0,880,7571,1,0,0,0,882,7573,
        1,0,0,0,884,7581,1,0,0,0,886,7586,1,0,0,0,888,7591,1,0,0,0,890,7593,
        1,0,0,0,892,7604,1,0,0,0,894,7610,1,0,0,0,896,7639,1,0,0,0,898,7646,
        1,0,0,0,900,7658,1,0,0,0,902,7660,1,0,0,0,904,7668,1,0,0,0,906,7692,
        1,0,0,0,908,7694,1,0,0,0,910,7696,1,0,0,0,912,7704,1,0,0,0,914,7720,
        1,0,0,0,916,7731,1,0,0,0,918,7736,1,0,0,0,920,7738,1,0,0,0,922,7769,
        1,0,0,0,924,7788,1,0,0,0,926,7801,1,0,0,0,928,7808,1,0,0,0,930,7819,
        1,0,0,0,932,7821,1,0,0,0,934,7832,1,0,0,0,936,7846,1,0,0,0,938,7850,
        1,0,0,0,940,7856,1,0,0,0,942,7858,1,0,0,0,944,7867,1,0,0,0,946,7885,
        1,0,0,0,948,7887,1,0,0,0,950,7890,1,0,0,0,952,7898,1,0,0,0,954,7906,
        1,0,0,0,956,7915,1,0,0,0,958,7923,1,0,0,0,960,7927,1,0,0,0,962,7937,
        1,0,0,0,964,7960,1,0,0,0,966,7962,1,0,0,0,968,7972,1,0,0,0,970,8003,
        1,0,0,0,972,8005,1,0,0,0,974,8011,1,0,0,0,976,8019,1,0,0,0,978,8031,
        1,0,0,0,980,8035,1,0,0,0,982,8045,1,0,0,0,984,8049,1,0,0,0,986,8065,
        1,0,0,0,988,8069,1,0,0,0,990,8074,1,0,0,0,992,8076,1,0,0,0,994,8086,
        1,0,0,0,996,8090,1,0,0,0,998,8092,1,0,0,0,1000,8096,1,0,0,0,1002,
        8104,1,0,0,0,1004,8120,1,0,0,0,1006,8124,1,0,0,0,1008,8149,1,0,0,
        0,1010,8151,1,0,0,0,1012,8160,1,0,0,0,1014,8162,1,0,0,0,1016,8169,
        1,0,0,0,1018,8173,1,0,0,0,1020,8175,1,0,0,0,1022,8177,1,0,0,0,1024,
        8183,1,0,0,0,1026,8185,1,0,0,0,1028,8198,1,0,0,0,1030,8200,1,0,0,
        0,1032,8203,1,0,0,0,1034,8208,1,0,0,0,1036,8213,1,0,0,0,1038,8222,
        1,0,0,0,1040,8228,1,0,0,0,1042,8232,1,0,0,0,1044,8235,1,0,0,0,1046,
        8239,1,0,0,0,1048,8243,1,0,0,0,1050,8258,1,0,0,0,1052,8260,1,0,0,
        0,1054,8277,1,0,0,0,1056,8288,1,0,0,0,1058,8290,1,0,0,0,1060,8346,
        1,0,0,0,1062,8370,1,0,0,0,1064,8381,1,0,0,0,1066,8384,1,0,0,0,1068,
        8406,1,0,0,0,1070,8408,1,0,0,0,1072,8419,1,0,0,0,1074,8433,1,0,0,
        0,1076,8435,1,0,0,0,1078,8443,1,0,0,0,1080,8450,1,0,0,0,1082,8463,
        1,0,0,0,1084,8475,1,0,0,0,1086,8477,1,0,0,0,1088,8480,1,0,0,0,1090,
        8494,1,0,0,0,1092,8499,1,0,0,0,1094,8504,1,0,0,0,1096,8514,1,0,0,
        0,1098,8518,1,0,0,0,1100,8520,1,0,0,0,1102,8528,1,0,0,0,1104,8532,
        1,0,0,0,1106,8553,1,0,0,0,1108,8561,1,0,0,0,1110,8571,1,0,0,0,1112,
        8583,1,0,0,0,1114,8585,1,0,0,0,1116,8599,1,0,0,0,1118,8619,1,0,0,
        0,1120,8628,1,0,0,0,1122,8644,1,0,0,0,1124,8650,1,0,0,0,1126,8656,
        1,0,0,0,1128,8668,1,0,0,0,1130,8686,1,0,0,0,1132,8693,1,0,0,0,1134,
        8697,1,0,0,0,1136,8701,1,0,0,0,1138,8703,1,0,0,0,1140,8709,1,0,0,
        0,1142,8712,1,0,0,0,1144,8719,1,0,0,0,1146,8732,1,0,0,0,1148,8736,
        1,0,0,0,1150,8738,1,0,0,0,1152,8747,1,0,0,0,1154,8756,1,0,0,0,1156,
        8784,1,0,0,0,1158,8786,1,0,0,0,1160,8796,1,0,0,0,1162,8798,1,0,0,
        0,1164,8800,1,0,0,0,1166,8804,1,0,0,0,1168,8812,1,0,0,0,1170,8820,
        1,0,0,0,1172,8828,1,0,0,0,1174,8842,1,0,0,0,1176,8851,1,0,0,0,1178,
        8855,1,0,0,0,1180,8859,1,0,0,0,1182,8885,1,0,0,0,1184,8899,1,0,0,
        0,1186,8914,1,0,0,0,1188,8924,1,0,0,0,1190,8928,1,0,0,0,1192,8936,
        1,0,0,0,1194,8944,1,0,0,0,1196,8950,1,0,0,0,1198,8954,1,0,0,0,1200,
        8961,1,0,0,0,1202,8966,1,0,0,0,1204,8981,1,0,0,0,1206,9061,1,0,0,
        0,1208,9063,1,0,0,0,1210,9065,1,0,0,0,1212,9095,1,0,0,0,1214,9099,
        1,0,0,0,1216,9278,1,0,0,0,1218,9285,1,0,0,0,1220,9298,1,0,0,0,1222,
        9300,1,0,0,0,1224,9305,1,0,0,0,1226,9313,1,0,0,0,1228,9318,1,0,0,
        0,1230,9325,1,0,0,0,1232,9342,1,0,0,0,1234,9344,1,0,0,0,1236,9354,
        1,0,0,0,1238,9363,1,0,0,0,1240,9368,1,0,0,0,1242,9370,1,0,0,0,1244,
        9378,1,0,0,0,1246,9388,1,0,0,0,1248,9390,1,0,0,0,1250,9399,1,0,0,
        0,1252,9405,1,0,0,0,1254,9420,1,0,0,0,1256,9428,1,0,0,0,1258,9437,
        1,0,0,0,1260,9449,1,0,0,0,1262,9463,1,0,0,0,1264,9465,1,0,0,0,1266,
        9472,1,0,0,0,1268,9478,1,0,0,0,1270,9482,1,0,0,0,1272,9484,1,0,0,
        0,1274,9492,1,0,0,0,1276,9500,1,0,0,0,1278,9514,1,0,0,0,1280,9516,
        1,0,0,0,1282,9524,1,0,0,0,1284,9537,1,0,0,0,1286,9539,1,0,0,0,1288,
        9547,1,0,0,0,1290,9554,1,0,0,0,1292,9567,1,0,0,0,1294,9577,1,0,0,
        0,1296,9579,1,0,0,0,1298,9581,1,0,0,0,1300,9595,1,0,0,0,1302,9624,
        1,0,0,0,1304,9633,1,0,0,0,1306,9640,1,0,0,0,1308,9642,1,0,0,0,1310,
        9649,1,0,0,0,1312,9653,1,0,0,0,1314,9661,1,0,0,0,1316,9665,1,0,0,
        0,1318,9667,1,0,0,0,1320,9686,1,0,0,0,1322,9690,1,0,0,0,1324,9693,
        1,0,0,0,1326,9700,1,0,0,0,1328,9705,1,0,0,0,1330,9707,1,0,0,0,1332,
        9723,1,0,0,0,1334,9725,1,0,0,0,1336,9733,1,0,0,0,1338,9737,1,0,0,
        0,1340,9745,1,0,0,0,1342,9747,1,0,0,0,1344,9749,1,0,0,0,1346,9758,
        1,0,0,0,1348,9792,1,0,0,0,1350,9794,1,0,0,0,1352,9796,1,0,0,0,1354,
        9798,1,0,0,0,1356,9800,1,0,0,0,1358,9802,1,0,0,0,1360,9816,1,0,0,
        0,1362,9821,1,0,0,0,1364,9828,1,0,0,0,1366,9830,1,0,0,0,1368,9835,
        1,0,0,0,1370,9837,1,0,0,0,1372,9851,1,0,0,0,1374,9857,1,0,0,0,1376,
        9863,1,0,0,0,1378,9869,1,0,0,0,1380,9877,1,0,0,0,1382,9886,1,0,0,
        0,1384,9888,1,0,0,0,1386,9890,1,0,0,0,1388,9944,1,0,0,0,1390,9946,
        1,0,0,0,1392,9948,1,0,0,0,1394,9950,1,0,0,0,1396,9952,1,0,0,0,1398,
        9959,1,0,0,0,1400,9982,1,0,0,0,1402,9984,1,0,0,0,1404,9990,1,0,0,
        0,1406,9994,1,0,0,0,1408,9996,1,0,0,0,1410,10003,1,0,0,0,1412,10010,
        1,0,0,0,1414,10013,1,0,0,0,1416,10017,1,0,0,0,1418,10024,1,0,0,0,
        1420,10026,1,0,0,0,1422,10050,1,0,0,0,1424,10052,1,0,0,0,1426,10059,
        1,0,0,0,1428,10061,1,0,0,0,1430,10069,1,0,0,0,1432,10072,1,0,0,0,
        1434,10076,1,0,0,0,1436,10078,1,0,0,0,1438,10082,1,0,0,0,1440,10084,
        1,0,0,0,1442,10089,1,0,0,0,1444,10094,1,0,0,0,1446,10100,1,0,0,0,
        1448,10104,1,0,0,0,1450,10106,1,0,0,0,1452,10111,1,0,0,0,1454,10141,
        1,0,0,0,1456,10143,1,0,0,0,1458,10161,1,0,0,0,1460,10165,1,0,0,0,
        1462,10167,1,0,0,0,1464,10172,1,0,0,0,1466,10181,1,0,0,0,1468,10183,
        1,0,0,0,1470,10191,1,0,0,0,1472,10195,1,0,0,0,1474,10197,1,0,0,0,
        1476,10201,1,0,0,0,1478,10212,1,0,0,0,1480,10229,1,0,0,0,1482,10235,
        1,0,0,0,1484,10237,1,0,0,0,1486,10247,1,0,0,0,1488,10250,1,0,0,0,
        1490,10254,1,0,0,0,1492,10262,1,0,0,0,1494,10264,1,0,0,0,1496,10267,
        1,0,0,0,1498,10272,1,0,0,0,1500,10277,1,0,0,0,1502,10299,1,0,0,0,
        1504,10313,1,0,0,0,1506,10317,1,0,0,0,1508,10322,1,0,0,0,1510,10324,
        1,0,0,0,1512,10326,1,0,0,0,1514,10338,1,0,0,0,1516,10340,1,0,0,0,
        1518,10345,1,0,0,0,1520,10347,1,0,0,0,1522,10365,1,0,0,0,1524,10393,
        1,0,0,0,1526,10403,1,0,0,0,1528,10412,1,0,0,0,1530,10417,1,0,0,0,
        1532,10419,1,0,0,0,1534,10423,1,0,0,0,1536,10431,1,0,0,0,1538,10439,
        1,0,0,0,1540,10441,1,0,0,0,1542,10448,1,0,0,0,1544,10451,1,0,0,0,
        1546,10467,1,0,0,0,1548,10469,1,0,0,0,1550,10483,1,0,0,0,1552,10485,
        1,0,0,0,1554,10512,1,0,0,0,1556,10514,1,0,0,0,1558,10525,1,0,0,0,
        1560,10531,1,0,0,0,1562,10535,1,0,0,0,1564,10537,1,0,0,0,1566,10545,
        1,0,0,0,1568,10550,1,0,0,0,1570,10569,1,0,0,0,1572,10571,1,0,0,0,
        1574,10576,1,0,0,0,1576,10580,1,0,0,0,1578,10583,1,0,0,0,1580,10587,
        1,0,0,0,1582,10597,1,0,0,0,1584,10611,1,0,0,0,1586,10615,1,0,0,0,
        1588,10620,1,0,0,0,1590,10623,1,0,0,0,1592,10627,1,0,0,0,1594,10632,
        1,0,0,0,1596,10643,1,0,0,0,1598,10647,1,0,0,0,1600,10651,1,0,0,0,
        1602,10655,1,0,0,0,1604,10660,1,0,0,0,1606,10664,1,0,0,0,1608,10666,
        1,0,0,0,1610,10668,1,0,0,0,1612,10676,1,0,0,0,1614,10678,1,0,0,0,
        1616,10680,1,0,0,0,1618,10682,1,0,0,0,1620,10684,1,0,0,0,1622,10692,
        1,0,0,0,1624,1625,3,4,2,0,1625,1626,5,0,0,1,1626,1,1,0,0,0,1627,
        1628,3,1396,698,0,1628,3,1,0,0,0,1629,1630,3,6,3,0,1630,5,1,0,0,
        0,1631,1633,3,8,4,0,1632,1634,5,7,0,0,1633,1632,1,0,0,0,1633,1634,
        1,0,0,0,1634,1636,1,0,0,0,1635,1631,1,0,0,0,1636,1639,1,0,0,0,1637,
        1635,1,0,0,0,1637,1638,1,0,0,0,1638,7,1,0,0,0,1639,1637,1,0,0,0,
        1640,1766,3,452,226,0,1641,1766,3,826,413,0,1642,1766,3,816,408,
        0,1643,1766,3,818,409,0,1644,1766,3,578,289,0,1645,1766,3,832,416,
        0,1646,1766,3,478,239,0,1647,1766,3,322,161,0,1648,1766,3,328,164,
        0,1649,1766,3,338,169,0,1650,1766,3,364,182,0,1651,1766,3,670,335,
        0,1652,1766,3,38,19,0,1653,1766,3,728,364,0,1654,1766,3,732,366,
        0,1655,1766,3,744,372,0,1656,1766,3,734,367,0,1657,1766,3,742,371,
        0,1658,1766,3,384,192,0,1659,1766,3,280,140,0,1660,1766,3,828,414,
        0,1661,1766,3,96,48,0,1662,1766,3,720,360,0,1663,1766,3,134,67,0,
        1664,1766,3,752,376,0,1665,1766,3,32,16,0,1666,1766,3,28,14,0,1667,
        1766,3,760,380,0,1668,1766,3,262,131,0,1669,1766,3,838,419,0,1670,
        1766,3,836,418,0,1671,1766,3,380,190,0,1672,1766,3,850,425,0,1673,
        1766,3,12,6,0,1674,1766,3,92,46,0,1675,1766,3,140,70,0,1676,1766,
        3,844,422,0,1677,1766,3,534,267,0,1678,1766,3,86,43,0,1679,1766,
        3,142,71,0,1680,1766,3,400,200,0,1681,1766,3,264,132,0,1682,1766,
        3,456,228,0,1683,1766,3,696,348,0,1684,1766,3,842,421,0,1685,1766,
        3,830,415,0,1686,1766,3,316,158,0,1687,1766,3,330,165,0,1688,1766,
        3,356,178,0,1689,1766,3,366,183,0,1690,1766,3,616,308,0,1691,1766,
        3,36,18,0,1692,1766,3,270,135,0,1693,1766,3,482,241,0,1694,1766,
        3,496,248,0,1695,1766,3,746,373,0,1696,1766,3,498,249,0,1697,1766,
        3,382,191,0,1698,1766,3,296,148,0,1699,1766,3,42,21,0,1700,1766,
        3,278,139,0,1701,1766,3,172,86,0,1702,1766,3,754,377,0,1703,1766,
        3,260,130,0,1704,1766,3,310,155,0,1705,1766,3,704,352,0,1706,1766,
        3,404,202,0,1707,1766,3,444,222,0,1708,1766,3,14,7,0,1709,1766,3,
        26,13,0,1710,1766,3,374,187,0,1711,1766,3,804,402,0,1712,1766,3,
        900,450,0,1713,1766,3,952,476,0,1714,1766,3,458,229,0,1715,1766,
        3,928,464,0,1716,1766,3,94,47,0,1717,1766,3,690,345,0,1718,1766,
        3,700,350,0,1719,1766,3,504,252,0,1720,1766,3,506,253,0,1721,1766,
        3,508,254,0,1722,1766,3,512,256,0,1723,1766,3,762,381,0,1724,1766,
        3,314,157,0,1725,1766,3,708,354,0,1726,1766,3,34,17,0,1727,1766,
        3,378,189,0,1728,1766,3,820,410,0,1729,1766,3,896,448,0,1730,1766,
        3,878,439,0,1731,1766,3,544,272,0,1732,1766,3,552,276,0,1733,1766,
        3,570,285,0,1734,1766,3,368,184,0,1735,1766,3,588,294,0,1736,1766,
        3,902,451,0,1737,1766,3,920,460,0,1738,1766,3,782,391,0,1739,1766,
        3,276,138,0,1740,1766,3,802,401,0,1741,1766,3,932,466,0,1742,1766,
        3,778,389,0,1743,1766,3,890,445,0,1744,1766,3,510,255,0,1745,1766,
        3,710,355,0,1746,1766,3,678,339,0,1747,1766,3,676,338,0,1748,1766,
        3,680,340,0,1749,1766,3,722,361,0,1750,1766,3,554,277,0,1751,1766,
        3,572,286,0,1752,1766,3,764,382,0,1753,1766,3,538,269,0,1754,1766,
        3,960,480,0,1755,1766,3,786,393,0,1756,1766,3,530,265,0,1757,1766,
        3,784,392,0,1758,1766,3,942,471,0,1759,1766,3,848,424,0,1760,1766,
        3,74,37,0,1761,1766,3,50,25,0,1762,1766,3,84,42,0,1763,1766,3,798,
        399,0,1764,1766,3,10,5,0,1765,1640,1,0,0,0,1765,1641,1,0,0,0,1765,
        1642,1,0,0,0,1765,1643,1,0,0,0,1765,1644,1,0,0,0,1765,1645,1,0,0,
        0,1765,1646,1,0,0,0,1765,1647,1,0,0,0,1765,1648,1,0,0,0,1765,1649,
        1,0,0,0,1765,1650,1,0,0,0,1765,1651,1,0,0,0,1765,1652,1,0,0,0,1765,
        1653,1,0,0,0,1765,1654,1,0,0,0,1765,1655,1,0,0,0,1765,1656,1,0,0,
        0,1765,1657,1,0,0,0,1765,1658,1,0,0,0,1765,1659,1,0,0,0,1765,1660,
        1,0,0,0,1765,1661,1,0,0,0,1765,1662,1,0,0,0,1765,1663,1,0,0,0,1765,
        1664,1,0,0,0,1765,1665,1,0,0,0,1765,1666,1,0,0,0,1765,1667,1,0,0,
        0,1765,1668,1,0,0,0,1765,1669,1,0,0,0,1765,1670,1,0,0,0,1765,1671,
        1,0,0,0,1765,1672,1,0,0,0,1765,1673,1,0,0,0,1765,1674,1,0,0,0,1765,
        1675,1,0,0,0,1765,1676,1,0,0,0,1765,1677,1,0,0,0,1765,1678,1,0,0,
        0,1765,1679,1,0,0,0,1765,1680,1,0,0,0,1765,1681,1,0,0,0,1765,1682,
        1,0,0,0,1765,1683,1,0,0,0,1765,1684,1,0,0,0,1765,1685,1,0,0,0,1765,
        1686,1,0,0,0,1765,1687,1,0,0,0,1765,1688,1,0,0,0,1765,1689,1,0,0,
        0,1765,1690,1,0,0,0,1765,1691,1,0,0,0,1765,1692,1,0,0,0,1765,1693,
        1,0,0,0,1765,1694,1,0,0,0,1765,1695,1,0,0,0,1765,1696,1,0,0,0,1765,
        1697,1,0,0,0,1765,1698,1,0,0,0,1765,1699,1,0,0,0,1765,1700,1,0,0,
        0,1765,1701,1,0,0,0,1765,1702,1,0,0,0,1765,1703,1,0,0,0,1765,1704,
        1,0,0,0,1765,1705,1,0,0,0,1765,1706,1,0,0,0,1765,1707,1,0,0,0,1765,
        1708,1,0,0,0,1765,1709,1,0,0,0,1765,1710,1,0,0,0,1765,1711,1,0,0,
        0,1765,1712,1,0,0,0,1765,1713,1,0,0,0,1765,1714,1,0,0,0,1765,1715,
        1,0,0,0,1765,1716,1,0,0,0,1765,1717,1,0,0,0,1765,1718,1,0,0,0,1765,
        1719,1,0,0,0,1765,1720,1,0,0,0,1765,1721,1,0,0,0,1765,1722,1,0,0,
        0,1765,1723,1,0,0,0,1765,1724,1,0,0,0,1765,1725,1,0,0,0,1765,1726,
        1,0,0,0,1765,1727,1,0,0,0,1765,1728,1,0,0,0,1765,1729,1,0,0,0,1765,
        1730,1,0,0,0,1765,1731,1,0,0,0,1765,1732,1,0,0,0,1765,1733,1,0,0,
        0,1765,1734,1,0,0,0,1765,1735,1,0,0,0,1765,1736,1,0,0,0,1765,1737,
        1,0,0,0,1765,1738,1,0,0,0,1765,1739,1,0,0,0,1765,1740,1,0,0,0,1765,
        1741,1,0,0,0,1765,1742,1,0,0,0,1765,1743,1,0,0,0,1765,1744,1,0,0,
        0,1765,1745,1,0,0,0,1765,1746,1,0,0,0,1765,1747,1,0,0,0,1765,1748,
        1,0,0,0,1765,1749,1,0,0,0,1765,1750,1,0,0,0,1765,1751,1,0,0,0,1765,
        1752,1,0,0,0,1765,1753,1,0,0,0,1765,1754,1,0,0,0,1765,1755,1,0,0,
        0,1765,1756,1,0,0,0,1765,1757,1,0,0,0,1765,1758,1,0,0,0,1765,1759,
        1,0,0,0,1765,1760,1,0,0,0,1765,1761,1,0,0,0,1765,1762,1,0,0,0,1765,
        1763,1,0,0,0,1765,1764,1,0,0,0,1766,9,1,0,0,0,1767,1769,5,668,0,
        0,1768,1770,5,669,0,0,1769,1768,1,0,0,0,1769,1770,1,0,0,0,1770,11,
        1,0,0,0,1771,1772,5,433,0,0,1772,1773,3,1210,605,0,1773,13,1,0,0,
        0,1774,1775,5,46,0,0,1775,1776,5,311,0,0,1776,1777,3,1366,683,0,
        1777,1778,3,16,8,0,1778,1779,3,18,9,0,1779,15,1,0,0,0,1780,1783,
        5,105,0,0,1781,1783,1,0,0,0,1782,1780,1,0,0,0,1782,1781,1,0,0,0,
        1783,17,1,0,0,0,1784,1786,3,24,12,0,1785,1784,1,0,0,0,1786,1789,
        1,0,0,0,1787,1785,1,0,0,0,1787,1788,1,0,0,0,1788,19,1,0,0,0,1789,
        1787,1,0,0,0,1790,1792,3,22,11,0,1791,1790,1,0,0,0,1792,1795,1,0,
        0,0,1793,1791,1,0,0,0,1793,1794,1,0,0,0,1794,21,1,0,0,0,1795,1793,
        1,0,0,0,1796,1799,5,280,0,0,1797,1800,3,1358,679,0,1798,1800,5,78,
        0,0,1799,1797,1,0,0,0,1799,1798,1,0,0,0,1800,1815,1,0,0,0,1801,1802,
        7,0,0,0,1802,1803,5,280,0,0,1803,1815,3,1358,679,0,1804,1815,5,228,
        0,0,1805,1806,5,164,0,0,1806,1807,5,74,0,0,1807,1815,3,1364,682,
        0,1808,1809,5,364,0,0,1809,1810,5,361,0,0,1810,1815,3,1358,679,0,
        1811,1812,5,99,0,0,1812,1815,3,1370,685,0,1813,1815,3,1382,691,0,
        1814,1796,1,0,0,0,1814,1801,1,0,0,0,1814,1804,1,0,0,0,1814,1805,
        1,0,0,0,1814,1808,1,0,0,0,1814,1811,1,0,0,0,1814,1813,1,0,0,0,1815,
        23,1,0,0,0,1816,1827,3,22,11,0,1817,1818,5,341,0,0,1818,1827,3,1356,
        678,0,1819,1820,5,134,0,0,1820,1827,3,1370,685,0,1821,1822,5,311,
        0,0,1822,1827,3,1370,685,0,1823,1824,5,68,0,0,1824,1825,7,1,0,0,
        1825,1827,3,1370,685,0,1826,1816,1,0,0,0,1826,1817,1,0,0,0,1826,
        1819,1,0,0,0,1826,1821,1,0,0,0,1826,1823,1,0,0,0,1827,25,1,0,0,0,
        1828,1829,5,46,0,0,1829,1830,5,99,0,0,1830,1831,3,1366,683,0,1831,
        1832,3,16,8,0,1832,1833,3,18,9,0,1833,27,1,0,0,0,1834,1835,5,138,
        0,0,1835,1836,7,2,0,0,1836,1837,3,1368,684,0,1837,1838,3,16,8,0,
        1838,1839,3,20,10,0,1839,29,1,0,0,0,1840,1845,1,0,0,0,1841,1842,
        5,68,0,0,1842,1843,5,175,0,0,1843,1845,3,1340,670,0,1844,1840,1,
        0,0,0,1844,1841,1,0,0,0,1845,31,1,0,0,0,1846,1847,5,138,0,0,1847,
        1849,7,2,0,0,1848,1850,5,30,0,0,1849,1848,1,0,0,0,1849,1850,1,0,
        0,0,1850,1851,1,0,0,0,1851,1852,3,1368,684,0,1852,1853,3,30,15,0,
        1853,1854,3,80,40,0,1854,33,1,0,0,0,1855,1856,5,191,0,0,1856,1859,
        7,3,0,0,1857,1858,5,220,0,0,1858,1860,5,389,0,0,1859,1857,1,0,0,
        0,1859,1860,1,0,0,0,1860,1861,1,0,0,0,1861,1862,3,1370,685,0,1862,
        35,1,0,0,0,1863,1864,5,46,0,0,1864,1865,5,66,0,0,1865,1866,3,1366,
        683,0,1866,1867,3,16,8,0,1867,1868,3,18,9,0,1868,37,1,0,0,0,1869,
        1870,5,138,0,0,1870,1871,5,66,0,0,1871,1872,3,1368,684,0,1872,1873,
        3,40,20,0,1873,1874,5,99,0,0,1874,1875,3,1370,685,0,1875,39,1,0,
        0,0,1876,1877,7,4,0,0,1877,41,1,0,0,0,1878,1879,5,46,0,0,1879,1883,
        5,316,0,0,1880,1881,5,220,0,0,1881,1882,5,77,0,0,1882,1884,5,389,
        0,0,1883,1880,1,0,0,0,1883,1884,1,0,0,0,1884,1890,1,0,0,0,1885,1886,
        3,44,22,0,1886,1887,5,106,0,0,1887,1888,3,1368,684,0,1888,1891,1,
        0,0,0,1889,1891,3,1372,686,0,1890,1885,1,0,0,0,1890,1889,1,0,0,0,
        1891,1892,1,0,0,0,1892,1893,3,46,23,0,1893,43,1,0,0,0,1894,1897,
        3,1372,686,0,1895,1897,1,0,0,0,1896,1894,1,0,0,0,1896,1895,1,0,0,
        0,1897,45,1,0,0,0,1898,1900,3,48,24,0,1899,1898,1,0,0,0,1900,1903,
        1,0,0,0,1901,1899,1,0,0,0,1901,1902,1,0,0,0,1902,47,1,0,0,0,1903,
        1901,1,0,0,0,1904,1911,3,172,86,0,1905,1911,3,588,294,0,1906,1911,
        3,278,139,0,1907,1911,3,404,202,0,1908,1911,3,552,276,0,1909,1911,
        3,798,399,0,1910,1904,1,0,0,0,1910,1905,1,0,0,0,1910,1906,1,0,0,
        0,1910,1907,1,0,0,0,1910,1908,1,0,0,0,1910,1909,1,0,0,0,1911,49,
        1,0,0,0,1912,1914,5,326,0,0,1913,1915,7,5,0,0,1914,1913,1,0,0,0,
        1914,1915,1,0,0,0,1915,1916,1,0,0,0,1916,1917,3,52,26,0,1917,51,
        1,0,0,0,1918,1919,5,349,0,0,1919,1927,3,792,396,0,1920,1921,5,325,
        0,0,1921,1922,5,154,0,0,1922,1923,5,36,0,0,1923,1924,5,349,0,0,1924,
        1927,3,792,396,0,1925,1927,3,56,28,0,1926,1918,1,0,0,0,1926,1920,
        1,0,0,0,1926,1925,1,0,0,0,1927,53,1,0,0,0,1928,1929,3,58,29,0,1929,
        1930,7,6,0,0,1930,1931,3,60,30,0,1931,55,1,0,0,0,1932,1958,3,54,
        27,0,1933,1934,3,58,29,0,1934,1935,5,64,0,0,1935,1936,5,434,0,0,
        1936,1958,1,0,0,0,1937,1938,5,411,0,0,1938,1939,5,379,0,0,1939,1958,
        3,68,34,0,1940,1941,5,152,0,0,1941,1958,3,1358,679,0,1942,1943,5,
        316,0,0,1943,1958,3,1358,679,0,1944,1945,5,260,0,0,1945,1958,3,70,
        35,0,1946,1947,5,311,0,0,1947,1958,3,72,36,0,1948,1949,5,325,0,0,
        1949,1950,5,106,0,0,1950,1958,3,72,36,0,1951,1952,5,376,0,0,1952,
        1953,5,272,0,0,1953,1958,3,1228,614,0,1954,1955,5,349,0,0,1955,1956,
        5,330,0,0,1956,1958,3,1358,679,0,1957,1932,1,0,0,0,1957,1933,1,0,
        0,0,1957,1937,1,0,0,0,1957,1940,1,0,0,0,1957,1942,1,0,0,0,1957,1944,
        1,0,0,0,1957,1946,1,0,0,0,1957,1948,1,0,0,0,1957,1951,1,0,0,0,1957,
        1954,1,0,0,0,1958,57,1,0,0,0,1959,1964,3,1372,686,0,1960,1961,5,
        11,0,0,1961,1963,3,1372,686,0,1962,1960,1,0,0,0,1963,1966,1,0,0,
        0,1964,1962,1,0,0,0,1964,1965,1,0,0,0,1965,59,1,0,0,0,1966,1964,
        1,0,0,0,1967,1972,3,62,31,0,1968,1969,5,6,0,0,1969,1971,3,62,31,
        0,1970,1968,1,0,0,0,1971,1974,1,0,0,0,1972,1970,1,0,0,0,1972,1973,
        1,0,0,0,1973,61,1,0,0,0,1974,1972,1,0,0,0,1975,1978,3,66,33,0,1976,
        1978,3,292,146,0,1977,1975,1,0,0,0,1977,1976,1,0,0,0,1978,63,1,0,
        0,0,1979,1980,5,293,0,0,1980,1985,7,7,0,0,1981,1982,5,303,0,0,1982,
        1985,5,293,0,0,1983,1985,5,323,0,0,1984,1979,1,0,0,0,1984,1981,1,
        0,0,0,1984,1983,1,0,0,0,1985,65,1,0,0,0,1986,1991,5,96,0,0,1987,
        1991,5,60,0,0,1988,1991,5,80,0,0,1989,1991,3,72,36,0,1990,1986,1,
        0,0,0,1990,1987,1,0,0,0,1990,1988,1,0,0,0,1990,1989,1,0,0,0,1991,
        67,1,0,0,0,1992,2008,3,1358,679,0,1993,2008,3,1382,691,0,1994,1995,
        3,1152,576,0,1995,1996,3,1358,679,0,1996,1997,3,1156,578,0,1997,
        2008,1,0,0,0,1998,1999,3,1152,576,0,1999,2000,5,2,0,0,2000,2001,
        3,1356,678,0,2001,2002,5,3,0,0,2002,2003,3,1358,679,0,2003,2008,
        1,0,0,0,2004,2008,3,292,146,0,2005,2008,5,53,0,0,2006,2008,5,245,
        0,0,2007,1992,1,0,0,0,2007,1993,1,0,0,0,2007,1994,1,0,0,0,2007,1998,
        1,0,0,0,2007,2004,1,0,0,0,2007,2005,1,0,0,0,2007,2006,1,0,0,0,2008,
        69,1,0,0,0,2009,2013,3,1358,679,0,2010,2013,5,53,0,0,2011,2013,1,
        0,0,0,2012,2009,1,0,0,0,2012,2010,1,0,0,0,2012,2011,1,0,0,0,2013,
        71,1,0,0,0,2014,2017,3,1378,689,0,2015,2017,3,1358,679,0,2016,2014,
        1,0,0,0,2016,2015,1,0,0,0,2017,73,1,0,0,0,2018,2019,5,306,0,0,2019,
        2020,3,76,38,0,2020,75,1,0,0,0,2021,2030,3,78,39,0,2022,2023,5,411,
        0,0,2023,2030,5,379,0,0,2024,2025,5,349,0,0,2025,2026,5,235,0,0,
        2026,2030,5,242,0,0,2027,2028,5,325,0,0,2028,2030,5,106,0,0,2029,
        2021,1,0,0,0,2029,2022,1,0,0,0,2029,2024,1,0,0,0,2029,2027,1,0,0,
        0,2030,77,1,0,0,0,2031,2034,3,58,29,0,2032,2034,5,30,0,0,2033,2031,
        1,0,0,0,2033,2032,1,0,0,0,2034,79,1,0,0,0,2035,2036,5,326,0,0,2036,
        2039,3,52,26,0,2037,2039,3,74,37,0,2038,2035,1,0,0,0,2038,2037,1,
        0,0,0,2039,81,1,0,0,0,2040,2041,5,326,0,0,2041,2044,3,56,28,0,2042,
        2044,3,74,37,0,2043,2040,1,0,0,0,2043,2042,1,0,0,0,2044,83,1,0,0,
        0,2045,2055,5,328,0,0,2046,2056,3,58,29,0,2047,2048,5,411,0,0,2048,
        2056,5,379,0,0,2049,2050,5,349,0,0,2050,2051,5,235,0,0,2051,2056,
        5,242,0,0,2052,2053,5,325,0,0,2053,2056,5,106,0,0,2054,2056,5,30,
        0,0,2055,2046,1,0,0,0,2055,2047,1,0,0,0,2055,2049,1,0,0,0,2055,2052,
        1,0,0,0,2055,2054,1,0,0,0,2056,85,1,0,0,0,2057,2058,5,326,0,0,2058,
        2059,5,165,0,0,2059,2060,3,88,44,0,2060,2061,3,90,45,0,2061,87,1,
        0,0,0,2062,2065,5,30,0,0,2063,2065,3,1334,667,0,2064,2062,1,0,0,
        0,2064,2063,1,0,0,0,2065,89,1,0,0,0,2066,2067,7,8,0,0,2067,91,1,
        0,0,0,2068,2069,5,155,0,0,2069,93,1,0,0,0,2070,2071,5,187,0,0,2071,
        2072,7,9,0,0,2072,95,1,0,0,0,2073,2074,5,138,0,0,2074,2077,5,92,
        0,0,2075,2076,5,220,0,0,2076,2078,5,389,0,0,2077,2075,1,0,0,0,2077,
        2078,1,0,0,0,2078,2079,1,0,0,0,2079,2082,3,1074,537,0,2080,2083,
        3,98,49,0,2081,2083,3,100,50,0,2082,2080,1,0,0,0,2082,2081,1,0,0,
        0,2083,2183,1,0,0,0,2084,2085,5,138,0,0,2085,2086,5,92,0,0,2086,
        2087,5,30,0,0,2087,2088,5,68,0,0,2088,2089,5,344,0,0,2089,2093,3,
        1340,670,0,2090,2091,5,274,0,0,2091,2092,5,147,0,0,2092,2094,3,1370,
        685,0,2093,2090,1,0,0,0,2093,2094,1,0,0,0,2094,2095,1,0,0,0,2095,
        2096,5,326,0,0,2096,2097,5,344,0,0,2097,2098,3,1340,670,0,2098,2099,
        3,938,469,0,2099,2183,1,0,0,0,2100,2101,5,138,0,0,2101,2104,5,226,
        0,0,2102,2103,5,220,0,0,2103,2105,5,389,0,0,2104,2102,1,0,0,0,2104,
        2105,1,0,0,0,2105,2106,1,0,0,0,2106,2109,3,1336,668,0,2107,2110,
        3,98,49,0,2108,2110,3,102,51,0,2109,2107,1,0,0,0,2109,2108,1,0,0,
        0,2110,2183,1,0,0,0,2111,2112,5,138,0,0,2112,2113,5,226,0,0,2113,
        2114,5,30,0,0,2114,2115,5,68,0,0,2115,2116,5,344,0,0,2116,2120,3,
        1340,670,0,2117,2118,5,274,0,0,2118,2119,5,147,0,0,2119,2121,3,1370,
        685,0,2120,2117,1,0,0,0,2120,2121,1,0,0,0,2121,2122,1,0,0,0,2122,
        2123,5,326,0,0,2123,2124,5,344,0,0,2124,2125,3,1340,670,0,2125,2126,
        3,938,469,0,2126,2183,1,0,0,0,2127,2128,5,138,0,0,2128,2131,5,321,
        0,0,2129,2130,5,220,0,0,2130,2132,5,389,0,0,2131,2129,1,0,0,0,2131,
        2132,1,0,0,0,2132,2133,1,0,0,0,2133,2134,3,1336,668,0,2134,2135,
        3,98,49,0,2135,2183,1,0,0,0,2136,2137,5,138,0,0,2137,2140,5,369,
        0,0,2138,2139,5,220,0,0,2139,2141,5,389,0,0,2140,2138,1,0,0,0,2140,
        2141,1,0,0,0,2141,2142,1,0,0,0,2142,2143,3,1336,668,0,2143,2144,
        3,98,49,0,2144,2183,1,0,0,0,2145,2146,5,138,0,0,2146,2147,5,251,
        0,0,2147,2150,5,369,0,0,2148,2149,5,220,0,0,2149,2151,5,389,0,0,
        2150,2148,1,0,0,0,2150,2151,1,0,0,0,2151,2152,1,0,0,0,2152,2153,
        3,1336,668,0,2153,2154,3,98,49,0,2154,2183,1,0,0,0,2155,2156,5,138,
        0,0,2156,2157,5,251,0,0,2157,2158,5,369,0,0,2158,2159,5,30,0,0,2159,
        2160,5,68,0,0,2160,2161,5,344,0,0,2161,2165,3,1340,670,0,2162,2163,
        5,274,0,0,2163,2164,5,147,0,0,2164,2166,3,1370,685,0,2165,2162,1,
        0,0,0,2165,2166,1,0,0,0,2166,2167,1,0,0,0,2167,2168,5,326,0,0,2168,
        2169,5,344,0,0,2169,2170,3,1340,670,0,2170,2171,3,938,469,0,2171,
        2183,1,0,0,0,2172,2173,5,138,0,0,2173,2174,5,63,0,0,2174,2177,5,
        92,0,0,2175,2176,5,220,0,0,2176,2178,5,389,0,0,2177,2175,1,0,0,0,
        2177,2178,1,0,0,0,2178,2179,1,0,0,0,2179,2180,3,1074,537,0,2180,
        2181,3,98,49,0,2181,2183,1,0,0,0,2182,2073,1,0,0,0,2182,2084,1,0,
        0,0,2182,2100,1,0,0,0,2182,2111,1,0,0,0,2182,2127,1,0,0,0,2182,2136,
        1,0,0,0,2182,2145,1,0,0,0,2182,2155,1,0,0,0,2182,2172,1,0,0,0,2183,
        97,1,0,0,0,2184,2189,3,104,52,0,2185,2186,5,6,0,0,2186,2188,3,104,
        52,0,2187,2185,1,0,0,0,2188,2191,1,0,0,0,2189,2187,1,0,0,0,2189,
        2190,1,0,0,0,2190,99,1,0,0,0,2191,2189,1,0,0,0,2192,2193,5,435,0,
        0,2193,2194,5,278,0,0,2194,2195,3,1336,668,0,2195,2196,3,128,64,
        0,2196,2201,1,0,0,0,2197,2198,5,436,0,0,2198,2199,5,278,0,0,2199,
        2201,3,1336,668,0,2200,2192,1,0,0,0,2200,2197,1,0,0,0,2201,101,1,
        0,0,0,2202,2203,5,435,0,0,2203,2204,5,278,0,0,2204,2205,3,1336,668,
        0,2205,103,1,0,0,0,2206,2207,5,133,0,0,2207,2459,3,188,94,0,2208,
        2209,5,133,0,0,2209,2210,5,220,0,0,2210,2211,5,77,0,0,2211,2212,
        5,389,0,0,2212,2459,3,188,94,0,2213,2214,5,133,0,0,2214,2215,5,44,
        0,0,2215,2459,3,188,94,0,2216,2217,5,133,0,0,2217,2218,5,44,0,0,
        2218,2219,5,220,0,0,2219,2220,5,77,0,0,2220,2221,5,389,0,0,2221,
        2459,3,188,94,0,2222,2223,5,138,0,0,2223,2224,3,724,362,0,2224,2225,
        3,1372,686,0,2225,2226,3,106,53,0,2226,2459,1,0,0,0,2227,2228,5,
        138,0,0,2228,2229,3,724,362,0,2229,2230,3,1372,686,0,2230,2231,5,
        191,0,0,2231,2232,5,77,0,0,2232,2233,5,78,0,0,2233,2459,1,0,0,0,
        2234,2235,5,138,0,0,2235,2236,3,724,362,0,2236,2237,3,1372,686,0,
        2237,2238,5,326,0,0,2238,2239,5,77,0,0,2239,2240,5,78,0,0,2240,2459,
        1,0,0,0,2241,2242,5,138,0,0,2242,2243,3,724,362,0,2243,2244,3,1372,
        686,0,2244,2245,5,191,0,0,2245,2246,5,437,0,0,2246,2459,1,0,0,0,
        2247,2248,5,138,0,0,2248,2249,3,724,362,0,2249,2250,3,1372,686,0,
        2250,2251,5,191,0,0,2251,2252,5,437,0,0,2252,2253,5,220,0,0,2253,
        2254,5,389,0,0,2254,2459,1,0,0,0,2255,2256,5,138,0,0,2256,2257,3,
        724,362,0,2257,2258,3,1372,686,0,2258,2259,5,326,0,0,2259,2260,5,
        335,0,0,2260,2261,3,1364,682,0,2261,2459,1,0,0,0,2262,2263,5,138,
        0,0,2263,2264,3,724,362,0,2264,2265,3,1356,678,0,2265,2266,5,326,
        0,0,2266,2267,5,335,0,0,2267,2268,3,1364,682,0,2268,2459,1,0,0,0,
        2269,2270,5,138,0,0,2270,2271,3,724,362,0,2271,2272,3,1372,686,0,
        2272,2273,5,326,0,0,2273,2274,3,116,58,0,2274,2459,1,0,0,0,2275,
        2276,5,138,0,0,2276,2277,3,724,362,0,2277,2278,3,1372,686,0,2278,
        2279,5,306,0,0,2279,2280,3,116,58,0,2280,2459,1,0,0,0,2281,2282,
        5,138,0,0,2282,2283,3,724,362,0,2283,2284,3,1372,686,0,2284,2285,
        5,326,0,0,2285,2286,5,338,0,0,2286,2287,3,1372,686,0,2287,2459,1,
        0,0,0,2288,2289,5,138,0,0,2289,2290,3,724,362,0,2290,2291,3,1372,
        686,0,2291,2292,5,133,0,0,2292,2293,5,438,0,0,2293,2294,3,198,99,
        0,2294,2295,5,36,0,0,2295,2296,5,219,0,0,2296,2297,3,284,142,0,2297,
        2459,1,0,0,0,2298,2299,5,138,0,0,2299,2300,3,724,362,0,2300,2301,
        3,1372,686,0,2301,2302,3,124,62,0,2302,2459,1,0,0,0,2303,2304,5,
        138,0,0,2304,2305,3,724,362,0,2305,2306,3,1372,686,0,2306,2307,5,
        191,0,0,2307,2308,5,219,0,0,2308,2459,1,0,0,0,2309,2310,5,138,0,
        0,2310,2311,3,724,362,0,2311,2312,3,1372,686,0,2312,2313,5,191,0,
        0,2313,2314,5,219,0,0,2314,2315,5,220,0,0,2315,2316,5,389,0,0,2316,
        2459,1,0,0,0,2317,2318,5,191,0,0,2318,2319,3,724,362,0,2319,2320,
        5,220,0,0,2320,2321,5,389,0,0,2321,2322,3,1372,686,0,2322,2323,3,
        108,54,0,2323,2459,1,0,0,0,2324,2325,5,191,0,0,2325,2326,3,724,362,
        0,2326,2327,3,1372,686,0,2327,2328,3,108,54,0,2328,2459,1,0,0,0,
        2329,2330,5,138,0,0,2330,2331,3,724,362,0,2331,2332,3,1372,686,0,
        2332,2333,3,726,363,0,2333,2334,5,353,0,0,2334,2335,3,1118,559,0,
        2335,2336,3,110,55,0,2336,2337,3,112,56,0,2337,2459,1,0,0,0,2338,
        2339,5,138,0,0,2339,2340,3,724,362,0,2340,2341,3,1372,686,0,2341,
        2342,3,344,172,0,2342,2459,1,0,0,0,2343,2344,5,133,0,0,2344,2459,
        3,208,104,0,2345,2346,5,138,0,0,2346,2347,5,45,0,0,2347,2348,3,1340,
        670,0,2348,2349,3,440,220,0,2349,2459,1,0,0,0,2350,2351,5,365,0,
        0,2351,2352,5,45,0,0,2352,2459,3,1340,670,0,2353,2354,5,191,0,0,
        2354,2355,5,45,0,0,2355,2356,5,220,0,0,2356,2357,5,389,0,0,2357,
        2358,3,1340,670,0,2358,2359,3,108,54,0,2359,2459,1,0,0,0,2360,2361,
        5,191,0,0,2361,2362,5,45,0,0,2362,2363,3,1340,670,0,2363,2364,3,
        108,54,0,2364,2459,1,0,0,0,2365,2366,5,326,0,0,2366,2367,5,372,0,
        0,2367,2459,5,270,0,0,2368,2369,5,158,0,0,2369,2370,5,80,0,0,2370,
        2459,3,1340,670,0,2371,2372,5,326,0,0,2372,2373,5,372,0,0,2373,2459,
        5,158,0,0,2374,2375,5,326,0,0,2375,2459,5,439,0,0,2376,2377,5,326,
        0,0,2377,2459,5,360,0,0,2378,2379,5,193,0,0,2379,2380,5,350,0,0,
        2380,2459,3,1340,670,0,2381,2382,5,193,0,0,2382,2383,5,139,0,0,2383,
        2384,5,350,0,0,2384,2459,3,1340,670,0,2385,2386,5,193,0,0,2386,2387,
        5,305,0,0,2387,2388,5,350,0,0,2388,2459,3,1340,670,0,2389,2390,5,
        193,0,0,2390,2391,5,350,0,0,2391,2459,5,30,0,0,2392,2393,5,193,0,
        0,2393,2394,5,350,0,0,2394,2459,5,99,0,0,2395,2396,5,186,0,0,2396,
        2397,5,350,0,0,2397,2459,3,1340,670,0,2398,2399,5,186,0,0,2399,2400,
        5,350,0,0,2400,2459,5,30,0,0,2401,2402,5,186,0,0,2402,2403,5,350,
        0,0,2403,2459,5,99,0,0,2404,2405,5,193,0,0,2405,2406,5,314,0,0,2406,
        2459,3,1340,670,0,2407,2408,5,193,0,0,2408,2409,5,139,0,0,2409,2410,
        5,314,0,0,2410,2459,3,1340,670,0,2411,2412,5,193,0,0,2412,2413,5,
        305,0,0,2413,2414,5,314,0,0,2414,2459,3,1340,670,0,2415,2416,5,186,
        0,0,2416,2417,5,314,0,0,2417,2459,3,1340,670,0,2418,2419,5,228,0,
        0,2419,2459,3,1336,668,0,2420,2421,5,262,0,0,2421,2422,5,228,0,0,
        2422,2459,3,1336,668,0,2423,2424,5,268,0,0,2424,2459,3,524,262,0,
        2425,2426,5,77,0,0,2426,2459,5,268,0,0,2427,2428,5,275,0,0,2428,
        2429,5,94,0,0,2429,2459,3,1368,684,0,2430,2431,5,326,0,0,2431,2432,
        5,344,0,0,2432,2459,3,1340,670,0,2433,2434,5,326,0,0,2434,2459,3,
        116,58,0,2435,2436,5,306,0,0,2436,2459,3,116,58,0,2437,2438,5,305,
        0,0,2438,2439,5,219,0,0,2439,2459,3,114,57,0,2440,2441,5,193,0,0,
        2441,2442,5,407,0,0,2442,2443,5,242,0,0,2443,2459,5,320,0,0,2444,
        2445,5,186,0,0,2445,2446,5,407,0,0,2446,2447,5,242,0,0,2447,2459,
        5,320,0,0,2448,2449,5,209,0,0,2449,2450,5,407,0,0,2450,2451,5,242,
        0,0,2451,2459,5,320,0,0,2452,2453,5,262,0,0,2453,2454,5,209,0,0,
        2454,2455,5,407,0,0,2455,2456,5,242,0,0,2456,2459,5,320,0,0,2457,
        2459,3,344,172,0,2458,2206,1,0,0,0,2458,2208,1,0,0,0,2458,2213,1,
        0,0,0,2458,2216,1,0,0,0,2458,2222,1,0,0,0,2458,2227,1,0,0,0,2458,
        2234,1,0,0,0,2458,2241,1,0,0,0,2458,2247,1,0,0,0,2458,2255,1,0,0,
        0,2458,2262,1,0,0,0,2458,2269,1,0,0,0,2458,2275,1,0,0,0,2458,2281,
        1,0,0,0,2458,2288,1,0,0,0,2458,2298,1,0,0,0,2458,2303,1,0,0,0,2458,
        2309,1,0,0,0,2458,2317,1,0,0,0,2458,2324,1,0,0,0,2458,2329,1,0,0,
        0,2458,2338,1,0,0,0,2458,2343,1,0,0,0,2458,2345,1,0,0,0,2458,2350,
        1,0,0,0,2458,2353,1,0,0,0,2458,2360,1,0,0,0,2458,2365,1,0,0,0,2458,
        2368,1,0,0,0,2458,2371,1,0,0,0,2458,2374,1,0,0,0,2458,2376,1,0,0,
        0,2458,2378,1,0,0,0,2458,2381,1,0,0,0,2458,2385,1,0,0,0,2458,2389,
        1,0,0,0,2458,2392,1,0,0,0,2458,2395,1,0,0,0,2458,2398,1,0,0,0,2458,
        2401,1,0,0,0,2458,2404,1,0,0,0,2458,2407,1,0,0,0,2458,2411,1,0,0,
        0,2458,2415,1,0,0,0,2458,2418,1,0,0,0,2458,2420,1,0,0,0,2458,2423,
        1,0,0,0,2458,2425,1,0,0,0,2458,2427,1,0,0,0,2458,2430,1,0,0,0,2458,
        2433,1,0,0,0,2458,2435,1,0,0,0,2458,2437,1,0,0,0,2458,2440,1,0,0,
        0,2458,2444,1,0,0,0,2458,2448,1,0,0,0,2458,2452,1,0,0,0,2458,2457,
        1,0,0,0,2459,105,1,0,0,0,2460,2461,5,326,0,0,2461,2462,5,53,0,0,
        2462,2466,3,1162,581,0,2463,2464,5,191,0,0,2464,2466,5,53,0,0,2465,
        2460,1,0,0,0,2465,2463,1,0,0,0,2466,107,1,0,0,0,2467,2471,5,150,
        0,0,2468,2471,5,308,0,0,2469,2471,1,0,0,0,2470,2467,1,0,0,0,2470,
        2468,1,0,0,0,2470,2469,1,0,0,0,2471,109,1,0,0,0,2472,2473,5,43,0,
        0,2473,2476,3,524,262,0,2474,2476,1,0,0,0,2475,2472,1,0,0,0,2475,
        2474,1,0,0,0,2476,111,1,0,0,0,2477,2478,5,100,0,0,2478,2481,3,1162,
        581,0,2479,2481,1,0,0,0,2480,2477,1,0,0,0,2480,2479,1,0,0,0,2481,
        113,1,0,0,0,2482,2489,5,263,0,0,2483,2489,5,113,0,0,2484,2489,5,
        53,0,0,2485,2486,5,100,0,0,2486,2487,5,226,0,0,2487,2489,3,1340,
        670,0,2488,2482,1,0,0,0,2488,2483,1,0,0,0,2488,2484,1,0,0,0,2488,
        2485,1,0,0,0,2489,115,1,0,0,0,2490,2491,5,2,0,0,2491,2492,3,120,
        60,0,2492,2493,5,3,0,0,2493,117,1,0,0,0,2494,2495,5,105,0,0,2495,
        2498,3,116,58,0,2496,2498,1,0,0,0,2497,2494,1,0,0,0,2497,2496,1,
        0,0,0,2498,119,1,0,0,0,2499,2504,3,122,61,0,2500,2501,5,6,0,0,2501,
        2503,3,122,61,0,2502,2500,1,0,0,0,2503,2506,1,0,0,0,2504,2502,1,
        0,0,0,2504,2505,1,0,0,0,2505,121,1,0,0,0,2506,2504,1,0,0,0,2507,
        2516,3,1380,690,0,2508,2509,5,10,0,0,2509,2517,3,466,233,0,2510,
        2511,5,11,0,0,2511,2514,3,1380,690,0,2512,2513,5,10,0,0,2513,2515,
        3,466,233,0,2514,2512,1,0,0,0,2514,2515,1,0,0,0,2515,2517,1,0,0,
        0,2516,2508,1,0,0,0,2516,2510,1,0,0,0,2516,2517,1,0,0,0,2517,123,
        1,0,0,0,2518,2520,3,126,63,0,2519,2518,1,0,0,0,2520,2521,1,0,0,0,
        2521,2519,1,0,0,0,2521,2522,1,0,0,0,2522,125,1,0,0,0,2523,2527,5,
        307,0,0,2524,2525,3,16,8,0,2525,2526,3,292,146,0,2526,2528,1,0,0,
        0,2527,2524,1,0,0,0,2527,2528,1,0,0,0,2528,2536,1,0,0,0,2529,2533,
        5,326,0,0,2530,2534,3,288,144,0,2531,2532,5,438,0,0,2532,2534,3,
        198,99,0,2533,2530,1,0,0,0,2533,2531,1,0,0,0,2534,2536,1,0,0,0,2535,
        2523,1,0,0,0,2535,2529,1,0,0,0,2536,127,1,0,0,0,2537,2538,5,62,0,
        0,2538,2539,5,415,0,0,2539,2540,5,105,0,0,2540,2541,5,2,0,0,2541,
        2542,3,132,66,0,2542,2543,5,3,0,0,2543,2564,1,0,0,0,2544,2545,5,
        62,0,0,2545,2546,5,415,0,0,2546,2547,5,68,0,0,2547,2548,5,2,0,0,
        2548,2549,3,1280,640,0,2549,2550,5,3,0,0,2550,2564,1,0,0,0,2551,
        2552,5,62,0,0,2552,2553,5,415,0,0,2553,2554,5,64,0,0,2554,2555,5,
        2,0,0,2555,2556,3,1280,640,0,2556,2557,5,3,0,0,2557,2558,5,94,0,
        0,2558,2559,5,2,0,0,2559,2560,3,1280,640,0,2560,2561,5,3,0,0,2561,
        2564,1,0,0,0,2562,2564,5,53,0,0,2563,2537,1,0,0,0,2563,2544,1,0,
        0,0,2563,2551,1,0,0,0,2563,2562,1,0,0,0,2564,129,1,0,0,0,2565,2566,
        3,1378,689,0,2566,2567,3,1356,678,0,2567,131,1,0,0,0,2568,2573,3,
        130,65,0,2569,2570,5,6,0,0,2570,2572,3,130,65,0,2571,2569,1,0,0,
        0,2572,2575,1,0,0,0,2573,2571,1,0,0,0,2573,2574,1,0,0,0,2574,133,
        1,0,0,0,2575,2573,1,0,0,0,2576,2577,5,138,0,0,2577,2578,5,353,0,
        0,2578,2579,3,524,262,0,2579,2580,3,136,68,0,2580,135,1,0,0,0,2581,
        2586,3,138,69,0,2582,2583,5,6,0,0,2583,2585,3,138,69,0,2584,2582,
        1,0,0,0,2585,2588,1,0,0,0,2586,2584,1,0,0,0,2586,2587,1,0,0,0,2587,
        137,1,0,0,0,2588,2586,1,0,0,0,2589,2590,5,133,0,0,2590,2591,5,143,
        0,0,2591,2592,3,1102,551,0,2592,2593,3,108,54,0,2593,2613,1,0,0,
        0,2594,2595,5,191,0,0,2595,2598,5,143,0,0,2596,2597,5,220,0,0,2597,
        2599,5,389,0,0,2598,2596,1,0,0,0,2598,2599,1,0,0,0,2599,2600,1,0,
        0,0,2600,2601,3,1372,686,0,2601,2602,3,108,54,0,2602,2613,1,0,0,
        0,2603,2604,5,138,0,0,2604,2605,5,143,0,0,2605,2606,3,1372,686,0,
        2606,2607,3,726,363,0,2607,2608,5,353,0,0,2608,2609,3,1118,559,0,
        2609,2610,3,110,55,0,2610,2611,3,108,54,0,2611,2613,1,0,0,0,2612,
        2589,1,0,0,0,2612,2594,1,0,0,0,2612,2603,1,0,0,0,2613,139,1,0,0,
        0,2614,2617,5,157,0,0,2615,2618,3,954,477,0,2616,2618,5,30,0,0,2617,
        2615,1,0,0,0,2617,2616,1,0,0,0,2618,141,1,0,0,0,2619,2620,5,169,
        0,0,2620,2621,3,156,78,0,2621,2622,3,1336,668,0,2622,2623,3,214,
        107,0,2623,2624,3,144,72,0,2624,2625,3,146,73,0,2625,2626,3,148,
        74,0,2626,2627,3,158,79,0,2627,2628,3,16,8,0,2628,2629,3,150,75,
        0,2629,2630,3,1094,547,0,2630,2642,1,0,0,0,2631,2632,5,169,0,0,2632,
        2633,5,2,0,0,2633,2634,3,894,447,0,2634,2635,5,3,0,0,2635,2636,5,
        94,0,0,2636,2637,3,146,73,0,2637,2638,3,148,74,0,2638,2639,3,16,
        8,0,2639,2640,3,150,75,0,2640,2642,1,0,0,0,2641,2619,1,0,0,0,2641,
        2631,1,0,0,0,2642,143,1,0,0,0,2643,2644,7,10,0,0,2644,145,1,0,0,
        0,2645,2648,5,290,0,0,2646,2648,1,0,0,0,2647,2645,1,0,0,0,2647,2646,
        1,0,0,0,2648,147,1,0,0,0,2649,2653,3,1358,679,0,2650,2653,5,336,
        0,0,2651,2653,5,337,0,0,2652,2649,1,0,0,0,2652,2650,1,0,0,0,2652,
        2651,1,0,0,0,2653,149,1,0,0,0,2654,2660,3,152,76,0,2655,2656,5,2,
        0,0,2656,2657,3,162,81,0,2657,2658,5,3,0,0,2658,2660,1,0,0,0,2659,
        2654,1,0,0,0,2659,2655,1,0,0,0,2660,151,1,0,0,0,2661,2663,3,154,
        77,0,2662,2661,1,0,0,0,2663,2666,1,0,0,0,2664,2662,1,0,0,0,2664,
        2665,1,0,0,0,2665,153,1,0,0,0,2666,2664,1,0,0,0,2667,2703,5,107,
        0,0,2668,2703,5,112,0,0,2669,2670,5,183,0,0,2670,2671,3,834,417,
        0,2671,2672,3,1358,679,0,2672,2703,1,0,0,0,2673,2674,5,78,0,0,2674,
        2675,3,834,417,0,2675,2676,3,1358,679,0,2676,2703,1,0,0,0,2677,2703,
        5,171,0,0,2678,2703,5,216,0,0,2679,2680,5,291,0,0,2680,2681,3,834,
        417,0,2681,2682,3,1358,679,0,2682,2703,1,0,0,0,2683,2684,5,197,0,
        0,2684,2685,3,834,417,0,2685,2686,3,1358,679,0,2686,2703,1,0,0,0,
        2687,2688,5,209,0,0,2688,2689,5,291,0,0,2689,2703,3,216,108,0,2690,
        2691,5,209,0,0,2691,2692,5,291,0,0,2692,2703,5,9,0,0,2693,2694,5,
        209,0,0,2694,2695,5,77,0,0,2695,2696,5,78,0,0,2696,2703,3,216,108,
        0,2697,2698,5,209,0,0,2698,2699,5,78,0,0,2699,2703,3,216,108,0,2700,
        2701,5,194,0,0,2701,2703,3,1358,679,0,2702,2667,1,0,0,0,2702,2668,
        1,0,0,0,2702,2669,1,0,0,0,2702,2673,1,0,0,0,2702,2677,1,0,0,0,2702,
        2678,1,0,0,0,2702,2679,1,0,0,0,2702,2683,1,0,0,0,2702,2687,1,0,0,
        0,2702,2690,1,0,0,0,2702,2693,1,0,0,0,2702,2697,1,0,0,0,2702,2700,
        1,0,0,0,2703,155,1,0,0,0,2704,2707,5,107,0,0,2705,2707,1,0,0,0,2706,
        2704,1,0,0,0,2706,2705,1,0,0,0,2707,157,1,0,0,0,2708,2709,3,160,
        80,0,2709,2710,5,184,0,0,2710,2711,3,1358,679,0,2711,2714,1,0,0,
        0,2712,2714,1,0,0,0,2713,2708,1,0,0,0,2713,2712,1,0,0,0,2714,159,
        1,0,0,0,2715,2718,5,100,0,0,2716,2718,1,0,0,0,2717,2715,1,0,0,0,
        2717,2716,1,0,0,0,2718,161,1,0,0,0,2719,2724,3,164,82,0,2720,2721,
        5,6,0,0,2721,2723,3,164,82,0,2722,2720,1,0,0,0,2723,2726,1,0,0,0,
        2724,2722,1,0,0,0,2724,2725,1,0,0,0,2725,163,1,0,0,0,2726,2724,1,
        0,0,0,2727,2728,3,1380,690,0,2728,2729,3,166,83,0,2729,165,1,0,0,
        0,2730,2739,3,66,33,0,2731,2739,3,292,146,0,2732,2739,5,9,0,0,2733,
        2734,5,2,0,0,2734,2735,3,168,84,0,2735,2736,5,3,0,0,2736,2739,1,
        0,0,0,2737,2739,1,0,0,0,2738,2730,1,0,0,0,2738,2731,1,0,0,0,2738,
        2732,1,0,0,0,2738,2733,1,0,0,0,2738,2737,1,0,0,0,2739,167,1,0,0,
        0,2740,2745,3,170,85,0,2741,2742,5,6,0,0,2742,2744,3,170,85,0,2743,
        2741,1,0,0,0,2744,2747,1,0,0,0,2745,2743,1,0,0,0,2745,2746,1,0,0,
        0,2746,169,1,0,0,0,2747,2745,1,0,0,0,2748,2749,3,66,33,0,2749,171,
        1,0,0,0,2750,2751,5,46,0,0,2751,2752,3,174,87,0,2752,2756,5,92,0,
        0,2753,2754,5,220,0,0,2754,2755,5,77,0,0,2755,2757,5,389,0,0,2756,
        2753,1,0,0,0,2756,2757,1,0,0,0,2757,2758,1,0,0,0,2758,2789,3,1336,
        668,0,2759,2760,5,2,0,0,2760,2761,3,176,88,0,2761,2762,5,3,0,0,2762,
        2763,3,238,119,0,2763,2764,3,240,120,0,2764,2765,3,248,124,0,2765,
        2766,3,250,125,0,2766,2767,3,252,126,0,2767,2768,3,254,127,0,2768,
        2790,1,0,0,0,2769,2770,5,268,0,0,2770,2771,3,524,262,0,2771,2772,
        3,178,89,0,2772,2773,3,240,120,0,2773,2774,3,248,124,0,2774,2775,
        3,250,125,0,2775,2776,3,252,126,0,2776,2777,3,254,127,0,2777,2790,
        1,0,0,0,2778,2779,5,278,0,0,2779,2780,5,268,0,0,2780,2781,3,1336,
        668,0,2781,2782,3,178,89,0,2782,2783,3,128,64,0,2783,2784,3,240,
        120,0,2784,2785,3,248,124,0,2785,2786,3,250,125,0,2786,2787,3,252,
        126,0,2787,2788,3,254,127,0,2788,2790,1,0,0,0,2789,2759,1,0,0,0,
        2789,2769,1,0,0,0,2789,2778,1,0,0,0,2790,173,1,0,0,0,2791,2800,5,
        347,0,0,2792,2800,5,345,0,0,2793,2794,5,245,0,0,2794,2800,7,11,0,
        0,2795,2796,5,213,0,0,2796,2800,7,11,0,0,2797,2800,5,360,0,0,2798,
        2800,1,0,0,0,2799,2791,1,0,0,0,2799,2792,1,0,0,0,2799,2793,1,0,0,
        0,2799,2795,1,0,0,0,2799,2797,1,0,0,0,2799,2798,1,0,0,0,2800,175,
        1,0,0,0,2801,2804,3,180,90,0,2802,2804,1,0,0,0,2803,2801,1,0,0,0,
        2803,2802,1,0,0,0,2804,177,1,0,0,0,2805,2806,5,2,0,0,2806,2807,3,
        182,91,0,2807,2808,5,3,0,0,2808,2811,1,0,0,0,2809,2811,1,0,0,0,2810,
        2805,1,0,0,0,2810,2809,1,0,0,0,2811,179,1,0,0,0,2812,2817,3,184,
        92,0,2813,2814,5,6,0,0,2814,2816,3,184,92,0,2815,2813,1,0,0,0,2816,
        2819,1,0,0,0,2817,2815,1,0,0,0,2817,2818,1,0,0,0,2818,181,1,0,0,
        0,2819,2817,1,0,0,0,2820,2825,3,186,93,0,2821,2822,5,6,0,0,2822,
        2824,3,186,93,0,2823,2821,1,0,0,0,2824,2827,1,0,0,0,2825,2823,1,
        0,0,0,2825,2826,1,0,0,0,2826,183,1,0,0,0,2827,2825,1,0,0,0,2828,
        2832,3,208,104,0,2829,2832,3,202,101,0,2830,2832,3,188,94,0,2831,
        2828,1,0,0,0,2831,2829,1,0,0,0,2831,2830,1,0,0,0,2832,185,1,0,0,
        0,2833,2836,3,190,95,0,2834,2836,3,208,104,0,2835,2833,1,0,0,0,2835,
        2834,1,0,0,0,2836,187,1,0,0,0,2837,2838,3,1372,686,0,2838,2839,3,
        1118,559,0,2839,2840,3,340,170,0,2840,2841,3,192,96,0,2841,189,1,
        0,0,0,2842,2845,3,1372,686,0,2843,2844,5,105,0,0,2844,2846,5,273,
        0,0,2845,2843,1,0,0,0,2845,2846,1,0,0,0,2846,2847,1,0,0,0,2847,2848,
        3,192,96,0,2848,191,1,0,0,0,2849,2851,3,194,97,0,2850,2849,1,0,0,
        0,2851,2854,1,0,0,0,2852,2850,1,0,0,0,2852,2853,1,0,0,0,2853,193,
        1,0,0,0,2854,2852,1,0,0,0,2855,2856,5,45,0,0,2856,2857,3,1340,670,
        0,2857,2858,3,196,98,0,2858,2864,1,0,0,0,2859,2864,3,196,98,0,2860,
        2864,3,200,100,0,2861,2862,5,43,0,0,2862,2864,3,524,262,0,2863,2855,
        1,0,0,0,2863,2859,1,0,0,0,2863,2860,1,0,0,0,2863,2861,1,0,0,0,2864,
        195,1,0,0,0,2865,2866,5,77,0,0,2866,2904,5,78,0,0,2867,2904,5,78,
        0,0,2868,2869,5,98,0,0,2869,2870,3,664,332,0,2870,2871,3,256,128,
        0,2871,2904,1,0,0,0,2872,2873,5,85,0,0,2873,2874,5,236,0,0,2874,
        2875,3,664,332,0,2875,2876,3,256,128,0,2876,2904,1,0,0,0,2877,2878,
        5,42,0,0,2878,2879,5,2,0,0,2879,2880,3,1162,581,0,2880,2881,5,3,
        0,0,2881,2882,3,212,106,0,2882,2904,1,0,0,0,2883,2884,5,53,0,0,2884,
        2904,3,1204,602,0,2885,2886,5,438,0,0,2886,2887,3,198,99,0,2887,
        2895,5,36,0,0,2888,2889,5,219,0,0,2889,2896,3,284,142,0,2890,2891,
        5,2,0,0,2891,2892,3,1162,581,0,2892,2893,5,3,0,0,2893,2894,5,440,
        0,0,2894,2896,1,0,0,0,2895,2888,1,0,0,0,2895,2890,1,0,0,0,2896,2904,
        1,0,0,0,2897,2898,5,86,0,0,2898,2899,3,1336,668,0,2899,2900,3,214,
        107,0,2900,2901,3,222,111,0,2901,2902,3,230,115,0,2902,2904,1,0,
        0,0,2903,2865,1,0,0,0,2903,2867,1,0,0,0,2903,2868,1,0,0,0,2903,2872,
        1,0,0,0,2903,2877,1,0,0,0,2903,2883,1,0,0,0,2903,2885,1,0,0,0,2903,
        2897,1,0,0,0,2904,197,1,0,0,0,2905,2909,5,139,0,0,2906,2907,5,147,
        0,0,2907,2909,5,53,0,0,2908,2905,1,0,0,0,2908,2906,1,0,0,0,2909,
        199,1,0,0,0,2910,2916,5,54,0,0,2911,2912,5,77,0,0,2912,2916,5,54,
        0,0,2913,2914,5,69,0,0,2914,2916,7,8,0,0,2915,2910,1,0,0,0,2915,
        2911,1,0,0,0,2915,2913,1,0,0,0,2916,201,1,0,0,0,2917,2918,5,120,
        0,0,2918,2919,3,1336,668,0,2919,2920,3,204,102,0,2920,203,1,0,0,
        0,2921,2922,7,12,0,0,2922,2924,3,206,103,0,2923,2921,1,0,0,0,2924,
        2927,1,0,0,0,2925,2923,1,0,0,0,2925,2926,1,0,0,0,2926,205,1,0,0,
        0,2927,2925,1,0,0,0,2928,2929,7,13,0,0,2929,207,1,0,0,0,2930,2931,
        5,45,0,0,2931,2932,3,1340,670,0,2932,2933,3,210,105,0,2933,2936,
        1,0,0,0,2934,2936,3,210,105,0,2935,2930,1,0,0,0,2935,2934,1,0,0,
        0,2936,209,1,0,0,0,2937,2938,5,42,0,0,2938,2939,5,2,0,0,2939,2940,
        3,1162,581,0,2940,2941,5,3,0,0,2941,2942,3,440,220,0,2942,2996,1,
        0,0,0,2943,2955,5,98,0,0,2944,2945,5,2,0,0,2945,2946,3,216,108,0,
        2946,2947,5,3,0,0,2947,2948,3,220,110,0,2948,2949,3,664,332,0,2949,
        2950,3,256,128,0,2950,2951,3,440,220,0,2951,2956,1,0,0,0,2952,2953,
        3,258,129,0,2953,2954,3,440,220,0,2954,2956,1,0,0,0,2955,2944,1,
        0,0,0,2955,2952,1,0,0,0,2956,2996,1,0,0,0,2957,2958,5,85,0,0,2958,
        2970,5,236,0,0,2959,2960,5,2,0,0,2960,2961,3,216,108,0,2961,2962,
        5,3,0,0,2962,2963,3,220,110,0,2963,2964,3,664,332,0,2964,2965,3,
        256,128,0,2965,2966,3,440,220,0,2966,2971,1,0,0,0,2967,2968,3,258,
        129,0,2968,2969,3,440,220,0,2969,2971,1,0,0,0,2970,2959,1,0,0,0,
        2970,2967,1,0,0,0,2971,2996,1,0,0,0,2972,2973,5,199,0,0,2973,2974,
        3,596,298,0,2974,2975,5,2,0,0,2975,2976,3,224,112,0,2976,2977,5,
        3,0,0,2977,2978,3,220,110,0,2978,2979,3,664,332,0,2979,2980,3,256,
        128,0,2980,2981,3,228,114,0,2981,2982,3,440,220,0,2982,2996,1,0,
        0,0,2983,2984,5,63,0,0,2984,2985,5,236,0,0,2985,2986,5,2,0,0,2986,
        2987,3,216,108,0,2987,2988,5,3,0,0,2988,2989,5,86,0,0,2989,2990,
        3,1336,668,0,2990,2991,3,214,107,0,2991,2992,3,222,111,0,2992,2993,
        3,230,115,0,2993,2994,3,440,220,0,2994,2996,1,0,0,0,2995,2937,1,
        0,0,0,2995,2943,1,0,0,0,2995,2957,1,0,0,0,2995,2972,1,0,0,0,2995,
        2983,1,0,0,0,2996,211,1,0,0,0,2997,2998,5,262,0,0,2998,3001,5,228,
        0,0,2999,3001,1,0,0,0,3000,2997,1,0,0,0,3000,2999,1,0,0,0,3001,213,
        1,0,0,0,3002,3003,5,2,0,0,3003,3004,3,216,108,0,3004,3005,5,3,0,
        0,3005,3008,1,0,0,0,3006,3008,1,0,0,0,3007,3002,1,0,0,0,3007,3006,
        1,0,0,0,3008,215,1,0,0,0,3009,3014,3,218,109,0,3010,3011,5,6,0,0,
        3011,3013,3,218,109,0,3012,3010,1,0,0,0,3013,3016,1,0,0,0,3014,3012,
        1,0,0,0,3014,3015,1,0,0,0,3015,217,1,0,0,0,3016,3014,1,0,0,0,3017,
        3018,3,1372,686,0,3018,219,1,0,0,0,3019,3020,5,441,0,0,3020,3021,
        5,2,0,0,3021,3022,3,216,108,0,3022,3023,5,3,0,0,3023,3026,1,0,0,
        0,3024,3026,1,0,0,0,3025,3019,1,0,0,0,3025,3024,1,0,0,0,3026,221,
        1,0,0,0,3027,3028,5,249,0,0,3028,3031,7,14,0,0,3029,3031,1,0,0,0,
        3030,3027,1,0,0,0,3030,3029,1,0,0,0,3031,223,1,0,0,0,3032,3037,3,
        226,113,0,3033,3034,5,6,0,0,3034,3036,3,226,113,0,3035,3033,1,0,
        0,0,3036,3039,1,0,0,0,3037,3035,1,0,0,0,3037,3038,1,0,0,0,3038,225,
        1,0,0,0,3039,3037,1,0,0,0,3040,3041,3,602,301,0,3041,3048,5,105,
        0,0,3042,3049,3,684,342,0,3043,3044,5,271,0,0,3044,3045,5,2,0,0,
        3045,3046,3,684,342,0,3046,3047,5,3,0,0,3047,3049,1,0,0,0,3048,3042,
        1,0,0,0,3048,3043,1,0,0,0,3049,227,1,0,0,0,3050,3051,5,103,0,0,3051,
        3052,5,2,0,0,3052,3053,3,1162,581,0,3053,3054,5,3,0,0,3054,3057,
        1,0,0,0,3055,3057,1,0,0,0,3056,3050,1,0,0,0,3056,3055,1,0,0,0,3057,
        229,1,0,0,0,3058,3068,3,232,116,0,3059,3068,3,234,117,0,3060,3061,
        3,232,116,0,3061,3062,3,234,117,0,3062,3068,1,0,0,0,3063,3064,3,
        234,117,0,3064,3065,3,232,116,0,3065,3068,1,0,0,0,3066,3068,1,0,
        0,0,3067,3058,1,0,0,0,3067,3059,1,0,0,0,3067,3060,1,0,0,0,3067,3063,
        1,0,0,0,3067,3066,1,0,0,0,3068,231,1,0,0,0,3069,3070,5,80,0,0,3070,
        3071,5,362,0,0,3071,3072,3,236,118,0,3072,233,1,0,0,0,3073,3074,
        5,80,0,0,3074,3075,5,182,0,0,3075,3076,3,236,118,0,3076,235,1,0,
        0,0,3077,3078,5,262,0,0,3078,3084,5,132,0,0,3079,3084,5,308,0,0,
        3080,3084,5,150,0,0,3081,3082,5,326,0,0,3082,3084,7,15,0,0,3083,
        3077,1,0,0,0,3083,3079,1,0,0,0,3083,3080,1,0,0,0,3083,3081,1,0,0,
        0,3084,237,1,0,0,0,3085,3086,5,229,0,0,3086,3087,5,2,0,0,3087,3088,
        3,1334,667,0,3088,3089,5,3,0,0,3089,3092,1,0,0,0,3090,3092,1,0,0,
        0,3091,3085,1,0,0,0,3091,3090,1,0,0,0,3092,239,1,0,0,0,3093,3096,
        3,242,121,0,3094,3096,1,0,0,0,3095,3093,1,0,0,0,3095,3094,1,0,0,
        0,3096,241,1,0,0,0,3097,3098,5,278,0,0,3098,3099,5,147,0,0,3099,
        3100,3,1372,686,0,3100,3101,5,2,0,0,3101,3102,3,244,122,0,3102,3103,
        5,3,0,0,3103,243,1,0,0,0,3104,3109,3,246,123,0,3105,3106,5,6,0,0,
        3106,3108,3,246,123,0,3107,3105,1,0,0,0,3108,3111,1,0,0,0,3109,3107,
        1,0,0,0,3109,3110,1,0,0,0,3110,245,1,0,0,0,3111,3109,1,0,0,0,3112,
        3113,3,1372,686,0,3113,3114,3,608,304,0,3114,3115,3,610,305,0,3115,
        3127,1,0,0,0,3116,3117,3,1214,607,0,3117,3118,3,608,304,0,3118,3119,
        3,610,305,0,3119,3127,1,0,0,0,3120,3121,5,2,0,0,3121,3122,3,1162,
        581,0,3122,3123,5,3,0,0,3123,3124,3,608,304,0,3124,3125,3,610,305,
        0,3125,3127,1,0,0,0,3126,3112,1,0,0,0,3126,3116,1,0,0,0,3126,3120,
        1,0,0,0,3127,247,1,0,0,0,3128,3129,5,100,0,0,3129,3132,3,1340,670,
        0,3130,3132,1,0,0,0,3131,3128,1,0,0,0,3131,3130,1,0,0,0,3132,249,
        1,0,0,0,3133,3134,5,105,0,0,3134,3139,3,116,58,0,3135,3136,5,372,
        0,0,3136,3139,5,270,0,0,3137,3139,1,0,0,0,3138,3133,1,0,0,0,3138,
        3135,1,0,0,0,3138,3137,1,0,0,0,3139,251,1,0,0,0,3140,3141,5,80,0,
        0,3141,3147,5,161,0,0,3142,3148,5,191,0,0,3143,3144,5,182,0,0,3144,
        3148,5,313,0,0,3145,3146,5,285,0,0,3146,3148,5,313,0,0,3147,3142,
        1,0,0,0,3147,3143,1,0,0,0,3147,3145,1,0,0,0,3148,3151,1,0,0,0,3149,
        3151,1,0,0,0,3150,3140,1,0,0,0,3150,3149,1,0,0,0,3151,253,1,0,0,
        0,3152,3153,5,344,0,0,3153,3156,3,1340,670,0,3154,3156,1,0,0,0,3155,
        3152,1,0,0,0,3155,3154,1,0,0,0,3156,255,1,0,0,0,3157,3158,5,100,
        0,0,3158,3159,5,226,0,0,3159,3160,5,344,0,0,3160,3163,3,1340,670,
        0,3161,3163,1,0,0,0,3162,3157,1,0,0,0,3162,3161,1,0,0,0,3163,257,
        1,0,0,0,3164,3165,5,100,0,0,3165,3166,5,226,0,0,3166,3167,3,1340,
        670,0,3167,259,1,0,0,0,3168,3169,5,46,0,0,3169,3173,5,335,0,0,3170,
        3171,5,220,0,0,3171,3172,5,77,0,0,3172,3174,5,389,0,0,3173,3170,
        1,0,0,0,3173,3174,1,0,0,0,3174,3175,1,0,0,0,3175,3176,3,524,262,
        0,3176,3177,3,870,435,0,3177,3178,5,80,0,0,3178,3179,3,1280,640,
        0,3179,3180,5,64,0,0,3180,3181,3,1056,528,0,3181,261,1,0,0,0,3182,
        3183,5,138,0,0,3183,3186,5,335,0,0,3184,3185,5,220,0,0,3185,3187,
        5,389,0,0,3186,3184,1,0,0,0,3186,3187,1,0,0,0,3187,3188,1,0,0,0,
        3188,3189,3,524,262,0,3189,3190,5,326,0,0,3190,3191,5,335,0,0,3191,
        3192,3,1364,682,0,3192,263,1,0,0,0,3193,3194,5,46,0,0,3194,3195,
        3,174,87,0,3195,3199,5,92,0,0,3196,3197,5,220,0,0,3197,3198,5,77,
        0,0,3198,3200,5,389,0,0,3199,3196,1,0,0,0,3199,3200,1,0,0,0,3200,
        3201,1,0,0,0,3201,3202,3,266,133,0,3202,3203,5,36,0,0,3203,3204,
        3,960,480,0,3204,3205,3,268,134,0,3205,265,1,0,0,0,3206,3207,3,1336,
        668,0,3207,3208,3,214,107,0,3208,3209,3,248,124,0,3209,3210,3,250,
        125,0,3210,3211,3,252,126,0,3211,3212,3,254,127,0,3212,267,1,0,0,
        0,3213,3217,5,105,0,0,3214,3218,5,174,0,0,3215,3216,5,262,0,0,3216,
        3218,5,174,0,0,3217,3214,1,0,0,0,3217,3215,1,0,0,0,3218,3221,1,0,
        0,0,3219,3221,1,0,0,0,3220,3213,1,0,0,0,3220,3219,1,0,0,0,3221,269,
        1,0,0,0,3222,3223,5,46,0,0,3223,3224,3,274,137,0,3224,3225,5,251,
        0,0,3225,3229,5,369,0,0,3226,3227,5,220,0,0,3227,3228,5,77,0,0,3228,
        3230,5,389,0,0,3229,3226,1,0,0,0,3229,3230,1,0,0,0,3230,3231,1,0,
        0,0,3231,3232,3,272,136,0,3232,3233,5,36,0,0,3233,3234,3,960,480,
        0,3234,3235,3,268,134,0,3235,271,1,0,0,0,3236,3237,3,1336,668,0,
        3237,3238,3,214,107,0,3238,3239,3,248,124,0,3239,3240,3,118,59,0,
        3240,3241,3,254,127,0,3241,273,1,0,0,0,3242,3245,5,360,0,0,3243,
        3245,1,0,0,0,3244,3242,1,0,0,0,3244,3243,1,0,0,0,3245,275,1,0,0,
        0,3246,3247,5,298,0,0,3247,3248,5,251,0,0,3248,3249,5,369,0,0,3249,
        3250,3,592,296,0,3250,3251,3,1336,668,0,3251,3252,3,268,134,0,3252,
        277,1,0,0,0,3253,3254,5,46,0,0,3254,3255,3,174,87,0,3255,3259,5,
        321,0,0,3256,3257,5,220,0,0,3257,3258,5,77,0,0,3258,3260,5,389,0,
        0,3259,3256,1,0,0,0,3259,3260,1,0,0,0,3260,3261,1,0,0,0,3261,3262,
        3,1336,668,0,3262,3263,3,282,141,0,3263,279,1,0,0,0,3264,3265,5,
        138,0,0,3265,3268,5,321,0,0,3266,3267,5,220,0,0,3267,3269,5,389,
        0,0,3268,3266,1,0,0,0,3268,3269,1,0,0,0,3269,3270,1,0,0,0,3270,3271,
        3,1336,668,0,3271,3272,3,286,143,0,3272,281,1,0,0,0,3273,3276,3,
        286,143,0,3274,3276,1,0,0,0,3275,3273,1,0,0,0,3275,3274,1,0,0,0,
        3276,283,1,0,0,0,3277,3278,5,2,0,0,3278,3279,3,286,143,0,3279,3280,
        5,3,0,0,3280,3283,1,0,0,0,3281,3283,1,0,0,0,3282,3277,1,0,0,0,3282,
        3281,1,0,0,0,3283,285,1,0,0,0,3284,3286,3,288,144,0,3285,3284,1,
        0,0,0,3286,3287,1,0,0,0,3287,3285,1,0,0,0,3287,3288,1,0,0,0,3288,
        287,1,0,0,0,3289,3290,5,36,0,0,3290,3320,3,1122,561,0,3291,3292,
        5,148,0,0,3292,3320,3,292,146,0,3293,3320,5,173,0,0,3294,3295,5,
        225,0,0,3295,3296,3,290,145,0,3296,3297,3,292,146,0,3297,3320,1,
        0,0,0,3298,3299,5,252,0,0,3299,3320,3,292,146,0,3300,3301,5,255,
        0,0,3301,3320,3,292,146,0,3302,3303,5,262,0,0,3303,3320,7,16,0,0,
        3304,3305,5,274,0,0,3305,3306,5,147,0,0,3306,3320,3,524,262,0,3307,
        3308,5,321,0,0,3308,3309,5,259,0,0,3309,3320,3,524,262,0,3310,3311,
        5,333,0,0,3311,3312,3,16,8,0,3312,3313,3,292,146,0,3313,3320,1,0,
        0,0,3314,3315,5,307,0,0,3315,3317,3,16,8,0,3316,3318,3,292,146,0,
        3317,3316,1,0,0,0,3317,3318,1,0,0,0,3318,3320,1,0,0,0,3319,3289,
        1,0,0,0,3319,3291,1,0,0,0,3319,3293,1,0,0,0,3319,3294,1,0,0,0,3319,
        3298,1,0,0,0,3319,3300,1,0,0,0,3319,3302,1,0,0,0,3319,3304,1,0,0,
        0,3319,3307,1,0,0,0,3319,3310,1,0,0,0,3319,3314,1,0,0,0,3320,289,
        1,0,0,0,3321,3324,5,147,0,0,3322,3324,1,0,0,0,3323,3321,1,0,0,0,
        3323,3322,1,0,0,0,3324,291,1,0,0,0,3325,3332,3,1354,677,0,3326,3327,
        5,12,0,0,3327,3332,3,1354,677,0,3328,3329,5,13,0,0,3329,3332,3,1354,
        677,0,3330,3332,3,1364,682,0,3331,3325,1,0,0,0,3331,3326,1,0,0,0,
        3331,3328,1,0,0,0,3331,3330,1,0,0,0,3332,293,1,0,0,0,3333,3338,3,
        292,146,0,3334,3335,5,6,0,0,3335,3337,3,292,146,0,3336,3334,1,0,
        0,0,3337,3340,1,0,0,0,3338,3336,1,0,0,0,3338,3339,1,0,0,0,3339,295,
        1,0,0,0,3340,3338,1,0,0,0,3341,3342,5,46,0,0,3342,3343,3,618,309,
        0,3343,3344,3,298,149,0,3344,3345,3,308,154,0,3345,3346,5,238,0,
        0,3346,3352,3,1340,670,0,3347,3348,5,215,0,0,3348,3349,3,300,150,
        0,3349,3350,3,302,151,0,3350,3351,3,306,153,0,3351,3353,1,0,0,0,
        3352,3347,1,0,0,0,3352,3353,1,0,0,0,3353,297,1,0,0,0,3354,3357,5,
        352,0,0,3355,3357,1,0,0,0,3356,3354,1,0,0,0,3356,3355,1,0,0,0,3357,
        299,1,0,0,0,3358,3360,3,1340,670,0,3359,3361,3,526,263,0,3360,3359,
        1,0,0,0,3360,3361,1,0,0,0,3361,301,1,0,0,0,3362,3363,5,230,0,0,3363,
        3366,3,300,150,0,3364,3366,1,0,0,0,3365,3362,1,0,0,0,3365,3364,1,
        0,0,0,3366,303,1,0,0,0,3367,3368,5,366,0,0,3368,3372,3,300,150,0,
        3369,3370,5,262,0,0,3370,3372,5,366,0,0,3371,3367,1,0,0,0,3371,3369,
        1,0,0,0,3372,305,1,0,0,0,3373,3376,3,304,152,0,3374,3376,1,0,0,0,
        3375,3373,1,0,0,0,3375,3374,1,0,0,0,3376,307,1,0,0,0,3377,3380,5,
        288,0,0,3378,3380,1,0,0,0,3379,3377,1,0,0,0,3379,3378,1,0,0,0,3380,
        309,1,0,0,0,3381,3382,5,46,0,0,3382,3383,5,344,0,0,3383,3384,3,1340,
        670,0,3384,3385,3,312,156,0,3385,3386,5,246,0,0,3386,3387,3,1358,
        679,0,3387,3388,3,118,59,0,3388,311,1,0,0,0,3389,3390,5,275,0,0,
        3390,3393,3,1368,684,0,3391,3393,1,0,0,0,3392,3389,1,0,0,0,3392,
        3391,1,0,0,0,3393,313,1,0,0,0,3394,3395,5,191,0,0,3395,3398,5,344,
        0,0,3396,3397,5,220,0,0,3397,3399,5,389,0,0,3398,3396,1,0,0,0,3398,
        3399,1,0,0,0,3399,3400,1,0,0,0,3400,3401,3,1340,670,0,3401,315,1,
        0,0,0,3402,3403,5,46,0,0,3403,3407,5,204,0,0,3404,3405,5,220,0,0,
        3405,3406,5,77,0,0,3406,3408,5,389,0,0,3407,3404,1,0,0,0,3407,3408,
        1,0,0,0,3408,3409,1,0,0,0,3409,3410,3,1340,670,0,3410,3411,3,16,
        8,0,3411,3412,3,318,159,0,3412,317,1,0,0,0,3413,3415,3,320,160,0,
        3414,3413,1,0,0,0,3415,3418,1,0,0,0,3416,3414,1,0,0,0,3416,3417,
        1,0,0,0,3417,319,1,0,0,0,3418,3416,1,0,0,0,3419,3420,5,316,0,0,3420,
        3427,3,1340,670,0,3421,3422,5,368,0,0,3422,3427,3,72,36,0,3423,3424,
        5,64,0,0,3424,3427,3,72,36,0,3425,3427,5,150,0,0,3426,3419,1,0,0,
        0,3426,3421,1,0,0,0,3426,3423,1,0,0,0,3426,3425,1,0,0,0,3427,321,
        1,0,0,0,3428,3429,5,138,0,0,3429,3430,5,204,0,0,3430,3431,3,1340,
        670,0,3431,3432,5,362,0,0,3432,3433,3,324,162,0,3433,323,1,0,0,0,
        3434,3436,3,326,163,0,3435,3434,1,0,0,0,3436,3439,1,0,0,0,3437,3435,
        1,0,0,0,3437,3438,1,0,0,0,3438,325,1,0,0,0,3439,3437,1,0,0,0,3440,
        3441,5,94,0,0,3441,3442,3,72,36,0,3442,327,1,0,0,0,3443,3444,5,138,
        0,0,3444,3445,5,204,0,0,3445,3446,3,1340,670,0,3446,3447,3,40,20,
        0,3447,3448,3,516,258,0,3448,3449,3,1340,670,0,3449,3548,1,0,0,0,
        3450,3451,5,138,0,0,3451,3452,5,204,0,0,3452,3453,3,1340,670,0,3453,
        3454,3,40,20,0,3454,3455,3,514,257,0,3455,3456,3,524,262,0,3456,
        3548,1,0,0,0,3457,3458,5,138,0,0,3458,3459,5,204,0,0,3459,3460,3,
        1340,670,0,3460,3461,3,40,20,0,3461,3462,5,136,0,0,3462,3463,3,650,
        325,0,3463,3548,1,0,0,0,3464,3465,5,138,0,0,3465,3466,5,204,0,0,
        3466,3467,3,1340,670,0,3467,3468,3,40,20,0,3468,3469,5,41,0,0,3469,
        3470,5,2,0,0,3470,3471,3,1118,559,0,3471,3472,5,36,0,0,3472,3473,
        3,1118,559,0,3473,3474,5,3,0,0,3474,3548,1,0,0,0,3475,3476,5,138,
        0,0,3476,3477,5,204,0,0,3477,3478,3,1340,670,0,3478,3479,3,40,20,
        0,3479,3480,5,189,0,0,3480,3481,3,1118,559,0,3481,3548,1,0,0,0,3482,
        3483,5,138,0,0,3483,3484,5,204,0,0,3484,3485,3,1340,670,0,3485,3486,
        3,40,20,0,3486,3487,5,211,0,0,3487,3488,3,626,313,0,3488,3548,1,
        0,0,0,3489,3490,5,138,0,0,3490,3491,5,204,0,0,3491,3492,3,1340,670,
        0,3492,3493,3,40,20,0,3493,3494,5,271,0,0,3494,3495,3,688,344,0,
        3495,3548,1,0,0,0,3496,3497,5,138,0,0,3497,3498,5,204,0,0,3498,3499,
        3,1340,670,0,3499,3500,3,40,20,0,3500,3501,5,271,0,0,3501,3502,5,
        156,0,0,3502,3503,3,524,262,0,3503,3504,5,100,0,0,3504,3505,3,1340,
        670,0,3505,3548,1,0,0,0,3506,3507,5,138,0,0,3507,3508,5,204,0,0,
        3508,3509,3,1340,670,0,3509,3510,3,40,20,0,3510,3511,5,271,0,0,3511,
        3512,5,206,0,0,3512,3513,3,524,262,0,3513,3514,5,100,0,0,3514,3515,
        3,1340,670,0,3515,3548,1,0,0,0,3516,3517,5,138,0,0,3517,3518,5,204,
        0,0,3518,3519,3,1340,670,0,3519,3520,3,40,20,0,3520,3521,5,289,0,
        0,3521,3522,3,626,313,0,3522,3548,1,0,0,0,3523,3524,5,138,0,0,3524,
        3525,5,204,0,0,3525,3526,3,1340,670,0,3526,3527,3,40,20,0,3527,3528,
        5,442,0,0,3528,3529,3,626,313,0,3529,3548,1,0,0,0,3530,3531,5,138,
        0,0,3531,3532,5,204,0,0,3532,3533,3,1340,670,0,3533,3534,3,40,20,
        0,3534,3535,5,443,0,0,3535,3536,5,62,0,0,3536,3537,3,1118,559,0,
        3537,3538,5,238,0,0,3538,3539,3,1340,670,0,3539,3548,1,0,0,0,3540,
        3541,5,138,0,0,3541,3542,5,204,0,0,3542,3543,3,1340,670,0,3543,3544,
        3,40,20,0,3544,3545,5,353,0,0,3545,3546,3,1118,559,0,3546,3548,1,
        0,0,0,3547,3443,1,0,0,0,3547,3450,1,0,0,0,3547,3457,1,0,0,0,3547,
        3464,1,0,0,0,3547,3475,1,0,0,0,3547,3482,1,0,0,0,3547,3489,1,0,0,
        0,3547,3496,1,0,0,0,3547,3506,1,0,0,0,3547,3516,1,0,0,0,3547,3523,
        1,0,0,0,3547,3530,1,0,0,0,3547,3540,1,0,0,0,3548,329,1,0,0,0,3549,
        3550,5,46,0,0,3550,3551,5,63,0,0,3551,3552,5,174,0,0,3552,3553,5,
        374,0,0,3553,3554,3,1340,670,0,3554,3555,3,336,168,0,3555,3556,3,
        340,170,0,3556,331,1,0,0,0,3557,3558,5,215,0,0,3558,3566,3,300,150,
        0,3559,3560,5,262,0,0,3560,3566,5,215,0,0,3561,3562,5,366,0,0,3562,
        3566,3,300,150,0,3563,3564,5,262,0,0,3564,3566,5,366,0,0,3565,3557,
        1,0,0,0,3565,3559,1,0,0,0,3565,3561,1,0,0,0,3565,3563,1,0,0,0,3566,
        333,1,0,0,0,3567,3569,3,332,166,0,3568,3567,1,0,0,0,3569,3570,1,
        0,0,0,3570,3568,1,0,0,0,3570,3571,1,0,0,0,3571,335,1,0,0,0,3572,
        3575,3,334,167,0,3573,3575,1,0,0,0,3574,3572,1,0,0,0,3574,3573,1,
        0,0,0,3575,337,1,0,0,0,3576,3577,5,138,0,0,3577,3578,5,63,0,0,3578,
        3579,5,174,0,0,3579,3580,5,374,0,0,3580,3581,3,1340,670,0,3581,3582,
        3,336,168,0,3582,3583,3,344,172,0,3583,3592,1,0,0,0,3584,3585,5,
        138,0,0,3585,3586,5,63,0,0,3586,3587,5,174,0,0,3587,3588,5,374,0,
        0,3588,3589,3,1340,670,0,3589,3590,3,334,167,0,3590,3592,1,0,0,0,
        3591,3576,1,0,0,0,3591,3584,1,0,0,0,3592,339,1,0,0,0,3593,3594,5,
        273,0,0,3594,3595,5,2,0,0,3595,3596,3,342,171,0,3596,3597,5,3,0,
        0,3597,3600,1,0,0,0,3598,3600,1,0,0,0,3599,3593,1,0,0,0,3599,3598,
        1,0,0,0,3600,341,1,0,0,0,3601,3606,3,350,175,0,3602,3603,5,6,0,0,
        3603,3605,3,350,175,0,3604,3602,1,0,0,0,3605,3608,1,0,0,0,3606,3604,
        1,0,0,0,3606,3607,1,0,0,0,3607,343,1,0,0,0,3608,3606,1,0,0,0,3609,
        3610,5,273,0,0,3610,3611,5,2,0,0,3611,3612,3,346,173,0,3612,3613,
        5,3,0,0,3613,345,1,0,0,0,3614,3619,3,348,174,0,3615,3616,5,6,0,0,
        3616,3618,3,348,174,0,3617,3615,1,0,0,0,3618,3621,1,0,0,0,3619,3617,
        1,0,0,0,3619,3620,1,0,0,0,3620,347,1,0,0,0,3621,3619,1,0,0,0,3622,
        3630,3,350,175,0,3623,3624,5,326,0,0,3624,3630,3,350,175,0,3625,
        3626,5,133,0,0,3626,3630,3,350,175,0,3627,3628,5,191,0,0,3628,3630,
        3,352,176,0,3629,3622,1,0,0,0,3629,3623,1,0,0,0,3629,3625,1,0,0,
        0,3629,3627,1,0,0,0,3630,349,1,0,0,0,3631,3632,3,352,176,0,3632,
        3633,3,354,177,0,3633,351,1,0,0,0,3634,3635,3,1380,690,0,3635,353,
        1,0,0,0,3636,3637,3,1358,679,0,3637,355,1,0,0,0,3638,3639,5,46,0,
        0,3639,3640,5,324,0,0,3640,3641,3,1340,670,0,3641,3642,3,358,179,
        0,3642,3643,3,362,181,0,3643,3644,5,63,0,0,3644,3645,5,174,0,0,3645,
        3646,5,374,0,0,3646,3647,3,1340,670,0,3647,3648,3,340,170,0,3648,
        3664,1,0,0,0,3649,3650,5,46,0,0,3650,3651,5,324,0,0,3651,3652,5,
        220,0,0,3652,3653,5,77,0,0,3653,3654,5,389,0,0,3654,3655,3,1340,
        670,0,3655,3656,3,358,179,0,3656,3657,3,362,181,0,3657,3658,5,63,
        0,0,3658,3659,5,174,0,0,3659,3660,5,374,0,0,3660,3661,3,1340,670,
        0,3661,3662,3,340,170,0,3662,3664,1,0,0,0,3663,3638,1,0,0,0,3663,
        3649,1,0,0,0,3664,357,1,0,0,0,3665,3666,5,353,0,0,3666,3669,3,1358,
        679,0,3667,3669,1,0,0,0,3668,3665,1,0,0,0,3668,3667,1,0,0,0,3669,
        359,1,0,0,0,3670,3673,5,368,0,0,3671,3674,3,1358,679,0,3672,3674,
        5,78,0,0,3673,3671,1,0,0,0,3673,3672,1,0,0,0,3674,361,1,0,0,0,3675,
        3678,3,360,180,0,3676,3678,1,0,0,0,3677,3675,1,0,0,0,3677,3676,1,
        0,0,0,3678,363,1,0,0,0,3679,3680,5,138,0,0,3680,3681,5,324,0,0,3681,
        3687,3,1340,670,0,3682,3688,3,344,172,0,3683,3685,3,360,180,0,3684,
        3686,3,344,172,0,3685,3684,1,0,0,0,3685,3686,1,0,0,0,3686,3688,1,
        0,0,0,3687,3682,1,0,0,0,3687,3683,1,0,0,0,3688,365,1,0,0,0,3689,
        3690,5,46,0,0,3690,3691,5,63,0,0,3691,3692,5,92,0,0,3692,3693,3,
        1336,668,0,3693,3694,5,2,0,0,3694,3695,3,176,88,0,3695,3696,5,3,
        0,0,3696,3697,3,238,119,0,3697,3698,5,324,0,0,3698,3699,3,1340,670,
        0,3699,3700,3,340,170,0,3700,3746,1,0,0,0,3701,3702,5,46,0,0,3702,
        3703,5,63,0,0,3703,3704,5,92,0,0,3704,3705,5,220,0,0,3705,3706,5,
        77,0,0,3706,3707,5,389,0,0,3707,3708,3,1336,668,0,3708,3709,5,2,
        0,0,3709,3710,3,176,88,0,3710,3711,5,3,0,0,3711,3712,3,238,119,0,
        3712,3713,5,324,0,0,3713,3714,3,1340,670,0,3714,3715,3,340,170,0,
        3715,3746,1,0,0,0,3716,3717,5,46,0,0,3717,3718,5,63,0,0,3718,3719,
        5,92,0,0,3719,3720,3,1336,668,0,3720,3721,5,278,0,0,3721,3722,5,
        268,0,0,3722,3723,3,1336,668,0,3723,3724,3,178,89,0,3724,3725,3,
        128,64,0,3725,3726,5,324,0,0,3726,3727,3,1340,670,0,3727,3728,3,
        340,170,0,3728,3746,1,0,0,0,3729,3730,5,46,0,0,3730,3731,5,63,0,
        0,3731,3732,5,92,0,0,3732,3733,5,220,0,0,3733,3734,5,77,0,0,3734,
        3735,5,389,0,0,3735,3736,3,1336,668,0,3736,3737,5,278,0,0,3737,3738,
        5,268,0,0,3738,3739,3,1336,668,0,3739,3740,3,178,89,0,3740,3741,
        3,128,64,0,3741,3742,5,324,0,0,3742,3743,3,1340,670,0,3743,3744,
        3,340,170,0,3744,3746,1,0,0,0,3745,3689,1,0,0,0,3745,3701,1,0,0,
        0,3745,3716,1,0,0,0,3745,3729,1,0,0,0,3746,367,1,0,0,0,3747,3748,
        5,444,0,0,3748,3749,5,63,0,0,3749,3750,5,316,0,0,3750,3751,3,1340,
        670,0,3751,3752,3,372,186,0,3752,3753,5,64,0,0,3753,3754,5,324,0,
        0,3754,3755,3,1340,670,0,3755,3756,5,71,0,0,3756,3757,3,1340,670,
        0,3757,3758,3,340,170,0,3758,369,1,0,0,0,3759,3760,5,74,0,0,3760,
        3763,5,94,0,0,3761,3763,5,59,0,0,3762,3759,1,0,0,0,3762,3761,1,0,
        0,0,3763,371,1,0,0,0,3764,3765,3,370,185,0,3765,3766,5,2,0,0,3766,
        3767,3,1076,538,0,3767,3768,5,3,0,0,3768,3771,1,0,0,0,3769,3771,
        1,0,0,0,3770,3764,1,0,0,0,3770,3769,1,0,0,0,3771,373,1,0,0,0,3772,
        3773,5,46,0,0,3773,3774,5,99,0,0,3774,3775,5,248,0,0,3775,3776,5,
        62,0,0,3776,3777,3,376,188,0,3777,3778,5,324,0,0,3778,3779,3,1340,
        670,0,3779,3780,3,340,170,0,3780,3794,1,0,0,0,3781,3782,5,46,0,0,
        3782,3783,5,99,0,0,3783,3784,5,248,0,0,3784,3785,5,220,0,0,3785,
        3786,5,77,0,0,3786,3787,5,389,0,0,3787,3788,5,62,0,0,3788,3789,3,
        376,188,0,3789,3790,5,324,0,0,3790,3791,3,1340,670,0,3791,3792,3,
        340,170,0,3792,3794,1,0,0,0,3793,3772,1,0,0,0,3793,3781,1,0,0,0,
        3794,375,1,0,0,0,3795,3798,3,1368,684,0,3796,3798,5,99,0,0,3797,
        3795,1,0,0,0,3797,3796,1,0,0,0,3798,377,1,0,0,0,3799,3800,5,191,
        0,0,3800,3801,5,99,0,0,3801,3802,5,248,0,0,3802,3803,5,62,0,0,3803,
        3804,3,376,188,0,3804,3805,5,324,0,0,3805,3806,3,1340,670,0,3806,
        3818,1,0,0,0,3807,3808,5,191,0,0,3808,3809,5,99,0,0,3809,3810,5,
        248,0,0,3810,3811,5,220,0,0,3811,3812,5,389,0,0,3812,3813,5,62,0,
        0,3813,3814,3,376,188,0,3814,3815,5,324,0,0,3815,3816,3,1340,670,
        0,3816,3818,1,0,0,0,3817,3799,1,0,0,0,3817,3807,1,0,0,0,3818,379,
        1,0,0,0,3819,3820,5,138,0,0,3820,3821,5,99,0,0,3821,3822,5,248,0,
        0,3822,3823,5,62,0,0,3823,3824,3,376,188,0,3824,3825,5,324,0,0,3825,
        3826,3,1340,670,0,3826,3827,3,344,172,0,3827,381,1,0,0,0,3828,3829,
        5,46,0,0,3829,3830,5,445,0,0,3830,3831,3,1340,670,0,3831,3832,5,
        80,0,0,3832,3833,3,1336,668,0,3833,3834,3,394,197,0,3834,3835,3,
        396,198,0,3835,3836,3,390,195,0,3836,3837,3,386,193,0,3837,3838,
        3,388,194,0,3838,383,1,0,0,0,3839,3840,5,138,0,0,3840,3841,5,445,
        0,0,3841,3842,3,1340,670,0,3842,3843,5,80,0,0,3843,3844,3,1336,668,
        0,3844,3845,3,392,196,0,3845,3846,3,386,193,0,3846,3847,3,388,194,
        0,3847,385,1,0,0,0,3848,3849,5,100,0,0,3849,3850,5,2,0,0,3850,3851,
        3,1162,581,0,3851,3852,5,3,0,0,3852,3855,1,0,0,0,3853,3855,1,0,0,
        0,3854,3848,1,0,0,0,3854,3853,1,0,0,0,3855,387,1,0,0,0,3856,3857,
        5,105,0,0,3857,3858,5,42,0,0,3858,3859,5,2,0,0,3859,3860,3,1162,
        581,0,3860,3861,5,3,0,0,3861,3864,1,0,0,0,3862,3864,1,0,0,0,3863,
        3856,1,0,0,0,3863,3862,1,0,0,0,3864,389,1,0,0,0,3865,3866,5,94,0,
        0,3866,3869,3,1370,685,0,3867,3869,1,0,0,0,3868,3865,1,0,0,0,3868,
        3867,1,0,0,0,3869,391,1,0,0,0,3870,3871,5,94,0,0,3871,3874,3,1370,
        685,0,3872,3874,1,0,0,0,3873,3870,1,0,0,0,3873,3872,1,0,0,0,3874,
        393,1,0,0,0,3875,3876,5,36,0,0,3876,3879,3,1382,691,0,3877,3879,
        1,0,0,0,3878,3875,1,0,0,0,3878,3877,1,0,0,0,3879,395,1,0,0,0,3880,
        3881,5,62,0,0,3881,3884,3,398,199,0,3882,3884,1,0,0,0,3883,3880,
        1,0,0,0,3883,3882,1,0,0,0,3884,397,1,0,0,0,3885,3886,7,17,0,0,3886,
        399,1,0,0,0,3887,3888,5,46,0,0,3888,3889,5,131,0,0,3889,3890,5,446,
        0,0,3890,3891,3,1340,670,0,3891,3892,5,353,0,0,3892,3893,3,402,201,
        0,3893,3894,5,215,0,0,3894,3895,3,300,150,0,3895,401,1,0,0,0,3896,
        3897,7,18,0,0,3897,403,1,0,0,0,3898,3899,5,46,0,0,3899,3900,5,350,
        0,0,3900,3901,3,1340,670,0,3901,3902,3,406,203,0,3902,3903,3,408,
        204,0,3903,3904,5,80,0,0,3904,3905,3,1336,668,0,3905,3906,3,412,
        206,0,3906,3907,3,424,212,0,3907,3908,3,430,215,0,3908,3909,5,202,
        0,0,3909,3910,3,432,216,0,3910,3911,3,1346,673,0,3911,3912,5,2,0,
        0,3912,3913,3,434,217,0,3913,3914,5,3,0,0,3914,3937,1,0,0,0,3915,
        3916,5,46,0,0,3916,3917,5,45,0,0,3917,3918,5,350,0,0,3918,3919,3,
        1340,670,0,3919,3920,5,135,0,0,3920,3921,3,408,204,0,3921,3922,5,
        80,0,0,3922,3923,3,1336,668,0,3923,3924,3,438,219,0,3924,3925,3,
        440,220,0,3925,3926,5,62,0,0,3926,3927,5,192,0,0,3927,3928,5,407,
        0,0,3928,3929,3,430,215,0,3929,3930,5,202,0,0,3930,3931,3,432,216,
        0,3931,3932,3,1346,673,0,3932,3933,5,2,0,0,3933,3934,3,434,217,0,
        3934,3935,5,3,0,0,3935,3937,1,0,0,0,3936,3898,1,0,0,0,3936,3915,
        1,0,0,0,3937,405,1,0,0,0,3938,3943,5,145,0,0,3939,3943,5,135,0,0,
        3940,3941,5,233,0,0,3941,3943,5,268,0,0,3942,3938,1,0,0,0,3942,3939,
        1,0,0,0,3942,3940,1,0,0,0,3943,407,1,0,0,0,3944,3949,3,410,205,0,
        3945,3946,5,82,0,0,3946,3948,3,410,205,0,3947,3945,1,0,0,0,3948,
        3951,1,0,0,0,3949,3947,1,0,0,0,3949,3950,1,0,0,0,3950,409,1,0,0,
        0,3951,3949,1,0,0,0,3952,3960,5,232,0,0,3953,3960,5,182,0,0,3954,
        3960,5,362,0,0,3955,3956,5,362,0,0,3956,3957,5,268,0,0,3957,3960,
        3,216,108,0,3958,3960,5,351,0,0,3959,3952,1,0,0,0,3959,3953,1,0,
        0,0,3959,3954,1,0,0,0,3959,3955,1,0,0,0,3959,3958,1,0,0,0,3960,411,
        1,0,0,0,3961,3962,5,447,0,0,3962,3965,3,414,207,0,3963,3965,1,0,
        0,0,3964,3961,1,0,0,0,3964,3963,1,0,0,0,3965,413,1,0,0,0,3966,3968,
        3,416,208,0,3967,3966,1,0,0,0,3968,3969,1,0,0,0,3969,3967,1,0,0,
        0,3969,3970,1,0,0,0,3970,415,1,0,0,0,3971,3972,3,418,209,0,3972,
        3973,3,420,210,0,3973,3974,3,834,417,0,3974,3975,3,422,211,0,3975,
        417,1,0,0,0,3976,3977,7,19,0,0,3977,419,1,0,0,0,3978,3979,7,20,0,
        0,3979,421,1,0,0,0,3980,3981,3,1372,686,0,3981,423,1,0,0,0,3982,
        3983,5,62,0,0,3983,3984,3,426,213,0,3984,3985,3,428,214,0,3985,3988,
        1,0,0,0,3986,3988,1,0,0,0,3987,3982,1,0,0,0,3987,3986,1,0,0,0,3988,
        425,1,0,0,0,3989,3992,5,192,0,0,3990,3992,1,0,0,0,3991,3989,1,0,
        0,0,3991,3990,1,0,0,0,3992,427,1,0,0,0,3993,3994,7,21,0,0,3994,429,
        1,0,0,0,3995,3996,5,102,0,0,3996,3997,5,2,0,0,3997,3998,3,1162,581,
        0,3998,3999,5,3,0,0,3999,4002,1,0,0,0,4000,4002,1,0,0,0,4001,3995,
        1,0,0,0,4001,4000,1,0,0,0,4002,431,1,0,0,0,4003,4004,7,22,0,0,4004,
        433,1,0,0,0,4005,4008,3,436,218,0,4006,4008,1,0,0,0,4007,4005,1,
        0,0,0,4007,4006,1,0,0,0,4008,4013,1,0,0,0,4009,4010,5,6,0,0,4010,
        4012,3,436,218,0,4011,4009,1,0,0,0,4012,4015,1,0,0,0,4013,4011,1,
        0,0,0,4013,4014,1,0,0,0,4014,435,1,0,0,0,4015,4013,1,0,0,0,4016,
        4021,3,1356,678,0,4017,4021,3,1354,677,0,4018,4021,3,1358,679,0,
        4019,4021,3,1380,690,0,4020,4016,1,0,0,0,4020,4017,1,0,0,0,4020,
        4018,1,0,0,0,4020,4019,1,0,0,0,4021,437,1,0,0,0,4022,4023,5,64,0,
        0,4023,4026,3,1336,668,0,4024,4026,1,0,0,0,4025,4022,1,0,0,0,4025,
        4024,1,0,0,0,4026,439,1,0,0,0,4027,4029,3,442,221,0,4028,4027,1,
        0,0,0,4029,4032,1,0,0,0,4030,4028,1,0,0,0,4030,4031,1,0,0,0,4031,
        441,1,0,0,0,4032,4030,1,0,0,0,4033,4034,5,77,0,0,4034,4045,5,54,
        0,0,4035,4045,5,54,0,0,4036,4037,5,69,0,0,4037,4045,5,221,0,0,4038,
        4039,5,69,0,0,4039,4045,5,180,0,0,4040,4041,5,77,0,0,4041,4045,5,
        364,0,0,4042,4043,5,262,0,0,4043,4045,5,228,0,0,4044,4033,1,0,0,
        0,4044,4035,1,0,0,0,4044,4036,1,0,0,0,4044,4038,1,0,0,0,4044,4040,
        1,0,0,0,4044,4042,1,0,0,0,4045,443,1,0,0,0,4046,4047,5,46,0,0,4047,
        4048,5,198,0,0,4048,4049,5,350,0,0,4049,4050,3,1340,670,0,4050,4051,
        5,80,0,0,4051,4052,3,1380,690,0,4052,4053,5,202,0,0,4053,4054,3,
        432,216,0,4054,4055,3,1346,673,0,4055,4056,5,2,0,0,4056,4057,5,3,
        0,0,4057,4073,1,0,0,0,4058,4059,5,46,0,0,4059,4060,5,198,0,0,4060,
        4061,5,350,0,0,4061,4062,3,1340,670,0,4062,4063,5,80,0,0,4063,4064,
        3,1380,690,0,4064,4065,5,102,0,0,4065,4066,3,446,223,0,4066,4067,
        5,202,0,0,4067,4068,3,432,216,0,4068,4069,3,1346,673,0,4069,4070,
        5,2,0,0,4070,4071,5,3,0,0,4071,4073,1,0,0,0,4072,4046,1,0,0,0,4072,
        4058,1,0,0,0,4073,445,1,0,0,0,4074,4079,3,448,224,0,4075,4076,5,
        33,0,0,4076,4078,3,448,224,0,4077,4075,1,0,0,0,4078,4081,1,0,0,0,
        4079,4077,1,0,0,0,4079,4080,1,0,0,0,4080,447,1,0,0,0,4081,4079,1,
        0,0,0,4082,4083,3,1372,686,0,4083,4084,5,68,0,0,4084,4085,5,2,0,
        0,4085,4086,3,450,225,0,4086,4087,5,3,0,0,4087,449,1,0,0,0,4088,
        4093,3,1358,679,0,4089,4090,5,6,0,0,4090,4092,3,1358,679,0,4091,
        4089,1,0,0,0,4092,4095,1,0,0,0,4093,4091,1,0,0,0,4093,4094,1,0,0,
        0,4094,451,1,0,0,0,4095,4093,1,0,0,0,4096,4097,5,138,0,0,4097,4098,
        5,198,0,0,4098,4099,5,350,0,0,4099,4100,3,1340,670,0,4100,4101,3,
        454,227,0,4101,453,1,0,0,0,4102,4109,5,193,0,0,4103,4104,5,193,0,
        0,4104,4109,5,305,0,0,4105,4106,5,193,0,0,4106,4109,5,139,0,0,4107,
        4109,5,186,0,0,4108,4102,1,0,0,0,4108,4103,1,0,0,0,4108,4105,1,0,
        0,0,4108,4107,1,0,0,0,4109,455,1,0,0,0,4110,4111,5,46,0,0,4111,4112,
        5,140,0,0,4112,4113,3,524,262,0,4113,4114,5,42,0,0,4114,4115,5,2,
        0,0,4115,4116,3,1162,581,0,4116,4117,5,3,0,0,4117,4118,3,440,220,
        0,4118,457,1,0,0,0,4119,4120,5,46,0,0,4120,4121,3,618,309,0,4121,
        4122,5,136,0,0,4122,4123,3,1346,673,0,4123,4124,3,646,323,0,4124,
        4125,3,460,230,0,4125,4226,1,0,0,0,4126,4127,5,46,0,0,4127,4128,
        3,618,309,0,4128,4129,5,136,0,0,4129,4130,3,1346,673,0,4130,4131,
        3,468,234,0,4131,4226,1,0,0,0,4132,4133,5,46,0,0,4133,4134,5,271,
        0,0,4134,4135,3,684,342,0,4135,4136,3,460,230,0,4136,4226,1,0,0,
        0,4137,4138,5,46,0,0,4138,4139,5,353,0,0,4139,4140,3,524,262,0,4140,
        4141,3,460,230,0,4141,4226,1,0,0,0,4142,4143,5,46,0,0,4143,4144,
        5,353,0,0,4144,4226,3,524,262,0,4145,4146,5,46,0,0,4146,4147,5,353,
        0,0,4147,4148,3,524,262,0,4148,4149,5,36,0,0,4149,4150,5,2,0,0,4150,
        4151,3,1098,549,0,4151,4152,5,3,0,0,4152,4226,1,0,0,0,4153,4154,
        5,46,0,0,4154,4155,5,353,0,0,4155,4156,3,524,262,0,4156,4157,5,36,
        0,0,4157,4158,5,196,0,0,4158,4159,5,2,0,0,4159,4160,3,474,237,0,
        4160,4161,5,3,0,0,4161,4226,1,0,0,0,4162,4163,5,46,0,0,4163,4164,
        5,353,0,0,4164,4165,3,524,262,0,4165,4166,5,36,0,0,4166,4167,5,292,
        0,0,4167,4168,3,460,230,0,4168,4226,1,0,0,0,4169,4170,5,46,0,0,4170,
        4171,5,348,0,0,4171,4172,5,318,0,0,4172,4173,5,276,0,0,4173,4174,
        3,524,262,0,4174,4175,3,460,230,0,4175,4226,1,0,0,0,4176,4177,5,
        46,0,0,4177,4178,5,348,0,0,4178,4179,5,318,0,0,4179,4180,5,185,0,
        0,4180,4181,3,524,262,0,4181,4182,3,460,230,0,4182,4226,1,0,0,0,
        4183,4184,5,46,0,0,4184,4185,5,348,0,0,4185,4186,5,318,0,0,4186,
        4187,5,346,0,0,4187,4188,3,524,262,0,4188,4189,3,460,230,0,4189,
        4226,1,0,0,0,4190,4191,5,46,0,0,4191,4192,5,348,0,0,4192,4193,5,
        318,0,0,4193,4194,5,163,0,0,4194,4195,3,524,262,0,4195,4196,3,460,
        230,0,4196,4226,1,0,0,0,4197,4198,5,46,0,0,4198,4199,5,108,0,0,4199,
        4200,3,524,262,0,4200,4201,3,460,230,0,4201,4226,1,0,0,0,4202,4203,
        5,46,0,0,4203,4204,5,108,0,0,4204,4205,5,220,0,0,4205,4206,5,77,
        0,0,4206,4207,5,389,0,0,4207,4208,3,524,262,0,4208,4209,3,460,230,
        0,4209,4226,1,0,0,0,4210,4211,5,46,0,0,4211,4212,5,108,0,0,4212,
        4213,3,524,262,0,4213,4214,5,64,0,0,4214,4215,3,524,262,0,4215,4226,
        1,0,0,0,4216,4217,5,46,0,0,4217,4218,5,108,0,0,4218,4219,5,220,0,
        0,4219,4220,5,77,0,0,4220,4221,5,389,0,0,4221,4222,3,524,262,0,4222,
        4223,5,64,0,0,4223,4224,3,524,262,0,4224,4226,1,0,0,0,4225,4119,
        1,0,0,0,4225,4126,1,0,0,0,4225,4132,1,0,0,0,4225,4137,1,0,0,0,4225,
        4142,1,0,0,0,4225,4145,1,0,0,0,4225,4153,1,0,0,0,4225,4162,1,0,0,
        0,4225,4169,1,0,0,0,4225,4176,1,0,0,0,4225,4183,1,0,0,0,4225,4190,
        1,0,0,0,4225,4197,1,0,0,0,4225,4202,1,0,0,0,4225,4210,1,0,0,0,4225,
        4216,1,0,0,0,4226,459,1,0,0,0,4227,4228,5,2,0,0,4228,4229,3,462,
        231,0,4229,4230,5,3,0,0,4230,461,1,0,0,0,4231,4236,3,464,232,0,4232,
        4233,5,6,0,0,4233,4235,3,464,232,0,4234,4232,1,0,0,0,4235,4238,1,
        0,0,0,4236,4234,1,0,0,0,4236,4237,1,0,0,0,4237,463,1,0,0,0,4238,
        4236,1,0,0,0,4239,4242,3,1380,690,0,4240,4241,5,10,0,0,4241,4243,
        3,466,233,0,4242,4240,1,0,0,0,4242,4243,1,0,0,0,4243,465,1,0,0,0,
        4244,4251,3,640,320,0,4245,4251,3,1392,696,0,4246,4251,3,1276,638,
        0,4247,4251,3,292,146,0,4248,4251,3,1358,679,0,4249,4251,5,400,0,
        0,4250,4244,1,0,0,0,4250,4245,1,0,0,0,4250,4246,1,0,0,0,4250,4247,
        1,0,0,0,4250,4248,1,0,0,0,4250,4249,1,0,0,0,4251,467,1,0,0,0,4252,
        4253,5,2,0,0,4253,4254,3,470,235,0,4254,4255,5,3,0,0,4255,469,1,
        0,0,0,4256,4261,3,472,236,0,4257,4258,5,6,0,0,4258,4260,3,472,236,
        0,4259,4257,1,0,0,0,4260,4263,1,0,0,0,4261,4259,1,0,0,0,4261,4262,
        1,0,0,0,4262,471,1,0,0,0,4263,4261,1,0,0,0,4264,4265,3,1382,691,
        0,4265,4266,5,10,0,0,4266,4267,3,466,233,0,4267,473,1,0,0,0,4268,
        4271,3,476,238,0,4269,4271,1,0,0,0,4270,4268,1,0,0,0,4270,4269,1,
        0,0,0,4271,475,1,0,0,0,4272,4277,3,1358,679,0,4273,4274,5,6,0,0,
        4274,4276,3,1358,679,0,4275,4273,1,0,0,0,4276,4279,1,0,0,0,4277,
        4275,1,0,0,0,4277,4278,1,0,0,0,4278,477,1,0,0,0,4279,4277,1,0,0,
        0,4280,4281,5,138,0,0,4281,4282,5,353,0,0,4282,4283,3,524,262,0,
        4283,4284,5,133,0,0,4284,4285,5,450,0,0,4285,4286,3,480,240,0,4286,
        4287,3,1358,679,0,4287,4318,1,0,0,0,4288,4289,5,138,0,0,4289,4290,
        5,353,0,0,4290,4291,3,524,262,0,4291,4292,5,133,0,0,4292,4293,5,
        450,0,0,4293,4294,3,480,240,0,4294,4295,3,1358,679,0,4295,4296,5,
        145,0,0,4296,4297,3,1358,679,0,4297,4318,1,0,0,0,4298,4299,5,138,
        0,0,4299,4300,5,353,0,0,4300,4301,3,524,262,0,4301,4302,5,133,0,
        0,4302,4303,5,450,0,0,4303,4304,3,480,240,0,4304,4305,3,1358,679,
        0,4305,4306,5,135,0,0,4306,4307,3,1358,679,0,4307,4318,1,0,0,0,4308,
        4309,5,138,0,0,4309,4310,5,353,0,0,4310,4311,3,524,262,0,4311,4312,
        5,302,0,0,4312,4313,5,450,0,0,4313,4314,3,1358,679,0,4314,4315,5,
        94,0,0,4315,4316,3,1358,679,0,4316,4318,1,0,0,0,4317,4280,1,0,0,
        0,4317,4288,1,0,0,0,4317,4298,1,0,0,0,4317,4308,1,0,0,0,4318,479,
        1,0,0,0,4319,4320,5,220,0,0,4320,4321,5,77,0,0,4321,4324,5,389,0,
        0,4322,4324,1,0,0,0,4323,4319,1,0,0,0,4323,4322,1,0,0,0,4324,481,
        1,0,0,0,4325,4326,5,46,0,0,4326,4327,5,271,0,0,4327,4328,5,156,0,
        0,4328,4329,3,524,262,0,4329,4330,3,488,244,0,4330,4331,5,62,0,0,
        4331,4332,5,353,0,0,4332,4333,3,1118,559,0,4333,4334,5,100,0,0,4334,
        4335,3,1340,670,0,4335,4336,3,490,245,0,4336,4337,5,36,0,0,4337,
        4338,3,484,242,0,4338,483,1,0,0,0,4339,4344,3,486,243,0,4340,4341,
        5,6,0,0,4341,4343,3,486,243,0,4342,4340,1,0,0,0,4343,4346,1,0,0,
        0,4344,4342,1,0,0,0,4344,4345,1,0,0,0,4345,485,1,0,0,0,4346,4344,
        1,0,0,0,4347,4348,5,271,0,0,4348,4349,3,1356,678,0,4349,4350,3,684,
        342,0,4350,4351,3,492,246,0,4351,4352,3,494,247,0,4352,4373,1,0,
        0,0,4353,4354,5,271,0,0,4354,4355,3,1356,678,0,4355,4356,3,688,344,
        0,4356,4357,3,492,246,0,4357,4358,3,494,247,0,4358,4373,1,0,0,0,
        4359,4360,5,211,0,0,4360,4361,3,1356,678,0,4361,4362,3,626,313,0,
        4362,4373,1,0,0,0,4363,4364,5,211,0,0,4364,4365,3,1356,678,0,4365,
        4366,5,2,0,0,4366,4367,3,1286,643,0,4367,4368,5,3,0,0,4368,4369,
        3,626,313,0,4369,4373,1,0,0,0,4370,4371,5,338,0,0,4371,4373,3,1118,
        559,0,4372,4347,1,0,0,0,4372,4353,1,0,0,0,4372,4359,1,0,0,0,4372,
        4363,1,0,0,0,4372,4370,1,0,0,0,4373,487,1,0,0,0,4374,4377,5,53,0,
        0,4375,4377,1,0,0,0,4376,4374,1,0,0,0,4376,4375,1,0,0,0,4377,489,
        1,0,0,0,4378,4379,5,206,0,0,4379,4382,3,524,262,0,4380,4382,1,0,
        0,0,4381,4378,1,0,0,0,4381,4380,1,0,0,0,4382,491,1,0,0,0,4383,4384,
        5,62,0,0,4384,4391,5,318,0,0,4385,4386,5,62,0,0,4386,4387,5,83,0,
        0,4387,4388,5,147,0,0,4388,4391,3,524,262,0,4389,4391,1,0,0,0,4390,
        4383,1,0,0,0,4390,4385,1,0,0,0,4390,4389,1,0,0,0,4391,493,1,0,0,
        0,4392,4395,5,295,0,0,4393,4395,1,0,0,0,4394,4392,1,0,0,0,4394,4393,
        1,0,0,0,4395,495,1,0,0,0,4396,4397,5,46,0,0,4397,4398,5,271,0,0,
        4398,4399,5,206,0,0,4399,4400,3,524,262,0,4400,4401,5,100,0,0,4401,
        4402,3,1340,670,0,4402,497,1,0,0,0,4403,4404,5,138,0,0,4404,4405,
        5,271,0,0,4405,4406,5,206,0,0,4406,4407,3,524,262,0,4407,4408,5,
        100,0,0,4408,4409,3,1340,670,0,4409,4410,5,133,0,0,4410,4411,3,484,
        242,0,4411,4422,1,0,0,0,4412,4413,5,138,0,0,4413,4414,5,271,0,0,
        4414,4415,5,206,0,0,4415,4416,3,524,262,0,4416,4417,5,100,0,0,4417,
        4418,3,1340,670,0,4418,4419,5,191,0,0,4419,4420,3,500,250,0,4420,
        4422,1,0,0,0,4421,4403,1,0,0,0,4421,4412,1,0,0,0,4422,499,1,0,0,
        0,4423,4428,3,502,251,0,4424,4425,5,6,0,0,4425,4427,3,502,251,0,
        4426,4424,1,0,0,0,4427,4430,1,0,0,0,4428,4426,1,0,0,0,4428,4429,
        1,0,0,0,4429,501,1,0,0,0,4430,4428,1,0,0,0,4431,4432,5,271,0,0,4432,
        4433,3,1356,678,0,4433,4434,5,2,0,0,4434,4435,3,1286,643,0,4435,
        4436,5,3,0,0,4436,4444,1,0,0,0,4437,4438,5,211,0,0,4438,4439,3,1356,
        678,0,4439,4440,5,2,0,0,4440,4441,3,1286,643,0,4441,4442,5,3,0,0,
        4442,4444,1,0,0,0,4443,4431,1,0,0,0,4443,4437,1,0,0,0,4444,503,1,
        0,0,0,4445,4446,5,191,0,0,4446,4447,5,271,0,0,4447,4448,5,156,0,
        0,4448,4449,3,524,262,0,4449,4450,5,100,0,0,4450,4451,3,1340,670,
        0,4451,4452,3,108,54,0,4452,4464,1,0,0,0,4453,4454,5,191,0,0,4454,
        4455,5,271,0,0,4455,4456,5,156,0,0,4456,4457,5,220,0,0,4457,4458,
        5,389,0,0,4458,4459,3,524,262,0,4459,4460,5,100,0,0,4460,4461,3,
        1340,670,0,4461,4462,3,108,54,0,4462,4464,1,0,0,0,4463,4445,1,0,
        0,0,4463,4453,1,0,0,0,4464,505,1,0,0,0,4465,4466,5,191,0,0,4466,
        4467,5,271,0,0,4467,4468,5,206,0,0,4468,4469,3,524,262,0,4469,4470,
        5,100,0,0,4470,4471,3,1340,670,0,4471,4472,3,108,54,0,4472,4484,
        1,0,0,0,4473,4474,5,191,0,0,4474,4475,5,271,0,0,4475,4476,5,206,
        0,0,4476,4477,5,220,0,0,4477,4478,5,389,0,0,4478,4479,3,524,262,
        0,4479,4480,5,100,0,0,4480,4481,3,1340,670,0,4481,4482,3,108,54,
        0,4482,4484,1,0,0,0,4483,4465,1,0,0,0,4483,4473,1,0,0,0,4484,507,
        1,0,0,0,4485,4486,5,191,0,0,4486,4487,5,274,0,0,4487,4488,5,147,
        0,0,4488,4489,3,1370,685,0,4489,4490,3,108,54,0,4490,509,1,0,0,0,
        4491,4492,5,294,0,0,4492,4493,5,274,0,0,4493,4494,5,147,0,0,4494,
        4495,3,1370,685,0,4495,4496,5,94,0,0,4496,4497,3,1368,684,0,4497,
        511,1,0,0,0,4498,4499,5,191,0,0,4499,4500,3,514,257,0,4500,4501,
        5,220,0,0,4501,4502,5,389,0,0,4502,4503,3,522,261,0,4503,4504,3,
        108,54,0,4504,4577,1,0,0,0,4505,4506,5,191,0,0,4506,4507,3,514,257,
        0,4507,4508,3,522,261,0,4508,4509,3,108,54,0,4509,4577,1,0,0,0,4510,
        4511,5,191,0,0,4511,4512,3,518,259,0,4512,4513,5,220,0,0,4513,4514,
        5,389,0,0,4514,4515,3,1338,669,0,4515,4516,3,108,54,0,4516,4577,
        1,0,0,0,4517,4518,5,191,0,0,4518,4519,3,518,259,0,4519,4520,3,1338,
        669,0,4520,4521,3,108,54,0,4521,4577,1,0,0,0,4522,4523,5,191,0,0,
        4523,4524,3,520,260,0,4524,4525,3,1340,670,0,4525,4526,5,80,0,0,
        4526,4527,3,524,262,0,4527,4528,3,108,54,0,4528,4577,1,0,0,0,4529,
        4530,5,191,0,0,4530,4531,3,520,260,0,4531,4532,5,220,0,0,4532,4533,
        5,389,0,0,4533,4534,3,1340,670,0,4534,4535,5,80,0,0,4535,4536,3,
        524,262,0,4536,4537,3,108,54,0,4537,4577,1,0,0,0,4538,4539,5,191,
        0,0,4539,4540,5,353,0,0,4540,4541,3,528,264,0,4541,4542,3,108,54,
        0,4542,4577,1,0,0,0,4543,4544,5,191,0,0,4544,4545,5,353,0,0,4545,
        4546,5,220,0,0,4546,4547,5,389,0,0,4547,4548,3,528,264,0,4548,4549,
        3,108,54,0,4549,4577,1,0,0,0,4550,4551,5,191,0,0,4551,4552,5,189,
        0,0,4552,4553,3,528,264,0,4553,4554,3,108,54,0,4554,4577,1,0,0,0,
        4555,4556,5,191,0,0,4556,4557,5,189,0,0,4557,4558,5,220,0,0,4558,
        4559,5,389,0,0,4559,4560,3,528,264,0,4560,4561,3,108,54,0,4561,4577,
        1,0,0,0,4562,4563,5,191,0,0,4563,4564,5,226,0,0,4564,4565,5,109,
        0,0,4565,4566,3,522,261,0,4566,4567,3,108,54,0,4567,4577,1,0,0,0,
        4568,4569,5,191,0,0,4569,4570,5,226,0,0,4570,4571,5,109,0,0,4571,
        4572,5,220,0,0,4572,4573,5,389,0,0,4573,4574,3,522,261,0,4574,4575,
        3,108,54,0,4575,4577,1,0,0,0,4576,4498,1,0,0,0,4576,4505,1,0,0,0,
        4576,4510,1,0,0,0,4576,4517,1,0,0,0,4576,4522,1,0,0,0,4576,4529,
        1,0,0,0,4576,4538,1,0,0,0,4576,4543,1,0,0,0,4576,4550,1,0,0,0,4576,
        4555,1,0,0,0,4576,4562,1,0,0,0,4576,4568,1,0,0,0,4577,513,1,0,0,
        0,4578,4602,5,92,0,0,4579,4602,5,321,0,0,4580,4602,5,369,0,0,4581,
        4582,5,251,0,0,4582,4602,5,369,0,0,4583,4602,5,226,0,0,4584,4585,
        5,63,0,0,4585,4602,5,92,0,0,4586,4602,5,108,0,0,4587,4602,5,168,
        0,0,4588,4602,5,335,0,0,4589,4590,5,348,0,0,4590,4591,5,318,0,0,
        4591,4602,5,276,0,0,4592,4593,5,348,0,0,4593,4594,5,318,0,0,4594,
        4602,5,185,0,0,4595,4596,5,348,0,0,4596,4597,5,318,0,0,4597,4602,
        5,346,0,0,4598,4599,5,348,0,0,4599,4600,5,318,0,0,4600,4602,5,163,
        0,0,4601,4578,1,0,0,0,4601,4579,1,0,0,0,4601,4580,1,0,0,0,4601,4581,
        1,0,0,0,4601,4583,1,0,0,0,4601,4584,1,0,0,0,4601,4586,1,0,0,0,4601,
        4587,1,0,0,0,4601,4588,1,0,0,0,4601,4589,1,0,0,0,4601,4592,1,0,0,
        0,4601,4595,1,0,0,0,4601,4598,1,0,0,0,4602,515,1,0,0,0,4603,4609,
        3,518,259,0,4604,4609,5,175,0,0,4605,4609,5,311,0,0,4606,4609,5,
        451,0,0,4607,4609,5,344,0,0,4608,4603,1,0,0,0,4608,4604,1,0,0,0,
        4608,4605,1,0,0,0,4608,4606,1,0,0,0,4608,4607,1,0,0,0,4609,517,1,
        0,0,0,4610,4611,5,131,0,0,4611,4625,5,446,0,0,4612,4613,5,198,0,
        0,4613,4625,5,350,0,0,4614,4625,5,204,0,0,4615,4616,5,63,0,0,4616,
        4617,5,174,0,0,4617,4625,5,374,0,0,4618,4619,3,308,154,0,4619,4620,
        5,238,0,0,4620,4625,1,0,0,0,4621,4625,5,452,0,0,4622,4625,5,316,
        0,0,4623,4625,5,324,0,0,4624,4610,1,0,0,0,4624,4612,1,0,0,0,4624,
        4614,1,0,0,0,4624,4615,1,0,0,0,4624,4618,1,0,0,0,4624,4621,1,0,0,
        0,4624,4622,1,0,0,0,4624,4623,1,0,0,0,4625,519,1,0,0,0,4626,4627,
        7,23,0,0,4627,521,1,0,0,0,4628,4633,3,524,262,0,4629,4630,5,6,0,
        0,4630,4632,3,524,262,0,4631,4629,1,0,0,0,4632,4635,1,0,0,0,4633,
        4631,1,0,0,0,4633,4634,1,0,0,0,4634,523,1,0,0,0,4635,4633,1,0,0,
        0,4636,4638,3,1372,686,0,4637,4639,3,526,263,0,4638,4637,1,0,0,0,
        4638,4639,1,0,0,0,4639,525,1,0,0,0,4640,4641,5,11,0,0,4641,4643,
        3,1342,671,0,4642,4640,1,0,0,0,4643,4644,1,0,0,0,4644,4642,1,0,0,
        0,4644,4645,1,0,0,0,4645,527,1,0,0,0,4646,4651,3,1118,559,0,4647,
        4648,5,6,0,0,4648,4650,3,1118,559,0,4649,4647,1,0,0,0,4650,4653,
        1,0,0,0,4651,4649,1,0,0,0,4651,4652,1,0,0,0,4652,529,1,0,0,0,4653,
        4651,1,0,0,0,4654,4655,5,351,0,0,4655,4656,3,988,494,0,4656,4657,
        3,1076,538,0,4657,4658,3,532,266,0,4658,4659,3,108,54,0,4659,531,
        1,0,0,0,4660,4661,5,167,0,0,4661,4666,5,219,0,0,4662,4663,5,307,
        0,0,4663,4666,5,219,0,0,4664,4666,1,0,0,0,4665,4660,1,0,0,0,4665,
        4662,1,0,0,0,4665,4664,1,0,0,0,4666,533,1,0,0,0,4667,4668,5,159,
        0,0,4668,4669,5,80,0,0,4669,4670,3,514,257,0,4670,4671,3,524,262,
        0,4671,4672,5,116,0,0,4672,4673,3,536,268,0,4673,4815,1,0,0,0,4674,
        4675,5,159,0,0,4675,4676,5,80,0,0,4676,4677,5,44,0,0,4677,4678,3,
        524,262,0,4678,4679,5,116,0,0,4679,4680,3,536,268,0,4680,4815,1,
        0,0,0,4681,4682,5,159,0,0,4682,4683,5,80,0,0,4683,4684,3,516,258,
        0,4684,4685,3,1340,670,0,4685,4686,5,116,0,0,4686,4687,3,536,268,
        0,4687,4815,1,0,0,0,4688,4689,5,159,0,0,4689,4690,5,80,0,0,4690,
        4691,5,353,0,0,4691,4692,3,1118,559,0,4692,4693,5,116,0,0,4693,4694,
        3,536,268,0,4694,4815,1,0,0,0,4695,4696,5,159,0,0,4696,4697,5,80,
        0,0,4697,4698,5,189,0,0,4698,4699,3,1118,559,0,4699,4700,5,116,0,
        0,4700,4701,3,536,268,0,4701,4815,1,0,0,0,4702,4703,5,159,0,0,4703,
        4704,5,80,0,0,4704,4705,5,136,0,0,4705,4706,3,650,325,0,4706,4707,
        5,116,0,0,4707,4708,3,536,268,0,4708,4815,1,0,0,0,4709,4710,5,159,
        0,0,4710,4711,5,80,0,0,4711,4712,5,211,0,0,4712,4713,3,626,313,0,
        4713,4714,5,116,0,0,4714,4715,3,536,268,0,4715,4815,1,0,0,0,4716,
        4717,5,159,0,0,4717,4718,5,80,0,0,4718,4719,5,271,0,0,4719,4720,
        3,688,344,0,4720,4721,5,116,0,0,4721,4722,3,536,268,0,4722,4815,
        1,0,0,0,4723,4724,5,159,0,0,4724,4725,5,80,0,0,4725,4726,5,45,0,
        0,4726,4727,3,1340,670,0,4727,4728,5,80,0,0,4728,4729,3,524,262,
        0,4729,4730,5,116,0,0,4730,4731,3,536,268,0,4731,4815,1,0,0,0,4732,
        4733,5,159,0,0,4733,4734,5,80,0,0,4734,4735,5,45,0,0,4735,4736,3,
        1340,670,0,4736,4737,5,80,0,0,4737,4738,5,189,0,0,4738,4739,3,524,
        262,0,4739,4740,5,116,0,0,4740,4741,3,536,268,0,4741,4815,1,0,0,
        0,4742,4743,5,159,0,0,4743,4744,5,80,0,0,4744,4745,3,520,260,0,4745,
        4746,3,1340,670,0,4746,4747,5,80,0,0,4747,4748,3,524,262,0,4748,
        4749,5,116,0,0,4749,4750,3,536,268,0,4750,4815,1,0,0,0,4751,4752,
        5,159,0,0,4752,4753,5,80,0,0,4753,4754,5,289,0,0,4754,4755,3,626,
        313,0,4755,4756,5,116,0,0,4756,4757,3,536,268,0,4757,4815,1,0,0,
        0,4758,4759,5,159,0,0,4759,4760,5,80,0,0,4760,4761,5,442,0,0,4761,
        4762,3,626,313,0,4762,4763,5,116,0,0,4763,4764,3,536,268,0,4764,
        4815,1,0,0,0,4765,4766,5,159,0,0,4766,4767,5,80,0,0,4767,4768,5,
        443,0,0,4768,4769,5,62,0,0,4769,4770,3,1118,559,0,4770,4771,5,238,
        0,0,4771,4772,3,1340,670,0,4772,4773,5,116,0,0,4773,4774,3,536,268,
        0,4774,4815,1,0,0,0,4775,4776,5,159,0,0,4776,4777,5,80,0,0,4777,
        4778,5,271,0,0,4778,4779,5,156,0,0,4779,4780,3,524,262,0,4780,4781,
        5,100,0,0,4781,4782,3,1340,670,0,4782,4783,5,116,0,0,4783,4784,3,
        536,268,0,4784,4815,1,0,0,0,4785,4786,5,159,0,0,4786,4787,5,80,0,
        0,4787,4788,5,271,0,0,4788,4789,5,206,0,0,4789,4790,3,524,262,0,
        4790,4791,5,100,0,0,4791,4792,3,1340,670,0,4792,4793,5,116,0,0,4793,
        4794,3,536,268,0,4794,4815,1,0,0,0,4795,4796,5,159,0,0,4796,4797,
        5,80,0,0,4797,4798,5,239,0,0,4798,4799,5,267,0,0,4799,4800,3,292,
        146,0,4800,4801,5,116,0,0,4801,4802,3,536,268,0,4802,4815,1,0,0,
        0,4803,4804,5,159,0,0,4804,4805,5,80,0,0,4805,4806,5,41,0,0,4806,
        4807,5,2,0,0,4807,4808,3,1118,559,0,4808,4809,5,36,0,0,4809,4810,
        3,1118,559,0,4810,4811,5,3,0,0,4811,4812,5,116,0,0,4812,4813,3,536,
        268,0,4813,4815,1,0,0,0,4814,4667,1,0,0,0,4814,4674,1,0,0,0,4814,
        4681,1,0,0,0,4814,4688,1,0,0,0,4814,4695,1,0,0,0,4814,4702,1,0,0,
        0,4814,4709,1,0,0,0,4814,4716,1,0,0,0,4814,4723,1,0,0,0,4814,4732,
        1,0,0,0,4814,4742,1,0,0,0,4814,4751,1,0,0,0,4814,4758,1,0,0,0,4814,
        4765,1,0,0,0,4814,4775,1,0,0,0,4814,4785,1,0,0,0,4814,4795,1,0,0,
        0,4814,4803,1,0,0,0,4815,535,1,0,0,0,4816,4819,3,1358,679,0,4817,
        4819,5,78,0,0,4818,4816,1,0,0,0,4818,4817,1,0,0,0,4819,537,1,0,0,
        0,4820,4821,5,320,0,0,4821,4822,5,237,0,0,4822,4823,3,540,270,0,
        4823,4824,5,80,0,0,4824,4825,3,514,257,0,4825,4826,3,524,262,0,4826,
        4827,5,116,0,0,4827,4828,3,542,271,0,4828,4912,1,0,0,0,4829,4830,
        5,320,0,0,4830,4831,5,237,0,0,4831,4832,3,540,270,0,4832,4833,5,
        80,0,0,4833,4834,5,44,0,0,4834,4835,3,524,262,0,4835,4836,5,116,
        0,0,4836,4837,3,542,271,0,4837,4912,1,0,0,0,4838,4839,5,320,0,0,
        4839,4840,5,237,0,0,4840,4841,3,540,270,0,4841,4842,5,80,0,0,4842,
        4843,3,516,258,0,4843,4844,3,1340,670,0,4844,4845,5,116,0,0,4845,
        4846,3,542,271,0,4846,4912,1,0,0,0,4847,4848,5,320,0,0,4848,4849,
        5,237,0,0,4849,4850,3,540,270,0,4850,4851,5,80,0,0,4851,4852,5,353,
        0,0,4852,4853,3,1118,559,0,4853,4854,5,116,0,0,4854,4855,3,542,271,
        0,4855,4912,1,0,0,0,4856,4857,5,320,0,0,4857,4858,5,237,0,0,4858,
        4859,3,540,270,0,4859,4860,5,80,0,0,4860,4861,5,189,0,0,4861,4862,
        3,1118,559,0,4862,4863,5,116,0,0,4863,4864,3,542,271,0,4864,4912,
        1,0,0,0,4865,4866,5,320,0,0,4866,4867,5,237,0,0,4867,4868,3,540,
        270,0,4868,4869,5,80,0,0,4869,4870,5,136,0,0,4870,4871,3,650,325,
        0,4871,4872,5,116,0,0,4872,4873,3,542,271,0,4873,4912,1,0,0,0,4874,
        4875,5,320,0,0,4875,4876,5,237,0,0,4876,4877,3,540,270,0,4877,4878,
        5,80,0,0,4878,4879,5,211,0,0,4879,4880,3,626,313,0,4880,4881,5,116,
        0,0,4881,4882,3,542,271,0,4882,4912,1,0,0,0,4883,4884,5,320,0,0,
        4884,4885,5,237,0,0,4885,4886,3,540,270,0,4886,4887,5,80,0,0,4887,
        4888,5,239,0,0,4888,4889,5,267,0,0,4889,4890,3,292,146,0,4890,4891,
        5,116,0,0,4891,4892,3,542,271,0,4892,4912,1,0,0,0,4893,4894,5,320,
        0,0,4894,4895,5,237,0,0,4895,4896,3,540,270,0,4896,4897,5,80,0,0,
        4897,4898,5,289,0,0,4898,4899,3,626,313,0,4899,4900,5,116,0,0,4900,
        4901,3,542,271,0,4901,4912,1,0,0,0,4902,4903,5,320,0,0,4903,4904,
        5,237,0,0,4904,4905,3,540,270,0,4905,4906,5,80,0,0,4906,4907,5,442,
        0,0,4907,4908,3,626,313,0,4908,4909,5,116,0,0,4909,4910,3,542,271,
        0,4910,4912,1,0,0,0,4911,4820,1,0,0,0,4911,4829,1,0,0,0,4911,4838,
        1,0,0,0,4911,4847,1,0,0,0,4911,4856,1,0,0,0,4911,4865,1,0,0,0,4911,
        4874,1,0,0,0,4911,4883,1,0,0,0,4911,4893,1,0,0,0,4911,4902,1,0,0,
        0,4912,539,1,0,0,0,4913,4914,5,62,0,0,4914,4917,3,72,36,0,4915,4917,
        1,0,0,0,4916,4913,1,0,0,0,4916,4915,1,0,0,0,4917,541,1,0,0,0,4918,
        4921,3,1358,679,0,4919,4921,5,78,0,0,4920,4918,1,0,0,0,4920,4919,
        1,0,0,0,4921,543,1,0,0,0,4922,4923,5,61,0,0,4923,4927,3,546,273,
        0,4924,4925,5,258,0,0,4925,4927,3,546,273,0,4926,4922,1,0,0,0,4926,
        4924,1,0,0,0,4927,545,1,0,0,0,4928,4995,3,954,477,0,4929,4930,3,
        548,274,0,4930,4931,3,954,477,0,4931,4995,1,0,0,0,4932,4933,5,261,
        0,0,4933,4934,3,550,275,0,4934,4935,3,954,477,0,4935,4995,1,0,0,
        0,4936,4937,5,286,0,0,4937,4938,3,550,275,0,4938,4939,3,954,477,
        0,4939,4995,1,0,0,0,4940,4941,5,207,0,0,4941,4942,3,550,275,0,4942,
        4943,3,954,477,0,4943,4995,1,0,0,0,4944,4945,5,240,0,0,4945,4946,
        3,550,275,0,4946,4947,3,954,477,0,4947,4995,1,0,0,0,4948,4949,5,
        130,0,0,4949,4950,3,1364,682,0,4950,4951,3,550,275,0,4951,4952,3,
        954,477,0,4952,4995,1,0,0,0,4953,4954,5,300,0,0,4954,4955,3,1364,
        682,0,4955,4956,3,550,275,0,4956,4957,3,954,477,0,4957,4995,1,0,
        0,0,4958,4959,3,1364,682,0,4959,4960,3,550,275,0,4960,4961,3,954,
        477,0,4961,4995,1,0,0,0,4962,4963,5,30,0,0,4963,4964,3,550,275,0,
        4964,4965,3,954,477,0,4965,4995,1,0,0,0,4966,4967,5,210,0,0,4967,
        4968,3,550,275,0,4968,4969,3,954,477,0,4969,4995,1,0,0,0,4970,4971,
        5,210,0,0,4971,4972,3,1364,682,0,4972,4973,3,550,275,0,4973,4974,
        3,954,477,0,4974,4995,1,0,0,0,4975,4976,5,210,0,0,4976,4977,5,30,
        0,0,4977,4978,3,550,275,0,4978,4979,3,954,477,0,4979,4995,1,0,0,
        0,4980,4981,5,144,0,0,4981,4982,3,550,275,0,4982,4983,3,954,477,
        0,4983,4995,1,0,0,0,4984,4985,5,144,0,0,4985,4986,3,1364,682,0,4986,
        4987,3,550,275,0,4987,4988,3,954,477,0,4988,4995,1,0,0,0,4989,4990,
        5,144,0,0,4990,4991,5,30,0,0,4991,4992,3,550,275,0,4992,4993,3,954,
        477,0,4993,4995,1,0,0,0,4994,4928,1,0,0,0,4994,4929,1,0,0,0,4994,
        4932,1,0,0,0,4994,4936,1,0,0,0,4994,4940,1,0,0,0,4994,4944,1,0,0,
        0,4994,4948,1,0,0,0,4994,4953,1,0,0,0,4994,4958,1,0,0,0,4994,4962,
        1,0,0,0,4994,4966,1,0,0,0,4994,4970,1,0,0,0,4994,4975,1,0,0,0,4994,
        4980,1,0,0,0,4994,4984,1,0,0,0,4994,4989,1,0,0,0,4995,547,1,0,0,
        0,4996,4997,7,24,0,0,4997,549,1,0,0,0,4998,5001,3,548,274,0,4999,
        5001,1,0,0,0,5000,4998,1,0,0,0,5000,4999,1,0,0,0,5001,551,1,0,0,
        0,5002,5003,5,65,0,0,5003,5004,3,556,278,0,5004,5005,5,80,0,0,5005,
        5006,3,562,281,0,5006,5007,5,94,0,0,5007,5008,3,564,282,0,5008,5009,
        3,568,284,0,5009,553,1,0,0,0,5010,5011,5,310,0,0,5011,5012,3,556,
        278,0,5012,5013,5,80,0,0,5013,5014,3,562,281,0,5014,5015,5,64,0,
        0,5015,5016,3,564,282,0,5016,5017,3,108,54,0,5017,5030,1,0,0,0,5018,
        5019,5,310,0,0,5019,5020,5,65,0,0,5020,5021,5,272,0,0,5021,5022,
        5,62,0,0,5022,5023,3,556,278,0,5023,5024,5,80,0,0,5024,5025,3,562,
        281,0,5025,5026,5,64,0,0,5026,5027,3,564,282,0,5027,5028,3,108,54,
        0,5028,5030,1,0,0,0,5029,5010,1,0,0,0,5029,5018,1,0,0,0,5030,555,
        1,0,0,0,5031,5047,3,558,279,0,5032,5047,5,30,0,0,5033,5034,5,30,
        0,0,5034,5047,5,287,0,0,5035,5036,5,30,0,0,5036,5037,5,2,0,0,5037,
        5038,3,216,108,0,5038,5039,5,3,0,0,5039,5047,1,0,0,0,5040,5041,5,
        30,0,0,5041,5042,5,287,0,0,5042,5043,5,2,0,0,5043,5044,3,216,108,
        0,5044,5045,5,3,0,0,5045,5047,1,0,0,0,5046,5031,1,0,0,0,5046,5032,
        1,0,0,0,5046,5033,1,0,0,0,5046,5035,1,0,0,0,5046,5040,1,0,0,0,5047,
        557,1,0,0,0,5048,5053,3,560,280,0,5049,5050,5,6,0,0,5050,5052,3,
        560,280,0,5051,5049,1,0,0,0,5052,5055,1,0,0,0,5053,5051,1,0,0,0,
        5053,5054,1,0,0,0,5054,559,1,0,0,0,5055,5053,1,0,0,0,5056,5057,5,
        88,0,0,5057,5066,3,214,107,0,5058,5059,5,86,0,0,5059,5066,3,214,
        107,0,5060,5061,5,46,0,0,5061,5066,3,214,107,0,5062,5063,3,1372,
        686,0,5063,5064,3,214,107,0,5064,5066,1,0,0,0,5065,5056,1,0,0,0,
        5065,5058,1,0,0,0,5065,5060,1,0,0,0,5065,5062,1,0,0,0,5066,561,1,
        0,0,0,5067,5126,3,1334,667,0,5068,5069,5,92,0,0,5069,5126,3,1334,
        667,0,5070,5071,5,321,0,0,5071,5126,3,1334,667,0,5072,5073,5,63,
        0,0,5073,5074,5,174,0,0,5074,5075,5,374,0,0,5075,5126,3,1338,669,
        0,5076,5077,5,63,0,0,5077,5078,5,324,0,0,5078,5126,3,1338,669,0,
        5079,5080,5,211,0,0,5080,5126,3,624,312,0,5081,5082,5,289,0,0,5082,
        5126,3,624,312,0,5083,5084,5,442,0,0,5084,5126,3,624,312,0,5085,
        5086,5,175,0,0,5086,5126,3,1338,669,0,5087,5088,5,189,0,0,5088,5126,
        3,522,261,0,5089,5090,5,238,0,0,5090,5126,3,1338,669,0,5091,5092,
        5,239,0,0,5092,5093,5,267,0,0,5093,5126,3,294,147,0,5094,5095,5,
        316,0,0,5095,5126,3,1338,669,0,5096,5097,5,344,0,0,5097,5126,3,1338,
        669,0,5098,5099,5,353,0,0,5099,5126,3,522,261,0,5100,5101,5,30,0,
        0,5101,5102,5,343,0,0,5102,5103,5,68,0,0,5103,5104,5,316,0,0,5104,
        5126,3,1338,669,0,5105,5106,5,30,0,0,5106,5107,5,322,0,0,5107,5108,
        5,68,0,0,5108,5109,5,316,0,0,5109,5126,3,1338,669,0,5110,5111,5,
        30,0,0,5111,5112,5,212,0,0,5112,5113,5,68,0,0,5113,5114,5,316,0,
        0,5114,5126,3,1338,669,0,5115,5116,5,30,0,0,5116,5117,5,457,0,0,
        5117,5118,5,68,0,0,5118,5119,5,316,0,0,5119,5126,3,1338,669,0,5120,
        5121,5,30,0,0,5121,5122,5,455,0,0,5122,5123,5,68,0,0,5123,5124,5,
        316,0,0,5124,5126,3,1338,669,0,5125,5067,1,0,0,0,5125,5068,1,0,0,
        0,5125,5070,1,0,0,0,5125,5072,1,0,0,0,5125,5076,1,0,0,0,5125,5079,
        1,0,0,0,5125,5081,1,0,0,0,5125,5083,1,0,0,0,5125,5085,1,0,0,0,5125,
        5087,1,0,0,0,5125,5089,1,0,0,0,5125,5091,1,0,0,0,5125,5094,1,0,0,
        0,5125,5096,1,0,0,0,5125,5098,1,0,0,0,5125,5100,1,0,0,0,5125,5105,
        1,0,0,0,5125,5110,1,0,0,0,5125,5115,1,0,0,0,5125,5120,1,0,0,0,5126,
        563,1,0,0,0,5127,5132,3,566,283,0,5128,5129,5,6,0,0,5129,5131,3,
        566,283,0,5130,5128,1,0,0,0,5131,5134,1,0,0,0,5132,5130,1,0,0,0,
        5132,5133,1,0,0,0,5133,565,1,0,0,0,5134,5132,1,0,0,0,5135,5139,3,
        1368,684,0,5136,5137,5,66,0,0,5137,5139,3,1368,684,0,5138,5135,1,
        0,0,0,5138,5136,1,0,0,0,5139,567,1,0,0,0,5140,5141,5,105,0,0,5141,
        5142,5,65,0,0,5142,5145,5,272,0,0,5143,5145,1,0,0,0,5144,5140,1,
        0,0,0,5144,5143,1,0,0,0,5145,569,1,0,0,0,5146,5147,5,65,0,0,5147,
        5148,3,558,279,0,5148,5149,5,94,0,0,5149,5150,3,1370,685,0,5150,
        5151,3,574,287,0,5151,5152,3,576,288,0,5152,571,1,0,0,0,5153,5154,
        5,310,0,0,5154,5155,3,558,279,0,5155,5156,5,64,0,0,5156,5157,3,1370,
        685,0,5157,5158,3,576,288,0,5158,5159,3,108,54,0,5159,5171,1,0,0,
        0,5160,5161,5,310,0,0,5161,5162,5,134,0,0,5162,5163,5,272,0,0,5163,
        5164,5,62,0,0,5164,5165,3,558,279,0,5165,5166,5,64,0,0,5166,5167,
        3,1370,685,0,5167,5168,3,576,288,0,5168,5169,3,108,54,0,5169,5171,
        1,0,0,0,5170,5153,1,0,0,0,5170,5160,1,0,0,0,5171,573,1,0,0,0,5172,
        5173,5,105,0,0,5173,5174,5,134,0,0,5174,5177,5,272,0,0,5175,5177,
        1,0,0,0,5176,5172,1,0,0,0,5176,5175,1,0,0,0,5177,575,1,0,0,0,5178,
        5179,5,214,0,0,5179,5180,5,147,0,0,5180,5183,3,1368,684,0,5181,5183,
        1,0,0,0,5182,5178,1,0,0,0,5182,5181,1,0,0,0,5183,577,1,0,0,0,5184,
        5185,5,138,0,0,5185,5186,5,53,0,0,5186,5187,5,287,0,0,5187,5188,
        3,580,290,0,5188,5189,3,584,292,0,5189,579,1,0,0,0,5190,5192,3,582,
        291,0,5191,5190,1,0,0,0,5192,5195,1,0,0,0,5193,5191,1,0,0,0,5193,
        5194,1,0,0,0,5194,581,1,0,0,0,5195,5193,1,0,0,0,5196,5197,5,68,0,
        0,5197,5198,5,316,0,0,5198,5206,3,1338,669,0,5199,5200,5,62,0,0,
        5200,5201,5,311,0,0,5201,5206,3,1370,685,0,5202,5203,5,62,0,0,5203,
        5204,5,99,0,0,5204,5206,3,1370,685,0,5205,5196,1,0,0,0,5205,5199,
        1,0,0,0,5205,5202,1,0,0,0,5206,583,1,0,0,0,5207,5208,5,65,0,0,5208,
        5209,3,556,278,0,5209,5210,5,80,0,0,5210,5211,3,586,293,0,5211,5212,
        5,94,0,0,5212,5213,3,564,282,0,5213,5214,3,568,284,0,5214,5235,1,
        0,0,0,5215,5216,5,310,0,0,5216,5217,3,556,278,0,5217,5218,5,80,0,
        0,5218,5219,3,586,293,0,5219,5220,5,64,0,0,5220,5221,3,564,282,0,
        5221,5222,3,108,54,0,5222,5235,1,0,0,0,5223,5224,5,310,0,0,5224,
        5225,5,65,0,0,5225,5226,5,272,0,0,5226,5227,5,62,0,0,5227,5228,3,
        556,278,0,5228,5229,5,80,0,0,5229,5230,3,586,293,0,5230,5231,5,64,
        0,0,5231,5232,3,564,282,0,5232,5233,3,108,54,0,5233,5235,1,0,0,0,
        5234,5207,1,0,0,0,5234,5215,1,0,0,0,5234,5223,1,0,0,0,5235,585,1,
        0,0,0,5236,5237,7,25,0,0,5237,587,1,0,0,0,5238,5239,5,46,0,0,5239,
        5240,3,590,295,0,5240,5241,5,226,0,0,5241,5242,3,592,296,0,5242,
        5243,3,594,297,0,5243,5244,5,80,0,0,5244,5245,3,1074,537,0,5245,
        5246,3,596,298,0,5246,5247,5,2,0,0,5247,5248,3,598,299,0,5248,5249,
        5,3,0,0,5249,5250,3,604,302,0,5250,5251,3,118,59,0,5251,5252,3,254,
        127,0,5252,5253,3,1094,547,0,5253,5274,1,0,0,0,5254,5255,5,46,0,
        0,5255,5256,3,590,295,0,5256,5257,5,226,0,0,5257,5258,3,592,296,
        0,5258,5259,5,220,0,0,5259,5260,5,77,0,0,5260,5261,5,389,0,0,5261,
        5262,3,1340,670,0,5262,5263,5,80,0,0,5263,5264,3,1074,537,0,5264,
        5265,3,596,298,0,5265,5266,5,2,0,0,5266,5267,3,598,299,0,5267,5268,
        5,3,0,0,5268,5269,3,604,302,0,5269,5270,3,118,59,0,5270,5271,3,254,
        127,0,5271,5272,3,1094,547,0,5272,5274,1,0,0,0,5273,5238,1,0,0,0,
        5273,5254,1,0,0,0,5274,589,1,0,0,0,5275,5278,5,98,0,0,5276,5278,
        1,0,0,0,5277,5275,1,0,0,0,5277,5276,1,0,0,0,5278,591,1,0,0,0,5279,
        5282,5,109,0,0,5280,5282,1,0,0,0,5281,5279,1,0,0,0,5281,5280,1,0,
        0,0,5282,593,1,0,0,0,5283,5286,3,1340,670,0,5284,5286,1,0,0,0,5285,
        5283,1,0,0,0,5285,5284,1,0,0,0,5286,595,1,0,0,0,5287,5288,5,100,
        0,0,5288,5291,3,1340,670,0,5289,5291,1,0,0,0,5290,5287,1,0,0,0,5290,
        5289,1,0,0,0,5291,597,1,0,0,0,5292,5297,3,602,301,0,5293,5294,5,
        6,0,0,5294,5296,3,602,301,0,5295,5293,1,0,0,0,5296,5299,1,0,0,0,
        5297,5295,1,0,0,0,5297,5298,1,0,0,0,5298,599,1,0,0,0,5299,5297,1,
        0,0,0,5300,5301,3,608,304,0,5301,5302,3,610,305,0,5302,5303,3,612,
        306,0,5303,5304,3,614,307,0,5304,5312,1,0,0,0,5305,5306,3,608,304,
        0,5306,5307,3,524,262,0,5307,5308,3,116,58,0,5308,5309,3,612,306,
        0,5309,5310,3,614,307,0,5310,5312,1,0,0,0,5311,5300,1,0,0,0,5311,
        5305,1,0,0,0,5312,601,1,0,0,0,5313,5314,3,1372,686,0,5314,5315,3,
        600,300,0,5315,5325,1,0,0,0,5316,5317,3,1214,607,0,5317,5318,3,600,
        300,0,5318,5325,1,0,0,0,5319,5320,5,2,0,0,5320,5321,3,1162,581,0,
        5321,5322,5,3,0,0,5322,5323,3,600,300,0,5323,5325,1,0,0,0,5324,5313,
        1,0,0,0,5324,5316,1,0,0,0,5324,5319,1,0,0,0,5325,603,1,0,0,0,5326,
        5327,5,441,0,0,5327,5328,5,2,0,0,5328,5329,3,606,303,0,5329,5330,
        5,3,0,0,5330,5333,1,0,0,0,5331,5333,1,0,0,0,5332,5326,1,0,0,0,5332,
        5331,1,0,0,0,5333,605,1,0,0,0,5334,5339,3,602,301,0,5335,5336,5,
        6,0,0,5336,5338,3,602,301,0,5337,5335,1,0,0,0,5338,5341,1,0,0,0,
        5339,5337,1,0,0,0,5339,5340,1,0,0,0,5340,607,1,0,0,0,5341,5339,1,
        0,0,0,5342,5343,5,43,0,0,5343,5346,3,524,262,0,5344,5346,1,0,0,0,
        5345,5342,1,0,0,0,5345,5344,1,0,0,0,5346,609,1,0,0,0,5347,5350,3,
        524,262,0,5348,5350,1,0,0,0,5349,5347,1,0,0,0,5349,5348,1,0,0,0,
        5350,611,1,0,0,0,5351,5355,5,37,0,0,5352,5355,5,55,0,0,5353,5355,
        1,0,0,0,5354,5351,1,0,0,0,5354,5352,1,0,0,0,5354,5353,1,0,0,0,5355,
        613,1,0,0,0,5356,5357,5,266,0,0,5357,5362,5,207,0,0,5358,5359,5,
        266,0,0,5359,5362,5,240,0,0,5360,5362,1,0,0,0,5361,5356,1,0,0,0,
        5361,5358,1,0,0,0,5361,5360,1,0,0,0,5362,615,1,0,0,0,5363,5364,5,
        46,0,0,5364,5365,3,618,309,0,5365,5366,7,22,0,0,5366,5367,3,1346,
        673,0,5367,5377,3,628,314,0,5368,5375,5,309,0,0,5369,5376,3,638,
        319,0,5370,5371,5,92,0,0,5371,5372,5,2,0,0,5372,5373,3,668,334,0,
        5373,5374,5,3,0,0,5374,5376,1,0,0,0,5375,5369,1,0,0,0,5375,5370,
        1,0,0,0,5376,5378,1,0,0,0,5377,5368,1,0,0,0,5377,5378,1,0,0,0,5378,
        5379,1,0,0,0,5379,5380,3,654,327,0,5380,617,1,0,0,0,5381,5382,5,
        82,0,0,5382,5385,5,304,0,0,5383,5385,1,0,0,0,5384,5381,1,0,0,0,5384,
        5383,1,0,0,0,5385,619,1,0,0,0,5386,5388,5,2,0,0,5387,5389,3,622,
        311,0,5388,5387,1,0,0,0,5388,5389,1,0,0,0,5389,5390,1,0,0,0,5390,
        5391,5,3,0,0,5391,621,1,0,0,0,5392,5397,3,632,316,0,5393,5394,5,
        6,0,0,5394,5396,3,632,316,0,5395,5393,1,0,0,0,5396,5399,1,0,0,0,
        5397,5395,1,0,0,0,5397,5398,1,0,0,0,5398,623,1,0,0,0,5399,5397,1,
        0,0,0,5400,5405,3,626,313,0,5401,5402,5,6,0,0,5402,5404,3,626,313,
        0,5403,5401,1,0,0,0,5404,5407,1,0,0,0,5405,5403,1,0,0,0,5405,5406,
        1,0,0,0,5406,625,1,0,0,0,5407,5405,1,0,0,0,5408,5409,3,1346,673,
        0,5409,5410,3,620,310,0,5410,5417,1,0,0,0,5411,5417,3,1390,695,0,
        5412,5414,3,1372,686,0,5413,5415,3,1324,662,0,5414,5413,1,0,0,0,
        5414,5415,1,0,0,0,5415,5417,1,0,0,0,5416,5408,1,0,0,0,5416,5411,
        1,0,0,0,5416,5412,1,0,0,0,5417,627,1,0,0,0,5418,5420,5,2,0,0,5419,
        5421,3,630,315,0,5420,5419,1,0,0,0,5420,5421,1,0,0,0,5421,5422,1,
        0,0,0,5422,5423,5,3,0,0,5423,629,1,0,0,0,5424,5429,3,642,321,0,5425,
        5426,5,6,0,0,5426,5428,3,642,321,0,5427,5425,1,0,0,0,5428,5431,1,
        0,0,0,5429,5427,1,0,0,0,5429,5430,1,0,0,0,5430,631,1,0,0,0,5431,
        5429,1,0,0,0,5432,5434,3,634,317,0,5433,5435,3,636,318,0,5434,5433,
        1,0,0,0,5434,5435,1,0,0,0,5435,5436,1,0,0,0,5436,5437,3,640,320,
        0,5437,5446,1,0,0,0,5438,5440,3,636,318,0,5439,5441,3,634,317,0,
        5440,5439,1,0,0,0,5440,5441,1,0,0,0,5441,5442,1,0,0,0,5442,5443,
        3,640,320,0,5443,5446,1,0,0,0,5444,5446,3,640,320,0,5445,5432,1,
        0,0,0,5445,5438,1,0,0,0,5445,5444,1,0,0,0,5446,633,1,0,0,0,5447,
        5449,5,68,0,0,5448,5450,5,453,0,0,5449,5448,1,0,0,0,5449,5450,1,
        0,0,0,5450,5455,1,0,0,0,5451,5455,5,453,0,0,5452,5455,5,393,0,0,
        5453,5455,5,101,0,0,5454,5447,1,0,0,0,5454,5451,1,0,0,0,5454,5452,
        1,0,0,0,5454,5453,1,0,0,0,5455,635,1,0,0,0,5456,5461,3,1376,688,
        0,5457,5461,3,1394,697,0,5458,5461,5,119,0,0,5459,5461,5,126,0,0,
        5460,5456,1,0,0,0,5460,5457,1,0,0,0,5460,5458,1,0,0,0,5460,5459,
        1,0,0,0,5461,637,1,0,0,0,5462,5463,3,640,320,0,5463,639,1,0,0,0,
        5464,5479,3,1118,559,0,5465,5467,5,408,0,0,5466,5465,1,0,0,0,5466,
        5467,1,0,0,0,5467,5472,1,0,0,0,5468,5473,3,1394,697,0,5469,5473,
        3,1376,688,0,5470,5473,5,119,0,0,5471,5473,5,126,0,0,5472,5468,1,
        0,0,0,5472,5469,1,0,0,0,5472,5470,1,0,0,0,5472,5471,1,0,0,0,5473,
        5474,1,0,0,0,5474,5475,3,526,263,0,5475,5476,5,27,0,0,5476,5477,
        5,353,0,0,5477,5479,1,0,0,0,5478,5464,1,0,0,0,5478,5466,1,0,0,0,
        5479,641,1,0,0,0,5480,5483,3,632,316,0,5481,5482,7,26,0,0,5482,5484,
        3,1162,581,0,5483,5481,1,0,0,0,5483,5484,1,0,0,0,5484,643,1,0,0,
        0,5485,5486,3,632,316,0,5486,645,1,0,0,0,5487,5498,5,2,0,0,5488,
        5499,5,9,0,0,5489,5499,3,648,324,0,5490,5491,5,83,0,0,5491,5492,
        5,147,0,0,5492,5499,3,648,324,0,5493,5494,3,648,324,0,5494,5495,
        5,83,0,0,5495,5496,5,147,0,0,5496,5497,3,648,324,0,5497,5499,1,0,
        0,0,5498,5488,1,0,0,0,5498,5489,1,0,0,0,5498,5490,1,0,0,0,5498,5493,
        1,0,0,0,5499,5500,1,0,0,0,5500,5501,5,3,0,0,5501,647,1,0,0,0,5502,
        5507,3,644,322,0,5503,5504,5,6,0,0,5504,5506,3,644,322,0,5505,5503,
        1,0,0,0,5506,5509,1,0,0,0,5507,5505,1,0,0,0,5507,5508,1,0,0,0,5508,
        649,1,0,0,0,5509,5507,1,0,0,0,5510,5511,3,1346,673,0,5511,5512,3,
        646,323,0,5512,651,1,0,0,0,5513,5518,3,650,325,0,5514,5515,5,6,0,
        0,5515,5517,3,650,325,0,5516,5514,1,0,0,0,5517,5520,1,0,0,0,5518,
        5516,1,0,0,0,5518,5519,1,0,0,0,5519,653,1,0,0,0,5520,5518,1,0,0,
        0,5521,5523,3,658,329,0,5522,5521,1,0,0,0,5523,5524,1,0,0,0,5524,
        5522,1,0,0,0,5524,5525,1,0,0,0,5525,5526,1,0,0,0,5526,5527,6,327,
        -1,0,5527,655,1,0,0,0,5528,5529,5,149,0,0,5529,5530,5,80,0,0,5530,
        5531,5,78,0,0,5531,5564,5,458,0,0,5532,5533,5,309,0,0,5533,5534,
        5,78,0,0,5534,5535,5,80,0,0,5535,5536,5,78,0,0,5536,5564,5,458,0,
        0,5537,5564,5,339,0,0,5538,5564,5,222,0,0,5539,5564,5,331,0,0,5540,
        5564,5,370,0,0,5541,5542,5,205,0,0,5542,5543,5,320,0,0,5543,5564,
        5,181,0,0,5544,5545,5,205,0,0,5545,5546,5,320,0,0,5546,5564,5,234,
        0,0,5547,5548,5,320,0,0,5548,5564,5,181,0,0,5549,5550,5,320,0,0,
        5550,5564,5,234,0,0,5551,5564,5,241,0,0,5552,5553,5,77,0,0,5553,
        5564,5,241,0,0,5554,5555,5,170,0,0,5555,5564,3,292,146,0,5556,5557,
        5,313,0,0,5557,5564,3,292,146,0,5558,5559,5,459,0,0,5559,5564,3,
        524,262,0,5560,5564,3,82,41,0,5561,5562,5,460,0,0,5562,5564,3,1372,
        686,0,5563,5528,1,0,0,0,5563,5532,1,0,0,0,5563,5537,1,0,0,0,5563,
        5538,1,0,0,0,5563,5539,1,0,0,0,5563,5540,1,0,0,0,5563,5541,1,0,0,
        0,5563,5544,1,0,0,0,5563,5547,1,0,0,0,5563,5549,1,0,0,0,5563,5551,
        1,0,0,0,5563,5552,1,0,0,0,5563,5554,1,0,0,0,5563,5556,1,0,0,0,5563,
        5558,1,0,0,0,5563,5560,1,0,0,0,5563,5561,1,0,0,0,5564,657,1,0,0,
        0,5565,5566,5,36,0,0,5566,5574,3,660,330,0,5567,5568,5,238,0,0,5568,
        5574,3,72,36,0,5569,5570,5,443,0,0,5570,5574,3,662,331,0,5571,5574,
        5,104,0,0,5572,5574,3,656,328,0,5573,5565,1,0,0,0,5573,5567,1,0,
        0,0,5573,5569,1,0,0,0,5573,5571,1,0,0,0,5573,5572,1,0,0,0,5574,659,
        1,0,0,0,5575,5581,3,1358,679,0,5576,5577,3,1358,679,0,5577,5578,
        5,6,0,0,5578,5579,3,1358,679,0,5579,5581,1,0,0,0,5580,5575,1,0,0,
        0,5580,5576,1,0,0,0,5581,661,1,0,0,0,5582,5583,5,62,0,0,5583,5584,
        5,353,0,0,5584,5591,3,1118,559,0,5585,5586,5,6,0,0,5586,5587,5,62,
        0,0,5587,5588,5,353,0,0,5588,5590,3,1118,559,0,5589,5585,1,0,0,0,
        5590,5593,1,0,0,0,5591,5589,1,0,0,0,5591,5592,1,0,0,0,5592,663,1,
        0,0,0,5593,5591,1,0,0,0,5594,5595,5,105,0,0,5595,5598,3,460,230,
        0,5596,5598,1,0,0,0,5597,5594,1,0,0,0,5597,5596,1,0,0,0,5598,665,
        1,0,0,0,5599,5600,3,636,318,0,5600,5601,3,640,320,0,5601,667,1,0,
        0,0,5602,5607,3,666,333,0,5603,5604,5,6,0,0,5604,5606,3,666,333,
        0,5605,5603,1,0,0,0,5606,5609,1,0,0,0,5607,5605,1,0,0,0,5607,5608,
        1,0,0,0,5608,669,1,0,0,0,5609,5607,1,0,0,0,5610,5611,5,138,0,0,5611,
        5612,7,27,0,0,5612,5613,3,626,313,0,5613,5614,3,672,336,0,5614,5615,
        3,674,337,0,5615,671,1,0,0,0,5616,5618,3,656,328,0,5617,5616,1,0,
        0,0,5618,5619,1,0,0,0,5619,5617,1,0,0,0,5619,5620,1,0,0,0,5620,673,
        1,0,0,0,5621,5624,5,308,0,0,5622,5624,1,0,0,0,5623,5621,1,0,0,0,
        5623,5622,1,0,0,0,5624,675,1,0,0,0,5625,5626,5,191,0,0,5626,5627,
        5,211,0,0,5627,5628,3,624,312,0,5628,5629,3,108,54,0,5629,5662,1,
        0,0,0,5630,5631,5,191,0,0,5631,5632,5,211,0,0,5632,5633,5,220,0,
        0,5633,5634,5,389,0,0,5634,5635,3,624,312,0,5635,5636,3,108,54,0,
        5636,5662,1,0,0,0,5637,5638,5,191,0,0,5638,5639,5,289,0,0,5639,5640,
        3,624,312,0,5640,5641,3,108,54,0,5641,5662,1,0,0,0,5642,5643,5,191,
        0,0,5643,5644,5,289,0,0,5644,5645,5,220,0,0,5645,5646,5,389,0,0,
        5646,5647,3,624,312,0,5647,5648,3,108,54,0,5648,5662,1,0,0,0,5649,
        5650,5,191,0,0,5650,5651,5,442,0,0,5651,5652,3,624,312,0,5652,5653,
        3,108,54,0,5653,5662,1,0,0,0,5654,5655,5,191,0,0,5655,5656,5,442,
        0,0,5656,5657,5,220,0,0,5657,5658,5,389,0,0,5658,5659,3,624,312,
        0,5659,5660,3,108,54,0,5660,5662,1,0,0,0,5661,5625,1,0,0,0,5661,
        5630,1,0,0,0,5661,5637,1,0,0,0,5661,5642,1,0,0,0,5661,5649,1,0,0,
        0,5661,5654,1,0,0,0,5662,677,1,0,0,0,5663,5664,5,191,0,0,5664,5665,
        5,136,0,0,5665,5666,3,652,326,0,5666,5667,3,108,54,0,5667,5676,1,
        0,0,0,5668,5669,5,191,0,0,5669,5670,5,136,0,0,5670,5671,5,220,0,
        0,5671,5672,5,389,0,0,5672,5673,3,652,326,0,5673,5674,3,108,54,0,
        5674,5676,1,0,0,0,5675,5663,1,0,0,0,5675,5668,1,0,0,0,5676,679,1,
        0,0,0,5677,5678,5,191,0,0,5678,5679,5,271,0,0,5679,5680,3,686,343,
        0,5680,5681,3,108,54,0,5681,5690,1,0,0,0,5682,5683,5,191,0,0,5683,
        5684,5,271,0,0,5684,5685,5,220,0,0,5685,5686,5,389,0,0,5686,5687,
        3,686,343,0,5687,5688,3,108,54,0,5688,5690,1,0,0,0,5689,5677,1,0,
        0,0,5689,5682,1,0,0,0,5690,681,1,0,0,0,5691,5692,5,2,0,0,5692,5693,
        3,1118,559,0,5693,5694,5,3,0,0,5694,5714,1,0,0,0,5695,5696,5,2,0,
        0,5696,5697,3,1118,559,0,5697,5698,5,6,0,0,5698,5699,3,1118,559,
        0,5699,5700,5,3,0,0,5700,5714,1,0,0,0,5701,5702,5,2,0,0,5702,5703,
        5,400,0,0,5703,5704,5,6,0,0,5704,5705,3,1118,559,0,5705,5706,5,3,
        0,0,5706,5714,1,0,0,0,5707,5708,5,2,0,0,5708,5709,3,1118,559,0,5709,
        5710,5,6,0,0,5710,5711,5,400,0,0,5711,5712,5,3,0,0,5712,5714,1,0,
        0,0,5713,5691,1,0,0,0,5713,5695,1,0,0,0,5713,5701,1,0,0,0,5713,5707,
        1,0,0,0,5714,683,1,0,0,0,5715,5716,3,1372,686,0,5716,5717,5,11,0,
        0,5717,5719,1,0,0,0,5718,5715,1,0,0,0,5719,5722,1,0,0,0,5720,5718,
        1,0,0,0,5720,5721,1,0,0,0,5721,5723,1,0,0,0,5722,5720,1,0,0,0,5723,
        5724,3,1270,635,0,5724,685,1,0,0,0,5725,5730,3,688,344,0,5726,5727,
        5,6,0,0,5727,5729,3,688,344,0,5728,5726,1,0,0,0,5729,5732,1,0,0,
        0,5730,5728,1,0,0,0,5730,5731,1,0,0,0,5731,687,1,0,0,0,5732,5730,
        1,0,0,0,5733,5734,3,684,342,0,5734,5735,3,682,341,0,5735,689,1,0,
        0,0,5736,5737,5,57,0,0,5737,5738,3,692,346,0,5738,691,1,0,0,0,5739,
        5741,3,694,347,0,5740,5739,1,0,0,0,5741,5742,1,0,0,0,5742,5740,1,
        0,0,0,5742,5743,1,0,0,0,5743,693,1,0,0,0,5744,5748,3,1358,679,0,
        5745,5746,5,238,0,0,5746,5748,3,72,36,0,5747,5744,1,0,0,0,5747,5745,
        1,0,0,0,5748,695,1,0,0,0,5749,5750,5,46,0,0,5750,5751,5,41,0,0,5751,
        5752,5,2,0,0,5752,5753,3,1118,559,0,5753,5754,5,36,0,0,5754,5755,
        3,1118,559,0,5755,5756,5,3,0,0,5756,5757,5,105,0,0,5757,5758,5,211,
        0,0,5758,5759,3,626,313,0,5759,5760,3,698,349,0,5760,5784,1,0,0,
        0,5761,5762,5,46,0,0,5762,5763,5,41,0,0,5763,5764,5,2,0,0,5764,5765,
        3,1118,559,0,5765,5766,5,36,0,0,5766,5767,3,1118,559,0,5767,5768,
        5,3,0,0,5768,5769,5,372,0,0,5769,5770,5,211,0,0,5770,5771,3,698,
        349,0,5771,5784,1,0,0,0,5772,5773,5,46,0,0,5773,5774,5,41,0,0,5774,
        5775,5,2,0,0,5775,5776,3,1118,559,0,5776,5777,5,36,0,0,5777,5778,
        3,1118,559,0,5778,5779,5,3,0,0,5779,5780,5,105,0,0,5780,5781,5,393,
        0,0,5781,5782,3,698,349,0,5782,5784,1,0,0,0,5783,5749,1,0,0,0,5783,
        5761,1,0,0,0,5783,5772,1,0,0,0,5784,697,1,0,0,0,5785,5786,5,36,0,
        0,5786,5791,5,223,0,0,5787,5788,5,36,0,0,5788,5791,5,141,0,0,5789,
        5791,1,0,0,0,5790,5785,1,0,0,0,5790,5787,1,0,0,0,5790,5789,1,0,0,
        0,5791,699,1,0,0,0,5792,5793,5,191,0,0,5793,5794,5,41,0,0,5794,5795,
        3,702,351,0,5795,5796,5,2,0,0,5796,5797,3,1118,559,0,5797,5798,5,
        36,0,0,5798,5799,3,1118,559,0,5799,5800,5,3,0,0,5800,5801,3,108,
        54,0,5801,701,1,0,0,0,5802,5803,5,220,0,0,5803,5806,5,389,0,0,5804,
        5806,1,0,0,0,5805,5802,1,0,0,0,5805,5804,1,0,0,0,5806,703,1,0,0,
        0,5807,5808,5,46,0,0,5808,5809,3,618,309,0,5809,5810,5,443,0,0,5810,
        5811,5,62,0,0,5811,5812,3,1118,559,0,5812,5813,5,238,0,0,5813,5814,
        3,1340,670,0,5814,5815,5,2,0,0,5815,5816,3,706,353,0,5816,5817,5,
        3,0,0,5817,705,1,0,0,0,5818,5819,5,64,0,0,5819,5820,5,461,0,0,5820,
        5821,5,105,0,0,5821,5822,5,211,0,0,5822,5823,3,626,313,0,5823,5824,
        5,6,0,0,5824,5825,5,94,0,0,5825,5826,5,461,0,0,5826,5827,5,105,0,
        0,5827,5828,5,211,0,0,5828,5829,3,626,313,0,5829,5853,1,0,0,0,5830,
        5831,5,94,0,0,5831,5832,5,461,0,0,5832,5833,5,105,0,0,5833,5834,
        5,211,0,0,5834,5835,3,626,313,0,5835,5836,5,6,0,0,5836,5837,5,64,
        0,0,5837,5838,5,461,0,0,5838,5839,5,105,0,0,5839,5840,5,211,0,0,
        5840,5841,3,626,313,0,5841,5853,1,0,0,0,5842,5843,5,64,0,0,5843,
        5844,5,461,0,0,5844,5845,5,105,0,0,5845,5846,5,211,0,0,5846,5853,
        3,626,313,0,5847,5848,5,94,0,0,5848,5849,5,461,0,0,5849,5850,5,105,
        0,0,5850,5851,5,211,0,0,5851,5853,3,626,313,0,5852,5818,1,0,0,0,
        5852,5830,1,0,0,0,5852,5842,1,0,0,0,5852,5847,1,0,0,0,5853,707,1,
        0,0,0,5854,5855,5,191,0,0,5855,5856,5,443,0,0,5856,5857,3,702,351,
        0,5857,5858,5,62,0,0,5858,5859,3,1118,559,0,5859,5860,5,238,0,0,
        5860,5861,3,1340,670,0,5861,5862,3,108,54,0,5862,709,1,0,0,0,5863,
        5864,5,299,0,0,5864,5865,3,712,356,0,5865,5866,3,592,296,0,5866,
        5867,3,1336,668,0,5867,5890,1,0,0,0,5868,5869,5,299,0,0,5869,5870,
        3,714,357,0,5870,5871,3,592,296,0,5871,5872,3,1340,670,0,5872,5890,
        1,0,0,0,5873,5874,5,299,0,0,5874,5875,5,2,0,0,5875,5876,3,716,358,
        0,5876,5877,5,3,0,0,5877,5878,3,712,356,0,5878,5879,3,592,296,0,
        5879,5880,3,1336,668,0,5880,5890,1,0,0,0,5881,5882,5,299,0,0,5882,
        5883,5,2,0,0,5883,5884,3,716,358,0,5884,5885,5,3,0,0,5885,5886,3,
        714,357,0,5886,5887,3,592,296,0,5887,5888,3,1340,670,0,5888,5890,
        1,0,0,0,5889,5863,1,0,0,0,5889,5868,1,0,0,0,5889,5873,1,0,0,0,5889,
        5881,1,0,0,0,5890,711,1,0,0,0,5891,5892,7,28,0,0,5892,713,1,0,0,
        0,5893,5894,7,29,0,0,5894,715,1,0,0,0,5895,5900,3,718,359,0,5896,
        5897,5,6,0,0,5897,5899,3,718,359,0,5898,5896,1,0,0,0,5899,5902,1,
        0,0,0,5900,5898,1,0,0,0,5900,5901,1,0,0,0,5901,717,1,0,0,0,5902,
        5900,1,0,0,0,5903,5904,7,30,0,0,5904,719,1,0,0,0,5905,5906,5,138,
        0,0,5906,5907,5,344,0,0,5907,5908,3,1340,670,0,5908,5909,5,326,0,
        0,5909,5910,3,116,58,0,5910,5918,1,0,0,0,5911,5912,5,138,0,0,5912,
        5913,5,344,0,0,5913,5914,3,1340,670,0,5914,5915,5,306,0,0,5915,5916,
        3,116,58,0,5916,5918,1,0,0,0,5917,5905,1,0,0,0,5917,5911,1,0,0,0,
        5918,721,1,0,0,0,5919,5920,5,138,0,0,5920,5921,5,136,0,0,5921,5922,
        3,650,325,0,5922,5923,5,302,0,0,5923,5924,5,94,0,0,5924,5925,3,1340,
        670,0,5925,6388,1,0,0,0,5926,5927,5,138,0,0,5927,5928,5,108,0,0,
        5928,5929,3,524,262,0,5929,5930,5,302,0,0,5930,5931,5,94,0,0,5931,
        5932,3,1340,670,0,5932,6388,1,0,0,0,5933,5934,5,138,0,0,5934,5935,
        5,168,0,0,5935,5936,3,524,262,0,5936,5937,5,302,0,0,5937,5938,5,
        94,0,0,5938,5939,3,1340,670,0,5939,6388,1,0,0,0,5940,5941,5,138,
        0,0,5941,5942,5,175,0,0,5942,5943,3,1340,670,0,5943,5944,5,302,0,
        0,5944,5945,5,94,0,0,5945,5946,3,1340,670,0,5946,6388,1,0,0,0,5947,
        5948,5,138,0,0,5948,5949,5,189,0,0,5949,5950,3,524,262,0,5950,5951,
        5,302,0,0,5951,5952,5,94,0,0,5952,5953,3,1340,670,0,5953,6388,1,
        0,0,0,5954,5955,5,138,0,0,5955,5956,5,189,0,0,5956,5957,3,524,262,
        0,5957,5958,5,302,0,0,5958,5959,5,45,0,0,5959,5960,3,1340,670,0,
        5960,5961,5,94,0,0,5961,5962,3,1340,670,0,5962,6388,1,0,0,0,5963,
        5964,5,138,0,0,5964,5965,5,63,0,0,5965,5966,5,174,0,0,5966,5967,
        5,374,0,0,5967,5968,3,1340,670,0,5968,5969,5,302,0,0,5969,5970,5,
        94,0,0,5970,5971,3,1340,670,0,5971,6388,1,0,0,0,5972,5973,5,138,
        0,0,5973,5974,5,211,0,0,5974,5975,3,626,313,0,5975,5976,5,302,0,
        0,5976,5977,5,94,0,0,5977,5978,3,1340,670,0,5978,6388,1,0,0,0,5979,
        5980,5,138,0,0,5980,5981,5,66,0,0,5981,5982,3,1366,683,0,5982,5983,
        5,302,0,0,5983,5984,5,94,0,0,5984,5985,3,1366,683,0,5985,6388,1,
        0,0,0,5986,5987,5,138,0,0,5987,5988,3,308,154,0,5988,5989,5,238,
        0,0,5989,5990,3,1340,670,0,5990,5991,5,302,0,0,5991,5992,5,94,0,
        0,5992,5993,3,1340,670,0,5993,6388,1,0,0,0,5994,5995,5,138,0,0,5995,
        5996,5,271,0,0,5996,5997,5,156,0,0,5997,5998,3,524,262,0,5998,5999,
        5,100,0,0,5999,6000,3,1340,670,0,6000,6001,5,302,0,0,6001,6002,5,
        94,0,0,6002,6003,3,1340,670,0,6003,6388,1,0,0,0,6004,6005,5,138,
        0,0,6005,6006,5,271,0,0,6006,6007,5,206,0,0,6007,6008,3,524,262,
        0,6008,6009,5,100,0,0,6009,6010,3,1340,670,0,6010,6011,5,302,0,0,
        6011,6012,5,94,0,0,6012,6013,3,1340,670,0,6013,6388,1,0,0,0,6014,
        6015,5,138,0,0,6015,6016,5,445,0,0,6016,6017,3,1340,670,0,6017,6018,
        5,80,0,0,6018,6019,3,1336,668,0,6019,6020,5,302,0,0,6020,6021,5,
        94,0,0,6021,6022,3,1340,670,0,6022,6388,1,0,0,0,6023,6024,5,138,
        0,0,6024,6025,5,445,0,0,6025,6026,5,220,0,0,6026,6027,5,389,0,0,
        6027,6028,3,1340,670,0,6028,6029,5,80,0,0,6029,6030,3,1336,668,0,
        6030,6031,5,302,0,0,6031,6032,5,94,0,0,6032,6033,3,1340,670,0,6033,
        6388,1,0,0,0,6034,6035,5,138,0,0,6035,6036,5,289,0,0,6036,6037,3,
        626,313,0,6037,6038,5,302,0,0,6038,6039,5,94,0,0,6039,6040,3,1340,
        670,0,6040,6388,1,0,0,0,6041,6042,5,138,0,0,6042,6043,5,452,0,0,
        6043,6044,3,1340,670,0,6044,6045,5,302,0,0,6045,6046,5,94,0,0,6046,
        6047,3,1340,670,0,6047,6388,1,0,0,0,6048,6049,5,138,0,0,6049,6050,
        5,442,0,0,6050,6051,3,626,313,0,6051,6052,5,302,0,0,6052,6053,5,
        94,0,0,6053,6054,3,1340,670,0,6054,6388,1,0,0,0,6055,6056,5,138,
        0,0,6056,6057,5,316,0,0,6057,6058,3,1340,670,0,6058,6059,5,302,0,
        0,6059,6060,5,94,0,0,6060,6061,3,1340,670,0,6061,6388,1,0,0,0,6062,
        6063,5,138,0,0,6063,6064,5,324,0,0,6064,6065,3,1340,670,0,6065,6066,
        5,302,0,0,6066,6067,5,94,0,0,6067,6068,3,1340,670,0,6068,6388,1,
        0,0,0,6069,6070,5,138,0,0,6070,6071,5,451,0,0,6071,6072,3,1340,670,
        0,6072,6073,5,302,0,0,6073,6074,5,94,0,0,6074,6075,3,1340,670,0,
        6075,6388,1,0,0,0,6076,6077,5,138,0,0,6077,6078,5,92,0,0,6078,6079,
        3,1074,537,0,6079,6080,5,302,0,0,6080,6081,5,94,0,0,6081,6082,3,
        1340,670,0,6082,6388,1,0,0,0,6083,6084,5,138,0,0,6084,6085,5,92,
        0,0,6085,6086,5,220,0,0,6086,6087,5,389,0,0,6087,6088,3,1074,537,
        0,6088,6089,5,302,0,0,6089,6090,5,94,0,0,6090,6091,3,1340,670,0,
        6091,6388,1,0,0,0,6092,6093,5,138,0,0,6093,6094,5,321,0,0,6094,6095,
        3,1336,668,0,6095,6096,5,302,0,0,6096,6097,5,94,0,0,6097,6098,3,
        1340,670,0,6098,6388,1,0,0,0,6099,6100,5,138,0,0,6100,6101,5,321,
        0,0,6101,6102,5,220,0,0,6102,6103,5,389,0,0,6103,6104,3,1336,668,
        0,6104,6105,5,302,0,0,6105,6106,5,94,0,0,6106,6107,3,1340,670,0,
        6107,6388,1,0,0,0,6108,6109,5,138,0,0,6109,6110,5,369,0,0,6110,6111,
        3,1336,668,0,6111,6112,5,302,0,0,6112,6113,5,94,0,0,6113,6114,3,
        1340,670,0,6114,6388,1,0,0,0,6115,6116,5,138,0,0,6116,6117,5,369,
        0,0,6117,6118,5,220,0,0,6118,6119,5,389,0,0,6119,6120,3,1336,668,
        0,6120,6121,5,302,0,0,6121,6122,5,94,0,0,6122,6123,3,1340,670,0,
        6123,6388,1,0,0,0,6124,6125,5,138,0,0,6125,6126,5,251,0,0,6126,6127,
        5,369,0,0,6127,6128,3,1336,668,0,6128,6129,5,302,0,0,6129,6130,5,
        94,0,0,6130,6131,3,1340,670,0,6131,6388,1,0,0,0,6132,6133,5,138,
        0,0,6133,6134,5,251,0,0,6134,6135,5,369,0,0,6135,6136,5,220,0,0,
        6136,6137,5,389,0,0,6137,6138,3,1336,668,0,6138,6139,5,302,0,0,6139,
        6140,5,94,0,0,6140,6141,3,1340,670,0,6141,6388,1,0,0,0,6142,6143,
        5,138,0,0,6143,6144,5,226,0,0,6144,6145,3,1336,668,0,6145,6146,5,
        302,0,0,6146,6147,5,94,0,0,6147,6148,3,1340,670,0,6148,6388,1,0,
        0,0,6149,6150,5,138,0,0,6150,6151,5,226,0,0,6151,6152,5,220,0,0,
        6152,6153,5,389,0,0,6153,6154,3,1336,668,0,6154,6155,5,302,0,0,6155,
        6156,5,94,0,0,6156,6157,3,1340,670,0,6157,6388,1,0,0,0,6158,6159,
        5,138,0,0,6159,6160,5,63,0,0,6160,6161,5,92,0,0,6161,6162,3,1074,
        537,0,6162,6163,5,302,0,0,6163,6164,5,94,0,0,6164,6165,3,1340,670,
        0,6165,6388,1,0,0,0,6166,6167,5,138,0,0,6167,6168,5,63,0,0,6168,
        6169,5,92,0,0,6169,6170,5,220,0,0,6170,6171,5,389,0,0,6171,6172,
        3,1074,537,0,6172,6173,5,302,0,0,6173,6174,5,94,0,0,6174,6175,3,
        1340,670,0,6175,6388,1,0,0,0,6176,6177,5,138,0,0,6177,6178,5,92,
        0,0,6178,6179,3,1074,537,0,6179,6180,5,302,0,0,6180,6181,3,724,362,
        0,6181,6182,3,1340,670,0,6182,6183,5,94,0,0,6183,6184,3,1340,670,
        0,6184,6388,1,0,0,0,6185,6186,5,138,0,0,6186,6187,5,92,0,0,6187,
        6188,5,220,0,0,6188,6189,5,389,0,0,6189,6190,3,1074,537,0,6190,6191,
        5,302,0,0,6191,6192,3,724,362,0,6192,6193,3,1340,670,0,6193,6194,
        5,94,0,0,6194,6195,3,1340,670,0,6195,6388,1,0,0,0,6196,6197,5,138,
        0,0,6197,6198,5,369,0,0,6198,6199,3,1336,668,0,6199,6200,5,302,0,
        0,6200,6201,3,724,362,0,6201,6202,3,1340,670,0,6202,6203,5,94,0,
        0,6203,6204,3,1340,670,0,6204,6388,1,0,0,0,6205,6206,5,138,0,0,6206,
        6207,5,369,0,0,6207,6208,5,220,0,0,6208,6209,5,389,0,0,6209,6210,
        3,1336,668,0,6210,6211,5,302,0,0,6211,6212,3,724,362,0,6212,6213,
        3,1340,670,0,6213,6214,5,94,0,0,6214,6215,3,1340,670,0,6215,6388,
        1,0,0,0,6216,6217,5,138,0,0,6217,6218,5,251,0,0,6218,6219,5,369,
        0,0,6219,6220,3,1336,668,0,6220,6221,5,302,0,0,6221,6222,3,724,362,
        0,6222,6223,3,1340,670,0,6223,6224,5,94,0,0,6224,6225,3,1340,670,
        0,6225,6388,1,0,0,0,6226,6227,5,138,0,0,6227,6228,5,251,0,0,6228,
        6229,5,369,0,0,6229,6230,5,220,0,0,6230,6231,5,389,0,0,6231,6232,
        3,1336,668,0,6232,6233,5,302,0,0,6233,6234,3,724,362,0,6234,6235,
        3,1340,670,0,6235,6236,5,94,0,0,6236,6237,3,1340,670,0,6237,6388,
        1,0,0,0,6238,6239,5,138,0,0,6239,6240,5,92,0,0,6240,6241,3,1074,
        537,0,6241,6242,5,302,0,0,6242,6243,5,45,0,0,6243,6244,3,1340,670,
        0,6244,6245,5,94,0,0,6245,6246,3,1340,670,0,6246,6388,1,0,0,0,6247,
        6248,5,138,0,0,6248,6249,5,92,0,0,6249,6250,5,220,0,0,6250,6251,
        5,389,0,0,6251,6252,3,1074,537,0,6252,6253,5,302,0,0,6253,6254,5,
        45,0,0,6254,6255,3,1340,670,0,6255,6256,5,94,0,0,6256,6257,3,1340,
        670,0,6257,6388,1,0,0,0,6258,6259,5,138,0,0,6259,6260,5,63,0,0,6260,
        6261,5,92,0,0,6261,6262,3,1074,537,0,6262,6263,5,302,0,0,6263,6264,
        3,724,362,0,6264,6265,3,1340,670,0,6265,6266,5,94,0,0,6266,6267,
        3,1340,670,0,6267,6388,1,0,0,0,6268,6269,5,138,0,0,6269,6270,5,63,
        0,0,6270,6271,5,92,0,0,6271,6272,5,220,0,0,6272,6273,5,389,0,0,6273,
        6274,3,1074,537,0,6274,6275,5,302,0,0,6275,6276,3,724,362,0,6276,
        6277,3,1340,670,0,6277,6278,5,94,0,0,6278,6279,3,1340,670,0,6279,
        6388,1,0,0,0,6280,6281,5,138,0,0,6281,6282,5,314,0,0,6282,6283,3,
        1340,670,0,6283,6284,5,80,0,0,6284,6285,3,1336,668,0,6285,6286,5,
        302,0,0,6286,6287,5,94,0,0,6287,6288,3,1340,670,0,6288,6388,1,0,
        0,0,6289,6290,5,138,0,0,6290,6291,5,350,0,0,6291,6292,3,1340,670,
        0,6292,6293,5,80,0,0,6293,6294,3,1336,668,0,6294,6295,5,302,0,0,
        6295,6296,5,94,0,0,6296,6297,3,1340,670,0,6297,6388,1,0,0,0,6298,
        6299,5,138,0,0,6299,6300,5,198,0,0,6300,6301,5,350,0,0,6301,6302,
        3,1340,670,0,6302,6303,5,302,0,0,6303,6304,5,94,0,0,6304,6305,3,
        1340,670,0,6305,6388,1,0,0,0,6306,6307,5,138,0,0,6307,6308,5,311,
        0,0,6308,6309,3,1366,683,0,6309,6310,5,302,0,0,6310,6311,5,94,0,
        0,6311,6312,3,1366,683,0,6312,6388,1,0,0,0,6313,6314,5,138,0,0,6314,
        6315,5,99,0,0,6315,6316,3,1366,683,0,6316,6317,5,302,0,0,6317,6318,
        5,94,0,0,6318,6319,3,1366,683,0,6319,6388,1,0,0,0,6320,6321,5,138,
        0,0,6321,6322,5,344,0,0,6322,6323,3,1340,670,0,6323,6324,5,302,0,
        0,6324,6325,5,94,0,0,6325,6326,3,1340,670,0,6326,6388,1,0,0,0,6327,
        6328,5,138,0,0,6328,6329,5,335,0,0,6329,6330,3,524,262,0,6330,6331,
        5,302,0,0,6331,6332,5,94,0,0,6332,6333,3,1340,670,0,6333,6388,1,
        0,0,0,6334,6335,5,138,0,0,6335,6336,5,348,0,0,6336,6337,5,318,0,
        0,6337,6338,5,276,0,0,6338,6339,3,524,262,0,6339,6340,5,302,0,0,
        6340,6341,5,94,0,0,6341,6342,3,1340,670,0,6342,6388,1,0,0,0,6343,
        6344,5,138,0,0,6344,6345,5,348,0,0,6345,6346,5,318,0,0,6346,6347,
        5,185,0,0,6347,6348,3,524,262,0,6348,6349,5,302,0,0,6349,6350,5,
        94,0,0,6350,6351,3,1340,670,0,6351,6388,1,0,0,0,6352,6353,5,138,
        0,0,6353,6354,5,348,0,0,6354,6355,5,318,0,0,6355,6356,5,346,0,0,
        6356,6357,3,524,262,0,6357,6358,5,302,0,0,6358,6359,5,94,0,0,6359,
        6360,3,1340,670,0,6360,6388,1,0,0,0,6361,6362,5,138,0,0,6362,6363,
        5,348,0,0,6363,6364,5,318,0,0,6364,6365,5,163,0,0,6365,6366,3,524,
        262,0,6366,6367,5,302,0,0,6367,6368,5,94,0,0,6368,6369,3,1340,670,
        0,6369,6388,1,0,0,0,6370,6371,5,138,0,0,6371,6372,5,353,0,0,6372,
        6373,3,524,262,0,6373,6374,5,302,0,0,6374,6375,5,94,0,0,6375,6376,
        3,1340,670,0,6376,6388,1,0,0,0,6377,6378,5,138,0,0,6378,6379,5,353,
        0,0,6379,6380,3,524,262,0,6380,6381,5,302,0,0,6381,6382,5,143,0,
        0,6382,6383,3,1340,670,0,6383,6384,5,94,0,0,6384,6385,3,1340,670,
        0,6385,6386,3,108,54,0,6386,6388,1,0,0,0,6387,5919,1,0,0,0,6387,
        5926,1,0,0,0,6387,5933,1,0,0,0,6387,5940,1,0,0,0,6387,5947,1,0,0,
        0,6387,5954,1,0,0,0,6387,5963,1,0,0,0,6387,5972,1,0,0,0,6387,5979,
        1,0,0,0,6387,5986,1,0,0,0,6387,5994,1,0,0,0,6387,6004,1,0,0,0,6387,
        6014,1,0,0,0,6387,6023,1,0,0,0,6387,6034,1,0,0,0,6387,6041,1,0,0,
        0,6387,6048,1,0,0,0,6387,6055,1,0,0,0,6387,6062,1,0,0,0,6387,6069,
        1,0,0,0,6387,6076,1,0,0,0,6387,6083,1,0,0,0,6387,6092,1,0,0,0,6387,
        6099,1,0,0,0,6387,6108,1,0,0,0,6387,6115,1,0,0,0,6387,6124,1,0,0,
        0,6387,6132,1,0,0,0,6387,6142,1,0,0,0,6387,6149,1,0,0,0,6387,6158,
        1,0,0,0,6387,6166,1,0,0,0,6387,6176,1,0,0,0,6387,6185,1,0,0,0,6387,
        6196,1,0,0,0,6387,6205,1,0,0,0,6387,6216,1,0,0,0,6387,6226,1,0,0,
        0,6387,6238,1,0,0,0,6387,6247,1,0,0,0,6387,6258,1,0,0,0,6387,6268,
        1,0,0,0,6387,6280,1,0,0,0,6387,6289,1,0,0,0,6387,6298,1,0,0,0,6387,
        6306,1,0,0,0,6387,6313,1,0,0,0,6387,6320,1,0,0,0,6387,6327,1,0,0,
        0,6387,6334,1,0,0,0,6387,6343,1,0,0,0,6387,6352,1,0,0,0,6387,6361,
        1,0,0,0,6387,6370,1,0,0,0,6387,6377,1,0,0,0,6388,723,1,0,0,0,6389,
        6392,5,44,0,0,6390,6392,1,0,0,0,6391,6389,1,0,0,0,6391,6390,1,0,
        0,0,6392,725,1,0,0,0,6393,6394,5,326,0,0,6394,6397,5,174,0,0,6395,
        6397,1,0,0,0,6396,6393,1,0,0,0,6396,6395,1,0,0,0,6397,727,1,0,0,
        0,6398,6399,5,138,0,0,6399,6400,5,211,0,0,6400,6401,3,626,313,0,
        6401,6402,3,730,365,0,6402,6403,5,462,0,0,6403,6404,5,80,0,0,6404,
        6405,5,204,0,0,6405,6406,3,1340,670,0,6406,6456,1,0,0,0,6407,6408,
        5,138,0,0,6408,6409,5,289,0,0,6409,6410,3,626,313,0,6410,6411,3,
        730,365,0,6411,6412,5,462,0,0,6412,6413,5,80,0,0,6413,6414,5,204,
        0,0,6414,6415,3,1340,670,0,6415,6456,1,0,0,0,6416,6417,5,138,0,0,
        6417,6418,5,442,0,0,6418,6419,3,626,313,0,6419,6420,3,730,365,0,
        6420,6421,5,462,0,0,6421,6422,5,80,0,0,6422,6423,5,204,0,0,6423,
        6424,3,1340,670,0,6424,6456,1,0,0,0,6425,6426,5,138,0,0,6426,6427,
        5,350,0,0,6427,6428,3,1340,670,0,6428,6429,5,80,0,0,6429,6430,3,
        1336,668,0,6430,6431,3,730,365,0,6431,6432,5,462,0,0,6432,6433,5,
        80,0,0,6433,6434,5,204,0,0,6434,6435,3,1340,670,0,6435,6456,1,0,
        0,0,6436,6437,5,138,0,0,6437,6438,5,251,0,0,6438,6439,5,369,0,0,
        6439,6440,3,1336,668,0,6440,6441,3,730,365,0,6441,6442,5,462,0,0,
        6442,6443,5,80,0,0,6443,6444,5,204,0,0,6444,6445,3,1340,670,0,6445,
        6456,1,0,0,0,6446,6447,5,138,0,0,6447,6448,5,226,0,0,6448,6449,3,
        1336,668,0,6449,6450,3,730,365,0,6450,6451,5,462,0,0,6451,6452,5,
        80,0,0,6452,6453,5,204,0,0,6453,6454,3,1340,670,0,6454,6456,1,0,
        0,0,6455,6398,1,0,0,0,6455,6407,1,0,0,0,6455,6416,1,0,0,0,6455,6425,
        1,0,0,0,6455,6436,1,0,0,0,6455,6446,1,0,0,0,6456,729,1,0,0,0,6457,
        6460,5,262,0,0,6458,6460,1,0,0,0,6459,6457,1,0,0,0,6459,6458,1,0,
        0,0,6460,731,1,0,0,0,6461,6462,5,138,0,0,6462,6463,5,136,0,0,6463,
        6464,3,650,325,0,6464,6465,5,326,0,0,6465,6466,5,316,0,0,6466,6467,
        3,1340,670,0,6467,6679,1,0,0,0,6468,6469,5,138,0,0,6469,6470,5,108,
        0,0,6470,6471,3,524,262,0,6471,6472,5,326,0,0,6472,6473,5,316,0,
        0,6473,6474,3,1340,670,0,6474,6679,1,0,0,0,6475,6476,5,138,0,0,6476,
        6477,5,168,0,0,6477,6478,3,524,262,0,6478,6479,5,326,0,0,6479,6480,
        5,316,0,0,6480,6481,3,1340,670,0,6481,6679,1,0,0,0,6482,6483,5,138,
        0,0,6483,6484,5,189,0,0,6484,6485,3,524,262,0,6485,6486,5,326,0,
        0,6486,6487,5,316,0,0,6487,6488,3,1340,670,0,6488,6679,1,0,0,0,6489,
        6490,5,138,0,0,6490,6491,5,204,0,0,6491,6492,3,1340,670,0,6492,6493,
        5,326,0,0,6493,6494,5,316,0,0,6494,6495,3,1340,670,0,6495,6679,1,
        0,0,0,6496,6497,5,138,0,0,6497,6498,5,211,0,0,6498,6499,3,626,313,
        0,6499,6500,5,326,0,0,6500,6501,5,316,0,0,6501,6502,3,1340,670,0,
        6502,6679,1,0,0,0,6503,6504,5,138,0,0,6504,6505,5,271,0,0,6505,6506,
        3,688,344,0,6506,6507,5,326,0,0,6507,6508,5,316,0,0,6508,6509,3,
        1340,670,0,6509,6679,1,0,0,0,6510,6511,5,138,0,0,6511,6512,5,271,
        0,0,6512,6513,5,156,0,0,6513,6514,3,524,262,0,6514,6515,5,100,0,
        0,6515,6516,3,1340,670,0,6516,6517,5,326,0,0,6517,6518,5,316,0,0,
        6518,6519,3,1340,670,0,6519,6679,1,0,0,0,6520,6521,5,138,0,0,6521,
        6522,5,271,0,0,6522,6523,5,206,0,0,6523,6524,3,524,262,0,6524,6525,
        5,100,0,0,6525,6526,3,1340,670,0,6526,6527,5,326,0,0,6527,6528,5,
        316,0,0,6528,6529,3,1340,670,0,6529,6679,1,0,0,0,6530,6531,5,138,
        0,0,6531,6532,5,289,0,0,6532,6533,3,626,313,0,6533,6534,5,326,0,
        0,6534,6535,5,316,0,0,6535,6536,3,1340,670,0,6536,6679,1,0,0,0,6537,
        6538,5,138,0,0,6538,6539,5,442,0,0,6539,6540,3,626,313,0,6540,6541,
        5,326,0,0,6541,6542,5,316,0,0,6542,6543,3,1340,670,0,6543,6679,1,
        0,0,0,6544,6545,5,138,0,0,6545,6546,5,92,0,0,6546,6547,3,1074,537,
        0,6547,6548,5,326,0,0,6548,6549,5,316,0,0,6549,6550,3,1340,670,0,
        6550,6679,1,0,0,0,6551,6552,5,138,0,0,6552,6553,5,92,0,0,6553,6554,
        5,220,0,0,6554,6555,5,389,0,0,6555,6556,3,1074,537,0,6556,6557,5,
        326,0,0,6557,6558,5,316,0,0,6558,6559,3,1340,670,0,6559,6679,1,0,
        0,0,6560,6561,5,138,0,0,6561,6562,5,335,0,0,6562,6563,3,524,262,
        0,6563,6564,5,326,0,0,6564,6565,5,316,0,0,6565,6566,3,1340,670,0,
        6566,6679,1,0,0,0,6567,6568,5,138,0,0,6568,6569,5,348,0,0,6569,6570,
        5,318,0,0,6570,6571,5,276,0,0,6571,6572,3,524,262,0,6572,6573,5,
        326,0,0,6573,6574,5,316,0,0,6574,6575,3,1340,670,0,6575,6679,1,0,
        0,0,6576,6577,5,138,0,0,6577,6578,5,348,0,0,6578,6579,5,318,0,0,
        6579,6580,5,185,0,0,6580,6581,3,524,262,0,6581,6582,5,326,0,0,6582,
        6583,5,316,0,0,6583,6584,3,1340,670,0,6584,6679,1,0,0,0,6585,6586,
        5,138,0,0,6586,6587,5,348,0,0,6587,6588,5,318,0,0,6588,6589,5,346,
        0,0,6589,6590,3,524,262,0,6590,6591,5,326,0,0,6591,6592,5,316,0,
        0,6592,6593,3,1340,670,0,6593,6679,1,0,0,0,6594,6595,5,138,0,0,6595,
        6596,5,348,0,0,6596,6597,5,318,0,0,6597,6598,5,163,0,0,6598,6599,
        3,524,262,0,6599,6600,5,326,0,0,6600,6601,5,316,0,0,6601,6602,3,
        1340,670,0,6602,6679,1,0,0,0,6603,6604,5,138,0,0,6604,6605,5,321,
        0,0,6605,6606,3,1336,668,0,6606,6607,5,326,0,0,6607,6608,5,316,0,
        0,6608,6609,3,1340,670,0,6609,6679,1,0,0,0,6610,6611,5,138,0,0,6611,
        6612,5,321,0,0,6612,6613,5,220,0,0,6613,6614,5,389,0,0,6614,6615,
        3,1336,668,0,6615,6616,5,326,0,0,6616,6617,5,316,0,0,6617,6618,3,
        1340,670,0,6618,6679,1,0,0,0,6619,6620,5,138,0,0,6620,6621,5,369,
        0,0,6621,6622,3,1336,668,0,6622,6623,5,326,0,0,6623,6624,5,316,0,
        0,6624,6625,3,1340,670,0,6625,6679,1,0,0,0,6626,6627,5,138,0,0,6627,
        6628,5,369,0,0,6628,6629,5,220,0,0,6629,6630,5,389,0,0,6630,6631,
        3,1336,668,0,6631,6632,5,326,0,0,6632,6633,5,316,0,0,6633,6634,3,
        1340,670,0,6634,6679,1,0,0,0,6635,6636,5,138,0,0,6636,6637,5,251,
        0,0,6637,6638,5,369,0,0,6638,6639,3,1336,668,0,6639,6640,5,326,0,
        0,6640,6641,5,316,0,0,6641,6642,3,1340,670,0,6642,6679,1,0,0,0,6643,
        6644,5,138,0,0,6644,6645,5,251,0,0,6645,6646,5,369,0,0,6646,6647,
        5,220,0,0,6647,6648,5,389,0,0,6648,6649,3,1336,668,0,6649,6650,5,
        326,0,0,6650,6651,5,316,0,0,6651,6652,3,1340,670,0,6652,6679,1,0,
        0,0,6653,6654,5,138,0,0,6654,6655,5,63,0,0,6655,6656,5,92,0,0,6656,
        6657,3,1074,537,0,6657,6658,5,326,0,0,6658,6659,5,316,0,0,6659,6660,
        3,1340,670,0,6660,6679,1,0,0,0,6661,6662,5,138,0,0,6662,6663,5,63,
        0,0,6663,6664,5,92,0,0,6664,6665,5,220,0,0,6665,6666,5,389,0,0,6666,
        6667,3,1074,537,0,6667,6668,5,326,0,0,6668,6669,5,316,0,0,6669,6670,
        3,1340,670,0,6670,6679,1,0,0,0,6671,6672,5,138,0,0,6672,6673,5,353,
        0,0,6673,6674,3,524,262,0,6674,6675,5,326,0,0,6675,6676,5,316,0,
        0,6676,6677,3,1340,670,0,6677,6679,1,0,0,0,6678,6461,1,0,0,0,6678,
        6468,1,0,0,0,6678,6475,1,0,0,0,6678,6482,1,0,0,0,6678,6489,1,0,0,
        0,6678,6496,1,0,0,0,6678,6503,1,0,0,0,6678,6510,1,0,0,0,6678,6520,
        1,0,0,0,6678,6530,1,0,0,0,6678,6537,1,0,0,0,6678,6544,1,0,0,0,6678,
        6551,1,0,0,0,6678,6560,1,0,0,0,6678,6567,1,0,0,0,6678,6576,1,0,0,
        0,6678,6585,1,0,0,0,6678,6594,1,0,0,0,6678,6603,1,0,0,0,6678,6610,
        1,0,0,0,6678,6619,1,0,0,0,6678,6626,1,0,0,0,6678,6635,1,0,0,0,6678,
        6643,1,0,0,0,6678,6653,1,0,0,0,6678,6661,1,0,0,0,6678,6671,1,0,0,
        0,6679,733,1,0,0,0,6680,6681,5,138,0,0,6681,6682,5,271,0,0,6682,
        6683,3,688,344,0,6683,6684,5,326,0,0,6684,6685,5,2,0,0,6685,6686,
        3,736,368,0,6686,6687,5,3,0,0,6687,735,1,0,0,0,6688,6693,3,738,369,
        0,6689,6690,5,6,0,0,6690,6692,3,738,369,0,6691,6689,1,0,0,0,6692,
        6695,1,0,0,0,6693,6691,1,0,0,0,6693,6694,1,0,0,0,6694,737,1,0,0,
        0,6695,6693,1,0,0,0,6696,6697,3,1380,690,0,6697,6698,5,10,0,0,6698,
        6699,5,400,0,0,6699,6705,1,0,0,0,6700,6701,3,1380,690,0,6701,6702,
        5,10,0,0,6702,6703,3,740,370,0,6703,6705,1,0,0,0,6704,6696,1,0,0,
        0,6704,6700,1,0,0,0,6705,739,1,0,0,0,6706,6712,3,640,320,0,6707,
        6712,3,1392,696,0,6708,6712,3,1276,638,0,6709,6712,3,292,146,0,6710,
        6712,3,1358,679,0,6711,6706,1,0,0,0,6711,6707,1,0,0,0,6711,6708,
        1,0,0,0,6711,6709,1,0,0,0,6711,6710,1,0,0,0,6712,741,1,0,0,0,6713,
        6714,5,138,0,0,6714,6715,5,353,0,0,6715,6716,3,524,262,0,6716,6717,
        5,326,0,0,6717,6718,5,2,0,0,6718,6719,3,736,368,0,6719,6720,5,3,
        0,0,6720,743,1,0,0,0,6721,6722,5,138,0,0,6722,6723,5,136,0,0,6723,
        6724,3,650,325,0,6724,6725,5,275,0,0,6725,6726,5,94,0,0,6726,6727,
        3,1368,684,0,6727,6905,1,0,0,0,6728,6729,5,138,0,0,6729,6730,5,108,
        0,0,6730,6731,3,524,262,0,6731,6732,5,275,0,0,6732,6733,5,94,0,0,
        6733,6734,3,1368,684,0,6734,6905,1,0,0,0,6735,6736,5,138,0,0,6736,
        6737,5,168,0,0,6737,6738,3,524,262,0,6738,6739,5,275,0,0,6739,6740,
        5,94,0,0,6740,6741,3,1368,684,0,6741,6905,1,0,0,0,6742,6743,5,138,
        0,0,6743,6744,5,175,0,0,6744,6745,3,1340,670,0,6745,6746,5,275,0,
        0,6746,6747,5,94,0,0,6747,6748,3,1368,684,0,6748,6905,1,0,0,0,6749,
        6750,5,138,0,0,6750,6751,5,189,0,0,6751,6752,3,524,262,0,6752,6753,
        5,275,0,0,6753,6754,5,94,0,0,6754,6755,3,1368,684,0,6755,6905,1,
        0,0,0,6756,6757,5,138,0,0,6757,6758,5,211,0,0,6758,6759,3,626,313,
        0,6759,6760,5,275,0,0,6760,6761,5,94,0,0,6761,6762,3,1368,684,0,
        6762,6905,1,0,0,0,6763,6764,5,138,0,0,6764,6765,3,308,154,0,6765,
        6766,5,238,0,0,6766,6767,3,1340,670,0,6767,6768,5,275,0,0,6768,6769,
        5,94,0,0,6769,6770,3,1368,684,0,6770,6905,1,0,0,0,6771,6772,5,138,
        0,0,6772,6773,5,239,0,0,6773,6774,5,267,0,0,6774,6775,3,292,146,
        0,6775,6776,5,275,0,0,6776,6777,5,94,0,0,6777,6778,3,1368,684,0,
        6778,6905,1,0,0,0,6779,6780,5,138,0,0,6780,6781,5,271,0,0,6781,6782,
        3,688,344,0,6782,6783,5,275,0,0,6783,6784,5,94,0,0,6784,6785,3,1368,
        684,0,6785,6905,1,0,0,0,6786,6787,5,138,0,0,6787,6788,5,271,0,0,
        6788,6789,5,156,0,0,6789,6790,3,524,262,0,6790,6791,5,100,0,0,6791,
        6792,3,1340,670,0,6792,6793,5,275,0,0,6793,6794,5,94,0,0,6794,6795,
        3,1368,684,0,6795,6905,1,0,0,0,6796,6797,5,138,0,0,6797,6798,5,271,
        0,0,6798,6799,5,206,0,0,6799,6800,3,524,262,0,6800,6801,5,100,0,
        0,6801,6802,3,1340,670,0,6802,6803,5,275,0,0,6803,6804,5,94,0,0,
        6804,6805,3,1368,684,0,6805,6905,1,0,0,0,6806,6807,5,138,0,0,6807,
        6808,5,289,0,0,6808,6809,3,626,313,0,6809,6810,5,275,0,0,6810,6811,
        5,94,0,0,6811,6812,3,1368,684,0,6812,6905,1,0,0,0,6813,6814,5,138,
        0,0,6814,6815,5,442,0,0,6815,6816,3,626,313,0,6816,6817,5,275,0,
        0,6817,6818,5,94,0,0,6818,6819,3,1368,684,0,6819,6905,1,0,0,0,6820,
        6821,5,138,0,0,6821,6822,5,316,0,0,6822,6823,3,1340,670,0,6823,6824,
        5,275,0,0,6824,6825,5,94,0,0,6825,6826,3,1368,684,0,6826,6905,1,
        0,0,0,6827,6828,5,138,0,0,6828,6829,5,353,0,0,6829,6830,3,524,262,
        0,6830,6831,5,275,0,0,6831,6832,5,94,0,0,6832,6833,3,1368,684,0,
        6833,6905,1,0,0,0,6834,6835,5,138,0,0,6835,6836,5,344,0,0,6836,6837,
        3,1340,670,0,6837,6838,5,275,0,0,6838,6839,5,94,0,0,6839,6840,3,
        1368,684,0,6840,6905,1,0,0,0,6841,6842,5,138,0,0,6842,6843,5,335,
        0,0,6843,6844,3,524,262,0,6844,6845,5,275,0,0,6845,6846,5,94,0,0,
        6846,6847,3,1368,684,0,6847,6905,1,0,0,0,6848,6849,5,138,0,0,6849,
        6850,5,348,0,0,6850,6851,5,318,0,0,6851,6852,5,185,0,0,6852,6853,
        3,524,262,0,6853,6854,5,275,0,0,6854,6855,5,94,0,0,6855,6856,3,1368,
        684,0,6856,6905,1,0,0,0,6857,6858,5,138,0,0,6858,6859,5,348,0,0,
        6859,6860,5,318,0,0,6860,6861,5,163,0,0,6861,6862,3,524,262,0,6862,
        6863,5,275,0,0,6863,6864,5,94,0,0,6864,6865,3,1368,684,0,6865,6905,
        1,0,0,0,6866,6867,5,138,0,0,6867,6868,5,63,0,0,6868,6869,5,174,0,
        0,6869,6870,5,374,0,0,6870,6871,3,1340,670,0,6871,6872,5,275,0,0,
        6872,6873,5,94,0,0,6873,6874,3,1368,684,0,6874,6905,1,0,0,0,6875,
        6876,5,138,0,0,6876,6877,5,324,0,0,6877,6878,3,1340,670,0,6878,6879,
        5,275,0,0,6879,6880,5,94,0,0,6880,6881,3,1368,684,0,6881,6905,1,
        0,0,0,6882,6883,5,138,0,0,6883,6884,5,198,0,0,6884,6885,5,350,0,
        0,6885,6886,3,1340,670,0,6886,6887,5,275,0,0,6887,6888,5,94,0,0,
        6888,6889,3,1368,684,0,6889,6905,1,0,0,0,6890,6891,5,138,0,0,6891,
        6892,5,452,0,0,6892,6893,3,1340,670,0,6893,6894,5,275,0,0,6894,6895,
        5,94,0,0,6895,6896,3,1368,684,0,6896,6905,1,0,0,0,6897,6898,5,138,
        0,0,6898,6899,5,451,0,0,6899,6900,3,1340,670,0,6900,6901,5,275,0,
        0,6901,6902,5,94,0,0,6902,6903,3,1368,684,0,6903,6905,1,0,0,0,6904,
        6721,1,0,0,0,6904,6728,1,0,0,0,6904,6735,1,0,0,0,6904,6742,1,0,0,
        0,6904,6749,1,0,0,0,6904,6756,1,0,0,0,6904,6763,1,0,0,0,6904,6771,
        1,0,0,0,6904,6779,1,0,0,0,6904,6786,1,0,0,0,6904,6796,1,0,0,0,6904,
        6806,1,0,0,0,6904,6813,1,0,0,0,6904,6820,1,0,0,0,6904,6827,1,0,0,
        0,6904,6834,1,0,0,0,6904,6841,1,0,0,0,6904,6848,1,0,0,0,6904,6857,
        1,0,0,0,6904,6866,1,0,0,0,6904,6875,1,0,0,0,6904,6882,1,0,0,0,6904,
        6890,1,0,0,0,6904,6897,1,0,0,0,6905,745,1,0,0,0,6906,6907,5,46,0,
        0,6907,6908,5,452,0,0,6908,6909,3,1340,670,0,6909,6910,3,748,374,
        0,6910,6911,3,664,332,0,6911,747,1,0,0,0,6912,6915,3,750,375,0,6913,
        6915,1,0,0,0,6914,6912,1,0,0,0,6914,6913,1,0,0,0,6915,749,1,0,0,
        0,6916,6917,5,62,0,0,6917,6918,5,92,0,0,6918,6923,3,1076,538,0,6919,
        6920,5,62,0,0,6920,6921,5,30,0,0,6921,6923,5,343,0,0,6922,6916,1,
        0,0,0,6922,6919,1,0,0,0,6923,751,1,0,0,0,6924,6925,5,138,0,0,6925,
        6926,5,452,0,0,6926,6927,3,1340,670,0,6927,6928,5,326,0,0,6928,6929,
        3,460,230,0,6929,6952,1,0,0,0,6930,6931,5,138,0,0,6931,6932,5,452,
        0,0,6932,6933,3,1340,670,0,6933,6934,5,133,0,0,6934,6935,5,92,0,
        0,6935,6936,3,1076,538,0,6936,6952,1,0,0,0,6937,6938,5,138,0,0,6938,
        6939,5,452,0,0,6939,6940,3,1340,670,0,6940,6941,5,326,0,0,6941,6942,
        5,92,0,0,6942,6943,3,1076,538,0,6943,6952,1,0,0,0,6944,6945,5,138,
        0,0,6945,6946,5,452,0,0,6946,6947,3,1340,670,0,6947,6948,5,191,0,
        0,6948,6949,5,92,0,0,6949,6950,3,1076,538,0,6950,6952,1,0,0,0,6951,
        6924,1,0,0,0,6951,6930,1,0,0,0,6951,6937,1,0,0,0,6951,6944,1,0,0,
        0,6952,753,1,0,0,0,6953,6954,5,46,0,0,6954,6955,5,451,0,0,6955,6956,
        3,1340,670,0,6956,6957,5,164,0,0,6957,6958,3,1358,679,0,6958,6959,
        5,452,0,0,6959,6960,3,756,378,0,6960,6961,3,664,332,0,6961,755,1,
        0,0,0,6962,6967,3,758,379,0,6963,6964,5,6,0,0,6964,6966,3,758,379,
        0,6965,6963,1,0,0,0,6966,6969,1,0,0,0,6967,6965,1,0,0,0,6967,6968,
        1,0,0,0,6968,757,1,0,0,0,6969,6967,1,0,0,0,6970,6971,3,1380,690,
        0,6971,759,1,0,0,0,6972,6973,5,138,0,0,6973,6974,5,451,0,0,6974,
        6975,3,1340,670,0,6975,6976,5,326,0,0,6976,6977,3,460,230,0,6977,
        7010,1,0,0,0,6978,6979,5,138,0,0,6979,6980,5,451,0,0,6980,6981,3,
        1340,670,0,6981,6982,5,164,0,0,6982,6983,3,1358,679,0,6983,7010,
        1,0,0,0,6984,6985,5,138,0,0,6985,6986,5,451,0,0,6986,6987,3,1340,
        670,0,6987,6988,5,298,0,0,6988,6989,5,452,0,0,6989,6990,3,664,332,
        0,6990,7010,1,0,0,0,6991,6992,5,138,0,0,6992,6993,5,451,0,0,6993,
        6994,3,1340,670,0,6994,6995,5,326,0,0,6995,6996,5,452,0,0,6996,6997,
        3,756,378,0,6997,6998,3,664,332,0,6998,7010,1,0,0,0,6999,7000,5,
        138,0,0,7000,7001,5,451,0,0,7001,7002,3,1340,670,0,7002,7003,5,193,
        0,0,7003,7010,1,0,0,0,7004,7005,5,138,0,0,7005,7006,5,451,0,0,7006,
        7007,3,1340,670,0,7007,7008,5,186,0,0,7008,7010,1,0,0,0,7009,6972,
        1,0,0,0,7009,6978,1,0,0,0,7009,6984,1,0,0,0,7009,6991,1,0,0,0,7009,
        6999,1,0,0,0,7009,7004,1,0,0,0,7010,761,1,0,0,0,7011,7012,5,191,
        0,0,7012,7013,5,451,0,0,7013,7014,3,1340,670,0,7014,7015,3,108,54,
        0,7015,7024,1,0,0,0,7016,7017,5,191,0,0,7017,7018,5,451,0,0,7018,
        7019,5,220,0,0,7019,7020,5,389,0,0,7020,7021,3,1340,670,0,7021,7022,
        3,108,54,0,7022,7024,1,0,0,0,7023,7011,1,0,0,0,7023,7016,1,0,0,0,
        7024,763,1,0,0,0,7025,7026,5,46,0,0,7026,7027,3,618,309,0,7027,7028,
        5,314,0,0,7028,7029,3,1340,670,0,7029,7030,5,36,0,0,7030,7031,5,
        80,0,0,7031,7032,3,774,387,0,7032,7033,5,94,0,0,7033,7034,3,1336,
        668,0,7034,7035,3,1094,547,0,7035,7036,5,57,0,0,7036,7037,3,776,
        388,0,7037,7038,3,766,383,0,7038,765,1,0,0,0,7039,7046,5,263,0,0,
        7040,7046,3,770,385,0,7041,7042,5,2,0,0,7042,7043,3,768,384,0,7043,
        7044,5,3,0,0,7044,7046,1,0,0,0,7045,7039,1,0,0,0,7045,7040,1,0,0,
        0,7045,7041,1,0,0,0,7046,767,1,0,0,0,7047,7052,3,772,386,0,7048,
        7049,5,7,0,0,7049,7051,3,772,386,0,7050,7048,1,0,0,0,7051,7054,1,
        0,0,0,7052,7050,1,0,0,0,7052,7053,1,0,0,0,7053,769,1,0,0,0,7054,
        7052,1,0,0,0,7055,7061,3,960,480,0,7056,7061,3,902,451,0,7057,7061,
        3,942,471,0,7058,7061,3,928,464,0,7059,7061,3,778,389,0,7060,7055,
        1,0,0,0,7060,7056,1,0,0,0,7060,7057,1,0,0,0,7060,7058,1,0,0,0,7060,
        7059,1,0,0,0,7061,771,1,0,0,0,7062,7065,3,770,385,0,7063,7065,1,
        0,0,0,7064,7062,1,0,0,0,7064,7063,1,0,0,0,7065,773,1,0,0,0,7066,
        7067,7,31,0,0,7067,775,1,0,0,0,7068,7072,5,233,0,0,7069,7072,5,137,
        0,0,7070,7072,1,0,0,0,7071,7068,1,0,0,0,7071,7069,1,0,0,0,7071,7070,
        1,0,0,0,7072,777,1,0,0,0,7073,7074,5,264,0,0,7074,7075,3,1372,686,
        0,7075,7076,3,780,390,0,7076,779,1,0,0,0,7077,7078,5,6,0,0,7078,
        7081,3,1358,679,0,7079,7081,1,0,0,0,7080,7077,1,0,0,0,7080,7079,
        1,0,0,0,7081,781,1,0,0,0,7082,7083,5,243,0,0,7083,7084,3,1372,686,
        0,7084,783,1,0,0,0,7085,7086,5,359,0,0,7086,7090,3,1372,686,0,7087,
        7088,5,359,0,0,7088,7090,5,9,0,0,7089,7085,1,0,0,0,7089,7087,1,0,
        0,0,7090,785,1,0,0,0,7091,7092,5,129,0,0,7092,7093,3,788,394,0,7093,
        7094,3,796,398,0,7094,7142,1,0,0,0,7095,7096,5,146,0,0,7096,7097,
        3,788,394,0,7097,7098,3,794,397,0,7098,7142,1,0,0,0,7099,7100,5,
        333,0,0,7100,7101,5,349,0,0,7101,7142,3,794,397,0,7102,7103,5,161,
        0,0,7103,7104,3,788,394,0,7104,7105,3,796,398,0,7105,7142,1,0,0,
        0,7106,7107,5,454,0,0,7107,7108,3,788,394,0,7108,7109,3,796,398,
        0,7109,7142,1,0,0,0,7110,7111,5,312,0,0,7111,7112,3,788,394,0,7112,
        7113,3,796,398,0,7113,7142,1,0,0,0,7114,7115,5,315,0,0,7115,7142,
        3,1372,686,0,7116,7117,5,301,0,0,7117,7118,5,315,0,0,7118,7142,3,
        1372,686,0,7119,7120,5,301,0,0,7120,7142,3,1372,686,0,7121,7122,
        5,312,0,0,7122,7123,3,788,394,0,7123,7124,5,94,0,0,7124,7125,5,315,
        0,0,7125,7126,3,1372,686,0,7126,7142,1,0,0,0,7127,7128,5,312,0,0,
        7128,7129,3,788,394,0,7129,7130,5,94,0,0,7130,7131,3,1372,686,0,
        7131,7142,1,0,0,0,7132,7133,5,283,0,0,7133,7134,5,349,0,0,7134,7142,
        3,1358,679,0,7135,7136,5,161,0,0,7136,7137,5,284,0,0,7137,7142,3,
        1358,679,0,7138,7139,5,312,0,0,7139,7140,5,284,0,0,7140,7142,3,1358,
        679,0,7141,7091,1,0,0,0,7141,7095,1,0,0,0,7141,7099,1,0,0,0,7141,
        7102,1,0,0,0,7141,7106,1,0,0,0,7141,7110,1,0,0,0,7141,7114,1,0,0,
        0,7141,7116,1,0,0,0,7141,7119,1,0,0,0,7141,7121,1,0,0,0,7141,7127,
        1,0,0,0,7141,7132,1,0,0,0,7141,7135,1,0,0,0,7141,7138,1,0,0,0,7142,
        787,1,0,0,0,7143,7147,5,373,0,0,7144,7147,5,349,0,0,7145,7147,1,
        0,0,0,7146,7143,1,0,0,0,7146,7144,1,0,0,0,7146,7145,1,0,0,0,7147,
        789,1,0,0,0,7148,7149,5,235,0,0,7149,7150,5,242,0,0,7150,7159,3,
        64,32,0,7151,7152,5,293,0,0,7152,7159,5,81,0,0,7153,7154,5,293,0,
        0,7154,7159,5,375,0,0,7155,7159,5,54,0,0,7156,7157,5,77,0,0,7157,
        7159,5,54,0,0,7158,7148,1,0,0,0,7158,7151,1,0,0,0,7158,7153,1,0,
        0,0,7158,7155,1,0,0,0,7158,7156,1,0,0,0,7159,791,1,0,0,0,7160,7167,
        3,790,395,0,7161,7163,5,6,0,0,7162,7161,1,0,0,0,7162,7163,1,0,0,
        0,7163,7164,1,0,0,0,7164,7166,3,790,395,0,7165,7162,1,0,0,0,7166,
        7169,1,0,0,0,7167,7165,1,0,0,0,7167,7168,1,0,0,0,7168,793,1,0,0,
        0,7169,7167,1,0,0,0,7170,7173,3,792,396,0,7171,7173,1,0,0,0,7172,
        7170,1,0,0,0,7172,7171,1,0,0,0,7173,795,1,0,0,0,7174,7176,5,33,0,
        0,7175,7177,5,262,0,0,7176,7175,1,0,0,0,7176,7177,1,0,0,0,7177,7178,
        1,0,0,0,7178,7181,5,153,0,0,7179,7181,1,0,0,0,7180,7174,1,0,0,0,
        7180,7179,1,0,0,0,7181,797,1,0,0,0,7182,7185,5,46,0,0,7183,7184,
        5,82,0,0,7184,7186,5,304,0,0,7185,7183,1,0,0,0,7185,7186,1,0,0,0,
        7186,7187,1,0,0,0,7187,7201,3,174,87,0,7188,7189,5,369,0,0,7189,
        7190,3,1336,668,0,7190,7191,3,214,107,0,7191,7192,3,118,59,0,7192,
        7202,1,0,0,0,7193,7194,5,296,0,0,7194,7195,5,369,0,0,7195,7196,3,
        1336,668,0,7196,7197,5,2,0,0,7197,7198,3,216,108,0,7198,7199,5,3,
        0,0,7199,7200,3,118,59,0,7200,7202,1,0,0,0,7201,7188,1,0,0,0,7201,
        7193,1,0,0,0,7202,7203,1,0,0,0,7203,7204,5,36,0,0,7204,7205,3,960,
        480,0,7205,7206,3,800,400,0,7206,799,1,0,0,0,7207,7209,5,105,0,0,
        7208,7210,7,32,0,0,7209,7208,1,0,0,0,7209,7210,1,0,0,0,7210,7211,
        1,0,0,0,7211,7212,5,42,0,0,7212,7215,5,272,0,0,7213,7215,1,0,0,0,
        7214,7207,1,0,0,0,7214,7213,1,0,0,0,7215,801,1,0,0,0,7216,7217,5,
        244,0,0,7217,7218,3,1344,672,0,7218,803,1,0,0,0,7219,7220,5,46,0,
        0,7220,7221,5,175,0,0,7221,7222,3,1340,670,0,7222,7223,3,16,8,0,
        7223,7224,3,806,403,0,7224,805,1,0,0,0,7225,7228,3,808,404,0,7226,
        7228,1,0,0,0,7227,7225,1,0,0,0,7227,7226,1,0,0,0,7228,807,1,0,0,
        0,7229,7231,3,810,405,0,7230,7229,1,0,0,0,7231,7232,1,0,0,0,7232,
        7230,1,0,0,0,7232,7233,1,0,0,0,7233,809,1,0,0,0,7234,7235,3,812,
        406,0,7235,7239,3,814,407,0,7236,7240,3,1364,682,0,7237,7240,3,66,
        33,0,7238,7240,5,53,0,0,7239,7236,1,0,0,0,7239,7237,1,0,0,0,7239,
        7238,1,0,0,0,7240,811,1,0,0,0,7241,7250,3,1382,691,0,7242,7243,5,
        164,0,0,7243,7250,5,74,0,0,7244,7250,5,194,0,0,7245,7250,5,246,0,
        0,7246,7250,5,275,0,0,7247,7250,5,344,0,0,7248,7250,5,346,0,0,7249,
        7241,1,0,0,0,7249,7242,1,0,0,0,7249,7244,1,0,0,0,7249,7245,1,0,0,
        0,7249,7246,1,0,0,0,7249,7247,1,0,0,0,7249,7248,1,0,0,0,7250,813,
        1,0,0,0,7251,7254,5,10,0,0,7252,7254,1,0,0,0,7253,7251,1,0,0,0,7253,
        7252,1,0,0,0,7254,815,1,0,0,0,7255,7256,5,138,0,0,7256,7257,5,175,
        0,0,7257,7264,3,1340,670,0,7258,7259,5,105,0,0,7259,7265,3,806,403,
        0,7260,7265,3,806,403,0,7261,7262,5,326,0,0,7262,7263,5,344,0,0,
        7263,7265,3,1340,670,0,7264,7258,1,0,0,0,7264,7260,1,0,0,0,7264,
        7261,1,0,0,0,7265,817,1,0,0,0,7266,7267,5,138,0,0,7267,7268,5,175,
        0,0,7268,7269,3,1340,670,0,7269,7270,3,80,40,0,7270,819,1,0,0,0,
        7271,7272,5,191,0,0,7272,7275,5,175,0,0,7273,7274,5,220,0,0,7274,
        7276,5,389,0,0,7275,7273,1,0,0,0,7275,7276,1,0,0,0,7276,7277,1,0,
        0,0,7277,7283,3,1340,670,0,7278,7279,3,16,8,0,7279,7280,5,2,0,0,
        7280,7281,3,822,411,0,7281,7282,5,3,0,0,7282,7284,1,0,0,0,7283,7278,
        1,0,0,0,7283,7284,1,0,0,0,7284,821,1,0,0,0,7285,7290,3,824,412,0,
        7286,7287,5,6,0,0,7287,7289,3,824,412,0,7288,7286,1,0,0,0,7289,7292,
        1,0,0,0,7290,7288,1,0,0,0,7290,7291,1,0,0,0,7291,823,1,0,0,0,7292,
        7290,1,0,0,0,7293,7294,5,209,0,0,7294,825,1,0,0,0,7295,7296,5,138,
        0,0,7296,7297,5,108,0,0,7297,7298,3,524,262,0,7298,7299,5,298,0,
        0,7299,7300,5,368,0,0,7300,827,1,0,0,0,7301,7302,5,138,0,0,7302,
        7303,5,342,0,0,7303,7304,7,33,0,0,7304,7305,3,54,27,0,7305,829,1,
        0,0,0,7306,7307,5,46,0,0,7307,7308,5,189,0,0,7308,7309,3,524,262,
        0,7309,7310,3,834,417,0,7310,7311,3,1118,559,0,7311,7312,3,192,96,
        0,7312,831,1,0,0,0,7313,7314,5,138,0,0,7314,7315,5,189,0,0,7315,
        7337,3,524,262,0,7316,7338,3,106,53,0,7317,7318,5,191,0,0,7318,7319,
        5,77,0,0,7319,7338,5,78,0,0,7320,7321,5,326,0,0,7321,7322,5,77,0,
        0,7322,7338,5,78,0,0,7323,7324,5,133,0,0,7324,7338,3,208,104,0,7325,
        7326,5,191,0,0,7326,7329,5,45,0,0,7327,7328,5,220,0,0,7328,7330,
        5,389,0,0,7329,7327,1,0,0,0,7329,7330,1,0,0,0,7330,7331,1,0,0,0,
        7331,7332,3,1340,670,0,7332,7333,3,108,54,0,7333,7338,1,0,0,0,7334,
        7335,5,365,0,0,7335,7336,5,45,0,0,7336,7338,3,1340,670,0,7337,7316,
        1,0,0,0,7337,7317,1,0,0,0,7337,7320,1,0,0,0,7337,7323,1,0,0,0,7337,
        7325,1,0,0,0,7337,7334,1,0,0,0,7338,833,1,0,0,0,7339,7342,5,36,0,
        0,7340,7342,1,0,0,0,7341,7339,1,0,0,0,7341,7340,1,0,0,0,7342,835,
        1,0,0,0,7343,7344,5,138,0,0,7344,7345,5,348,0,0,7345,7346,5,318,
        0,0,7346,7347,5,185,0,0,7347,7348,3,524,262,0,7348,7349,3,460,230,
        0,7349,837,1,0,0,0,7350,7351,5,138,0,0,7351,7352,5,348,0,0,7352,
        7353,5,318,0,0,7353,7354,5,163,0,0,7354,7355,3,524,262,0,7355,7356,
        5,133,0,0,7356,7357,5,248,0,0,7357,7358,5,62,0,0,7358,7359,3,1338,
        669,0,7359,7360,3,840,420,0,7360,7361,3,522,261,0,7361,7423,1,0,
        0,0,7362,7363,5,138,0,0,7363,7364,5,348,0,0,7364,7365,5,318,0,0,
        7365,7366,5,163,0,0,7366,7367,3,524,262,0,7367,7368,5,138,0,0,7368,
        7369,5,248,0,0,7369,7370,5,62,0,0,7370,7371,3,1338,669,0,7371,7372,
        3,840,420,0,7372,7373,3,522,261,0,7373,7423,1,0,0,0,7374,7375,5,
        138,0,0,7375,7376,5,348,0,0,7376,7377,5,318,0,0,7377,7378,5,163,
        0,0,7378,7379,3,524,262,0,7379,7380,5,138,0,0,7380,7381,5,248,0,
        0,7381,7382,5,304,0,0,7382,7383,3,524,262,0,7383,7384,3,840,420,
        0,7384,7385,3,524,262,0,7385,7423,1,0,0,0,7386,7387,5,138,0,0,7387,
        7388,5,348,0,0,7388,7389,5,318,0,0,7389,7390,5,163,0,0,7390,7391,
        3,524,262,0,7391,7392,5,138,0,0,7392,7393,5,248,0,0,7393,7394,5,
        62,0,0,7394,7395,3,1338,669,0,7395,7396,5,304,0,0,7396,7397,3,524,
        262,0,7397,7398,3,840,420,0,7398,7399,3,524,262,0,7399,7423,1,0,
        0,0,7400,7401,5,138,0,0,7401,7402,5,348,0,0,7402,7403,5,318,0,0,
        7403,7404,5,163,0,0,7404,7405,3,524,262,0,7405,7406,5,191,0,0,7406,
        7407,5,248,0,0,7407,7408,5,62,0,0,7408,7409,3,1338,669,0,7409,7423,
        1,0,0,0,7410,7411,5,138,0,0,7411,7412,5,348,0,0,7412,7413,5,318,
        0,0,7413,7414,5,163,0,0,7414,7415,3,524,262,0,7415,7416,5,191,0,
        0,7416,7417,5,248,0,0,7417,7418,5,220,0,0,7418,7419,5,389,0,0,7419,
        7420,5,62,0,0,7420,7421,3,1338,669,0,7421,7423,1,0,0,0,7422,7350,
        1,0,0,0,7422,7362,1,0,0,0,7422,7374,1,0,0,0,7422,7386,1,0,0,0,7422,
        7400,1,0,0,0,7422,7410,1,0,0,0,7423,839,1,0,0,0,7424,7425,5,105,
        0,0,7425,841,1,0,0,0,7426,7427,5,46,0,0,7427,7428,3,488,244,0,7428,
        7429,5,168,0,0,7429,7430,3,524,262,0,7430,7431,5,62,0,0,7431,7432,
        3,1358,679,0,7432,7433,5,94,0,0,7433,7434,3,1358,679,0,7434,7435,
        5,64,0,0,7435,7436,3,524,262,0,7436,843,1,0,0,0,7437,7438,5,158,
        0,0,7438,7439,3,864,432,0,7439,7440,3,1336,668,0,7440,7441,3,846,
        423,0,7441,7451,1,0,0,0,7442,7443,5,158,0,0,7443,7451,3,864,432,
        0,7444,7445,5,158,0,0,7445,7446,3,864,432,0,7446,7447,3,1340,670,
        0,7447,7448,5,80,0,0,7448,7449,3,1336,668,0,7449,7451,1,0,0,0,7450,
        7437,1,0,0,0,7450,7442,1,0,0,0,7450,7444,1,0,0,0,7451,845,1,0,0,
        0,7452,7453,5,100,0,0,7453,7456,3,1340,670,0,7454,7456,1,0,0,0,7455,
        7452,1,0,0,0,7455,7454,1,0,0,0,7456,847,1,0,0,0,7457,7458,5,363,
        0,0,7458,7459,3,866,433,0,7459,7460,3,868,434,0,7460,7461,3,864,
        432,0,7461,7462,3,862,431,0,7462,7463,3,876,438,0,7463,7471,1,0,
        0,0,7464,7465,5,363,0,0,7465,7466,5,2,0,0,7466,7467,3,852,426,0,
        7467,7468,5,3,0,0,7468,7469,3,876,438,0,7469,7471,1,0,0,0,7470,7457,
        1,0,0,0,7470,7464,1,0,0,0,7471,849,1,0,0,0,7472,7473,3,854,427,0,
        7473,7474,3,864,432,0,7474,7475,3,876,438,0,7475,7483,1,0,0,0,7476,
        7477,3,854,427,0,7477,7478,5,2,0,0,7478,7479,3,852,426,0,7479,7480,
        5,3,0,0,7480,7481,3,876,438,0,7481,7483,1,0,0,0,7482,7472,1,0,0,
        0,7482,7476,1,0,0,0,7483,851,1,0,0,0,7484,7489,3,856,428,0,7485,
        7486,5,6,0,0,7486,7488,3,856,428,0,7487,7485,1,0,0,0,7488,7491,1,
        0,0,0,7489,7487,1,0,0,0,7489,7490,1,0,0,0,7490,853,1,0,0,0,7491,
        7489,1,0,0,0,7492,7493,7,34,0,0,7493,855,1,0,0,0,7494,7495,3,858,
        429,0,7495,7496,3,860,430,0,7496,857,1,0,0,0,7497,7500,3,1378,689,
        0,7498,7500,3,854,427,0,7499,7497,1,0,0,0,7499,7498,1,0,0,0,7500,
        859,1,0,0,0,7501,7505,3,66,33,0,7502,7505,3,292,146,0,7503,7505,
        1,0,0,0,7504,7501,1,0,0,0,7504,7502,1,0,0,0,7504,7503,1,0,0,0,7505,
        861,1,0,0,0,7506,7509,3,854,427,0,7507,7509,1,0,0,0,7508,7506,1,
        0,0,0,7508,7507,1,0,0,0,7509,863,1,0,0,0,7510,7513,5,128,0,0,7511,
        7513,1,0,0,0,7512,7510,1,0,0,0,7512,7511,1,0,0,0,7513,865,1,0,0,
        0,7514,7517,5,113,0,0,7515,7517,1,0,0,0,7516,7514,1,0,0,0,7516,7515,
        1,0,0,0,7517,867,1,0,0,0,7518,7521,5,112,0,0,7519,7521,1,0,0,0,7520,
        7518,1,0,0,0,7520,7519,1,0,0,0,7521,869,1,0,0,0,7522,7523,5,2,0,
        0,7523,7524,3,1338,669,0,7524,7525,5,3,0,0,7525,7528,1,0,0,0,7526,
        7528,1,0,0,0,7527,7522,1,0,0,0,7527,7526,1,0,0,0,7528,871,1,0,0,
        0,7529,7530,3,1336,668,0,7530,7531,3,870,435,0,7531,873,1,0,0,0,
        7532,7537,3,872,436,0,7533,7534,5,6,0,0,7534,7536,3,872,436,0,7535,
        7533,1,0,0,0,7536,7539,1,0,0,0,7537,7535,1,0,0,0,7537,7538,1,0,0,
        0,7538,875,1,0,0,0,7539,7537,1,0,0,0,7540,7543,3,874,437,0,7541,
        7543,1,0,0,0,7542,7540,1,0,0,0,7542,7541,1,0,0,0,7543,877,1,0,0,
        0,7544,7545,5,203,0,0,7545,7561,3,880,440,0,7546,7547,5,203,0,0,
        7547,7548,3,854,427,0,7548,7549,3,864,432,0,7549,7550,3,880,440,
        0,7550,7561,1,0,0,0,7551,7552,5,203,0,0,7552,7553,5,128,0,0,7553,
        7561,3,880,440,0,7554,7555,5,203,0,0,7555,7556,5,2,0,0,7556,7557,
        3,882,441,0,7557,7558,5,3,0,0,7558,7559,3,880,440,0,7559,7561,1,
        0,0,0,7560,7544,1,0,0,0,7560,7546,1,0,0,0,7560,7551,1,0,0,0,7560,
        7554,1,0,0,0,7561,879,1,0,0,0,7562,7572,3,960,480,0,7563,7572,3,
        902,451,0,7564,7572,3,942,471,0,7565,7572,3,928,464,0,7566,7572,
        3,952,476,0,7567,7572,3,264,132,0,7568,7572,3,270,135,0,7569,7572,
        3,276,138,0,7570,7572,3,896,448,0,7571,7562,1,0,0,0,7571,7563,1,
        0,0,0,7571,7564,1,0,0,0,7571,7565,1,0,0,0,7571,7566,1,0,0,0,7571,
        7567,1,0,0,0,7571,7568,1,0,0,0,7571,7569,1,0,0,0,7571,7570,1,0,0,
        0,7572,881,1,0,0,0,7573,7578,3,884,442,0,7574,7575,5,6,0,0,7575,
        7577,3,884,442,0,7576,7574,1,0,0,0,7577,7580,1,0,0,0,7578,7576,1,
        0,0,0,7578,7579,1,0,0,0,7579,883,1,0,0,0,7580,7578,1,0,0,0,7581,
        7582,3,886,443,0,7582,7583,3,888,444,0,7583,885,1,0,0,0,7584,7587,
        3,1378,689,0,7585,7587,3,854,427,0,7586,7584,1,0,0,0,7586,7585,1,
        0,0,0,7587,887,1,0,0,0,7588,7592,3,66,33,0,7589,7592,3,292,146,0,
        7590,7592,1,0,0,0,7591,7588,1,0,0,0,7591,7589,1,0,0,0,7591,7590,
        1,0,0,0,7592,889,1,0,0,0,7593,7594,5,283,0,0,7594,7595,3,1340,670,
        0,7595,7596,3,892,446,0,7596,7597,5,36,0,0,7597,7598,3,894,447,0,
        7598,891,1,0,0,0,7599,7600,5,2,0,0,7600,7601,3,1286,643,0,7601,7602,
        5,3,0,0,7602,7605,1,0,0,0,7603,7605,1,0,0,0,7604,7599,1,0,0,0,7604,
        7603,1,0,0,0,7605,893,1,0,0,0,7606,7611,3,960,480,0,7607,7611,3,
        902,451,0,7608,7611,3,942,471,0,7609,7611,3,928,464,0,7610,7606,
        1,0,0,0,7610,7607,1,0,0,0,7610,7608,1,0,0,0,7610,7609,1,0,0,0,7611,
        895,1,0,0,0,7612,7613,5,202,0,0,7613,7614,3,1340,670,0,7614,7615,
        3,898,449,0,7615,7640,1,0,0,0,7616,7617,5,46,0,0,7617,7618,3,174,
        87,0,7618,7619,5,92,0,0,7619,7620,3,266,133,0,7620,7621,5,36,0,0,
        7621,7622,5,202,0,0,7622,7623,3,1340,670,0,7623,7624,3,898,449,0,
        7624,7625,3,268,134,0,7625,7640,1,0,0,0,7626,7627,5,46,0,0,7627,
        7628,3,174,87,0,7628,7629,5,92,0,0,7629,7630,5,220,0,0,7630,7631,
        5,77,0,0,7631,7632,5,389,0,0,7632,7633,3,266,133,0,7633,7634,5,36,
        0,0,7634,7635,5,202,0,0,7635,7636,3,1340,670,0,7636,7637,3,898,449,
        0,7637,7638,3,268,134,0,7638,7640,1,0,0,0,7639,7612,1,0,0,0,7639,
        7616,1,0,0,0,7639,7626,1,0,0,0,7640,897,1,0,0,0,7641,7642,5,2,0,
        0,7642,7643,3,1280,640,0,7643,7644,5,3,0,0,7644,7647,1,0,0,0,7645,
        7647,1,0,0,0,7646,7641,1,0,0,0,7646,7645,1,0,0,0,7647,899,1,0,0,
        0,7648,7649,5,177,0,0,7649,7659,3,1340,670,0,7650,7651,5,177,0,0,
        7651,7652,5,283,0,0,7652,7659,3,1340,670,0,7653,7654,5,177,0,0,7654,
        7659,5,30,0,0,7655,7656,5,177,0,0,7656,7657,5,283,0,0,7657,7659,
        5,30,0,0,7658,7648,1,0,0,0,7658,7650,1,0,0,0,7658,7653,1,0,0,0,7658,
        7655,1,0,0,0,7659,901,1,0,0,0,7660,7661,3,980,490,0,7661,7662,5,
        232,0,0,7662,7663,5,71,0,0,7663,7664,3,904,452,0,7664,7665,3,906,
        453,0,7665,7666,3,914,457,0,7666,7667,3,918,459,0,7667,903,1,0,0,
        0,7668,7671,3,1336,668,0,7669,7670,5,36,0,0,7670,7672,3,1372,686,
        0,7671,7669,1,0,0,0,7671,7672,1,0,0,0,7672,905,1,0,0,0,7673,7693,
        3,960,480,0,7674,7675,5,463,0,0,7675,7676,3,908,454,0,7676,7677,
        5,450,0,0,7677,7678,3,960,480,0,7678,7693,1,0,0,0,7679,7680,5,2,
        0,0,7680,7681,3,910,455,0,7681,7686,5,3,0,0,7682,7683,5,463,0,0,
        7683,7684,3,908,454,0,7684,7685,5,450,0,0,7685,7687,1,0,0,0,7686,
        7682,1,0,0,0,7686,7687,1,0,0,0,7687,7688,1,0,0,0,7688,7689,3,960,
        480,0,7689,7693,1,0,0,0,7690,7691,5,53,0,0,7691,7693,5,415,0,0,7692,
        7673,1,0,0,0,7692,7674,1,0,0,0,7692,7679,1,0,0,0,7692,7690,1,0,0,
        0,7693,907,1,0,0,0,7694,7695,7,35,0,0,7695,909,1,0,0,0,7696,7701,
        3,912,456,0,7697,7698,5,6,0,0,7698,7700,3,912,456,0,7699,7697,1,
        0,0,0,7700,7703,1,0,0,0,7701,7699,1,0,0,0,7701,7702,1,0,0,0,7702,
        911,1,0,0,0,7703,7701,1,0,0,0,7704,7705,3,1372,686,0,7705,7706,3,
        1326,663,0,7706,913,1,0,0,0,7707,7708,5,80,0,0,7708,7709,5,464,0,
        0,7709,7710,3,916,458,0,7710,7717,5,57,0,0,7711,7712,5,362,0,0,7712,
        7713,5,326,0,0,7713,7714,3,944,472,0,7714,7715,3,1094,547,0,7715,
        7718,1,0,0,0,7716,7718,5,263,0,0,7717,7711,1,0,0,0,7717,7716,1,0,
        0,0,7718,7721,1,0,0,0,7719,7721,1,0,0,0,7720,7707,1,0,0,0,7720,7719,
        1,0,0,0,7721,915,1,0,0,0,7722,7723,5,2,0,0,7723,7724,3,598,299,0,
        7724,7725,5,3,0,0,7725,7726,3,1094,547,0,7726,7732,1,0,0,0,7727,
        7728,5,80,0,0,7728,7729,5,45,0,0,7729,7732,3,1340,670,0,7730,7732,
        1,0,0,0,7731,7722,1,0,0,0,7731,7727,1,0,0,0,7731,7730,1,0,0,0,7732,
        917,1,0,0,0,7733,7734,5,87,0,0,7734,7737,3,1330,665,0,7735,7737,
        1,0,0,0,7736,7733,1,0,0,0,7736,7735,1,0,0,0,7737,919,1,0,0,0,7738,
        7740,5,253,0,0,7739,7741,5,71,0,0,7740,7739,1,0,0,0,7740,7741,1,
        0,0,0,7741,7742,1,0,0,0,7742,7744,3,1336,668,0,7743,7745,3,1062,
        531,0,7744,7743,1,0,0,0,7744,7745,1,0,0,0,7745,7746,1,0,0,0,7746,
        7749,5,100,0,0,7747,7750,3,962,481,0,7748,7750,3,1336,668,0,7749,
        7747,1,0,0,0,7749,7748,1,0,0,0,7750,7752,1,0,0,0,7751,7753,3,1062,
        531,0,7752,7751,1,0,0,0,7752,7753,1,0,0,0,7753,7754,1,0,0,0,7754,
        7755,5,80,0,0,7755,7764,3,1162,581,0,7756,7758,3,922,461,0,7757,
        7759,3,924,462,0,7758,7757,1,0,0,0,7758,7759,1,0,0,0,7759,7765,1,
        0,0,0,7760,7762,3,924,462,0,7761,7763,3,922,461,0,7762,7761,1,0,
        0,0,7762,7763,1,0,0,0,7763,7765,1,0,0,0,7764,7756,1,0,0,0,7764,7760,
        1,0,0,0,7765,7767,1,0,0,0,7766,7768,3,926,463,0,7767,7766,1,0,0,
        0,7767,7768,1,0,0,0,7768,921,1,0,0,0,7769,7770,5,102,0,0,7770,7771,
        5,77,0,0,7771,7774,5,250,0,0,7772,7773,5,33,0,0,7773,7775,3,1162,
        581,0,7774,7772,1,0,0,0,7774,7775,1,0,0,0,7775,7777,1,0,0,0,7776,
        7778,5,93,0,0,7777,7776,1,0,0,0,7777,7778,1,0,0,0,7778,7779,1,0,
        0,0,7779,7784,5,232,0,0,7780,7781,5,2,0,0,7781,7782,3,910,455,0,
        7782,7783,5,3,0,0,7783,7785,1,0,0,0,7784,7780,1,0,0,0,7784,7785,
        1,0,0,0,7785,7786,1,0,0,0,7786,7787,3,1052,526,0,7787,923,1,0,0,
        0,7788,7789,5,102,0,0,7789,7792,5,250,0,0,7790,7791,5,33,0,0,7791,
        7793,3,1162,581,0,7792,7790,1,0,0,0,7792,7793,1,0,0,0,7793,7795,
        1,0,0,0,7794,7796,5,93,0,0,7795,7794,1,0,0,0,7795,7796,1,0,0,0,7796,
        7797,1,0,0,0,7797,7798,5,362,0,0,7798,7799,5,326,0,0,7799,7800,3,
        944,472,0,7800,925,1,0,0,0,7801,7802,5,102,0,0,7802,7804,5,250,0,
        0,7803,7805,5,93,0,0,7804,7803,1,0,0,0,7804,7805,1,0,0,0,7805,7806,
        1,0,0,0,7806,7807,5,182,0,0,7807,927,1,0,0,0,7808,7809,3,980,490,
        0,7809,7810,5,182,0,0,7810,7811,5,64,0,0,7811,7812,3,1078,539,0,
        7812,7813,3,930,465,0,7813,7814,3,1096,548,0,7814,7815,3,918,459,
        0,7815,929,1,0,0,0,7816,7817,5,100,0,0,7817,7820,3,1056,528,0,7818,
        7820,1,0,0,0,7819,7816,1,0,0,0,7819,7818,1,0,0,0,7820,931,1,0,0,
        0,7821,7822,5,247,0,0,7822,7823,3,988,494,0,7823,7824,3,1076,538,
        0,7824,7825,3,934,467,0,7825,7826,3,938,469,0,7826,933,1,0,0,0,7827,
        7828,5,68,0,0,7828,7829,3,936,468,0,7829,7830,5,256,0,0,7830,7833,
        1,0,0,0,7831,7833,1,0,0,0,7832,7827,1,0,0,0,7832,7831,1,0,0,0,7833,
        935,1,0,0,0,7834,7835,5,131,0,0,7835,7847,7,36,0,0,7836,7837,5,407,
        0,0,7837,7847,7,36,0,0,7838,7843,5,327,0,0,7839,7840,5,362,0,0,7840,
        7844,5,201,0,0,7841,7842,5,407,0,0,7842,7844,5,201,0,0,7843,7839,
        1,0,0,0,7843,7841,1,0,0,0,7843,7844,1,0,0,0,7844,7847,1,0,0,0,7845,
        7847,5,201,0,0,7846,7834,1,0,0,0,7846,7836,1,0,0,0,7846,7838,1,0,
        0,0,7846,7845,1,0,0,0,7847,937,1,0,0,0,7848,7851,5,265,0,0,7849,
        7851,1,0,0,0,7850,7848,1,0,0,0,7850,7849,1,0,0,0,7851,939,1,0,0,
        0,7852,7857,5,265,0,0,7853,7854,5,465,0,0,7854,7857,5,466,0,0,7855,
        7857,1,0,0,0,7856,7852,1,0,0,0,7856,7853,1,0,0,0,7856,7855,1,0,0,
        0,7857,941,1,0,0,0,7858,7859,3,980,490,0,7859,7860,5,362,0,0,7860,
        7861,3,1078,539,0,7861,7862,5,326,0,0,7862,7863,3,944,472,0,7863,
        7864,3,1054,527,0,7864,7865,3,1096,548,0,7865,7866,3,918,459,0,7866,
        943,1,0,0,0,7867,7872,3,946,473,0,7868,7869,5,6,0,0,7869,7871,3,
        946,473,0,7870,7868,1,0,0,0,7871,7874,1,0,0,0,7872,7870,1,0,0,0,
        7872,7873,1,0,0,0,7873,945,1,0,0,0,7874,7872,1,0,0,0,7875,7876,3,
        948,474,0,7876,7877,5,10,0,0,7877,7878,3,1162,581,0,7878,7886,1,
        0,0,0,7879,7880,5,2,0,0,7880,7881,3,950,475,0,7881,7882,5,3,0,0,
        7882,7883,5,10,0,0,7883,7884,3,1162,581,0,7884,7886,1,0,0,0,7885,
        7875,1,0,0,0,7885,7879,1,0,0,0,7886,947,1,0,0,0,7887,7888,3,1372,
        686,0,7888,7889,3,1326,663,0,7889,949,1,0,0,0,7890,7895,3,948,474,
        0,7891,7892,5,6,0,0,7892,7894,3,948,474,0,7893,7891,1,0,0,0,7894,
        7897,1,0,0,0,7895,7893,1,0,0,0,7895,7896,1,0,0,0,7896,951,1,0,0,
        0,7897,7895,1,0,0,0,7898,7899,5,178,0,0,7899,7900,3,954,477,0,7900,
        7901,3,956,478,0,7901,7902,5,172,0,0,7902,7903,3,958,479,0,7903,
        7904,5,62,0,0,7904,7905,3,960,480,0,7905,953,1,0,0,0,7906,7907,3,
        1340,670,0,7907,955,1,0,0,0,7908,7909,5,262,0,0,7909,7914,5,317,
        0,0,7910,7914,5,317,0,0,7911,7914,5,107,0,0,7912,7914,5,231,0,0,
        7913,7908,1,0,0,0,7913,7910,1,0,0,0,7913,7911,1,0,0,0,7913,7912,
        1,0,0,0,7914,7917,1,0,0,0,7915,7913,1,0,0,0,7915,7916,1,0,0,0,7916,
        957,1,0,0,0,7917,7915,1,0,0,0,7918,7924,1,0,0,0,7919,7920,5,105,
        0,0,7920,7924,5,217,0,0,7921,7922,5,372,0,0,7922,7924,5,217,0,0,
        7923,7918,1,0,0,0,7923,7919,1,0,0,0,7923,7921,1,0,0,0,7924,959,1,
        0,0,0,7925,7928,3,964,482,0,7926,7928,3,962,481,0,7927,7925,1,0,
        0,0,7927,7926,1,0,0,0,7928,961,1,0,0,0,7929,7930,5,2,0,0,7930,7931,
        3,964,482,0,7931,7932,5,3,0,0,7932,7938,1,0,0,0,7933,7934,5,2,0,
        0,7934,7935,3,962,481,0,7935,7936,5,3,0,0,7936,7938,1,0,0,0,7937,
        7929,1,0,0,0,7937,7933,1,0,0,0,7938,963,1,0,0,0,7939,7940,3,966,
        483,0,7940,7947,3,996,498,0,7941,7942,3,1040,520,0,7942,7943,3,1006,
        503,0,7943,7948,1,0,0,0,7944,7945,3,1004,502,0,7945,7946,3,1042,
        521,0,7946,7948,1,0,0,0,7947,7941,1,0,0,0,7947,7944,1,0,0,0,7947,
        7948,1,0,0,0,7948,7961,1,0,0,0,7949,7950,3,972,486,0,7950,7951,3,
        966,483,0,7951,7958,3,996,498,0,7952,7953,3,1040,520,0,7953,7954,
        3,1006,503,0,7954,7959,1,0,0,0,7955,7956,3,1004,502,0,7956,7957,
        3,1042,521,0,7957,7959,1,0,0,0,7958,7952,1,0,0,0,7958,7955,1,0,0,
        0,7958,7959,1,0,0,0,7959,7961,1,0,0,0,7960,7939,1,0,0,0,7960,7949,
        1,0,0,0,7961,965,1,0,0,0,7962,7969,3,968,484,0,7963,7964,7,37,0,
        0,7964,7965,3,990,495,0,7965,7966,3,968,484,0,7966,7968,1,0,0,0,
        7967,7963,1,0,0,0,7968,7971,1,0,0,0,7969,7967,1,0,0,0,7969,7970,
        1,0,0,0,7970,967,1,0,0,0,7971,7969,1,0,0,0,7972,7979,3,970,485,0,
        7973,7974,5,70,0,0,7974,7975,3,990,495,0,7975,7976,3,970,485,0,7976,
        7978,1,0,0,0,7977,7973,1,0,0,0,7978,7981,1,0,0,0,7979,7977,1,0,0,
        0,7979,7980,1,0,0,0,7980,969,1,0,0,0,7981,7979,1,0,0,0,7982,7990,
        5,88,0,0,7983,7984,3,994,497,0,7984,7985,3,982,491,0,7985,7986,3,
        1328,664,0,7986,7991,1,0,0,0,7987,7988,3,992,496,0,7988,7989,3,1330,
        665,0,7989,7991,1,0,0,0,7990,7983,1,0,0,0,7990,7987,1,0,0,0,7991,
        7992,1,0,0,0,7992,7993,3,982,491,0,7993,7994,3,1054,527,0,7994,7995,
        3,1094,547,0,7995,7996,3,1024,512,0,7996,7997,3,1038,519,0,7997,
        7998,3,1240,620,0,7998,8004,1,0,0,0,7999,8004,3,1052,526,0,8000,
        8001,5,92,0,0,8001,8004,3,1074,537,0,8002,8004,3,962,481,0,8003,
        7982,1,0,0,0,8003,7999,1,0,0,0,8003,8000,1,0,0,0,8003,8002,1,0,0,
        0,8004,971,1,0,0,0,8005,8007,5,105,0,0,8006,8008,5,296,0,0,8007,
        8006,1,0,0,0,8007,8008,1,0,0,0,8008,8009,1,0,0,0,8009,8010,3,974,
        487,0,8010,973,1,0,0,0,8011,8016,3,976,488,0,8012,8013,5,6,0,0,8013,
        8015,3,976,488,0,8014,8012,1,0,0,0,8015,8018,1,0,0,0,8016,8014,1,
        0,0,0,8016,8017,1,0,0,0,8017,975,1,0,0,0,8018,8016,1,0,0,0,8019,
        8020,3,1340,670,0,8020,8021,3,870,435,0,8021,8022,5,36,0,0,8022,
        8023,3,978,489,0,8023,8024,5,2,0,0,8024,8025,3,894,447,0,8025,8026,
        5,3,0,0,8026,977,1,0,0,0,8027,8032,5,251,0,0,8028,8029,5,77,0,0,
        8029,8032,5,251,0,0,8030,8032,1,0,0,0,8031,8027,1,0,0,0,8031,8028,
        1,0,0,0,8031,8030,1,0,0,0,8032,979,1,0,0,0,8033,8036,3,972,486,0,
        8034,8036,1,0,0,0,8035,8033,1,0,0,0,8035,8034,1,0,0,0,8036,981,1,
        0,0,0,8037,8042,5,71,0,0,8038,8039,3,984,492,0,8039,8040,3,986,493,
        0,8040,8043,1,0,0,0,8041,8043,3,1566,783,0,8042,8038,1,0,0,0,8042,
        8041,1,0,0,0,8043,8046,1,0,0,0,8044,8046,1,0,0,0,8045,8037,1,0,0,
        0,8045,8044,1,0,0,0,8046,983,1,0,0,0,8047,8050,1,0,0,0,8048,8050,
        5,339,0,0,8049,8047,1,0,0,0,8049,8048,1,0,0,0,8050,985,1,0,0,0,8051,
        8053,7,38,0,0,8052,8051,1,0,0,0,8052,8053,1,0,0,0,8053,8054,1,0,
        0,0,8054,8055,7,11,0,0,8055,8056,3,988,494,0,8056,8057,3,1336,668,
        0,8057,8066,1,0,0,0,8058,8059,5,360,0,0,8059,8060,3,988,494,0,8060,
        8061,3,1336,668,0,8061,8066,1,0,0,0,8062,8063,5,92,0,0,8063,8066,
        3,1336,668,0,8064,8066,3,1336,668,0,8065,8052,1,0,0,0,8065,8058,
        1,0,0,0,8065,8062,1,0,0,0,8065,8064,1,0,0,0,8066,987,1,0,0,0,8067,
        8070,5,92,0,0,8068,8070,1,0,0,0,8069,8067,1,0,0,0,8069,8068,1,0,
        0,0,8070,989,1,0,0,0,8071,8075,5,30,0,0,8072,8075,5,56,0,0,8073,
        8075,1,0,0,0,8074,8071,1,0,0,0,8074,8072,1,0,0,0,8074,8073,1,0,0,
        0,8075,991,1,0,0,0,8076,8082,5,56,0,0,8077,8078,5,80,0,0,8078,8079,
        5,2,0,0,8079,8080,3,1280,640,0,8080,8081,5,3,0,0,8081,8083,1,0,0,
        0,8082,8077,1,0,0,0,8082,8083,1,0,0,0,8083,993,1,0,0,0,8084,8087,
        5,30,0,0,8085,8087,1,0,0,0,8086,8084,1,0,0,0,8086,8085,1,0,0,0,8087,
        995,1,0,0,0,8088,8091,3,998,499,0,8089,8091,1,0,0,0,8090,8088,1,
        0,0,0,8090,8089,1,0,0,0,8091,997,1,0,0,0,8092,8093,5,83,0,0,8093,
        8094,5,147,0,0,8094,8095,3,1000,500,0,8095,999,1,0,0,0,8096,8101,
        3,1002,501,0,8097,8098,5,6,0,0,8098,8100,3,1002,501,0,8099,8097,
        1,0,0,0,8100,8103,1,0,0,0,8101,8099,1,0,0,0,8101,8102,1,0,0,0,8102,
        1001,1,0,0,0,8103,8101,1,0,0,0,8104,8108,3,1162,581,0,8105,8106,
        5,100,0,0,8106,8109,3,1276,638,0,8107,8109,3,612,306,0,8108,8105,
        1,0,0,0,8108,8107,1,0,0,0,8109,8110,1,0,0,0,8110,8111,3,614,307,
        0,8111,1003,1,0,0,0,8112,8114,3,1008,504,0,8113,8115,3,1010,505,
        0,8114,8113,1,0,0,0,8114,8115,1,0,0,0,8115,8121,1,0,0,0,8116,8118,
        3,1010,505,0,8117,8119,3,1008,504,0,8118,8117,1,0,0,0,8118,8119,
        1,0,0,0,8119,8121,1,0,0,0,8120,8112,1,0,0,0,8120,8116,1,0,0,0,8121,
        1005,1,0,0,0,8122,8125,3,1004,502,0,8123,8125,1,0,0,0,8124,8122,
        1,0,0,0,8124,8123,1,0,0,0,8125,1007,1,0,0,0,8126,8127,5,74,0,0,8127,
        8130,3,1012,506,0,8128,8129,5,6,0,0,8129,8131,3,1014,507,0,8130,
        8128,1,0,0,0,8130,8131,1,0,0,0,8131,8150,1,0,0,0,8132,8133,5,61,
        0,0,8133,8147,3,1022,511,0,8134,8135,3,1016,508,0,8135,8139,3,1020,
        510,0,8136,8140,5,81,0,0,8137,8138,5,105,0,0,8138,8140,5,467,0,0,
        8139,8136,1,0,0,0,8139,8137,1,0,0,0,8140,8148,1,0,0,0,8141,8145,
        3,1020,510,0,8142,8146,5,81,0,0,8143,8144,5,105,0,0,8144,8146,5,
        467,0,0,8145,8142,1,0,0,0,8145,8143,1,0,0,0,8146,8148,1,0,0,0,8147,
        8134,1,0,0,0,8147,8141,1,0,0,0,8148,8150,1,0,0,0,8149,8126,1,0,0,
        0,8149,8132,1,0,0,0,8150,1009,1,0,0,0,8151,8156,5,79,0,0,8152,8157,
        3,1014,507,0,8153,8154,3,1016,508,0,8154,8155,3,1020,510,0,8155,
        8157,1,0,0,0,8156,8152,1,0,0,0,8156,8153,1,0,0,0,8157,1011,1,0,0,
        0,8158,8161,3,1162,581,0,8159,8161,5,30,0,0,8160,8158,1,0,0,0,8160,
        8159,1,0,0,0,8161,1013,1,0,0,0,8162,8163,3,1162,581,0,8163,1015,
        1,0,0,0,8164,8170,3,1206,603,0,8165,8166,5,12,0,0,8166,8170,3,1018,
        509,0,8167,8168,5,13,0,0,8168,8170,3,1018,509,0,8169,8164,1,0,0,
        0,8169,8165,1,0,0,0,8169,8167,1,0,0,0,8170,1017,1,0,0,0,8171,8174,
        3,1356,678,0,8172,8174,3,1354,677,0,8173,8171,1,0,0,0,8173,8172,
        1,0,0,0,8174,1019,1,0,0,0,8175,8176,7,39,0,0,8176,1021,1,0,0,0,8177,
        8178,7,40,0,0,8178,1023,1,0,0,0,8179,8180,5,66,0,0,8180,8181,5,147,
        0,0,8181,8184,3,1026,513,0,8182,8184,1,0,0,0,8183,8179,1,0,0,0,8183,
        8182,1,0,0,0,8184,1025,1,0,0,0,8185,8190,3,1028,514,0,8186,8187,
        5,6,0,0,8187,8189,3,1028,514,0,8188,8186,1,0,0,0,8189,8192,1,0,0,
        0,8190,8188,1,0,0,0,8190,8191,1,0,0,0,8191,1027,1,0,0,0,8192,8190,
        1,0,0,0,8193,8199,3,1030,515,0,8194,8199,3,1034,517,0,8195,8199,
        3,1032,516,0,8196,8199,3,1036,518,0,8197,8199,3,1162,581,0,8198,
        8193,1,0,0,0,8198,8194,1,0,0,0,8198,8195,1,0,0,0,8198,8196,1,0,0,
        0,8198,8197,1,0,0,0,8199,1029,1,0,0,0,8200,8201,5,2,0,0,8201,8202,
        5,3,0,0,8202,1031,1,0,0,0,8203,8204,5,468,0,0,8204,8205,5,2,0,0,
        8205,8206,3,1280,640,0,8206,8207,5,3,0,0,8207,1033,1,0,0,0,8208,
        8209,5,469,0,0,8209,8210,5,2,0,0,8210,8211,3,1280,640,0,8211,8212,
        5,3,0,0,8212,1035,1,0,0,0,8213,8214,5,470,0,0,8214,8215,5,471,0,
        0,8215,8216,5,2,0,0,8216,8217,3,1026,513,0,8217,8218,5,3,0,0,8218,
        1037,1,0,0,0,8219,8220,5,67,0,0,8220,8223,3,1162,581,0,8221,8223,
        1,0,0,0,8222,8219,1,0,0,0,8222,8221,1,0,0,0,8223,1039,1,0,0,0,8224,
        8229,3,1044,522,0,8225,8226,5,62,0,0,8226,8227,5,293,0,0,8227,8229,
        5,81,0,0,8228,8224,1,0,0,0,8228,8225,1,0,0,0,8229,1041,1,0,0,0,8230,
        8233,3,1040,520,0,8231,8233,1,0,0,0,8232,8230,1,0,0,0,8232,8231,
        1,0,0,0,8233,1043,1,0,0,0,8234,8236,3,1046,523,0,8235,8234,1,0,0,
        0,8236,8237,1,0,0,0,8237,8235,1,0,0,0,8237,8238,1,0,0,0,8238,1045,
        1,0,0,0,8239,8240,3,1048,524,0,8240,8241,3,1050,525,0,8241,8242,
        3,940,470,0,8242,1047,1,0,0,0,8243,8253,5,62,0,0,8244,8245,5,262,
        0,0,8245,8247,5,236,0,0,8246,8244,1,0,0,0,8246,8247,1,0,0,0,8247,
        8248,1,0,0,0,8248,8254,5,362,0,0,8249,8251,5,236,0,0,8250,8249,1,
        0,0,0,8250,8251,1,0,0,0,8251,8252,1,0,0,0,8252,8254,5,327,0,0,8253,
        8246,1,0,0,0,8253,8250,1,0,0,0,8254,1049,1,0,0,0,8255,8256,5,268,
        0,0,8256,8259,3,1334,667,0,8257,8259,1,0,0,0,8258,8255,1,0,0,0,8258,
        8257,1,0,0,0,8259,1051,1,0,0,0,8260,8261,5,415,0,0,8261,8262,5,2,
        0,0,8262,8263,3,1280,640,0,8263,8271,5,3,0,0,8264,8265,5,6,0,0,8265,
        8266,5,2,0,0,8266,8267,3,1280,640,0,8267,8268,5,3,0,0,8268,8270,
        1,0,0,0,8269,8264,1,0,0,0,8270,8273,1,0,0,0,8271,8269,1,0,0,0,8271,
        8272,1,0,0,0,8272,1053,1,0,0,0,8273,8271,1,0,0,0,8274,8275,5,64,
        0,0,8275,8278,3,1056,528,0,8276,8278,1,0,0,0,8277,8274,1,0,0,0,8277,
        8276,1,0,0,0,8278,1055,1,0,0,0,8279,8289,3,1058,529,0,8280,8285,
        3,1060,530,0,8281,8282,5,6,0,0,8282,8284,3,1060,530,0,8283,8281,
        1,0,0,0,8284,8287,1,0,0,0,8285,8283,1,0,0,0,8285,8286,1,0,0,0,8286,
        8289,1,0,0,0,8287,8285,1,0,0,0,8288,8279,1,0,0,0,8288,8280,1,0,0,
        0,8289,1057,1,0,0,0,8290,8293,3,1060,530,0,8291,8292,5,6,0,0,8292,
        8294,3,1060,530,0,8293,8291,1,0,0,0,8294,8295,1,0,0,0,8295,8293,
        1,0,0,0,8295,8296,1,0,0,0,8296,1059,1,0,0,0,8297,8298,3,1074,537,
        0,8298,8300,3,1064,532,0,8299,8301,3,1080,540,0,8300,8299,1,0,0,
        0,8300,8301,1,0,0,0,8301,8347,1,0,0,0,8302,8303,3,1084,542,0,8303,
        8304,3,1068,534,0,8304,8347,1,0,0,0,8305,8306,3,1104,552,0,8306,
        8307,3,1064,532,0,8307,8347,1,0,0,0,8308,8309,3,962,481,0,8309,8310,
        3,1064,532,0,8310,8347,1,0,0,0,8311,8321,5,72,0,0,8312,8313,3,1104,
        552,0,8313,8314,3,1064,532,0,8314,8322,1,0,0,0,8315,8316,3,1084,
        542,0,8316,8317,3,1068,534,0,8317,8322,1,0,0,0,8318,8319,3,962,481,
        0,8319,8320,3,1064,532,0,8320,8322,1,0,0,0,8321,8312,1,0,0,0,8321,
        8315,1,0,0,0,8321,8318,1,0,0,0,8322,8347,1,0,0,0,8323,8324,5,2,0,
        0,8324,8341,3,1060,530,0,8325,8326,5,110,0,0,8326,8327,5,118,0,0,
        8327,8342,3,1060,530,0,8328,8330,5,121,0,0,8329,8331,3,1070,535,
        0,8330,8329,1,0,0,0,8330,8331,1,0,0,0,8331,8332,1,0,0,0,8332,8333,
        5,118,0,0,8333,8342,3,1060,530,0,8334,8336,3,1070,535,0,8335,8334,
        1,0,0,0,8335,8336,1,0,0,0,8336,8337,1,0,0,0,8337,8338,5,118,0,0,
        8338,8339,3,1060,530,0,8339,8340,3,1072,536,0,8340,8342,1,0,0,0,
        8341,8325,1,0,0,0,8341,8328,1,0,0,0,8341,8335,1,0,0,0,8341,8342,
        1,0,0,0,8342,8343,1,0,0,0,8343,8344,5,3,0,0,8344,8345,3,1064,532,
        0,8345,8347,1,0,0,0,8346,8297,1,0,0,0,8346,8302,1,0,0,0,8346,8305,
        1,0,0,0,8346,8308,1,0,0,0,8346,8311,1,0,0,0,8346,8323,1,0,0,0,8347,
        8366,1,0,0,0,8348,8349,5,110,0,0,8349,8350,5,118,0,0,8350,8365,3,
        1060,530,0,8351,8353,5,121,0,0,8352,8354,3,1070,535,0,8353,8352,
        1,0,0,0,8353,8354,1,0,0,0,8354,8355,1,0,0,0,8355,8356,5,118,0,0,
        8356,8365,3,1060,530,0,8357,8359,3,1070,535,0,8358,8357,1,0,0,0,
        8358,8359,1,0,0,0,8359,8360,1,0,0,0,8360,8361,5,118,0,0,8361,8362,
        3,1060,530,0,8362,8363,3,1072,536,0,8363,8365,1,0,0,0,8364,8348,
        1,0,0,0,8364,8351,1,0,0,0,8364,8358,1,0,0,0,8365,8368,1,0,0,0,8366,
        8364,1,0,0,0,8366,8367,1,0,0,0,8367,1061,1,0,0,0,8368,8366,1,0,0,
        0,8369,8371,5,36,0,0,8370,8369,1,0,0,0,8370,8371,1,0,0,0,8371,8372,
        1,0,0,0,8372,8377,3,1372,686,0,8373,8374,5,2,0,0,8374,8375,3,1338,
        669,0,8375,8376,5,3,0,0,8376,8378,1,0,0,0,8377,8373,1,0,0,0,8377,
        8378,1,0,0,0,8378,1063,1,0,0,0,8379,8382,3,1066,533,0,8380,8382,
        1,0,0,0,8381,8379,1,0,0,0,8381,8380,1,0,0,0,8382,1065,1,0,0,0,8383,
        8385,5,36,0,0,8384,8383,1,0,0,0,8384,8385,1,0,0,0,8385,8386,1,0,
        0,0,8386,8391,3,1374,687,0,8387,8388,5,2,0,0,8388,8389,3,1338,669,
        0,8389,8390,5,3,0,0,8390,8392,1,0,0,0,8391,8387,1,0,0,0,8391,8392,
        1,0,0,0,8392,1067,1,0,0,0,8393,8407,3,1062,531,0,8394,8396,5,36,
        0,0,8395,8397,3,1372,686,0,8396,8395,1,0,0,0,8396,8397,1,0,0,0,8397,
        8400,1,0,0,0,8398,8400,3,1372,686,0,8399,8394,1,0,0,0,8399,8398,
        1,0,0,0,8400,8401,1,0,0,0,8401,8402,5,2,0,0,8402,8403,3,1100,550,
        0,8403,8404,5,3,0,0,8404,8407,1,0,0,0,8405,8407,1,0,0,0,8406,8393,
        1,0,0,0,8406,8399,1,0,0,0,8406,8405,1,0,0,0,8407,1069,1,0,0,0,8408,
        8410,7,41,0,0,8409,8411,5,123,0,0,8410,8409,1,0,0,0,8410,8411,1,
        0,0,0,8411,1071,1,0,0,0,8412,8413,5,100,0,0,8413,8414,5,2,0,0,8414,
        8415,3,1338,669,0,8415,8416,5,3,0,0,8416,8420,1,0,0,0,8417,8418,
        5,80,0,0,8418,8420,3,1162,581,0,8419,8412,1,0,0,0,8419,8417,1,0,
        0,0,8420,1073,1,0,0,0,8421,8423,3,1336,668,0,8422,8424,5,9,0,0,8423,
        8422,1,0,0,0,8423,8424,1,0,0,0,8424,8434,1,0,0,0,8425,8431,5,81,
        0,0,8426,8432,3,1336,668,0,8427,8428,5,2,0,0,8428,8429,3,1336,668,
        0,8429,8430,5,3,0,0,8430,8432,1,0,0,0,8431,8426,1,0,0,0,8431,8427,
        1,0,0,0,8432,8434,1,0,0,0,8433,8421,1,0,0,0,8433,8425,1,0,0,0,8434,
        1075,1,0,0,0,8435,8440,3,1074,537,0,8436,8437,5,6,0,0,8437,8439,
        3,1074,537,0,8438,8436,1,0,0,0,8439,8442,1,0,0,0,8440,8438,1,0,0,
        0,8440,8441,1,0,0,0,8441,1077,1,0,0,0,8442,8440,1,0,0,0,8443,8448,
        3,1074,537,0,8444,8446,5,36,0,0,8445,8444,1,0,0,0,8445,8446,1,0,
        0,0,8446,8447,1,0,0,0,8447,8449,3,1372,686,0,8448,8445,1,0,0,0,8448,
        8449,1,0,0,0,8449,1079,1,0,0,0,8450,8451,5,472,0,0,8451,8452,3,1346,
        673,0,8452,8453,5,2,0,0,8453,8454,3,1280,640,0,8454,8455,5,3,0,0,
        8455,8456,3,1082,541,0,8456,1081,1,0,0,0,8457,8458,5,303,0,0,8458,
        8459,5,2,0,0,8459,8460,3,1162,581,0,8460,8461,5,3,0,0,8461,8464,
        1,0,0,0,8462,8464,1,0,0,0,8463,8457,1,0,0,0,8463,8462,1,0,0,0,8464,
        1083,1,0,0,0,8465,8466,3,1214,607,0,8466,8467,3,1092,546,0,8467,
        8476,1,0,0,0,8468,8469,5,313,0,0,8469,8470,5,64,0,0,8470,8471,5,
        2,0,0,8471,8472,3,1088,544,0,8472,8473,5,3,0,0,8473,8474,3,1092,
        546,0,8474,8476,1,0,0,0,8475,8465,1,0,0,0,8475,8468,1,0,0,0,8476,
        1085,1,0,0,0,8477,8478,3,1214,607,0,8478,8479,3,1090,545,0,8479,
        1087,1,0,0,0,8480,8485,3,1086,543,0,8481,8482,5,6,0,0,8482,8484,
        3,1086,543,0,8483,8481,1,0,0,0,8484,8487,1,0,0,0,8485,8483,1,0,0,
        0,8485,8486,1,0,0,0,8486,1089,1,0,0,0,8487,8485,1,0,0,0,8488,8489,
        5,36,0,0,8489,8490,5,2,0,0,8490,8491,3,1100,550,0,8491,8492,5,3,
        0,0,8492,8495,1,0,0,0,8493,8495,1,0,0,0,8494,8488,1,0,0,0,8494,8493,
        1,0,0,0,8495,1091,1,0,0,0,8496,8497,5,105,0,0,8497,8500,5,473,0,
        0,8498,8500,1,0,0,0,8499,8496,1,0,0,0,8499,8498,1,0,0,0,8500,1093,
        1,0,0,0,8501,8502,5,103,0,0,8502,8505,3,1162,581,0,8503,8505,1,0,
        0,0,8504,8501,1,0,0,0,8504,8503,1,0,0,0,8505,1095,1,0,0,0,8506,8511,
        5,103,0,0,8507,8508,5,434,0,0,8508,8509,5,268,0,0,8509,8512,3,954,
        477,0,8510,8512,3,1162,581,0,8511,8507,1,0,0,0,8511,8510,1,0,0,0,
        8512,8515,1,0,0,0,8513,8515,1,0,0,0,8514,8506,1,0,0,0,8514,8513,
        1,0,0,0,8515,1097,1,0,0,0,8516,8519,3,1100,550,0,8517,8519,1,0,0,
        0,8518,8516,1,0,0,0,8518,8517,1,0,0,0,8519,1099,1,0,0,0,8520,8525,
        3,1102,551,0,8521,8522,5,6,0,0,8522,8524,3,1102,551,0,8523,8521,
        1,0,0,0,8524,8527,1,0,0,0,8525,8523,1,0,0,0,8525,8526,1,0,0,0,8526,
        1101,1,0,0,0,8527,8525,1,0,0,0,8528,8529,3,1372,686,0,8529,8530,
        3,1118,559,0,8530,8531,3,110,55,0,8531,1103,1,0,0,0,8532,8533,5,
        474,0,0,8533,8549,5,2,0,0,8534,8535,3,1206,603,0,8535,8536,3,1232,
        616,0,8536,8537,5,475,0,0,8537,8538,3,1106,553,0,8538,8550,1,0,0,
        0,8539,8540,5,476,0,0,8540,8541,5,2,0,0,8541,8542,3,1114,557,0,8542,
        8543,5,3,0,0,8543,8544,5,6,0,0,8544,8545,3,1206,603,0,8545,8546,
        3,1232,616,0,8546,8547,5,475,0,0,8547,8548,3,1106,553,0,8548,8550,
        1,0,0,0,8549,8534,1,0,0,0,8549,8539,1,0,0,0,8550,8551,1,0,0,0,8551,
        8552,5,3,0,0,8552,1105,1,0,0,0,8553,8558,3,1108,554,0,8554,8555,
        5,6,0,0,8555,8557,3,1108,554,0,8556,8554,1,0,0,0,8557,8560,1,0,0,
        0,8558,8556,1,0,0,0,8558,8559,1,0,0,0,8559,1107,1,0,0,0,8560,8558,
        1,0,0,0,8561,8568,3,1372,686,0,8562,8564,3,1118,559,0,8563,8565,
        3,1110,555,0,8564,8563,1,0,0,0,8564,8565,1,0,0,0,8565,8569,1,0,0,
        0,8566,8567,5,62,0,0,8567,8569,5,473,0,0,8568,8562,1,0,0,0,8568,
        8566,1,0,0,0,8569,1109,1,0,0,0,8570,8572,3,1112,556,0,8571,8570,
        1,0,0,0,8572,8573,1,0,0,0,8573,8571,1,0,0,0,8573,8574,1,0,0,0,8574,
        1111,1,0,0,0,8575,8576,5,53,0,0,8576,8584,3,1162,581,0,8577,8578,
        3,1382,691,0,8578,8579,3,1162,581,0,8579,8584,1,0,0,0,8580,8581,
        5,77,0,0,8581,8584,5,78,0,0,8582,8584,5,78,0,0,8583,8575,1,0,0,0,
        8583,8577,1,0,0,0,8583,8580,1,0,0,0,8583,8582,1,0,0,0,8584,1113,
        1,0,0,0,8585,8590,3,1116,558,0,8586,8587,5,6,0,0,8587,8589,3,1116,
        558,0,8588,8586,1,0,0,0,8589,8592,1,0,0,0,8590,8588,1,0,0,0,8590,
        8591,1,0,0,0,8591,1115,1,0,0,0,8592,8590,1,0,0,0,8593,8594,3,1204,
        602,0,8594,8595,5,36,0,0,8595,8596,3,1380,690,0,8596,8600,1,0,0,
        0,8597,8598,5,53,0,0,8598,8600,3,1204,602,0,8599,8593,1,0,0,0,8599,
        8597,1,0,0,0,8600,1117,1,0,0,0,8601,8603,5,408,0,0,8602,8601,1,0,
        0,0,8602,8603,1,0,0,0,8603,8604,1,0,0,0,8604,8613,3,1122,561,0,8605,
        8614,3,1120,560,0,8606,8611,5,35,0,0,8607,8608,5,4,0,0,8608,8609,
        3,1356,678,0,8609,8610,5,5,0,0,8610,8612,1,0,0,0,8611,8607,1,0,0,
        0,8611,8612,1,0,0,0,8612,8614,1,0,0,0,8613,8605,1,0,0,0,8613,8606,
        1,0,0,0,8614,8620,1,0,0,0,8615,8616,3,1336,668,0,8616,8617,5,27,
        0,0,8617,8618,7,42,0,0,8618,8620,1,0,0,0,8619,8602,1,0,0,0,8619,
        8615,1,0,0,0,8620,1119,1,0,0,0,8621,8623,5,4,0,0,8622,8624,3,1356,
        678,0,8623,8622,1,0,0,0,8623,8624,1,0,0,0,8624,8625,1,0,0,0,8625,
        8627,5,5,0,0,8626,8621,1,0,0,0,8627,8630,1,0,0,0,8628,8626,1,0,0,
        0,8628,8629,1,0,0,0,8629,1121,1,0,0,0,8630,8628,1,0,0,0,8631,8645,
        3,1126,563,0,8632,8645,3,1130,565,0,8633,8645,3,1134,567,0,8634,
        8645,3,1142,571,0,8635,8645,3,1150,575,0,8636,8642,3,1152,576,0,
        8637,8643,3,1156,578,0,8638,8639,5,2,0,0,8639,8640,3,1356,678,0,
        8640,8641,5,3,0,0,8641,8643,1,0,0,0,8642,8637,1,0,0,0,8642,8638,
        1,0,0,0,8643,8645,1,0,0,0,8644,8631,1,0,0,0,8644,8632,1,0,0,0,8644,
        8633,1,0,0,0,8644,8634,1,0,0,0,8644,8635,1,0,0,0,8644,8636,1,0,0,
        0,8645,1123,1,0,0,0,8646,8651,3,1130,565,0,8647,8651,3,1136,568,
        0,8648,8651,3,1144,572,0,8649,8651,3,1150,575,0,8650,8646,1,0,0,
        0,8650,8647,1,0,0,0,8650,8648,1,0,0,0,8650,8649,1,0,0,0,8651,1125,
        1,0,0,0,8652,8657,3,1394,697,0,8653,8657,3,1376,688,0,8654,8657,
        5,119,0,0,8655,8657,5,126,0,0,8656,8652,1,0,0,0,8656,8653,1,0,0,
        0,8656,8654,1,0,0,0,8656,8655,1,0,0,0,8657,8659,1,0,0,0,8658,8660,
        3,526,263,0,8659,8658,1,0,0,0,8659,8660,1,0,0,0,8660,8661,1,0,0,
        0,8661,8662,3,1128,564,0,8662,1127,1,0,0,0,8663,8664,5,2,0,0,8664,
        8665,3,1280,640,0,8665,8666,5,3,0,0,8666,8669,1,0,0,0,8667,8669,
        1,0,0,0,8668,8663,1,0,0,0,8668,8667,1,0,0,0,8669,1129,1,0,0,0,8670,
        8687,5,394,0,0,8671,8687,5,395,0,0,8672,8687,5,409,0,0,8673,8687,
        5,381,0,0,8674,8687,5,406,0,0,8675,8676,5,391,0,0,8676,8687,3,1132,
        566,0,8677,8678,5,190,0,0,8678,8687,5,405,0,0,8679,8680,5,388,0,
        0,8680,8687,3,1128,564,0,8681,8682,5,387,0,0,8682,8687,3,1128,564,
        0,8683,8684,5,402,0,0,8684,8687,3,1128,564,0,8685,8687,5,383,0,0,
        8686,8670,1,0,0,0,8686,8671,1,0,0,0,8686,8672,1,0,0,0,8686,8673,
        1,0,0,0,8686,8674,1,0,0,0,8686,8675,1,0,0,0,8686,8677,1,0,0,0,8686,
        8679,1,0,0,0,8686,8681,1,0,0,0,8686,8683,1,0,0,0,8686,8685,1,0,0,
        0,8687,1131,1,0,0,0,8688,8689,5,2,0,0,8689,8690,3,1356,678,0,8690,
        8691,5,3,0,0,8691,8694,1,0,0,0,8692,8694,1,0,0,0,8693,8688,1,0,0,
        0,8693,8692,1,0,0,0,8694,1133,1,0,0,0,8695,8698,3,1138,569,0,8696,
        8698,3,1140,570,0,8697,8695,1,0,0,0,8697,8696,1,0,0,0,8698,1135,
        1,0,0,0,8699,8702,3,1138,569,0,8700,8702,3,1140,570,0,8701,8699,
        1,0,0,0,8701,8700,1,0,0,0,8702,1137,1,0,0,0,8703,8704,5,382,0,0,
        8704,8705,3,1148,574,0,8705,8706,5,2,0,0,8706,8707,3,1280,640,0,
        8707,8708,5,3,0,0,8708,1139,1,0,0,0,8709,8710,5,382,0,0,8710,8711,
        3,1148,574,0,8711,1141,1,0,0,0,8712,8717,3,1146,573,0,8713,8714,
        5,2,0,0,8714,8715,3,1356,678,0,8715,8716,5,3,0,0,8716,8718,1,0,0,
        0,8717,8713,1,0,0,0,8717,8718,1,0,0,0,8718,1143,1,0,0,0,8719,8724,
        3,1146,573,0,8720,8721,5,2,0,0,8721,8722,3,1356,678,0,8722,8723,
        5,3,0,0,8723,8725,1,0,0,0,8724,8720,1,0,0,0,8724,8725,1,0,0,0,8725,
        1145,1,0,0,0,8726,8727,7,43,0,0,8727,8733,3,1148,574,0,8728,8733,
        5,416,0,0,8729,8730,5,398,0,0,8730,8731,7,44,0,0,8731,8733,3,1148,
        574,0,8732,8726,1,0,0,0,8732,8728,1,0,0,0,8732,8729,1,0,0,0,8733,
        1147,1,0,0,0,8734,8737,5,367,0,0,8735,8737,1,0,0,0,8736,8734,1,0,
        0,0,8736,8735,1,0,0,0,8737,1149,1,0,0,0,8738,8743,7,45,0,0,8739,
        8740,5,2,0,0,8740,8741,3,1356,678,0,8741,8742,5,3,0,0,8742,8744,
        1,0,0,0,8743,8739,1,0,0,0,8743,8744,1,0,0,0,8744,8745,1,0,0,0,8745,
        8746,3,1154,577,0,8746,1151,1,0,0,0,8747,8748,5,396,0,0,8748,1153,
        1,0,0,0,8749,8750,5,105,0,0,8750,8751,5,411,0,0,8751,8757,5,379,
        0,0,8752,8753,5,372,0,0,8753,8754,5,411,0,0,8754,8757,5,379,0,0,
        8755,8757,1,0,0,0,8756,8749,1,0,0,0,8756,8752,1,0,0,0,8756,8755,
        1,0,0,0,8757,1155,1,0,0,0,8758,8785,5,377,0,0,8759,8785,5,257,0,
        0,8760,8785,5,176,0,0,8761,8785,5,218,0,0,8762,8785,5,254,0,0,8763,
        8785,3,1158,579,0,8764,8765,5,377,0,0,8765,8766,5,94,0,0,8766,8785,
        5,257,0,0,8767,8768,5,176,0,0,8768,8772,5,94,0,0,8769,8773,5,218,
        0,0,8770,8773,5,254,0,0,8771,8773,3,1158,579,0,8772,8769,1,0,0,0,
        8772,8770,1,0,0,0,8772,8771,1,0,0,0,8773,8785,1,0,0,0,8774,8775,
        5,218,0,0,8775,8778,5,94,0,0,8776,8779,5,254,0,0,8777,8779,3,1158,
        579,0,8778,8776,1,0,0,0,8778,8777,1,0,0,0,8779,8785,1,0,0,0,8780,
        8781,5,254,0,0,8781,8782,5,94,0,0,8782,8785,3,1158,579,0,8783,8785,
        1,0,0,0,8784,8758,1,0,0,0,8784,8759,1,0,0,0,8784,8760,1,0,0,0,8784,
        8761,1,0,0,0,8784,8762,1,0,0,0,8784,8763,1,0,0,0,8784,8764,1,0,0,
        0,8784,8767,1,0,0,0,8784,8774,1,0,0,0,8784,8780,1,0,0,0,8784,8783,
        1,0,0,0,8785,1157,1,0,0,0,8786,8791,5,319,0,0,8787,8788,5,2,0,0,
        8788,8789,3,1356,678,0,8789,8790,5,3,0,0,8790,8792,1,0,0,0,8791,
        8787,1,0,0,0,8791,8792,1,0,0,0,8792,1159,1,0,0,0,8793,8794,5,197,
        0,0,8794,8797,3,1162,581,0,8795,8797,1,0,0,0,8796,8793,1,0,0,0,8796,
        8795,1,0,0,0,8797,1161,1,0,0,0,8798,8799,3,1164,582,0,8799,1163,
        1,0,0,0,8800,8802,3,1166,583,0,8801,8803,3,1274,637,0,8802,8801,
        1,0,0,0,8802,8803,1,0,0,0,8803,1165,1,0,0,0,8804,8809,3,1168,584,
        0,8805,8806,7,46,0,0,8806,8808,3,1168,584,0,8807,8805,1,0,0,0,8808,
        8811,1,0,0,0,8809,8807,1,0,0,0,8809,8810,1,0,0,0,8810,1167,1,0,0,
        0,8811,8809,1,0,0,0,8812,8817,3,1170,585,0,8813,8814,5,82,0,0,8814,
        8816,3,1170,585,0,8815,8813,1,0,0,0,8816,8819,1,0,0,0,8817,8815,
        1,0,0,0,8817,8818,1,0,0,0,8818,1169,1,0,0,0,8819,8817,1,0,0,0,8820,
        8825,3,1172,586,0,8821,8822,5,33,0,0,8822,8824,3,1172,586,0,8823,
        8821,1,0,0,0,8824,8827,1,0,0,0,8825,8823,1,0,0,0,8825,8826,1,0,0,
        0,8826,1171,1,0,0,0,8827,8825,1,0,0,0,8828,8840,3,1174,587,0,8829,
        8831,5,77,0,0,8830,8829,1,0,0,0,8830,8831,1,0,0,0,8831,8832,1,0,
        0,0,8832,8834,5,380,0,0,8833,8835,5,91,0,0,8834,8833,1,0,0,0,8834,
        8835,1,0,0,0,8835,8836,1,0,0,0,8836,8837,3,1174,587,0,8837,8838,
        5,33,0,0,8838,8839,3,1174,587,0,8839,8841,1,0,0,0,8840,8830,1,0,
        0,0,8840,8841,1,0,0,0,8841,1173,1,0,0,0,8842,8848,3,1176,588,0,8843,
        8845,5,77,0,0,8844,8843,1,0,0,0,8844,8845,1,0,0,0,8845,8846,1,0,
        0,0,8846,8847,5,68,0,0,8847,8849,3,1306,653,0,8848,8844,1,0,0,0,
        8848,8849,1,0,0,0,8849,1175,1,0,0,0,8850,8852,5,77,0,0,8851,8850,
        1,0,0,0,8851,8852,1,0,0,0,8852,8853,1,0,0,0,8853,8854,3,1178,589,
        0,8854,1177,1,0,0,0,8855,8857,3,1180,590,0,8856,8858,7,47,0,0,8857,
        8856,1,0,0,0,8857,8858,1,0,0,0,8858,1179,1,0,0,0,8859,8883,3,1182,
        591,0,8860,8862,5,116,0,0,8861,8863,5,77,0,0,8862,8861,1,0,0,0,8862,
        8863,1,0,0,0,8863,8881,1,0,0,0,8864,8882,5,78,0,0,8865,8882,5,96,
        0,0,8866,8882,5,60,0,0,8867,8882,5,358,0,0,8868,8869,5,56,0,0,8869,
        8870,5,64,0,0,8870,8882,3,1162,581,0,8871,8872,5,268,0,0,8872,8873,
        5,2,0,0,8873,8874,3,1286,643,0,8874,8875,5,3,0,0,8875,8882,1,0,0,
        0,8876,8882,5,188,0,0,8877,8879,3,1296,648,0,8878,8877,1,0,0,0,8878,
        8879,1,0,0,0,8879,8880,1,0,0,0,8880,8882,5,478,0,0,8881,8864,1,0,
        0,0,8881,8865,1,0,0,0,8881,8866,1,0,0,0,8881,8867,1,0,0,0,8881,8868,
        1,0,0,0,8881,8871,1,0,0,0,8881,8876,1,0,0,0,8881,8878,1,0,0,0,8882,
        8884,1,0,0,0,8883,8860,1,0,0,0,8883,8884,1,0,0,0,8884,1181,1,0,0,
        0,8885,8897,3,1184,592,0,8886,8887,7,48,0,0,8887,8898,3,1184,592,
        0,8888,8889,3,1278,639,0,8889,8895,3,1268,634,0,8890,8896,3,962,
        481,0,8891,8892,5,2,0,0,8892,8893,3,1162,581,0,8893,8894,5,3,0,0,
        8894,8896,1,0,0,0,8895,8890,1,0,0,0,8895,8891,1,0,0,0,8896,8898,
        1,0,0,0,8897,8886,1,0,0,0,8897,8888,1,0,0,0,8897,8898,1,0,0,0,8898,
        1183,1,0,0,0,8899,8912,3,1186,593,0,8900,8902,5,77,0,0,8901,8900,
        1,0,0,0,8901,8902,1,0,0,0,8902,8907,1,0,0,0,8903,8908,5,120,0,0,
        8904,8908,5,114,0,0,8905,8906,5,127,0,0,8906,8908,5,94,0,0,8907,
        8903,1,0,0,0,8907,8904,1,0,0,0,8907,8905,1,0,0,0,8908,8909,1,0,0,
        0,8909,8910,3,1186,593,0,8910,8911,3,1160,580,0,8911,8913,1,0,0,
        0,8912,8901,1,0,0,0,8912,8913,1,0,0,0,8913,1185,1,0,0,0,8914,8920,
        3,1188,594,0,8915,8916,3,1274,637,0,8916,8917,3,1188,594,0,8917,
        8919,1,0,0,0,8918,8915,1,0,0,0,8919,8922,1,0,0,0,8920,8918,1,0,0,
        0,8920,8921,1,0,0,0,8921,1187,1,0,0,0,8922,8920,1,0,0,0,8923,8925,
        3,1274,637,0,8924,8923,1,0,0,0,8924,8925,1,0,0,0,8925,8926,1,0,0,
        0,8926,8927,3,1190,595,0,8927,1189,1,0,0,0,8928,8933,3,1192,596,
        0,8929,8930,7,49,0,0,8930,8932,3,1192,596,0,8931,8929,1,0,0,0,8932,
        8935,1,0,0,0,8933,8931,1,0,0,0,8933,8934,1,0,0,0,8934,1191,1,0,0,
        0,8935,8933,1,0,0,0,8936,8941,3,1194,597,0,8937,8938,7,50,0,0,8938,
        8940,3,1194,597,0,8939,8937,1,0,0,0,8940,8943,1,0,0,0,8941,8939,
        1,0,0,0,8941,8942,1,0,0,0,8942,1193,1,0,0,0,8943,8941,1,0,0,0,8944,
        8947,3,1196,598,0,8945,8946,5,15,0,0,8946,8948,3,1162,581,0,8947,
        8945,1,0,0,0,8947,8948,1,0,0,0,8948,1195,1,0,0,0,8949,8951,7,49,
        0,0,8950,8949,1,0,0,0,8950,8951,1,0,0,0,8951,8952,1,0,0,0,8952,8953,
        3,1198,599,0,8953,1197,1,0,0,0,8954,8959,3,1200,600,0,8955,8956,
        5,142,0,0,8956,8957,5,411,0,0,8957,8958,5,379,0,0,8958,8960,3,1162,
        581,0,8959,8955,1,0,0,0,8959,8960,1,0,0,0,8960,1199,1,0,0,0,8961,
        8964,3,1202,601,0,8962,8963,5,43,0,0,8963,8965,3,524,262,0,8964,
        8962,1,0,0,0,8964,8965,1,0,0,0,8965,1201,1,0,0,0,8966,8971,3,1206,
        603,0,8967,8968,5,26,0,0,8968,8970,3,1118,559,0,8969,8967,1,0,0,
        0,8970,8973,1,0,0,0,8971,8969,1,0,0,0,8971,8972,1,0,0,0,8972,1203,
        1,0,0,0,8973,8971,1,0,0,0,8974,8975,6,602,-1,0,8975,8982,3,1206,
        603,0,8976,8977,7,49,0,0,8977,8982,3,1204,602,9,8978,8979,3,1274,
        637,0,8979,8980,3,1204,602,3,8980,8982,1,0,0,0,8981,8974,1,0,0,0,
        8981,8976,1,0,0,0,8981,8978,1,0,0,0,8982,9022,1,0,0,0,8983,8984,
        10,8,0,0,8984,8985,5,15,0,0,8985,9021,3,1204,602,9,8986,8987,10,
        7,0,0,8987,8988,7,50,0,0,8988,9021,3,1204,602,8,8989,8990,10,6,0,
        0,8990,8991,7,49,0,0,8991,9021,3,1204,602,7,8992,8993,10,5,0,0,8993,
        8994,3,1274,637,0,8994,8995,3,1204,602,6,8995,9021,1,0,0,0,8996,
        8997,10,4,0,0,8997,8998,7,48,0,0,8998,9021,3,1204,602,5,8999,9000,
        10,10,0,0,9000,9001,5,26,0,0,9001,9021,3,1118,559,0,9002,9003,10,
        2,0,0,9003,9021,3,1274,637,0,9004,9005,10,1,0,0,9005,9007,5,116,
        0,0,9006,9008,5,77,0,0,9007,9006,1,0,0,0,9007,9008,1,0,0,0,9008,
        9018,1,0,0,0,9009,9010,5,56,0,0,9010,9011,5,64,0,0,9011,9019,3,1204,
        602,0,9012,9013,5,268,0,0,9013,9014,5,2,0,0,9014,9015,3,1286,643,
        0,9015,9016,5,3,0,0,9016,9019,1,0,0,0,9017,9019,5,188,0,0,9018,9009,
        1,0,0,0,9018,9012,1,0,0,0,9018,9017,1,0,0,0,9019,9021,1,0,0,0,9020,
        8983,1,0,0,0,9020,8986,1,0,0,0,9020,8989,1,0,0,0,9020,8992,1,0,0,
        0,9020,8996,1,0,0,0,9020,8999,1,0,0,0,9020,9002,1,0,0,0,9020,9004,
        1,0,0,0,9021,9024,1,0,0,0,9022,9020,1,0,0,0,9022,9023,1,0,0,0,9023,
        1205,1,0,0,0,9024,9022,1,0,0,0,9025,9026,5,389,0,0,9026,9062,3,962,
        481,0,9027,9030,5,35,0,0,9028,9031,3,962,481,0,9029,9031,3,1288,
        644,0,9030,9028,1,0,0,0,9030,9029,1,0,0,0,9031,9062,1,0,0,0,9032,
        9033,5,28,0,0,9033,9062,3,1326,663,0,9034,9035,5,470,0,0,9035,9036,
        5,2,0,0,9036,9037,3,1280,640,0,9037,9038,5,3,0,0,9038,9062,1,0,0,
        0,9039,9040,5,98,0,0,9040,9062,3,962,481,0,9041,9062,3,1318,659,
        0,9042,9062,3,1348,674,0,9043,9062,3,1208,604,0,9044,9045,5,2,0,
        0,9045,9046,3,1162,581,0,9046,9047,5,3,0,0,9047,9048,3,1326,663,
        0,9048,9062,1,0,0,0,9049,9062,3,1308,654,0,9050,9062,3,1212,606,
        0,9051,9053,3,962,481,0,9052,9054,3,1324,662,0,9053,9052,1,0,0,0,
        9053,9054,1,0,0,0,9054,9062,1,0,0,0,9055,9062,3,1264,632,0,9056,
        9062,3,1266,633,0,9057,9058,3,1262,631,0,9058,9059,5,125,0,0,9059,
        9060,3,1262,631,0,9060,9062,1,0,0,0,9061,9025,1,0,0,0,9061,9027,
        1,0,0,0,9061,9032,1,0,0,0,9061,9034,1,0,0,0,9061,9039,1,0,0,0,9061,
        9041,1,0,0,0,9061,9042,1,0,0,0,9061,9043,1,0,0,0,9061,9044,1,0,0,
        0,9061,9049,1,0,0,0,9061,9050,1,0,0,0,9061,9051,1,0,0,0,9061,9055,
        1,0,0,0,9061,9056,1,0,0,0,9061,9057,1,0,0,0,9062,1207,1,0,0,0,9063,
        9064,5,661,0,0,9064,1209,1,0,0,0,9065,9066,3,1346,673,0,9066,9085,
        5,2,0,0,9067,9071,3,1282,641,0,9068,9069,5,6,0,0,9069,9070,5,101,
        0,0,9070,9072,3,1284,642,0,9071,9068,1,0,0,0,9071,9072,1,0,0,0,9072,
        9073,1,0,0,0,9073,9074,3,996,498,0,9074,9086,1,0,0,0,9075,9076,5,
        101,0,0,9076,9077,3,1284,642,0,9077,9078,3,996,498,0,9078,9086,1,
        0,0,0,9079,9080,7,51,0,0,9080,9081,3,1282,641,0,9081,9082,3,996,
        498,0,9082,9086,1,0,0,0,9083,9086,5,9,0,0,9084,9086,1,0,0,0,9085,
        9067,1,0,0,0,9085,9075,1,0,0,0,9085,9079,1,0,0,0,9085,9083,1,0,0,
        0,9085,9084,1,0,0,0,9086,9087,1,0,0,0,9087,9088,5,3,0,0,9088,1211,
        1,0,0,0,9089,9090,3,1210,605,0,9090,9091,3,1236,618,0,9091,9092,
        3,1238,619,0,9092,9093,3,1246,623,0,9093,9096,1,0,0,0,9094,9096,
        3,1216,608,0,9095,9089,1,0,0,0,9095,9094,1,0,0,0,9096,1213,1,0,0,
        0,9097,9100,3,1210,605,0,9098,9100,3,1216,608,0,9099,9097,1,0,0,
        0,9099,9098,1,0,0,0,9100,1215,1,0,0,0,9101,9102,5,108,0,0,9102,9103,
        5,62,0,0,9103,9104,5,2,0,0,9104,9105,3,1162,581,0,9105,9106,5,3,
        0,0,9106,9279,1,0,0,0,9107,9279,5,48,0,0,9108,9113,5,50,0,0,9109,
        9110,5,2,0,0,9110,9111,3,1356,678,0,9111,9112,5,3,0,0,9112,9114,
        1,0,0,0,9113,9109,1,0,0,0,9113,9114,1,0,0,0,9114,9279,1,0,0,0,9115,
        9120,5,51,0,0,9116,9117,5,2,0,0,9117,9118,3,1356,678,0,9118,9119,
        5,3,0,0,9119,9121,1,0,0,0,9120,9116,1,0,0,0,9120,9121,1,0,0,0,9121,
        9279,1,0,0,0,9122,9127,5,75,0,0,9123,9124,5,2,0,0,9124,9125,3,1356,
        678,0,9125,9126,5,3,0,0,9126,9128,1,0,0,0,9127,9123,1,0,0,0,9127,
        9128,1,0,0,0,9128,9279,1,0,0,0,9129,9134,5,76,0,0,9130,9131,5,2,
        0,0,9131,9132,3,1356,678,0,9132,9133,5,3,0,0,9133,9135,1,0,0,0,9134,
        9130,1,0,0,0,9134,9135,1,0,0,0,9135,9279,1,0,0,0,9136,9279,5,49,
        0,0,9137,9279,5,52,0,0,9138,9279,5,89,0,0,9139,9279,5,99,0,0,9140,
        9279,5,47,0,0,9141,9279,5,111,0,0,9142,9143,5,41,0,0,9143,9144,5,
        2,0,0,9144,9145,3,1162,581,0,9145,9146,5,36,0,0,9146,9147,3,1118,
        559,0,9147,9148,5,3,0,0,9148,9279,1,0,0,0,9149,9150,5,390,0,0,9150,
        9151,5,2,0,0,9151,9152,3,1292,646,0,9152,9153,5,3,0,0,9153,9279,
        1,0,0,0,9154,9155,5,489,0,0,9155,9156,5,2,0,0,9156,9159,3,1162,581,
        0,9157,9158,5,6,0,0,9158,9160,3,1296,648,0,9159,9157,1,0,0,0,9159,
        9160,1,0,0,0,9160,9161,1,0,0,0,9161,9162,5,3,0,0,9162,9279,1,0,0,
        0,9163,9164,5,403,0,0,9164,9165,5,2,0,0,9165,9166,3,1298,649,0,9166,
        9167,5,3,0,0,9167,9279,1,0,0,0,9168,9169,5,404,0,0,9169,9170,5,2,
        0,0,9170,9171,3,1300,650,0,9171,9172,5,3,0,0,9172,9279,1,0,0,0,9173,
        9174,5,410,0,0,9174,9175,5,2,0,0,9175,9176,3,1302,651,0,9176,9177,
        5,3,0,0,9177,9279,1,0,0,0,9178,9179,5,413,0,0,9179,9180,5,2,0,0,
        9180,9181,3,1162,581,0,9181,9182,5,36,0,0,9182,9183,3,1118,559,0,
        9183,9184,5,3,0,0,9184,9279,1,0,0,0,9185,9186,5,414,0,0,9186,9188,
        5,2,0,0,9187,9189,7,52,0,0,9188,9187,1,0,0,0,9188,9189,1,0,0,0,9189,
        9190,1,0,0,0,9190,9191,3,1304,652,0,9191,9192,5,3,0,0,9192,9279,
        1,0,0,0,9193,9194,5,401,0,0,9194,9195,5,2,0,0,9195,9196,3,1162,581,
        0,9196,9197,5,6,0,0,9197,9198,3,1162,581,0,9198,9199,5,3,0,0,9199,
        9279,1,0,0,0,9200,9201,5,386,0,0,9201,9202,5,2,0,0,9202,9203,3,1280,
        640,0,9203,9204,5,3,0,0,9204,9279,1,0,0,0,9205,9206,5,392,0,0,9206,
        9207,5,2,0,0,9207,9208,3,1280,640,0,9208,9209,5,3,0,0,9209,9279,
        1,0,0,0,9210,9211,5,397,0,0,9211,9212,5,2,0,0,9212,9213,3,1280,640,
        0,9213,9214,5,3,0,0,9214,9279,1,0,0,0,9215,9216,5,425,0,0,9216,9217,
        5,2,0,0,9217,9218,3,1280,640,0,9218,9219,5,3,0,0,9219,9279,1,0,0,
        0,9220,9221,5,426,0,0,9221,9222,5,2,0,0,9222,9223,5,259,0,0,9223,
        9229,3,1380,690,0,9224,9227,5,6,0,0,9225,9228,3,1222,611,0,9226,
        9228,3,1280,640,0,9227,9225,1,0,0,0,9227,9226,1,0,0,0,9228,9230,
        1,0,0,0,9229,9224,1,0,0,0,9229,9230,1,0,0,0,9230,9231,1,0,0,0,9231,
        9232,5,3,0,0,9232,9279,1,0,0,0,9233,9234,5,427,0,0,9234,9235,5,2,
        0,0,9235,9236,3,1206,603,0,9236,9237,3,1232,616,0,9237,9238,5,3,
        0,0,9238,9279,1,0,0,0,9239,9240,5,428,0,0,9240,9241,5,2,0,0,9241,
        9242,3,1224,612,0,9242,9243,5,3,0,0,9243,9279,1,0,0,0,9244,9245,
        5,429,0,0,9245,9246,5,2,0,0,9246,9247,3,1228,614,0,9247,9248,3,1162,
        581,0,9248,9249,3,1230,615,0,9249,9250,5,3,0,0,9250,9279,1,0,0,0,
        9251,9252,5,430,0,0,9252,9253,5,2,0,0,9253,9254,5,259,0,0,9254,9257,
        3,1380,690,0,9255,9256,5,6,0,0,9256,9258,3,1162,581,0,9257,9255,
        1,0,0,0,9257,9258,1,0,0,0,9258,9259,1,0,0,0,9259,9260,5,3,0,0,9260,
        9279,1,0,0,0,9261,9262,5,431,0,0,9262,9263,5,2,0,0,9263,9264,5,376,
        0,0,9264,9265,3,1162,581,0,9265,9266,5,6,0,0,9266,9267,3,1218,609,
        0,9267,9268,3,1220,610,0,9268,9269,5,3,0,0,9269,9279,1,0,0,0,9270,
        9271,5,432,0,0,9271,9272,5,2,0,0,9272,9273,3,1228,614,0,9273,9274,
        3,1162,581,0,9274,9275,5,36,0,0,9275,9276,3,1122,561,0,9276,9277,
        5,3,0,0,9277,9279,1,0,0,0,9278,9101,1,0,0,0,9278,9107,1,0,0,0,9278,
        9108,1,0,0,0,9278,9115,1,0,0,0,9278,9122,1,0,0,0,9278,9129,1,0,0,
        0,9278,9136,1,0,0,0,9278,9137,1,0,0,0,9278,9138,1,0,0,0,9278,9139,
        1,0,0,0,9278,9140,1,0,0,0,9278,9141,1,0,0,0,9278,9142,1,0,0,0,9278,
        9149,1,0,0,0,9278,9154,1,0,0,0,9278,9163,1,0,0,0,9278,9168,1,0,0,
        0,9278,9173,1,0,0,0,9278,9178,1,0,0,0,9278,9185,1,0,0,0,9278,9193,
        1,0,0,0,9278,9200,1,0,0,0,9278,9205,1,0,0,0,9278,9210,1,0,0,0,9278,
        9215,1,0,0,0,9278,9220,1,0,0,0,9278,9233,1,0,0,0,9278,9239,1,0,0,
        0,9278,9244,1,0,0,0,9278,9251,1,0,0,0,9278,9261,1,0,0,0,9278,9270,
        1,0,0,0,9279,1217,1,0,0,0,9280,9281,5,368,0,0,9281,9286,3,1162,581,
        0,9282,9283,5,368,0,0,9283,9284,5,262,0,0,9284,9286,5,450,0,0,9285,
        9280,1,0,0,0,9285,9282,1,0,0,0,9286,1219,1,0,0,0,9287,9288,5,6,0,
        0,9288,9289,5,332,0,0,9289,9299,5,378,0,0,9290,9291,5,6,0,0,9291,
        9292,5,332,0,0,9292,9299,5,262,0,0,9293,9294,5,6,0,0,9294,9295,5,
        332,0,0,9295,9296,5,262,0,0,9296,9299,5,450,0,0,9297,9299,1,0,0,
        0,9298,9287,1,0,0,0,9298,9290,1,0,0,0,9298,9293,1,0,0,0,9298,9297,
        1,0,0,0,9299,1221,1,0,0,0,9300,9301,5,417,0,0,9301,9302,5,2,0,0,
        9302,9303,3,1224,612,0,9303,9304,5,3,0,0,9304,1223,1,0,0,0,9305,
        9310,3,1226,613,0,9306,9307,5,6,0,0,9307,9309,3,1226,613,0,9308,
        9306,1,0,0,0,9309,9312,1,0,0,0,9310,9308,1,0,0,0,9310,9311,1,0,0,
        0,9311,1225,1,0,0,0,9312,9310,1,0,0,0,9313,9316,3,1162,581,0,9314,
        9315,5,36,0,0,9315,9317,3,1380,690,0,9316,9314,1,0,0,0,9316,9317,
        1,0,0,0,9317,1227,1,0,0,0,9318,9319,7,53,0,0,9319,1229,1,0,0,0,9320,
        9321,5,285,0,0,9321,9326,5,371,0,0,9322,9323,5,340,0,0,9323,9326,
        5,371,0,0,9324,9326,1,0,0,0,9325,9320,1,0,0,0,9325,9322,1,0,0,0,
        9325,9324,1,0,0,0,9326,1231,1,0,0,0,9327,9328,5,279,0,0,9328,9343,
        3,1206,603,0,9329,9330,5,279,0,0,9330,9331,3,1206,603,0,9331,9332,
        3,1234,617,0,9332,9343,1,0,0,0,9333,9334,5,279,0,0,9334,9335,3,1234,
        617,0,9335,9336,3,1206,603,0,9336,9343,1,0,0,0,9337,9338,5,279,0,
        0,9338,9339,3,1234,617,0,9339,9340,3,1206,603,0,9340,9341,3,1234,
        617,0,9341,9343,1,0,0,0,9342,9327,1,0,0,0,9342,9329,1,0,0,0,9342,
        9333,1,0,0,0,9342,9337,1,0,0,0,9343,1233,1,0,0,0,9344,9345,5,147,
        0,0,9345,9346,7,54,0,0,9346,1235,1,0,0,0,9347,9348,5,479,0,0,9348,
        9349,5,66,0,0,9349,9350,5,2,0,0,9350,9351,3,998,499,0,9351,9352,
        5,3,0,0,9352,9355,1,0,0,0,9353,9355,1,0,0,0,9354,9347,1,0,0,0,9354,
        9353,1,0,0,0,9355,1237,1,0,0,0,9356,9357,5,480,0,0,9357,9358,5,2,
        0,0,9358,9359,5,103,0,0,9359,9360,3,1162,581,0,9360,9361,5,3,0,0,
        9361,9364,1,0,0,0,9362,9364,1,0,0,0,9363,9356,1,0,0,0,9363,9362,
        1,0,0,0,9364,1239,1,0,0,0,9365,9366,5,104,0,0,9366,9369,3,1242,621,
        0,9367,9369,1,0,0,0,9368,9365,1,0,0,0,9368,9367,1,0,0,0,9369,1241,
        1,0,0,0,9370,9375,3,1244,622,0,9371,9372,5,6,0,0,9372,9374,3,1244,
        622,0,9373,9371,1,0,0,0,9374,9377,1,0,0,0,9375,9373,1,0,0,0,9375,
        9376,1,0,0,0,9376,1243,1,0,0,0,9377,9375,1,0,0,0,9378,9379,3,1372,
        686,0,9379,9380,5,36,0,0,9380,9381,3,1248,624,0,9381,1245,1,0,0,
        0,9382,9385,5,124,0,0,9383,9386,3,1248,624,0,9384,9386,3,1372,686,
        0,9385,9383,1,0,0,0,9385,9384,1,0,0,0,9386,9389,1,0,0,0,9387,9389,
        1,0,0,0,9388,9382,1,0,0,0,9388,9387,1,0,0,0,9389,1247,1,0,0,0,9390,
        9391,5,2,0,0,9391,9392,3,1250,625,0,9392,9393,3,1252,626,0,9393,
        9394,3,996,498,0,9394,9395,3,1254,627,0,9395,9396,5,3,0,0,9396,1249,
        1,0,0,0,9397,9400,3,1372,686,0,9398,9400,1,0,0,0,9399,9397,1,0,0,
        0,9399,9398,1,0,0,0,9400,1251,1,0,0,0,9401,9402,5,278,0,0,9402,9403,
        5,147,0,0,9403,9406,3,1280,640,0,9404,9406,1,0,0,0,9405,9401,1,0,
        0,0,9405,9404,1,0,0,0,9406,1253,1,0,0,0,9407,9408,5,292,0,0,9408,
        9409,3,1256,628,0,9409,9410,3,1260,630,0,9410,9421,1,0,0,0,9411,
        9412,5,313,0,0,9412,9413,3,1256,628,0,9413,9414,3,1260,630,0,9414,
        9421,1,0,0,0,9415,9416,5,481,0,0,9416,9417,3,1256,628,0,9417,9418,
        3,1260,630,0,9418,9421,1,0,0,0,9419,9421,1,0,0,0,9420,9407,1,0,0,
        0,9420,9411,1,0,0,0,9420,9415,1,0,0,0,9420,9419,1,0,0,0,9421,1255,
        1,0,0,0,9422,9429,3,1258,629,0,9423,9424,5,380,0,0,9424,9425,3,1258,
        629,0,9425,9426,5,33,0,0,9426,9427,3,1258,629,0,9427,9429,1,0,0,
        0,9428,9422,1,0,0,0,9428,9423,1,0,0,0,9429,1257,1,0,0,0,9430,9431,
        5,355,0,0,9431,9438,7,55,0,0,9432,9433,5,434,0,0,9433,9438,5,407,
        0,0,9434,9435,3,1162,581,0,9435,9436,7,55,0,0,9436,9438,1,0,0,0,
        9437,9430,1,0,0,0,9437,9432,1,0,0,0,9437,9434,1,0,0,0,9438,1259,
        1,0,0,0,9439,9446,5,199,0,0,9440,9441,5,434,0,0,9441,9447,5,407,
        0,0,9442,9447,5,66,0,0,9443,9447,5,467,0,0,9444,9445,5,262,0,0,9445,
        9447,5,482,0,0,9446,9440,1,0,0,0,9446,9442,1,0,0,0,9446,9443,1,0,
        0,0,9446,9444,1,0,0,0,9447,9450,1,0,0,0,9448,9450,1,0,0,0,9449,9439,
        1,0,0,0,9449,9448,1,0,0,0,9450,1261,1,0,0,0,9451,9452,5,407,0,0,
        9452,9454,5,2,0,0,9453,9455,3,1280,640,0,9454,9453,1,0,0,0,9454,
        9455,1,0,0,0,9455,9456,1,0,0,0,9456,9464,5,3,0,0,9457,9458,5,2,0,
        0,9458,9459,3,1280,640,0,9459,9460,5,6,0,0,9460,9461,3,1162,581,
        0,9461,9462,5,3,0,0,9462,9464,1,0,0,0,9463,9451,1,0,0,0,9463,9457,
        1,0,0,0,9464,1263,1,0,0,0,9465,9466,5,407,0,0,9466,9468,5,2,0,0,
        9467,9469,3,1280,640,0,9468,9467,1,0,0,0,9468,9469,1,0,0,0,9469,
        9470,1,0,0,0,9470,9471,5,3,0,0,9471,1265,1,0,0,0,9472,9473,5,2,0,
        0,9473,9474,3,1280,640,0,9474,9475,5,6,0,0,9475,9476,3,1162,581,
        0,9476,9477,5,3,0,0,9477,1267,1,0,0,0,9478,9479,7,56,0,0,9479,1269,
        1,0,0,0,9480,9483,5,29,0,0,9481,9483,3,1272,636,0,9482,9480,1,0,
        0,0,9482,9481,1,0,0,0,9483,1271,1,0,0,0,9484,9485,7,57,0,0,9485,
        1273,1,0,0,0,9486,9493,5,29,0,0,9487,9488,5,271,0,0,9488,9489,5,
        2,0,0,9489,9490,3,684,342,0,9490,9491,5,3,0,0,9491,9493,1,0,0,0,
        9492,9486,1,0,0,0,9492,9487,1,0,0,0,9493,1275,1,0,0,0,9494,9501,
        3,1270,635,0,9495,9496,5,271,0,0,9496,9497,5,2,0,0,9497,9498,3,684,
        342,0,9498,9499,5,3,0,0,9499,9501,1,0,0,0,9500,9494,1,0,0,0,9500,
        9495,1,0,0,0,9501,1277,1,0,0,0,9502,9515,3,1270,635,0,9503,9504,
        5,271,0,0,9504,9505,5,2,0,0,9505,9506,3,684,342,0,9506,9507,5,3,
        0,0,9507,9515,1,0,0,0,9508,9515,5,120,0,0,9509,9510,5,77,0,0,9510,
        9515,5,120,0,0,9511,9515,5,114,0,0,9512,9513,5,77,0,0,9513,9515,
        5,114,0,0,9514,9502,1,0,0,0,9514,9503,1,0,0,0,9514,9508,1,0,0,0,
        9514,9509,1,0,0,0,9514,9511,1,0,0,0,9514,9512,1,0,0,0,9515,1279,
        1,0,0,0,9516,9521,3,1162,581,0,9517,9518,5,6,0,0,9518,9520,3,1162,
        581,0,9519,9517,1,0,0,0,9520,9523,1,0,0,0,9521,9519,1,0,0,0,9521,
        9522,1,0,0,0,9522,1281,1,0,0,0,9523,9521,1,0,0,0,9524,9529,3,1284,
        642,0,9525,9526,5,6,0,0,9526,9528,3,1284,642,0,9527,9525,1,0,0,0,
        9528,9531,1,0,0,0,9529,9527,1,0,0,0,9529,9530,1,0,0,0,9530,1283,
        1,0,0,0,9531,9529,1,0,0,0,9532,9538,3,1162,581,0,9533,9534,3,636,
        318,0,9534,9535,7,58,0,0,9535,9536,3,1162,581,0,9536,9538,1,0,0,
        0,9537,9532,1,0,0,0,9537,9533,1,0,0,0,9538,1285,1,0,0,0,9539,9544,
        3,1118,559,0,9540,9541,5,6,0,0,9541,9543,3,1118,559,0,9542,9540,
        1,0,0,0,9543,9546,1,0,0,0,9544,9542,1,0,0,0,9544,9545,1,0,0,0,9545,
        1287,1,0,0,0,9546,9544,1,0,0,0,9547,9550,5,4,0,0,9548,9551,3,1280,
        640,0,9549,9551,3,1290,645,0,9550,9548,1,0,0,0,9550,9549,1,0,0,0,
        9550,9551,1,0,0,0,9551,9552,1,0,0,0,9552,9553,5,5,0,0,9553,1289,
        1,0,0,0,9554,9559,3,1288,644,0,9555,9556,5,6,0,0,9556,9558,3,1288,
        644,0,9557,9555,1,0,0,0,9558,9561,1,0,0,0,9559,9557,1,0,0,0,9559,
        9560,1,0,0,0,9560,1291,1,0,0,0,9561,9559,1,0,0,0,9562,9563,3,1294,
        647,0,9563,9564,5,64,0,0,9564,9565,3,1162,581,0,9565,9568,1,0,0,
        0,9566,9568,1,0,0,0,9567,9562,1,0,0,0,9567,9566,1,0,0,0,9568,1293,
        1,0,0,0,9569,9578,3,1382,691,0,9570,9578,5,377,0,0,9571,9578,5,257,
        0,0,9572,9578,5,176,0,0,9573,9578,5,218,0,0,9574,9578,5,254,0,0,
        9575,9578,5,319,0,0,9576,9578,3,1358,679,0,9577,9569,1,0,0,0,9577,
        9570,1,0,0,0,9577,9571,1,0,0,0,9577,9572,1,0,0,0,9577,9573,1,0,0,
        0,9577,9574,1,0,0,0,9577,9575,1,0,0,0,9577,9576,1,0,0,0,9578,1295,
        1,0,0,0,9579,9580,7,59,0,0,9580,1297,1,0,0,0,9581,9582,3,1162,581,
        0,9582,9583,5,84,0,0,9583,9584,3,1162,581,0,9584,9585,5,64,0,0,9585,
        9588,3,1162,581,0,9586,9587,5,62,0,0,9587,9589,3,1162,581,0,9588,
        9586,1,0,0,0,9588,9589,1,0,0,0,9589,1299,1,0,0,0,9590,9591,3,1204,
        602,0,9591,9592,5,68,0,0,9592,9593,3,1204,602,0,9593,9596,1,0,0,
        0,9594,9596,1,0,0,0,9595,9590,1,0,0,0,9595,9594,1,0,0,0,9596,1301,
        1,0,0,0,9597,9598,3,1162,581,0,9598,9599,5,64,0,0,9599,9600,3,1162,
        581,0,9600,9601,5,62,0,0,9601,9602,3,1162,581,0,9602,9625,1,0,0,
        0,9603,9604,3,1162,581,0,9604,9605,5,62,0,0,9605,9606,3,1162,581,
        0,9606,9607,5,64,0,0,9607,9608,3,1162,581,0,9608,9625,1,0,0,0,9609,
        9610,3,1162,581,0,9610,9611,5,64,0,0,9611,9612,3,1162,581,0,9612,
        9625,1,0,0,0,9613,9614,3,1162,581,0,9614,9615,5,62,0,0,9615,9616,
        3,1162,581,0,9616,9625,1,0,0,0,9617,9618,3,1162,581,0,9618,9619,
        5,127,0,0,9619,9620,3,1162,581,0,9620,9621,5,197,0,0,9621,9622,3,
        1162,581,0,9622,9625,1,0,0,0,9623,9625,3,1280,640,0,9624,9597,1,
        0,0,0,9624,9603,1,0,0,0,9624,9609,1,0,0,0,9624,9613,1,0,0,0,9624,
        9617,1,0,0,0,9624,9623,1,0,0,0,9625,1303,1,0,0,0,9626,9627,3,1162,
        581,0,9627,9628,5,64,0,0,9628,9629,3,1280,640,0,9629,9634,1,0,0,
        0,9630,9631,5,64,0,0,9631,9634,3,1280,640,0,9632,9634,3,1280,640,
        0,9633,9626,1,0,0,0,9633,9630,1,0,0,0,9633,9632,1,0,0,0,9634,1305,
        1,0,0,0,9635,9641,3,962,481,0,9636,9637,5,2,0,0,9637,9638,3,1280,
        640,0,9638,9639,5,3,0,0,9639,9641,1,0,0,0,9640,9635,1,0,0,0,9640,
        9636,1,0,0,0,9641,1307,1,0,0,0,9642,9643,5,40,0,0,9643,9644,3,1316,
        658,0,9644,9645,3,1310,655,0,9645,9646,3,1314,657,0,9646,9647,5,
        454,0,0,9647,1309,1,0,0,0,9648,9650,3,1312,656,0,9649,9648,1,0,0,
        0,9650,9651,1,0,0,0,9651,9649,1,0,0,0,9651,9652,1,0,0,0,9652,1311,
        1,0,0,0,9653,9654,5,102,0,0,9654,9655,3,1162,581,0,9655,9656,5,93,
        0,0,9656,9657,3,1162,581,0,9657,1313,1,0,0,0,9658,9659,5,58,0,0,
        9659,9662,3,1162,581,0,9660,9662,1,0,0,0,9661,9658,1,0,0,0,9661,
        9660,1,0,0,0,9662,1315,1,0,0,0,9663,9666,3,1162,581,0,9664,9666,
        1,0,0,0,9665,9663,1,0,0,0,9665,9664,1,0,0,0,9666,1317,1,0,0,0,9667,
        9669,3,1372,686,0,9668,9670,3,1324,662,0,9669,9668,1,0,0,0,9669,
        9670,1,0,0,0,9670,1319,1,0,0,0,9671,9674,5,11,0,0,9672,9675,3,1342,
        671,0,9673,9675,5,9,0,0,9674,9672,1,0,0,0,9674,9673,1,0,0,0,9675,
        9687,1,0,0,0,9676,9682,5,4,0,0,9677,9683,3,1162,581,0,9678,9679,
        3,1322,661,0,9679,9680,5,8,0,0,9680,9681,3,1322,661,0,9681,9683,
        1,0,0,0,9682,9677,1,0,0,0,9682,9678,1,0,0,0,9683,9684,1,0,0,0,9684,
        9685,5,5,0,0,9685,9687,1,0,0,0,9686,9671,1,0,0,0,9686,9676,1,0,0,
        0,9687,1321,1,0,0,0,9688,9691,3,1162,581,0,9689,9691,1,0,0,0,9690,
        9688,1,0,0,0,9690,9689,1,0,0,0,9691,1323,1,0,0,0,9692,9694,3,1320,
        660,0,9693,9692,1,0,0,0,9694,9695,1,0,0,0,9695,9693,1,0,0,0,9695,
        9696,1,0,0,0,9696,1325,1,0,0,0,9697,9699,3,1320,660,0,9698,9697,
        1,0,0,0,9699,9702,1,0,0,0,9700,9698,1,0,0,0,9700,9701,1,0,0,0,9701,
        1327,1,0,0,0,9702,9700,1,0,0,0,9703,9706,3,1330,665,0,9704,9706,
        1,0,0,0,9705,9703,1,0,0,0,9705,9704,1,0,0,0,9706,1329,1,0,0,0,9707,
        9712,3,1332,666,0,9708,9709,5,6,0,0,9709,9711,3,1332,666,0,9710,
        9708,1,0,0,0,9711,9714,1,0,0,0,9712,9710,1,0,0,0,9712,9713,1,0,0,
        0,9713,1331,1,0,0,0,9714,9712,1,0,0,0,9715,9720,3,1162,581,0,9716,
        9717,5,36,0,0,9717,9721,3,1380,690,0,9718,9721,3,1382,691,0,9719,
        9721,1,0,0,0,9720,9716,1,0,0,0,9720,9718,1,0,0,0,9720,9719,1,0,0,
        0,9721,9724,1,0,0,0,9722,9724,5,9,0,0,9723,9715,1,0,0,0,9723,9722,
        1,0,0,0,9724,1333,1,0,0,0,9725,9730,3,1336,668,0,9726,9727,5,6,0,
        0,9727,9729,3,1336,668,0,9728,9726,1,0,0,0,9729,9732,1,0,0,0,9730,
        9728,1,0,0,0,9730,9731,1,0,0,0,9731,1335,1,0,0,0,9732,9730,1,0,0,
        0,9733,9735,3,1372,686,0,9734,9736,3,1324,662,0,9735,9734,1,0,0,
        0,9735,9736,1,0,0,0,9736,1337,1,0,0,0,9737,9742,3,1340,670,0,9738,
        9739,5,6,0,0,9739,9741,3,1340,670,0,9740,9738,1,0,0,0,9741,9744,
        1,0,0,0,9742,9740,1,0,0,0,9742,9743,1,0,0,0,9743,1339,1,0,0,0,9744,
        9742,1,0,0,0,9745,9746,3,1372,686,0,9746,1341,1,0,0,0,9747,9748,
        3,1380,690,0,9748,1343,1,0,0,0,9749,9750,3,1358,679,0,9750,1345,
        1,0,0,0,9751,9759,3,1394,697,0,9752,9759,3,1376,688,0,9753,9754,
        3,1372,686,0,9754,9755,3,1324,662,0,9755,9759,1,0,0,0,9756,9759,
        5,119,0,0,9757,9759,5,126,0,0,9758,9751,1,0,0,0,9758,9752,1,0,0,
        0,9758,9753,1,0,0,0,9758,9756,1,0,0,0,9758,9757,1,0,0,0,9759,1347,
        1,0,0,0,9760,9793,3,1356,678,0,9761,9793,3,1354,677,0,9762,9793,
        3,1358,679,0,9763,9793,3,1352,676,0,9764,9793,3,1350,675,0,9765,
        9773,3,1346,673,0,9766,9774,3,1358,679,0,9767,9768,5,2,0,0,9768,
        9769,3,1282,641,0,9769,9770,3,996,498,0,9770,9771,5,3,0,0,9771,9772,
        3,1358,679,0,9772,9774,1,0,0,0,9773,9766,1,0,0,0,9773,9767,1,0,0,
        0,9774,9793,1,0,0,0,9775,9776,3,1124,562,0,9776,9777,3,1358,679,
        0,9777,9793,1,0,0,0,9778,9787,3,1152,576,0,9779,9780,3,1358,679,
        0,9780,9781,3,1156,578,0,9781,9788,1,0,0,0,9782,9783,5,2,0,0,9783,
        9784,3,1356,678,0,9784,9785,5,3,0,0,9785,9786,3,1358,679,0,9786,
        9788,1,0,0,0,9787,9779,1,0,0,0,9787,9782,1,0,0,0,9788,9793,1,0,0,
        0,9789,9793,5,96,0,0,9790,9793,5,60,0,0,9791,9793,5,78,0,0,9792,
        9760,1,0,0,0,9792,9761,1,0,0,0,9792,9762,1,0,0,0,9792,9763,1,0,0,
        0,9792,9764,1,0,0,0,9792,9765,1,0,0,0,9792,9775,1,0,0,0,9792,9778,
        1,0,0,0,9792,9789,1,0,0,0,9792,9790,1,0,0,0,9792,9791,1,0,0,0,9793,
        1349,1,0,0,0,9794,9795,5,654,0,0,9795,1351,1,0,0,0,9796,9797,5,650,
        0,0,9797,1353,1,0,0,0,9798,9799,5,660,0,0,9799,1355,1,0,0,0,9800,
        9801,5,658,0,0,9801,1357,1,0,0,0,9802,9803,3,1360,680,0,9803,9804,
        3,1362,681,0,9804,1359,1,0,0,0,9805,9817,5,645,0,0,9806,9817,5,647,
        0,0,9807,9811,5,649,0,0,9808,9810,5,677,0,0,9809,9808,1,0,0,0,9810,
        9813,1,0,0,0,9811,9809,1,0,0,0,9811,9812,1,0,0,0,9812,9814,1,0,0,
        0,9813,9811,1,0,0,0,9814,9817,5,678,0,0,9815,9817,5,671,0,0,9816,
        9805,1,0,0,0,9816,9806,1,0,0,0,9816,9807,1,0,0,0,9816,9815,1,0,0,
        0,9817,1361,1,0,0,0,9818,9819,5,487,0,0,9819,9822,3,1360,680,0,9820,
        9822,1,0,0,0,9821,9818,1,0,0,0,9821,9820,1,0,0,0,9822,1363,1,0,0,
        0,9823,9829,3,1356,678,0,9824,9825,5,12,0,0,9825,9829,3,1356,678,
        0,9826,9827,5,13,0,0,9827,9829,3,1356,678,0,9828,9823,1,0,0,0,9828,
        9824,1,0,0,0,9828,9826,1,0,0,0,9829,1365,1,0,0,0,9830,9831,3,1368,
        684,0,9831,1367,1,0,0,0,9832,9836,3,1378,689,0,9833,9836,5,52,0,
        0,9834,9836,5,89,0,0,9835,9832,1,0,0,0,9835,9833,1,0,0,0,9835,9834,
        1,0,0,0,9836,1369,1,0,0,0,9837,9842,3,1368,684,0,9838,9839,5,6,0,
        0,9839,9841,3,1368,684,0,9840,9838,1,0,0,0,9841,9844,1,0,0,0,9842,
        9840,1,0,0,0,9842,9843,1,0,0,0,9843,1371,1,0,0,0,9844,9842,1,0,0,
        0,9845,9852,3,1382,691,0,9846,9852,3,1386,693,0,9847,9852,3,1388,
        694,0,9848,9852,3,1608,804,0,9849,9852,5,119,0,0,9850,9852,5,126,
        0,0,9851,9845,1,0,0,0,9851,9846,1,0,0,0,9851,9847,1,0,0,0,9851,9848,
        1,0,0,0,9851,9849,1,0,0,0,9851,9850,1,0,0,0,9852,1373,1,0,0,0,9853,
        9858,3,1382,691,0,9854,9858,3,1386,693,0,9855,9858,3,1388,694,0,
        9856,9858,3,1608,804,0,9857,9853,1,0,0,0,9857,9854,1,0,0,0,9857,
        9855,1,0,0,0,9857,9856,1,0,0,0,9858,1375,1,0,0,0,9859,9864,3,1382,
        691,0,9860,9864,3,1386,693,0,9861,9864,3,1608,804,0,9862,9864,3,
        1390,695,0,9863,9859,1,0,0,0,9863,9860,1,0,0,0,9863,9861,1,0,0,0,
        9863,9862,1,0,0,0,9864,1377,1,0,0,0,9865,9870,3,1382,691,0,9866,
        9870,3,1386,693,0,9867,9870,3,1388,694,0,9868,9870,3,1390,695,0,
        9869,9865,1,0,0,0,9869,9866,1,0,0,0,9869,9867,1,0,0,0,9869,9868,
        1,0,0,0,9870,1379,1,0,0,0,9871,9878,3,1382,691,0,9872,9878,3,1608,
        804,0,9873,9878,3,1386,693,0,9874,9878,3,1388,694,0,9875,9878,3,
        1390,695,0,9876,9878,3,1392,696,0,9877,9871,1,0,0,0,9877,9872,1,
        0,0,0,9877,9873,1,0,0,0,9877,9874,1,0,0,0,9877,9875,1,0,0,0,9877,
        9876,1,0,0,0,9878,1381,1,0,0,0,9879,9880,5,636,0,0,9880,9887,3,1362,
        681,0,9881,9887,5,637,0,0,9882,9887,5,641,0,0,9883,9887,3,1208,604,
        0,9884,9887,3,1384,692,0,9885,9887,3,1608,804,0,9886,9879,1,0,0,
        0,9886,9881,1,0,0,0,9886,9882,1,0,0,0,9886,9883,1,0,0,0,9886,9884,
        1,0,0,0,9886,9885,1,0,0,0,9887,1383,1,0,0,0,9888,9889,5,662,0,0,
        9889,1385,1,0,0,0,9890,9891,7,60,0,0,9891,1387,1,0,0,0,9892,9945,
        5,380,0,0,9893,9945,5,381,0,0,9894,9945,3,1134,567,0,9895,9945,5,
        383,0,0,9896,9945,5,384,0,0,9897,9945,3,1142,571,0,9898,9945,5,386,
        0,0,9899,9945,5,387,0,0,9900,9945,5,388,0,0,9901,9945,5,389,0,0,
        9902,9945,5,390,0,0,9903,9945,5,391,0,0,9904,9945,5,392,0,0,9905,
        9945,5,470,0,0,9906,9945,5,393,0,0,9907,9945,5,394,0,0,9908,9945,
        5,395,0,0,9909,9945,5,396,0,0,9910,9945,5,397,0,0,9911,9945,5,398,
        0,0,9912,9945,5,399,0,0,9913,9945,5,400,0,0,9914,9945,5,489,0,0,
        9915,9945,5,401,0,0,9916,9945,3,1130,565,0,9917,9945,5,453,0,0,9918,
        9945,5,403,0,0,9919,9945,5,404,0,0,9920,9945,5,405,0,0,9921,9945,
        5,406,0,0,9922,9945,5,407,0,0,9923,9945,5,408,0,0,9924,9945,5,409,
        0,0,9925,9945,5,410,0,0,9926,9945,5,411,0,0,9927,9945,5,412,0,0,
        9928,9945,5,413,0,0,9929,9945,5,414,0,0,9930,9945,5,415,0,0,9931,
        9945,5,416,0,0,9932,9945,5,417,0,0,9933,9945,5,425,0,0,9934,9945,
        5,426,0,0,9935,9945,5,427,0,0,9936,9945,5,428,0,0,9937,9945,5,476,
        0,0,9938,9945,5,429,0,0,9939,9945,5,430,0,0,9940,9945,5,431,0,0,
        9941,9945,5,432,0,0,9942,9945,5,474,0,0,9943,9945,3,1394,697,0,9944,
        9892,1,0,0,0,9944,9893,1,0,0,0,9944,9894,1,0,0,0,9944,9895,1,0,0,
        0,9944,9896,1,0,0,0,9944,9897,1,0,0,0,9944,9898,1,0,0,0,9944,9899,
        1,0,0,0,9944,9900,1,0,0,0,9944,9901,1,0,0,0,9944,9902,1,0,0,0,9944,
        9903,1,0,0,0,9944,9904,1,0,0,0,9944,9905,1,0,0,0,9944,9906,1,0,0,
        0,9944,9907,1,0,0,0,9944,9908,1,0,0,0,9944,9909,1,0,0,0,9944,9910,
        1,0,0,0,9944,9911,1,0,0,0,9944,9912,1,0,0,0,9944,9913,1,0,0,0,9944,
        9914,1,0,0,0,9944,9915,1,0,0,0,9944,9916,1,0,0,0,9944,9917,1,0,0,
        0,9944,9918,1,0,0,0,9944,9919,1,0,0,0,9944,9920,1,0,0,0,9944,9921,
        1,0,0,0,9944,9922,1,0,0,0,9944,9923,1,0,0,0,9944,9924,1,0,0,0,9944,
        9925,1,0,0,0,9944,9926,1,0,0,0,9944,9927,1,0,0,0,9944,9928,1,0,0,
        0,9944,9929,1,0,0,0,9944,9930,1,0,0,0,9944,9931,1,0,0,0,9944,9932,
        1,0,0,0,9944,9933,1,0,0,0,9944,9934,1,0,0,0,9944,9935,1,0,0,0,9944,
        9936,1,0,0,0,9944,9937,1,0,0,0,9944,9938,1,0,0,0,9944,9939,1,0,0,
        0,9944,9940,1,0,0,0,9944,9941,1,0,0,0,9944,9942,1,0,0,0,9944,9943,
        1,0,0,0,9945,1389,1,0,0,0,9946,9947,7,61,0,0,9947,1391,1,0,0,0,9948,
        9949,7,62,0,0,9949,1393,1,0,0,0,9950,9951,7,63,0,0,9951,1395,1,0,
        0,0,9952,9953,3,1398,699,0,9953,9954,3,1408,704,0,9954,9955,3,1406,
        703,0,9955,1397,1,0,0,0,9956,9958,3,1400,700,0,9957,9956,1,0,0,0,
        9958,9961,1,0,0,0,9959,9957,1,0,0,0,9959,9960,1,0,0,0,9960,1399,
        1,0,0,0,9961,9959,1,0,0,0,9962,9963,3,1402,701,0,9963,9964,5,272,
        0,0,9964,9965,5,490,0,0,9965,9983,1,0,0,0,9966,9967,3,1402,701,0,
        9967,9968,5,491,0,0,9968,9969,3,1404,702,0,9969,9983,1,0,0,0,9970,
        9971,3,1402,701,0,9971,9972,5,492,0,0,9972,9973,5,493,0,0,9973,9983,
        1,0,0,0,9974,9975,3,1402,701,0,9975,9976,5,492,0,0,9976,9977,5,494,
        0,0,9977,9983,1,0,0,0,9978,9979,3,1402,701,0,9979,9980,5,492,0,0,
        9980,9981,5,495,0,0,9981,9983,1,0,0,0,9982,9962,1,0,0,0,9982,9966,
        1,0,0,0,9982,9970,1,0,0,0,9982,9974,1,0,0,0,9982,9978,1,0,0,0,9983,
        1401,1,0,0,0,9984,9985,5,29,0,0,9985,1403,1,0,0,0,9986,9991,3,1358,
        679,0,9987,9991,3,1392,696,0,9988,9991,3,1608,804,0,9989,9991,3,
        1386,693,0,9990,9986,1,0,0,0,9990,9987,1,0,0,0,9990,9988,1,0,0,0,
        9990,9989,1,0,0,0,9991,1405,1,0,0,0,9992,9995,1,0,0,0,9993,9995,
        5,7,0,0,9994,9992,1,0,0,0,9994,9993,1,0,0,0,9995,1407,1,0,0,0,9996,
        9997,3,1410,705,0,9997,9998,5,146,0,0,9998,9999,3,1452,726,0,9999,
        10000,3,1588,794,0,10000,10001,5,454,0,0,10001,10002,3,1602,801,
        0,10002,1409,1,0,0,0,10003,10008,3,1598,799,0,10004,10006,3,1412,
        706,0,10005,10007,3,1414,707,0,10006,10005,1,0,0,0,10006,10007,1,
        0,0,0,10007,10009,1,0,0,0,10008,10004,1,0,0,0,10008,10009,1,0,0,
        0,10009,1411,1,0,0,0,10010,10011,5,178,0,0,10011,1413,1,0,0,0,10012,
        10014,3,1418,709,0,10013,10012,1,0,0,0,10014,10015,1,0,0,0,10015,
        10013,1,0,0,0,10015,10016,1,0,0,0,10016,1415,1,0,0,0,10017,10018,
        5,18,0,0,10018,10019,3,1606,803,0,10019,10020,5,19,0,0,10020,1417,
        1,0,0,0,10021,10025,3,1420,710,0,10022,10025,5,178,0,0,10023,10025,
        3,1416,708,0,10024,10021,1,0,0,0,10024,10022,1,0,0,0,10024,10023,
        1,0,0,0,10025,1419,1,0,0,0,10026,10042,3,1436,718,0,10027,10028,
        5,496,0,0,10028,10029,5,62,0,0,10029,10043,3,1434,717,0,10030,10031,
        3,1438,719,0,10031,10032,3,1440,720,0,10032,10033,3,1442,721,0,10033,
        10034,3,1444,722,0,10034,10035,3,1446,723,0,10035,10043,1,0,0,0,
        10036,10037,3,1422,711,0,10037,10038,5,172,0,0,10038,10039,3,1426,
        713,0,10039,10040,3,1432,716,0,10040,10041,3,1424,712,0,10041,10043,
        1,0,0,0,10042,10027,1,0,0,0,10042,10030,1,0,0,0,10042,10036,1,0,
        0,0,10043,10044,1,0,0,0,10044,10045,5,7,0,0,10045,1421,1,0,0,0,10046,
        10051,1,0,0,0,10047,10048,5,262,0,0,10048,10051,5,317,0,0,10049,
        10051,5,317,0,0,10050,10046,1,0,0,0,10050,10047,1,0,0,0,10050,10049,
        1,0,0,0,10051,1423,1,0,0,0,10052,10053,3,960,480,0,10053,1425,1,
        0,0,0,10054,10060,1,0,0,0,10055,10056,5,2,0,0,10056,10057,3,1428,
        714,0,10057,10058,5,3,0,0,10058,10060,1,0,0,0,10059,10054,1,0,0,
        0,10059,10055,1,0,0,0,10060,1427,1,0,0,0,10061,10066,3,1430,715,
        0,10062,10063,5,6,0,0,10063,10065,3,1430,715,0,10064,10062,1,0,0,
        0,10065,10068,1,0,0,0,10066,10064,1,0,0,0,10066,10067,1,0,0,0,10067,
        1429,1,0,0,0,10068,10066,1,0,0,0,10069,10070,3,1436,718,0,10070,
        10071,3,1440,720,0,10071,1431,1,0,0,0,10072,10073,7,64,0,0,10073,
        1433,1,0,0,0,10074,10077,5,28,0,0,10075,10077,3,1372,686,0,10076,
        10074,1,0,0,0,10076,10075,1,0,0,0,10077,1435,1,0,0,0,10078,10079,
        3,1606,803,0,10079,1437,1,0,0,0,10080,10083,1,0,0,0,10081,10083,
        5,497,0,0,10082,10080,1,0,0,0,10082,10081,1,0,0,0,10083,1439,1,0,
        0,0,10084,10085,3,1118,559,0,10085,1441,1,0,0,0,10086,10090,1,0,
        0,0,10087,10088,5,43,0,0,10088,10090,3,524,262,0,10089,10086,1,0,
        0,0,10089,10087,1,0,0,0,10090,1443,1,0,0,0,10091,10095,1,0,0,0,10092,
        10093,5,77,0,0,10093,10095,5,78,0,0,10094,10091,1,0,0,0,10094,10092,
        1,0,0,0,10095,1445,1,0,0,0,10096,10101,1,0,0,0,10097,10098,3,1448,
        724,0,10098,10099,3,1610,805,0,10099,10101,1,0,0,0,10100,10096,1,
        0,0,0,10100,10097,1,0,0,0,10101,1447,1,0,0,0,10102,10105,3,1450,
        725,0,10103,10105,5,53,0,0,10104,10102,1,0,0,0,10104,10103,1,0,0,
        0,10105,1449,1,0,0,0,10106,10107,7,65,0,0,10107,1451,1,0,0,0,10108,
        10110,3,1454,727,0,10109,10108,1,0,0,0,10110,10113,1,0,0,0,10111,
        10109,1,0,0,0,10111,10112,1,0,0,0,10112,1453,1,0,0,0,10113,10111,
        1,0,0,0,10114,10115,3,1408,704,0,10115,10116,5,7,0,0,10116,10142,
        1,0,0,0,10117,10142,3,1520,760,0,10118,10142,3,1524,762,0,10119,
        10142,3,1462,731,0,10120,10142,3,1478,739,0,10121,10142,3,1484,742,
        0,10122,10142,3,1494,747,0,10123,10142,3,1496,748,0,10124,10142,
        3,1498,749,0,10125,10142,3,1512,756,0,10126,10142,3,1516,758,0,10127,
        10142,3,1536,768,0,10128,10142,3,1542,771,0,10129,10142,3,1544,772,
        0,10130,10142,3,1456,728,0,10131,10142,3,1458,729,0,10132,10142,
        3,1464,732,0,10133,10142,3,1552,776,0,10134,10142,3,1564,782,0,10135,
        10142,3,1572,786,0,10136,10142,3,1574,787,0,10137,10142,3,1576,788,
        0,10138,10142,3,1578,789,0,10139,10142,3,1580,790,0,10140,10142,
        3,1584,792,0,10141,10114,1,0,0,0,10141,10117,1,0,0,0,10141,10118,
        1,0,0,0,10141,10119,1,0,0,0,10141,10120,1,0,0,0,10141,10121,1,0,
        0,0,10141,10122,1,0,0,0,10141,10123,1,0,0,0,10141,10124,1,0,0,0,
        10141,10125,1,0,0,0,10141,10126,1,0,0,0,10141,10127,1,0,0,0,10141,
        10128,1,0,0,0,10141,10129,1,0,0,0,10141,10130,1,0,0,0,10141,10131,
        1,0,0,0,10141,10132,1,0,0,0,10141,10133,1,0,0,0,10141,10134,1,0,
        0,0,10141,10135,1,0,0,0,10141,10136,1,0,0,0,10141,10137,1,0,0,0,
        10141,10138,1,0,0,0,10141,10139,1,0,0,0,10141,10140,1,0,0,0,10142,
        1455,1,0,0,0,10143,10144,5,498,0,0,10144,10145,3,1614,807,0,10145,
        10146,5,7,0,0,10146,1457,1,0,0,0,10147,10148,5,433,0,0,10148,10149,
        3,1606,803,0,10149,10150,5,2,0,0,10150,10151,3,1460,730,0,10151,
        10152,5,3,0,0,10152,10153,5,7,0,0,10153,10162,1,0,0,0,10154,10155,
        5,57,0,0,10155,10156,3,1606,803,0,10156,10157,5,2,0,0,10157,10158,
        3,1460,730,0,10158,10159,5,3,0,0,10159,10160,5,7,0,0,10160,10162,
        1,0,0,0,10161,10147,1,0,0,0,10161,10154,1,0,0,0,10162,1459,1,0,0,
        0,10163,10166,1,0,0,0,10164,10166,3,1280,640,0,10165,10163,1,0,0,
        0,10165,10164,1,0,0,0,10166,1461,1,0,0,0,10167,10168,3,1476,738,
        0,10168,10169,3,1450,725,0,10169,10170,3,1610,805,0,10170,10171,
        5,7,0,0,10171,1463,1,0,0,0,10172,10173,5,499,0,0,10173,10174,3,1466,
        733,0,10174,10175,5,500,0,0,10175,10176,3,1468,734,0,10176,10177,
        5,7,0,0,10177,1465,1,0,0,0,10178,10182,1,0,0,0,10179,10182,5,434,
        0,0,10180,10182,5,501,0,0,10181,10178,1,0,0,0,10181,10179,1,0,0,
        0,10181,10180,1,0,0,0,10182,1467,1,0,0,0,10183,10188,3,1470,735,
        0,10184,10185,5,6,0,0,10185,10187,3,1470,735,0,10186,10184,1,0,0,
        0,10187,10190,1,0,0,0,10188,10186,1,0,0,0,10188,10189,1,0,0,0,10189,
        1469,1,0,0,0,10190,10188,1,0,0,0,10191,10192,3,1474,737,0,10192,
        10193,3,1450,725,0,10193,10194,3,1472,736,0,10194,1471,1,0,0,0,10195,
        10196,3,1372,686,0,10196,1473,1,0,0,0,10197,10198,3,1476,738,0,10198,
        1475,1,0,0,0,10199,10202,3,524,262,0,10200,10202,5,28,0,0,10201,
        10199,1,0,0,0,10201,10200,1,0,0,0,10202,10209,1,0,0,0,10203,10204,
        5,4,0,0,10204,10205,3,1616,808,0,10205,10206,5,5,0,0,10206,10208,
        1,0,0,0,10207,10203,1,0,0,0,10208,10211,1,0,0,0,10209,10207,1,0,
        0,0,10209,10210,1,0,0,0,10210,1477,1,0,0,0,10211,10209,1,0,0,0,10212,
        10213,5,220,0,0,10213,10214,3,1612,806,0,10214,10215,5,93,0,0,10215,
        10216,3,1452,726,0,10216,10217,3,1480,740,0,10217,10218,3,1482,741,
        0,10218,10219,5,454,0,0,10219,10220,5,220,0,0,10220,10221,5,7,0,
        0,10221,1479,1,0,0,0,10222,10223,5,502,0,0,10223,10224,3,1162,581,
        0,10224,10225,5,93,0,0,10225,10226,3,1452,726,0,10226,10228,1,0,
        0,0,10227,10222,1,0,0,0,10228,10231,1,0,0,0,10229,10227,1,0,0,0,
        10229,10230,1,0,0,0,10230,1481,1,0,0,0,10231,10229,1,0,0,0,10232,
        10236,1,0,0,0,10233,10234,5,58,0,0,10234,10236,3,1452,726,0,10235,
        10232,1,0,0,0,10235,10233,1,0,0,0,10236,1483,1,0,0,0,10237,10238,
        5,40,0,0,10238,10239,3,1486,743,0,10239,10240,3,1488,744,0,10240,
        10241,3,1492,746,0,10241,10242,5,454,0,0,10242,10243,5,40,0,0,10243,
        10244,5,7,0,0,10244,1485,1,0,0,0,10245,10248,1,0,0,0,10246,10248,
        3,1610,805,0,10247,10245,1,0,0,0,10247,10246,1,0,0,0,10248,1487,
        1,0,0,0,10249,10251,3,1490,745,0,10250,10249,1,0,0,0,10251,10252,
        1,0,0,0,10252,10250,1,0,0,0,10252,10253,1,0,0,0,10253,1489,1,0,0,
        0,10254,10255,5,102,0,0,10255,10256,3,1280,640,0,10256,10257,5,93,
        0,0,10257,10258,3,1452,726,0,10258,1491,1,0,0,0,10259,10263,1,0,
        0,0,10260,10261,5,58,0,0,10261,10263,3,1452,726,0,10262,10259,1,
        0,0,0,10262,10260,1,0,0,0,10263,1493,1,0,0,0,10264,10265,3,1600,
        800,0,10265,10266,3,1540,770,0,10266,1495,1,0,0,0,10267,10268,3,
        1600,800,0,10268,10269,5,503,0,0,10269,10270,3,1618,809,0,10270,
        10271,3,1540,770,0,10271,1497,1,0,0,0,10272,10273,3,1600,800,0,10273,
        10274,5,62,0,0,10274,10275,3,1500,750,0,10275,10276,3,1540,770,0,
        10276,1499,1,0,0,0,10277,10278,3,1510,755,0,10278,10294,5,68,0,0,
        10279,10280,3,954,477,0,10280,10281,3,1504,752,0,10281,10295,1,0,
        0,0,10282,10295,3,960,480,0,10283,10295,3,878,439,0,10284,10285,
        5,202,0,0,10285,10286,3,1162,581,0,10286,10287,3,1502,751,0,10287,
        10295,1,0,0,0,10288,10289,3,1506,753,0,10289,10290,3,1162,581,0,
        10290,10291,5,24,0,0,10291,10292,3,1162,581,0,10292,10293,3,1508,
        754,0,10293,10295,1,0,0,0,10294,10279,1,0,0,0,10294,10282,1,0,0,
        0,10294,10283,1,0,0,0,10294,10284,1,0,0,0,10294,10288,1,0,0,0,10295,
        1501,1,0,0,0,10296,10300,1,0,0,0,10297,10298,5,100,0,0,10298,10300,
        3,1280,640,0,10299,10296,1,0,0,0,10299,10297,1,0,0,0,10300,1503,
        1,0,0,0,10301,10314,1,0,0,0,10302,10303,5,2,0,0,10303,10308,3,1162,
        581,0,10304,10305,5,6,0,0,10305,10307,3,1162,581,0,10306,10304,1,
        0,0,0,10307,10310,1,0,0,0,10308,10306,1,0,0,0,10308,10309,1,0,0,
        0,10309,10311,1,0,0,0,10310,10308,1,0,0,0,10311,10312,5,3,0,0,10312,
        10314,1,0,0,0,10313,10301,1,0,0,0,10313,10302,1,0,0,0,10314,1505,
        1,0,0,0,10315,10318,1,0,0,0,10316,10318,5,504,0,0,10317,10315,1,
        0,0,0,10317,10316,1,0,0,0,10318,1507,1,0,0,0,10319,10323,1,0,0,0,
        10320,10321,5,147,0,0,10321,10323,3,1162,581,0,10322,10319,1,0,0,
        0,10322,10320,1,0,0,0,10323,1509,1,0,0,0,10324,10325,3,522,261,0,
        10325,1511,1,0,0,0,10326,10327,3,1600,800,0,10327,10328,5,505,0,
        0,10328,10329,3,1510,755,0,10329,10330,3,1514,757,0,10330,10331,
        5,68,0,0,10331,10332,5,35,0,0,10332,10333,3,1162,581,0,10333,10334,
        3,1540,770,0,10334,1513,1,0,0,0,10335,10339,1,0,0,0,10336,10337,
        5,506,0,0,10337,10339,3,1356,678,0,10338,10335,1,0,0,0,10338,10336,
        1,0,0,0,10339,1515,1,0,0,0,10340,10341,3,1518,759,0,10341,10342,
        3,1602,801,0,10342,10343,3,1604,802,0,10343,10344,5,7,0,0,10344,
        1517,1,0,0,0,10345,10346,7,66,0,0,10346,1519,1,0,0,0,10347,10359,
        5,508,0,0,10348,10349,5,261,0,0,10349,10360,3,1610,805,0,10350,10356,
        5,509,0,0,10351,10352,5,202,0,0,10352,10353,3,1162,581,0,10353,10354,
        3,1502,751,0,10354,10357,1,0,0,0,10355,10357,3,960,480,0,10356,10351,
        1,0,0,0,10356,10355,1,0,0,0,10357,10360,1,0,0,0,10358,10360,3,1522,
        761,0,10359,10348,1,0,0,0,10359,10350,1,0,0,0,10359,10358,1,0,0,
        0,10360,10361,1,0,0,0,10361,10362,5,7,0,0,10362,1521,1,0,0,0,10363,
        10366,1,0,0,0,10364,10366,3,1610,805,0,10365,10363,1,0,0,0,10365,
        10364,1,0,0,0,10366,1523,1,0,0,0,10367,10368,5,510,0,0,10368,10369,
        3,1526,763,0,10369,10370,3,1358,679,0,10370,10371,3,1528,764,0,10371,
        10372,3,1530,765,0,10372,10373,5,7,0,0,10373,10394,1,0,0,0,10374,
        10375,5,510,0,0,10375,10376,3,1526,763,0,10376,10377,3,1382,691,
        0,10377,10378,3,1530,765,0,10378,10379,5,7,0,0,10379,10394,1,0,0,
        0,10380,10381,5,510,0,0,10381,10382,3,1526,763,0,10382,10383,5,511,
        0,0,10383,10384,3,1358,679,0,10384,10385,3,1530,765,0,10385,10386,
        5,7,0,0,10386,10394,1,0,0,0,10387,10388,5,510,0,0,10388,10389,3,
        1526,763,0,10389,10390,3,1530,765,0,10390,10391,5,7,0,0,10391,10394,
        1,0,0,0,10392,10394,5,510,0,0,10393,10367,1,0,0,0,10393,10374,1,
        0,0,0,10393,10380,1,0,0,0,10393,10387,1,0,0,0,10393,10392,1,0,0,
        0,10394,1525,1,0,0,0,10395,10404,1,0,0,0,10396,10404,1,0,0,0,10397,
        10404,5,512,0,0,10398,10404,5,513,0,0,10399,10404,5,514,0,0,10400,
        10404,5,515,0,0,10401,10404,5,516,0,0,10402,10404,5,517,0,0,10403,
        10395,1,0,0,0,10403,10396,1,0,0,0,10403,10397,1,0,0,0,10403,10398,
        1,0,0,0,10403,10399,1,0,0,0,10403,10400,1,0,0,0,10403,10401,1,0,
        0,0,10403,10402,1,0,0,0,10404,1527,1,0,0,0,10405,10413,1,0,0,0,10406,
        10407,5,6,0,0,10407,10409,3,1162,581,0,10408,10406,1,0,0,0,10409,
        10410,1,0,0,0,10410,10408,1,0,0,0,10410,10411,1,0,0,0,10411,10413,
        1,0,0,0,10412,10405,1,0,0,0,10412,10408,1,0,0,0,10413,1529,1,0,0,
        0,10414,10418,1,0,0,0,10415,10416,5,100,0,0,10416,10418,3,1534,767,
        0,10417,10414,1,0,0,0,10417,10415,1,0,0,0,10418,1531,1,0,0,0,10419,
        10420,3,1382,691,0,10420,10421,5,10,0,0,10421,10422,3,1162,581,0,
        10422,1533,1,0,0,0,10423,10428,3,1532,766,0,10424,10425,5,6,0,0,
        10425,10427,3,1532,766,0,10426,10424,1,0,0,0,10427,10430,1,0,0,0,
        10428,10426,1,0,0,0,10428,10429,1,0,0,0,10429,1535,1,0,0,0,10430,
        10428,1,0,0,0,10431,10432,5,518,0,0,10432,10433,3,1610,805,0,10433,
        10434,3,1538,769,0,10434,10435,5,7,0,0,10435,1537,1,0,0,0,10436,
        10440,1,0,0,0,10437,10438,5,6,0,0,10438,10440,3,1610,805,0,10439,
        10436,1,0,0,0,10439,10437,1,0,0,0,10440,1539,1,0,0,0,10441,10442,
        5,519,0,0,10442,10443,3,1452,726,0,10443,10444,5,454,0,0,10444,10445,
        5,519,0,0,10445,10446,3,1602,801,0,10446,10447,5,7,0,0,10447,1541,
        1,0,0,0,10448,10449,3,1620,810,0,10449,10450,5,7,0,0,10450,1543,
        1,0,0,0,10451,10452,5,202,0,0,10452,10460,3,1162,581,0,10453,10454,
        3,1550,775,0,10454,10455,3,1546,773,0,10455,10461,1,0,0,0,10456,
        10457,3,1546,773,0,10457,10458,3,1550,775,0,10458,10461,1,0,0,0,
        10459,10461,1,0,0,0,10460,10453,1,0,0,0,10460,10456,1,0,0,0,10460,
        10459,1,0,0,0,10461,10462,1,0,0,0,10462,10463,5,7,0,0,10463,1545,
        1,0,0,0,10464,10468,1,0,0,0,10465,10466,5,100,0,0,10466,10468,3,
        1548,774,0,10467,10464,1,0,0,0,10467,10465,1,0,0,0,10468,1547,1,
        0,0,0,10469,10474,3,1162,581,0,10470,10471,5,6,0,0,10471,10473,3,
        1162,581,0,10472,10470,1,0,0,0,10473,10476,1,0,0,0,10474,10472,1,
        0,0,0,10474,10475,1,0,0,0,10475,1549,1,0,0,0,10476,10474,1,0,0,0,
        10477,10484,1,0,0,0,10478,10480,5,71,0,0,10479,10481,5,339,0,0,10480,
        10479,1,0,0,0,10480,10481,1,0,0,0,10481,10482,1,0,0,0,10482,10484,
        3,1566,783,0,10483,10477,1,0,0,0,10483,10478,1,0,0,0,10484,1551,
        1,0,0,0,10485,10503,5,520,0,0,10486,10487,3,1586,793,0,10487,10488,
        3,1560,780,0,10488,10494,5,62,0,0,10489,10495,3,960,480,0,10490,
        10491,5,202,0,0,10491,10492,3,1610,805,0,10492,10493,3,1558,779,
        0,10493,10495,1,0,0,0,10494,10489,1,0,0,0,10494,10490,1,0,0,0,10495,
        10504,1,0,0,0,10496,10501,3,1372,686,0,10497,10498,5,2,0,0,10498,
        10499,3,1556,778,0,10499,10500,5,3,0,0,10500,10502,1,0,0,0,10501,
        10497,1,0,0,0,10501,10502,1,0,0,0,10502,10504,1,0,0,0,10503,10486,
        1,0,0,0,10503,10496,1,0,0,0,10504,10505,1,0,0,0,10505,10506,5,7,
        0,0,10506,1553,1,0,0,0,10507,10508,3,1372,686,0,10508,10509,5,20,
        0,0,10509,10510,3,1162,581,0,10510,10513,1,0,0,0,10511,10513,3,1162,
        581,0,10512,10507,1,0,0,0,10512,10511,1,0,0,0,10513,1555,1,0,0,0,
        10514,10519,3,1554,777,0,10515,10516,5,6,0,0,10516,10518,3,1554,
        777,0,10517,10515,1,0,0,0,10518,10521,1,0,0,0,10519,10517,1,0,0,
        0,10519,10520,1,0,0,0,10520,1557,1,0,0,0,10521,10519,1,0,0,0,10522,
        10526,1,0,0,0,10523,10524,5,100,0,0,10524,10526,3,1280,640,0,10525,
        10522,1,0,0,0,10525,10523,1,0,0,0,10526,1559,1,0,0,0,10527,10532,
        1,0,0,0,10528,10529,3,1562,781,0,10529,10530,5,317,0,0,10530,10532,
        1,0,0,0,10531,10527,1,0,0,0,10531,10528,1,0,0,0,10532,1561,1,0,0,
        0,10533,10536,1,0,0,0,10534,10536,5,262,0,0,10535,10533,1,0,0,0,
        10535,10534,1,0,0,0,10536,1563,1,0,0,0,10537,10538,5,61,0,0,10538,
        10539,3,1570,785,0,10539,10540,3,1568,784,0,10540,10541,3,1586,793,
        0,10541,10542,5,71,0,0,10542,10543,3,1566,783,0,10543,10544,5,7,
        0,0,10544,1565,1,0,0,0,10545,10546,3,1280,640,0,10546,1567,1,0,0,
        0,10547,10551,1,0,0,0,10548,10551,5,64,0,0,10549,10551,5,68,0,0,
        10550,10547,1,0,0,0,10550,10548,1,0,0,0,10550,10549,1,0,0,0,10551,
        1569,1,0,0,0,10552,10570,1,0,0,0,10553,10570,1,0,0,0,10554,10570,
        5,261,0,0,10555,10570,5,286,0,0,10556,10570,5,207,0,0,10557,10570,
        5,240,0,0,10558,10559,5,130,0,0,10559,10570,3,1162,581,0,10560,10561,
        5,300,0,0,10561,10570,3,1162,581,0,10562,10570,3,1162,581,0,10563,
        10570,5,30,0,0,10564,10567,7,67,0,0,10565,10568,3,1162,581,0,10566,
        10568,5,30,0,0,10567,10565,1,0,0,0,10567,10566,1,0,0,0,10567,10568,
        1,0,0,0,10568,10570,1,0,0,0,10569,10552,1,0,0,0,10569,10553,1,0,
        0,0,10569,10554,1,0,0,0,10569,10555,1,0,0,0,10569,10556,1,0,0,0,
        10569,10557,1,0,0,0,10569,10558,1,0,0,0,10569,10560,1,0,0,0,10569,
        10562,1,0,0,0,10569,10563,1,0,0,0,10569,10564,1,0,0,0,10570,1571,
        1,0,0,0,10571,10572,5,258,0,0,10572,10573,3,1570,785,0,10573,10574,
        3,1586,793,0,10574,10575,5,7,0,0,10575,1573,1,0,0,0,10576,10577,
        5,157,0,0,10577,10578,3,1586,793,0,10578,10579,5,7,0,0,10579,1575,
        1,0,0,0,10580,10581,5,78,0,0,10581,10582,5,7,0,0,10582,1577,1,0,
        0,0,10583,10584,5,161,0,0,10584,10585,3,1582,791,0,10585,10586,5,
        7,0,0,10586,1579,1,0,0,0,10587,10588,5,312,0,0,10588,10589,3,1582,
        791,0,10589,10590,5,7,0,0,10590,1581,1,0,0,0,10591,10593,5,33,0,
        0,10592,10594,5,262,0,0,10593,10592,1,0,0,0,10593,10594,1,0,0,0,
        10594,10595,1,0,0,0,10595,10598,5,153,0,0,10596,10598,1,0,0,0,10597,
        10591,1,0,0,0,10597,10596,1,0,0,0,10598,1583,1,0,0,0,10599,10600,
        5,326,0,0,10600,10601,3,524,262,0,10601,10602,5,94,0,0,10602,10603,
        5,53,0,0,10603,10604,5,7,0,0,10604,10612,1,0,0,0,10605,10608,5,306,
        0,0,10606,10609,3,524,262,0,10607,10609,5,30,0,0,10608,10606,1,0,
        0,0,10608,10607,1,0,0,0,10609,10610,1,0,0,0,10610,10612,5,7,0,0,
        10611,10599,1,0,0,0,10611,10605,1,0,0,0,10612,1585,1,0,0,0,10613,
        10616,3,1372,686,0,10614,10616,5,28,0,0,10615,10613,1,0,0,0,10615,
        10614,1,0,0,0,10616,1587,1,0,0,0,10617,10621,1,0,0,0,10618,10619,
        5,517,0,0,10619,10621,3,1590,795,0,10620,10617,1,0,0,0,10620,10618,
        1,0,0,0,10621,1589,1,0,0,0,10622,10624,3,1592,796,0,10623,10622,
        1,0,0,0,10624,10625,1,0,0,0,10625,10623,1,0,0,0,10625,10626,1,0,
        0,0,10626,1591,1,0,0,0,10627,10628,5,102,0,0,10628,10629,3,1594,
        797,0,10629,10630,5,93,0,0,10630,10631,3,1452,726,0,10631,1593,1,
        0,0,0,10632,10637,3,1596,798,0,10633,10634,5,82,0,0,10634,10636,
        3,1596,798,0,10635,10633,1,0,0,0,10636,10639,1,0,0,0,10637,10635,
        1,0,0,0,10637,10638,1,0,0,0,10638,1595,1,0,0,0,10639,10637,1,0,0,
        0,10640,10644,3,1606,803,0,10641,10642,5,511,0,0,10642,10644,3,1358,
        679,0,10643,10640,1,0,0,0,10643,10641,1,0,0,0,10644,1597,1,0,0,0,
        10645,10648,1,0,0,0,10646,10648,3,1416,708,0,10647,10645,1,0,0,0,
        10647,10646,1,0,0,0,10648,1599,1,0,0,0,10649,10652,1,0,0,0,10650,
        10652,3,1416,708,0,10651,10649,1,0,0,0,10651,10650,1,0,0,0,10652,
        1601,1,0,0,0,10653,10656,1,0,0,0,10654,10656,3,1606,803,0,10655,
        10653,1,0,0,0,10655,10654,1,0,0,0,10656,1603,1,0,0,0,10657,10658,
        5,102,0,0,10658,10661,3,1614,807,0,10659,10661,1,0,0,0,10660,10657,
        1,0,0,0,10660,10659,1,0,0,0,10661,1605,1,0,0,0,10662,10665,3,1372,
        686,0,10663,10665,3,1608,804,0,10664,10662,1,0,0,0,10664,10663,1,
        0,0,0,10665,1607,1,0,0,0,10666,10667,7,68,0,0,10667,1609,1,0,0,0,
        10668,10669,3,1328,664,0,10669,10670,3,982,491,0,10670,10671,3,1054,
        527,0,10671,10672,3,1094,547,0,10672,10673,3,1024,512,0,10673,10674,
        3,1038,519,0,10674,10675,3,1240,620,0,10675,1611,1,0,0,0,10676,10677,
        3,1610,805,0,10677,1613,1,0,0,0,10678,10679,3,1610,805,0,10679,1615,
        1,0,0,0,10680,10681,3,1162,581,0,10681,1617,1,0,0,0,10682,10683,
        3,1162,581,0,10683,1619,1,0,0,0,10684,10685,3,8,4,0,10685,10686,
        3,1622,811,0,10686,1621,1,0,0,0,10687,10688,5,71,0,0,10688,10689,
        3,984,492,0,10689,10690,3,1566,783,0,10690,10693,1,0,0,0,10691,10693,
        1,0,0,0,10692,10687,1,0,0,0,10692,10691,1,0,0,0,10693,1623,1,0,0,
        0,744,1633,1637,1765,1769,1782,1787,1793,1799,1814,1826,1844,1849,
        1859,1883,1890,1896,1901,1910,1914,1926,1957,1964,1972,1977,1984,
        1990,2007,2012,2016,2029,2033,2038,2043,2055,2064,2077,2082,2093,
        2104,2109,2120,2131,2140,2150,2165,2177,2182,2189,2200,2458,2465,
        2470,2475,2480,2488,2497,2504,2514,2516,2521,2527,2533,2535,2563,
        2573,2586,2598,2612,2617,2641,2647,2652,2659,2664,2702,2706,2713,
        2717,2724,2738,2745,2756,2789,2799,2803,2810,2817,2825,2831,2835,
        2845,2852,2863,2895,2903,2908,2915,2925,2935,2955,2970,2995,3000,
        3007,3014,3025,3030,3037,3048,3056,3067,3083,3091,3095,3109,3126,
        3131,3138,3147,3150,3155,3162,3173,3186,3199,3217,3220,3229,3244,
        3259,3268,3275,3282,3287,3317,3319,3323,3331,3338,3352,3356,3360,
        3365,3371,3375,3379,3392,3398,3407,3416,3426,3437,3547,3565,3570,
        3574,3591,3599,3606,3619,3629,3663,3668,3673,3677,3685,3687,3745,
        3762,3770,3793,3797,3817,3854,3863,3868,3873,3878,3883,3936,3942,
        3949,3959,3964,3969,3987,3991,4001,4007,4013,4020,4025,4030,4044,
        4072,4079,4093,4108,4225,4236,4242,4250,4261,4270,4277,4317,4323,
        4344,4372,4376,4381,4390,4394,4421,4428,4443,4463,4483,4576,4601,
        4608,4624,4633,4638,4644,4651,4665,4814,4818,4911,4916,4920,4926,
        4994,5000,5029,5046,5053,5065,5125,5132,5138,5144,5170,5176,5182,
        5193,5205,5234,5273,5277,5281,5285,5290,5297,5311,5324,5332,5339,
        5345,5349,5354,5361,5375,5377,5384,5388,5397,5405,5414,5416,5420,
        5429,5434,5440,5445,5449,5454,5460,5466,5472,5478,5483,5498,5507,
        5518,5524,5563,5573,5580,5591,5597,5607,5619,5623,5661,5675,5689,
        5713,5720,5730,5742,5747,5783,5790,5805,5852,5889,5900,5917,6387,
        6391,6396,6455,6459,6678,6693,6704,6711,6904,6914,6922,6951,6967,
        7009,7023,7045,7052,7060,7064,7071,7080,7089,7141,7146,7158,7162,
        7167,7172,7176,7180,7185,7201,7209,7214,7227,7232,7239,7249,7253,
        7264,7275,7283,7290,7329,7337,7341,7422,7450,7455,7470,7482,7489,
        7499,7504,7508,7512,7516,7520,7527,7537,7542,7560,7571,7578,7586,
        7591,7604,7610,7639,7646,7658,7671,7686,7692,7701,7717,7720,7731,
        7736,7740,7744,7749,7752,7758,7762,7764,7767,7774,7777,7784,7792,
        7795,7804,7819,7832,7843,7846,7850,7856,7872,7885,7895,7913,7915,
        7923,7927,7937,7947,7958,7960,7969,7979,7990,8003,8007,8016,8031,
        8035,8042,8045,8049,8052,8065,8069,8074,8082,8086,8090,8101,8108,
        8114,8118,8120,8124,8130,8139,8145,8147,8149,8156,8160,8169,8173,
        8183,8190,8198,8222,8228,8232,8237,8246,8250,8253,8258,8271,8277,
        8285,8288,8295,8300,8321,8330,8335,8341,8346,8353,8358,8364,8366,
        8370,8377,8381,8384,8391,8396,8399,8406,8410,8419,8423,8431,8433,
        8440,8445,8448,8463,8475,8485,8494,8499,8504,8511,8514,8518,8525,
        8549,8558,8564,8568,8573,8583,8590,8599,8602,8611,8613,8619,8623,
        8628,8642,8644,8650,8656,8659,8668,8686,8693,8697,8701,8717,8724,
        8732,8736,8743,8756,8772,8778,8784,8791,8796,8802,8809,8817,8825,
        8830,8834,8840,8844,8848,8851,8857,8862,8878,8881,8883,8895,8897,
        8901,8907,8912,8920,8924,8933,8941,8947,8950,8959,8964,8971,8981,
        9007,9018,9020,9022,9030,9053,9061,9071,9085,9095,9099,9113,9120,
        9127,9134,9159,9188,9227,9229,9257,9278,9285,9298,9310,9316,9325,
        9342,9354,9363,9368,9375,9385,9388,9399,9405,9420,9428,9437,9446,
        9449,9454,9463,9468,9482,9492,9500,9514,9521,9529,9537,9544,9550,
        9559,9567,9577,9588,9595,9624,9633,9640,9651,9661,9665,9669,9674,
        9682,9686,9690,9695,9700,9705,9712,9720,9723,9730,9735,9742,9758,
        9773,9787,9792,9811,9816,9821,9828,9835,9842,9851,9857,9863,9869,
        9877,9886,9944,9959,9982,9990,9994,10006,10008,10015,10024,10042,
        10050,10059,10066,10076,10082,10089,10094,10100,10104,10111,10141,
        10161,10165,10181,10188,10201,10209,10229,10235,10247,10252,10262,
        10294,10299,10308,10313,10317,10322,10338,10356,10359,10365,10393,
        10403,10410,10412,10417,10428,10439,10460,10467,10474,10480,10483,
        10494,10501,10503,10512,10519,10525,10531,10535,10550,10567,10569,
        10593,10597,10608,10611,10615,10620,10625,10637,10643,10647,10651,
        10655,10660,10664,10692
    ]

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>", "'ALL'", "'ANALYSE'", "'ANALYZE'", "'AND'", 
                     "'ANY'", "'ARRAY'", "'AS'", "'ASC'", "'ASYMMETRIC'", 
                     "'BOTH'", "'CASE'", "'CAST'", "'CHECK'", "'COLLATE'", 
                     "'COLUMN'", "'CONSTRAINT'", "'CREATE'", "'CURRENT_CATALOG'", 
                     "'CURRENT_DATE'", "'CURRENT_ROLE'", "'CURRENT_TIME'", 
                     "'CURRENT_TIMESTAMP'", "'CURRENT_USER'", "'DEFAULT'", 
                     "'DEFERRABLE'", "'DESC'", "'DISTINCT'", "'DO'", "'ELSE'", 
                     "'EXCEPT'", "'FALSE'", "'FETCH'", "'FOR'", "'FOREIGN'", 
                     "'FROM'", "'GRANT'", "'GROUP'", "'HAVING'", "'IN'", 
                     "'INITIALLY'", "'INTERSECT'", "'INTO'", "'LATERAL'", 
                     "'LEADING'", "'LIMIT'", "'LOCALTIME'", "'LOCALTIMESTAMP'", 
                     "'NOT'", "'NULL'", "'OFFSET'", "'ON'", "'ONLY'", "'OR'", 
                     "'ORDER'", "'PLACING'", "'PRIMARY'", "'REFERENCES'", 
                     "'RETURNING'", "'SELECT'", "'SESSION_USER'", "'SOME'", 
                     "'SYMMETRIC'", "'TABLE'", "'THEN'", "'TO'", "'TRAILING'", 
                     "'TRUE'", "'UNION'", "'UNIQUE'", "'USER'", "'USING'", 
                     "'VARIADIC'", "'WHEN'", "'WHERE'", "'WINDOW'", "'WITH'", 
                     "'AUTHORIZATION'", "'BINARY'", "'COLLATION'", "'CONCURRENTLY'", 
                     "'CROSS'", "'CURRENT_SCHEMA'", "'FREEZE'", "'FULL'", 
                     "'ILIKE'", "'INNER'", "'IS'", "'ISNULL'", "'JOIN'", 
                     "'LEFT'", "'LIKE'", "'NATURAL'", "'NOTNULL'", "'OUTER'", 
                     "'OVER'", "'OVERLAPS'", "'RIGHT'", "'SIMILAR'", "'VERBOSE'", 
                     "'ABORT'", "'ABSOLUTE'", "'ACCESS'", "'ACTION'", "'ADD'", 
                     "'ADMIN'", "'AFTER'", "'AGGREGATE'", "'ALSO'", "'ALTER'", 
                     "'ALWAYS'", "'ASSERTION'", "'ASSIGNMENT'", "'AT'", 
                     "'ATTRIBUTE'", "'BACKWARD'", "'BEFORE'", "'BEGIN'", 
                     "'BY'", "'CACHE'", "'CALLED'", "'CASCADE'", "'CASCADED'", 
                     "'CATALOG'", "'CHAIN'", "'CHARACTERISTICS'", "'CHECKPOINT'", 
                     "'CLASS'", "'CLOSE'", "'CLUSTER'", "'COMMENT'", "'COMMENTS'", 
                     "'COMMIT'", "'COMMITTED'", "'CONFIGURATION'", "'CONNECTION'", 
                     "'CONSTRAINTS'", "'CONTENT'", "'CONTINUE'", "'CONVERSION'", 
                     "'COPY'", "'COST'", "'CSV'", "'CURSOR'", "'CYCLE'", 
                     "'DATA'", "'DATABASE'", "'DAY'", "'DEALLOCATE'", "'DECLARE'", 
                     "'DEFAULTS'", "'DEFERRED'", "'DEFINER'", "'DELETE'", 
                     "'DELIMITER'", "'DELIMITERS'", "'DICTIONARY'", "'DISABLE'", 
                     "'DISCARD'", "'DOCUMENT'", "'DOMAIN'", "'DOUBLE'", 
                     "'DROP'", "'EACH'", "'ENABLE'", "'ENCODING'", "'ENCRYPTED'", 
                     "'ENUM'", "'ESCAPE'", "'EVENT'", "'EXCLUDE'", "'EXCLUDING'", 
                     "'EXCLUSIVE'", "'EXECUTE'", "'EXPLAIN'", "'EXTENSION'", 
                     "'EXTERNAL'", "'FAMILY'", "'FIRST'", "'FOLLOWING'", 
                     "'FORCE'", "'FORWARD'", "'FUNCTION'", "'FUNCTIONS'", 
                     "'GLOBAL'", "'GRANTED'", "'HANDLER'", "'HEADER'", "'HOLD'", 
                     "'HOUR'", "'IDENTITY'", "'IF'", "'IMMEDIATE'", "'IMMUTABLE'", 
                     "'IMPLICIT'", "'INCLUDING'", "'INCREMENT'", "'INDEX'", 
                     "'INDEXES'", "'INHERIT'", "'INHERITS'", "'INLINE'", 
                     "'INSENSITIVE'", "'INSERT'", "'INSTEAD'", "'INVOKER'", 
                     "'ISOLATION'", "'KEY'", "'LABEL'", "'LANGUAGE'", "'LARGE'", 
                     "'LAST'", "'LEAKPROOF'", "'LEVEL'", "'LISTEN'", "'LOAD'", 
                     "'LOCAL'", "'LOCATION'", "'LOCK'", "'MAPPING'", "'MATCH'", 
                     "'MATCHED'", "'MATERIALIZED'", "'MAXVALUE'", "'MERGE'", 
                     "'MINUTE'", "'MINVALUE'", "'MODE'", "'MONTH'", "'MOVE'", 
                     "'NAME'", "'NAMES'", "'NEXT'", "'NO'", "'NOTHING'", 
                     "'NOTIFY'", "'NOWAIT'", "'NULLS'", "'OBJECT'", "'OF'", 
                     "'OFF'", "'OIDS'", "'OPERATOR'", "'OPTION'", "'OPTIONS'", 
                     "'OWNED'", "'OWNER'", "'PARSER'", "'PARTIAL'", "'PARTITION'", 
                     "'PASSING'", "'PASSWORD'", "'PLANS'", "'PRECEDING'", 
                     "'PREPARE'", "'PREPARED'", "'PRESERVE'", "'PRIOR'", 
                     "'PRIVILEGES'", "'PROCEDURAL'", "'PROCEDURE'", "'PROGRAM'", 
                     "'QUOTE'", "'RANGE'", "'READ'", "'REASSIGN'", "'RECHECK'", 
                     "'RECURSIVE'", "'REF'", "'REFRESH'", "'REINDEX'", "'RELATIVE'", 
                     "'RELEASE'", "'RENAME'", "'REPEATABLE'", "'REPLACE'", 
                     "'REPLICA'", "'RESET'", "'RESTART'", "'RESTRICT'", 
                     "'RETURNS'", "'REVOKE'", "'ROLE'", "'ROLLBACK'", "'ROWS'", 
                     "'RULE'", "'SAVEPOINT'", "'SCHEMA'", "'SCROLL'", "'SEARCH'", 
                     "'SECOND'", "'SECURITY'", "'SEQUENCE'", "'SEQUENCES'", 
                     "'SERIALIZABLE'", "'SERVER'", "'SESSION'", "'SET'", 
                     "'SHARE'", "'SHOW'", "'SIMPLE'", "'SNAPSHOT'", "'STABLE'", 
                     "'STANDALONE'", "'START'", "'STATEMENT'", "'STATISTICS'", 
                     "'STDIN'", "'STDOUT'", "'STORAGE'", "'STRICT'", "'STRIP'", 
                     "'SYSID'", "'SYSTEM'", "'TABLES'", "'TABLESPACE'", 
                     "'TEMP'", "'TEMPLATE'", "'TEMPORARY'", "'TEXT'", "'TRANSACTION'", 
                     "'TRIGGER'", "'TRUNCATE'", "'TRUSTED'", "'TYPE'", "'TYPES'", 
                     "'UNBOUNDED'", "'UNCOMMITTED'", "'UNENCRYPTED'", "'UNKNOWN'", 
                     "'UNLISTEN'", "'UNLOGGED'", "'UNTIL'", "'UPDATE'", 
                     "'VACUUM'", "'VALID'", "'VALIDATE'", "'VALIDATOR'", 
                     "'VARYING'", "'VERSION'", "'VIEW'", "'VOLATILE'", "'WHITESPACE'", 
                     "'WITHOUT'", "'WORK'", "'WRAPPER'", "'WRITE'", "'XML'", 
                     "'YEAR'", "'YES'", "'ZONE'", "'BETWEEN'", "'BIGINT'", 
                     "'BIT'", "'BOOLEAN'", "'CHAR'", "'CHARACTER'", "'COALESCE'", 
                     "'DEC'", "'DECIMAL'", "'EXISTS'", "'EXTRACT'", "'FLOAT'", 
                     "'GREATEST'", "'INOUT'", "'INT'", "'INTEGER'", "'INTERVAL'", 
                     "'LEAST'", "'NATIONAL'", "'NCHAR'", "'NONE'", "'NULLIF'", 
                     "'NUMERIC'", "'OVERLAY'", "'POSITION'", "'PRECISION'", 
                     "'REAL'", "'ROW'", "'SETOF'", "'SMALLINT'", "'SUBSTRING'", 
                     "'TIME'", "'TIMESTAMP'", "'TREAT'", "'TRIM'", "'VALUES'", 
                     "'VARCHAR'", "'XMLATTRIBUTES'", "'XMLCOMMENT'", "'XMLAGG'", 
                     "'XML_IS_WELL_FORMED'", "'XML_IS_WELL_FORMED_DOCUMENT'", 
                     "'XML_IS_WELL_FORMED_CONTENT'", "'XPATH'", "'XPATH_EXISTS'", 
                     "'XMLCONCAT'", "'XMLELEMENT'", "'XMLEXISTS'", "'XMLFOREST'", 
                     "'XMLPARSE'", "'XMLPI'", "'XMLROOT'", "'XMLSERIALIZE'", 
                     "'CALL'", "'CURRENT'", "'ATTACH'", "'DETACH'", "'EXPRESSION'", 
                     "'GENERATED'", "'LOGGED'", "'STORED'", "'INCLUDE'", 
                     "'ROUTINE'", "'TRANSFORM'", "'IMPORT'", "'POLICY'", 
                     "'METHOD'", "'REFERENCING'", "'NEW'", "'OLD'", "'VALUE'", 
                     "'SUBSCRIPTION'", "'PUBLICATION'", "'OUT'", "'END'", 
                     "'ROUTINES'", "'SCHEMAS'", "'PROCEDURES'", "'INPUT'", 
                     "'SUPPORT'", "'PARALLEL'", "'SQL'", "'DEPENDS'", "'OVERRIDING'", 
                     "'CONFLICT'", "'SKIP'", "'LOCKED'", "'TIES'", "'ROLLUP'", 
                     "'CUBE'", "'GROUPING'", "'SETS'", "'TABLESAMPLE'", 
                     "'ORDINALITY'", "'XMLTABLE'", "'COLUMNS'", "'XMLNAMESPACES'", 
                     "'ROWTYPE'", "'NORMALIZED'", "'WITHIN'", "'FILTER'", 
                     "'GROUPS'", "'OTHERS'", "'NFC'", "'NFD'", "'NFKC'", 
                     "'NFKD'", "'UESCAPE'", "'VIEWS'", "'NORMALIZE'", "'DUMP'", 
                     "'PRINT_STRICT_PARAMS'", "'VARIABLE_CONFLICT'", "'ERROR'", 
                     "'USE_VARIABLE'", "'USE_COLUMN'", "'ALIAS'", "'CONSTANT'", 
                     "'PERFORM'", "'GET'", "'DIAGNOSTICS'", "'STACKED'", 
                     "'ELSIF'", "'WHILE'", "'REVERSE'", "'FOREACH'", "'SLICE'", 
                     "'EXIT'", "'RETURN'", "'QUERY'", "'RAISE'", "'SQLSTATE'", 
                     "'DEBUG'", "'LOG'", "'INFO'", "'NOTICE'", "'WARNING'", 
                     "'EXCEPTION'", "'ASSERT'", "'LOOP'", "'OPEN'", "'ABS'", 
                     "'CBRT'", "'CEIL'", "'CEILING'", "'DEGREES'", "'DIV'", 
                     "'EXP'", "'FACTORIAL'", "'FLOOR'", "'GCD'", "'LCM'", 
                     "'LN'", "'LOG10'", "'MIN_SCALE'", "'MOD'", "'PI'", 
                     "'POWER'", "'RADIANS'", "'ROUND'", "'SCALE'", "'SIGN'", 
                     "'SQRT'", "'TRIM_SCALE'", "'TRUNC'", "'WIDTH_BUCKET'", 
                     "'RANDOM'", "'SETSEED'", "'ACOS'", "'ACOSD'", "'ASIN'", 
                     "'ASIND'", "'ATAN'", "'ATAND'", "'ATAN2'", "'ATAN2D'", 
                     "'COS'", "'COSD'", "'COT'", "'COTD'", "'SIN'", "'SIND'", 
                     "'TAN'", "'TAND'", "'SINH'", "'COSH'", "'TANH'", "'ASINH'", 
                     "'ACOSH'", "'ATANH'", "'BIT_LENGTH'", "'CHAR_LENGTH'", 
                     "'CHARACTER_LENGTH'", "'LOWER'", "'OCTET_LENGTH'", 
                     "'UPPER'", "'ASCII'", "'BTRIM'", "'CHR'", "'CONCAT'", 
                     "'CONCAT_WS'", "'FORMAT'", "'INITCAP'", "'LENGTH'", 
                     "'LPAD'", "'LTRIM'", "'MD5'", "'PARSE_IDENT'", "'PG_CLIENT_ENCODING'", 
                     "'QUOTE_IDENT'", "'QUOTE_LITERAL'", "'QUOTE_NULLABLE'", 
                     "'REGEXP_COUNT'", "'REGEXP_INSTR'", "'REGEXP_LIKE'", 
                     "'REGEXP_MATCH'", "'REGEXP_MATCHES'", "'REGEXP_REPLACE'", 
                     "'REGEXP_SPLIT_TO_ARRAY'", "'REGEXP_SPLIT_TO_TABLE'", 
                     "'REGEXP_SUBSTR'", "'REPEAT'", "'RPAD'", "'RTRIM'", 
                     "'SPLIT_PART'", "'STARTS_WITH'", "'STRING_TO_ARRAY'", 
                     "'STRING_TO_TABLE'", "'STRPOS'", "'SUBSTR'", "'TO_ASCII'", 
                     "'TO_HEX'", "'TRANSLATE'", "'UNISTR'", "'AGE'", "'CLOCK_TIMESTAMP'", 
                     "'DATE_BIN'", "'DATE_PART'", "'DATE_TRUNC'", "'ISFINITE'", 
                     "'JUSTIFY_DAYS'", "'JUSTIFY_HOURS'", "'JUSTIFY_INTERVAL'", 
                     "'MAKE_DATE'", "'MAKE_INTERVAL'", "'MAKE_TIME'", "'MAKE_TIMESTAMP'", 
                     "'MAKE_TIMESTAMPTZ'", "'NOW'", "'STATEMENT_TIMESTAMP'", 
                     "'TIMEOFDAY'", "'TRANSACTION_TIMESTAMP'", "'TO_TIMESTAMP'", 
                     "'TO_CHAR'", "'TO_DATE'", "'TO_NUMBER'", "<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>", "Dollar", "OPEN_PAREN", "CLOSE_PAREN", 
                      "OPEN_BRACKET", "CLOSE_BRACKET", "COMMA", "SEMI", 
                      "COLON", "STAR", "EQUAL", "DOT", "PLUS", "MINUS", 
                      "SLASH", "CARET", "LT", "GT", "LESS_LESS", "GREATER_GREATER", 
                      "COLON_EQUALS", "LESS_EQUALS", "EQUALS_GREATER", "GREATER_EQUALS", 
                      "DOT_DOT", "NOT_EQUALS", "TYPECAST", "PERCENT", "PARAM", 
                      "Operator", "ALL", "ANALYSE", "ANALYZE", "AND", "ANY", 
                      "ARRAY", "AS", "ASC", "ASYMMETRIC", "BOTH", "CASE", 
                      "CAST", "CHECK", "COLLATE", "COLUMN", "CONSTRAINT", 
                      "CREATE", "CURRENT_CATALOG", "CURRENT_DATE", "CURRENT_ROLE", 
                      "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", 
                      "DEFAULT", "DEFERRABLE", "DESC", "DISTINCT", "DO", 
                      "ELSE", "EXCEPT", "FALSE_P", "FETCH", "FOR", "FOREIGN", 
                      "FROM", "GRANT", "GROUP_P", "HAVING", "IN_P", "INITIALLY", 
                      "INTERSECT", "INTO", "LATERAL_P", "LEADING", "LIMIT", 
                      "LOCALTIME", "LOCALTIMESTAMP", "NOT", "NULL_P", "OFFSET", 
                      "ON", "ONLY", "OR", "ORDER", "PLACING", "PRIMARY", 
                      "REFERENCES", "RETURNING", "SELECT", "SESSION_USER", 
                      "SOME", "SYMMETRIC", "TABLE", "THEN", "TO", "TRAILING", 
                      "TRUE_P", "UNION", "UNIQUE", "USER", "USING", "VARIADIC", 
                      "WHEN", "WHERE", "WINDOW", "WITH", "AUTHORIZATION", 
                      "BINARY", "COLLATION", "CONCURRENTLY", "CROSS", "CURRENT_SCHEMA", 
                      "FREEZE", "FULL", "ILIKE", "INNER_P", "IS", "ISNULL", 
                      "JOIN", "LEFT", "LIKE", "NATURAL", "NOTNULL", "OUTER_P", 
                      "OVER", "OVERLAPS", "RIGHT", "SIMILAR", "VERBOSE", 
                      "ABORT_P", "ABSOLUTE_P", "ACCESS", "ACTION", "ADD_P", 
                      "ADMIN", "AFTER", "AGGREGATE", "ALSO", "ALTER", "ALWAYS", 
                      "ASSERTION", "ASSIGNMENT", "AT", "ATTRIBUTE", "BACKWARD", 
                      "BEFORE", "BEGIN_P", "BY", "CACHE", "CALLED", "CASCADE", 
                      "CASCADED", "CATALOG", "CHAIN", "CHARACTERISTICS", 
                      "CHECKPOINT", "CLASS", "CLOSE", "CLUSTER", "COMMENT", 
                      "COMMENTS", "COMMIT", "COMMITTED", "CONFIGURATION", 
                      "CONNECTION", "CONSTRAINTS", "CONTENT_P", "CONTINUE_P", 
                      "CONVERSION_P", "COPY", "COST", "CSV", "CURSOR", "CYCLE", 
                      "DATA_P", "DATABASE", "DAY_P", "DEALLOCATE", "DECLARE", 
                      "DEFAULTS", "DEFERRED", "DEFINER", "DELETE_P", "DELIMITER", 
                      "DELIMITERS", "DICTIONARY", "DISABLE_P", "DISCARD", 
                      "DOCUMENT_P", "DOMAIN_P", "DOUBLE_P", "DROP", "EACH", 
                      "ENABLE_P", "ENCODING", "ENCRYPTED", "ENUM_P", "ESCAPE", 
                      "EVENT", "EXCLUDE", "EXCLUDING", "EXCLUSIVE", "EXECUTE", 
                      "EXPLAIN", "EXTENSION", "EXTERNAL", "FAMILY", "FIRST_P", 
                      "FOLLOWING", "FORCE", "FORWARD", "FUNCTION", "FUNCTIONS", 
                      "GLOBAL", "GRANTED", "HANDLER", "HEADER_P", "HOLD", 
                      "HOUR_P", "IDENTITY_P", "IF_P", "IMMEDIATE", "IMMUTABLE", 
                      "IMPLICIT_P", "INCLUDING", "INCREMENT", "INDEX", "INDEXES", 
                      "INHERIT", "INHERITS", "INLINE_P", "INSENSITIVE", 
                      "INSERT", "INSTEAD", "INVOKER", "ISOLATION", "KEY", 
                      "LABEL", "LANGUAGE", "LARGE_P", "LAST_P", "LEAKPROOF", 
                      "LEVEL", "LISTEN", "LOAD", "LOCAL", "LOCATION", "LOCK_P", 
                      "MAPPING", "MATCH", "MATCHED", "MATERIALIZED", "MAXVALUE", 
                      "MERGE", "MINUTE_P", "MINVALUE", "MODE", "MONTH_P", 
                      "MOVE", "NAME_P", "NAMES", "NEXT", "NO", "NOTHING", 
                      "NOTIFY", "NOWAIT", "NULLS_P", "OBJECT_P", "OF", "OFF", 
                      "OIDS", "OPERATOR", "OPTION", "OPTIONS", "OWNED", 
                      "OWNER", "PARSER", "PARTIAL", "PARTITION", "PASSING", 
                      "PASSWORD", "PLANS", "PRECEDING", "PREPARE", "PREPARED", 
                      "PRESERVE", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", 
                      "PROGRAM", "QUOTE", "RANGE", "READ", "REASSIGN", "RECHECK", 
                      "RECURSIVE", "REF", "REFRESH", "REINDEX", "RELATIVE_P", 
                      "RELEASE", "RENAME", "REPEATABLE", "REPLACE", "REPLICA", 
                      "RESET", "RESTART", "RESTRICT", "RETURNS", "REVOKE", 
                      "ROLE", "ROLLBACK", "ROWS", "RULE", "SAVEPOINT", "SCHEMA", 
                      "SCROLL", "SEARCH", "SECOND_P", "SECURITY", "SEQUENCE", 
                      "SEQUENCES", "SERIALIZABLE", "SERVER", "SESSION", 
                      "SET", "SHARE", "SHOW", "SIMPLE", "SNAPSHOT", "STABLE", 
                      "STANDALONE_P", "START", "STATEMENT", "STATISTICS", 
                      "STDIN", "STDOUT", "STORAGE", "STRICT_P", "STRIP_P", 
                      "SYSID", "SYSTEM_P", "TABLES", "TABLESPACE", "TEMP", 
                      "TEMPLATE", "TEMPORARY", "TEXT_P", "TRANSACTION", 
                      "TRIGGER", "TRUNCATE", "TRUSTED", "TYPE_P", "TYPES_P", 
                      "UNBOUNDED", "UNCOMMITTED", "UNENCRYPTED", "UNKNOWN", 
                      "UNLISTEN", "UNLOGGED", "UNTIL", "UPDATE", "VACUUM", 
                      "VALID", "VALIDATE", "VALIDATOR", "VARYING", "VERSION_P", 
                      "VIEW", "VOLATILE", "WHITESPACE_P", "WITHOUT", "WORK", 
                      "WRAPPER", "WRITE", "XML_P", "YEAR_P", "YES_P", "ZONE", 
                      "BETWEEN", "BIGINT", "BIT", "BOOLEAN_P", "CHAR_P", 
                      "CHARACTER", "COALESCE", "DEC", "DECIMAL_P", "EXISTS", 
                      "EXTRACT", "FLOAT_P", "GREATEST", "INOUT", "INT_P", 
                      "INTEGER", "INTERVAL", "LEAST", "NATIONAL", "NCHAR", 
                      "NONE", "NULLIF", "NUMERIC", "OVERLAY", "POSITION", 
                      "PRECISION", "REAL", "ROW", "SETOF", "SMALLINT", "SUBSTRING", 
                      "TIME", "TIMESTAMP", "TREAT", "TRIM", "VALUES", "VARCHAR", 
                      "XMLATTRIBUTES", "XMLCOMMENT", "XMLAGG", "XML_IS_WELL_FORMED", 
                      "XML_IS_WELL_FORMED_DOCUMENT", "XML_IS_WELL_FORMED_CONTENT", 
                      "XPATH", "XPATH_EXISTS", "XMLCONCAT", "XMLELEMENT", 
                      "XMLEXISTS", "XMLFOREST", "XMLPARSE", "XMLPI", "XMLROOT", 
                      "XMLSERIALIZE", "CALL", "CURRENT_P", "ATTACH", "DETACH", 
                      "EXPRESSION", "GENERATED", "LOGGED", "STORED", "INCLUDE", 
                      "ROUTINE", "TRANSFORM", "IMPORT_P", "POLICY", "METHOD", 
                      "REFERENCING", "NEW", "OLD", "VALUE_P", "SUBSCRIPTION", 
                      "PUBLICATION", "OUT_P", "END_P", "ROUTINES", "SCHEMAS", 
                      "PROCEDURES", "INPUT_P", "SUPPORT", "PARALLEL", "SQL_P", 
                      "DEPENDS", "OVERRIDING", "CONFLICT", "SKIP_P", "LOCKED", 
                      "TIES", "ROLLUP", "CUBE", "GROUPING", "SETS", "TABLESAMPLE", 
                      "ORDINALITY", "XMLTABLE", "COLUMNS", "XMLNAMESPACES", 
                      "ROWTYPE", "NORMALIZED", "WITHIN", "FILTER", "GROUPS", 
                      "OTHERS", "NFC", "NFD", "NFKC", "NFKD", "UESCAPE", 
                      "VIEWS", "NORMALIZE", "DUMP", "PRINT_STRICT_PARAMS", 
                      "VARIABLE_CONFLICT", "ERROR", "USE_VARIABLE", "USE_COLUMN", 
                      "ALIAS", "CONSTANT", "PERFORM", "GET", "DIAGNOSTICS", 
                      "STACKED", "ELSIF", "WHILE", "REVERSE", "FOREACH", 
                      "SLICE", "EXIT", "RETURN", "QUERY", "RAISE", "SQLSTATE", 
                      "DEBUG", "LOG", "INFO", "NOTICE", "WARNING", "EXCEPTION", 
                      "ASSERT", "LOOP", "OPEN", "ABS", "CBRT", "CEIL", "CEILING", 
                      "DEGREES", "DIV", "EXP", "FACTORIAL", "FLOOR", "GCD", 
                      "LCM", "LN", "LOG10", "MIN_SCALE", "MOD", "PI", "POWER", 
                      "RADIANS", "ROUND", "SCALE", "SIGN", "SQRT", "TRIM_SCALE", 
                      "TRUNC", "WIDTH_BUCKET", "RANDOM", "SETSEED", "ACOS", 
                      "ACOSD", "ASIN", "ASIND", "ATAN", "ATAND", "ATAN2", 
                      "ATAN2D", "COS", "COSD", "COT", "COTD", "SIN", "SIND", 
                      "TAN", "TAND", "SINH", "COSH", "TANH", "ASINH", "ACOSH", 
                      "ATANH", "BIT_LENGTH", "CHAR_LENGTH", "CHARACTER_LENGTH", 
                      "LOWER", "OCTET_LENGTH", "UPPER", "ASCII", "BTRIM", 
                      "CHR", "CONCAT", "CONCAT_WS", "FORMAT", "INITCAP", 
                      "LENGTH", "LPAD", "LTRIM", "MD5", "PARSE_IDENT", "PG_CLIENT_ENCODING", 
                      "QUOTE_IDENT", "QUOTE_LITERAL", "QUOTE_NULLABLE", 
                      "REGEXP_COUNT", "REGEXP_INSTR", "REGEXP_LIKE", "REGEXP_MATCH", 
                      "REGEXP_MATCHES", "REGEXP_REPLACE", "REGEXP_SPLIT_TO_ARRAY", 
                      "REGEXP_SPLIT_TO_TABLE", "REGEXP_SUBSTR", "REPEAT", 
                      "RPAD", "RTRIM", "SPLIT_PART", "STARTS_WITH", "STRING_TO_ARRAY", 
                      "STRING_TO_TABLE", "STRPOS", "SUBSTR", "TO_ASCII", 
                      "TO_HEX", "TRANSLATE", "UNISTR", "AGE", "CLOCK_TIMESTAMP", 
                      "DATE_BIN", "DATE_PART", "DATE_TRUNC", "ISFINITE", 
                      "JUSTIFY_DAYS", "JUSTIFY_HOURS", "JUSTIFY_INTERVAL", 
                      "MAKE_DATE", "MAKE_INTERVAL", "MAKE_TIME", "MAKE_TIMESTAMP", 
                      "MAKE_TIMESTAMPTZ", "NOW", "STATEMENT_TIMESTAMP", 
                      "TIMEOFDAY", "TRANSACTION_TIMESTAMP", "TO_TIMESTAMP", 
                      "TO_CHAR", "TO_DATE", "TO_NUMBER", "Identifier", "QuotedIdentifier", 
                      "UnterminatedQuotedIdentifier", "InvalidQuotedIdentifier", 
                      "InvalidUnterminatedQuotedIdentifier", "UnicodeQuotedIdentifier", 
                      "UnterminatedUnicodeQuotedIdentifier", "InvalidUnicodeQuotedIdentifier", 
                      "InvalidUnterminatedUnicodeQuotedIdentifier", "StringConstant", 
                      "UnterminatedStringConstant", "UnicodeEscapeStringConstant", 
                      "UnterminatedUnicodeEscapeStringConstant", "BeginDollarStringConstant", 
                      "BinaryStringConstant", "UnterminatedBinaryStringConstant", 
                      "InvalidBinaryStringConstant", "InvalidUnterminatedBinaryStringConstant", 
                      "HexadecimalStringConstant", "UnterminatedHexadecimalStringConstant", 
                      "InvalidHexadecimalStringConstant", "InvalidUnterminatedHexadecimalStringConstant", 
                      "Integral", "NumericFail", "Numeric", "PLSQLVARIABLENAME", 
                      "PLSQLIDENTIFIER", "Whitespace", "Newline", "LineComment", 
                      "BlockComment", "UnterminatedBlockComment", "MetaCommand", 
                      "EndMetaCommand", "ErrorCharacter", "EscapeStringConstant", 
                      "UnterminatedEscapeStringConstant", "InvalidEscapeStringConstant", 
                      "InvalidUnterminatedEscapeStringConstant", "AfterEscapeStringConstantMode_NotContinued", 
                      "AfterEscapeStringConstantWithNewlineMode_NotContinued", 
                      "DollarText", "EndDollarStringConstant", "AfterEscapeStringConstantWithNewlineMode_Continued" ]

    RULE_root = 0
    RULE_plsqlroot = 1
    RULE_stmtblock = 2
    RULE_stmtmulti = 3
    RULE_stmt = 4
    RULE_plsqlconsolecommand = 5
    RULE_callstmt = 6
    RULE_createrolestmt = 7
    RULE_opt_with = 8
    RULE_optrolelist = 9
    RULE_alteroptrolelist = 10
    RULE_alteroptroleelem = 11
    RULE_createoptroleelem = 12
    RULE_createuserstmt = 13
    RULE_alterrolestmt = 14
    RULE_opt_in_database = 15
    RULE_alterrolesetstmt = 16
    RULE_droprolestmt = 17
    RULE_creategroupstmt = 18
    RULE_altergroupstmt = 19
    RULE_add_drop = 20
    RULE_createschemastmt = 21
    RULE_optschemaname = 22
    RULE_optschemaeltlist = 23
    RULE_schema_stmt = 24
    RULE_variablesetstmt = 25
    RULE_set_rest = 26
    RULE_generic_set = 27
    RULE_set_rest_more = 28
    RULE_var_name = 29
    RULE_var_list = 30
    RULE_var_value = 31
    RULE_iso_level = 32
    RULE_opt_boolean_or_string = 33
    RULE_zone_value = 34
    RULE_opt_encoding = 35
    RULE_nonreservedword_or_sconst = 36
    RULE_variableresetstmt = 37
    RULE_reset_rest = 38
    RULE_generic_reset = 39
    RULE_setresetclause = 40
    RULE_functionsetresetclause = 41
    RULE_variableshowstmt = 42
    RULE_constraintssetstmt = 43
    RULE_constraints_set_list = 44
    RULE_constraints_set_mode = 45
    RULE_checkpointstmt = 46
    RULE_discardstmt = 47
    RULE_altertablestmt = 48
    RULE_alter_table_cmds = 49
    RULE_partition_cmd = 50
    RULE_index_partition_cmd = 51
    RULE_alter_table_cmd = 52
    RULE_alter_column_default = 53
    RULE_opt_drop_behavior = 54
    RULE_opt_collate_clause = 55
    RULE_alter_using = 56
    RULE_replica_identity = 57
    RULE_reloptions = 58
    RULE_opt_reloptions = 59
    RULE_reloption_list = 60
    RULE_reloption_elem = 61
    RULE_alter_identity_column_option_list = 62
    RULE_alter_identity_column_option = 63
    RULE_partitionboundspec = 64
    RULE_hash_partbound_elem = 65
    RULE_hash_partbound = 66
    RULE_altercompositetypestmt = 67
    RULE_alter_type_cmds = 68
    RULE_alter_type_cmd = 69
    RULE_closeportalstmt = 70
    RULE_copystmt = 71
    RULE_copy_from = 72
    RULE_opt_program = 73
    RULE_copy_file_name = 74
    RULE_copy_options = 75
    RULE_copy_opt_list = 76
    RULE_copy_opt_item = 77
    RULE_opt_binary = 78
    RULE_copy_delimiter = 79
    RULE_opt_using = 80
    RULE_copy_generic_opt_list = 81
    RULE_copy_generic_opt_elem = 82
    RULE_copy_generic_opt_arg = 83
    RULE_copy_generic_opt_arg_list = 84
    RULE_copy_generic_opt_arg_list_item = 85
    RULE_createstmt = 86
    RULE_opttemp = 87
    RULE_opttableelementlist = 88
    RULE_opttypedtableelementlist = 89
    RULE_tableelementlist = 90
    RULE_typedtableelementlist = 91
    RULE_tableelement = 92
    RULE_typedtableelement = 93
    RULE_columnDef = 94
    RULE_columnOptions = 95
    RULE_colquallist = 96
    RULE_colconstraint = 97
    RULE_colconstraintelem = 98
    RULE_generated_when = 99
    RULE_constraintattr = 100
    RULE_tablelikeclause = 101
    RULE_tablelikeoptionlist = 102
    RULE_tablelikeoption = 103
    RULE_tableconstraint = 104
    RULE_constraintelem = 105
    RULE_opt_no_inherit = 106
    RULE_opt_column_list = 107
    RULE_columnlist = 108
    RULE_columnElem = 109
    RULE_opt_c_include = 110
    RULE_key_match = 111
    RULE_exclusionconstraintlist = 112
    RULE_exclusionconstraintelem = 113
    RULE_exclusionwhereclause = 114
    RULE_key_actions = 115
    RULE_key_update = 116
    RULE_key_delete = 117
    RULE_key_action = 118
    RULE_optinherit = 119
    RULE_optpartitionspec = 120
    RULE_partitionspec = 121
    RULE_part_params = 122
    RULE_part_elem = 123
    RULE_table_access_method_clause = 124
    RULE_optwith = 125
    RULE_oncommitoption = 126
    RULE_opttablespace = 127
    RULE_optconstablespace = 128
    RULE_existingindex = 129
    RULE_createstatsstmt = 130
    RULE_alterstatsstmt = 131
    RULE_createasstmt = 132
    RULE_create_as_target = 133
    RULE_opt_with_data = 134
    RULE_creatematviewstmt = 135
    RULE_create_mv_target = 136
    RULE_optnolog = 137
    RULE_refreshmatviewstmt = 138
    RULE_createseqstmt = 139
    RULE_alterseqstmt = 140
    RULE_optseqoptlist = 141
    RULE_optparenthesizedseqoptlist = 142
    RULE_seqoptlist = 143
    RULE_seqoptelem = 144
    RULE_opt_by = 145
    RULE_numericonly = 146
    RULE_numericonly_list = 147
    RULE_createplangstmt = 148
    RULE_opt_trusted = 149
    RULE_handler_name = 150
    RULE_opt_inline_handler = 151
    RULE_validator_clause = 152
    RULE_opt_validator = 153
    RULE_opt_procedural = 154
    RULE_createtablespacestmt = 155
    RULE_opttablespaceowner = 156
    RULE_droptablespacestmt = 157
    RULE_createextensionstmt = 158
    RULE_create_extension_opt_list = 159
    RULE_create_extension_opt_item = 160
    RULE_alterextensionstmt = 161
    RULE_alter_extension_opt_list = 162
    RULE_alter_extension_opt_item = 163
    RULE_alterextensioncontentsstmt = 164
    RULE_createfdwstmt = 165
    RULE_fdw_option = 166
    RULE_fdw_options = 167
    RULE_opt_fdw_options = 168
    RULE_alterfdwstmt = 169
    RULE_create_generic_options = 170
    RULE_generic_option_list = 171
    RULE_alter_generic_options = 172
    RULE_alter_generic_option_list = 173
    RULE_alter_generic_option_elem = 174
    RULE_generic_option_elem = 175
    RULE_generic_option_name = 176
    RULE_generic_option_arg = 177
    RULE_createforeignserverstmt = 178
    RULE_opt_type = 179
    RULE_foreign_server_version = 180
    RULE_opt_foreign_server_version = 181
    RULE_alterforeignserverstmt = 182
    RULE_createforeigntablestmt = 183
    RULE_importforeignschemastmt = 184
    RULE_import_qualification_type = 185
    RULE_import_qualification = 186
    RULE_createusermappingstmt = 187
    RULE_auth_ident = 188
    RULE_dropusermappingstmt = 189
    RULE_alterusermappingstmt = 190
    RULE_createpolicystmt = 191
    RULE_alterpolicystmt = 192
    RULE_rowsecurityoptionalexpr = 193
    RULE_rowsecurityoptionalwithcheck = 194
    RULE_rowsecuritydefaulttorole = 195
    RULE_rowsecurityoptionaltorole = 196
    RULE_rowsecuritydefaultpermissive = 197
    RULE_rowsecuritydefaultforcmd = 198
    RULE_row_security_cmd = 199
    RULE_createamstmt = 200
    RULE_am_type = 201
    RULE_createtrigstmt = 202
    RULE_triggeractiontime = 203
    RULE_triggerevents = 204
    RULE_triggeroneevent = 205
    RULE_triggerreferencing = 206
    RULE_triggertransitions = 207
    RULE_triggertransition = 208
    RULE_transitionoldornew = 209
    RULE_transitionrowortable = 210
    RULE_transitionrelname = 211
    RULE_triggerforspec = 212
    RULE_triggerforopteach = 213
    RULE_triggerfortype = 214
    RULE_triggerwhen = 215
    RULE_function_or_procedure = 216
    RULE_triggerfuncargs = 217
    RULE_triggerfuncarg = 218
    RULE_optconstrfromtable = 219
    RULE_constraintattributespec = 220
    RULE_constraintattributeElem = 221
    RULE_createeventtrigstmt = 222
    RULE_event_trigger_when_list = 223
    RULE_event_trigger_when_item = 224
    RULE_event_trigger_value_list = 225
    RULE_altereventtrigstmt = 226
    RULE_enable_trigger = 227
    RULE_createassertionstmt = 228
    RULE_definestmt = 229
    RULE_definition = 230
    RULE_def_list = 231
    RULE_def_elem = 232
    RULE_def_arg = 233
    RULE_old_aggr_definition = 234
    RULE_old_aggr_list = 235
    RULE_old_aggr_elem = 236
    RULE_opt_enum_val_list = 237
    RULE_enum_val_list = 238
    RULE_alterenumstmt = 239
    RULE_opt_if_not_exists = 240
    RULE_createopclassstmt = 241
    RULE_opclass_item_list = 242
    RULE_opclass_item = 243
    RULE_opt_default = 244
    RULE_opt_opfamily = 245
    RULE_opclass_purpose = 246
    RULE_opt_recheck = 247
    RULE_createopfamilystmt = 248
    RULE_alteropfamilystmt = 249
    RULE_opclass_drop_list = 250
    RULE_opclass_drop = 251
    RULE_dropopclassstmt = 252
    RULE_dropopfamilystmt = 253
    RULE_dropownedstmt = 254
    RULE_reassignownedstmt = 255
    RULE_dropstmt = 256
    RULE_object_type_any_name = 257
    RULE_object_type_name = 258
    RULE_drop_type_name = 259
    RULE_object_type_name_on_any_name = 260
    RULE_any_name_list = 261
    RULE_any_name = 262
    RULE_attrs = 263
    RULE_type_name_list = 264
    RULE_truncatestmt = 265
    RULE_opt_restart_seqs = 266
    RULE_commentstmt = 267
    RULE_comment_text = 268
    RULE_seclabelstmt = 269
    RULE_opt_provider = 270
    RULE_security_label = 271
    RULE_fetchstmt = 272
    RULE_fetch_args = 273
    RULE_from_in = 274
    RULE_opt_from_in = 275
    RULE_grantstmt = 276
    RULE_revokestmt = 277
    RULE_privileges = 278
    RULE_privilege_list = 279
    RULE_privilege = 280
    RULE_privilege_target = 281
    RULE_grantee_list = 282
    RULE_grantee = 283
    RULE_opt_grant_grant_option = 284
    RULE_grantrolestmt = 285
    RULE_revokerolestmt = 286
    RULE_opt_grant_admin_option = 287
    RULE_opt_granted_by = 288
    RULE_alterdefaultprivilegesstmt = 289
    RULE_defacloptionlist = 290
    RULE_defacloption = 291
    RULE_defaclaction = 292
    RULE_defacl_privilege_target = 293
    RULE_indexstmt = 294
    RULE_opt_unique = 295
    RULE_opt_concurrently = 296
    RULE_opt_index_name = 297
    RULE_access_method_clause = 298
    RULE_index_params = 299
    RULE_index_elem_options = 300
    RULE_index_elem = 301
    RULE_opt_include = 302
    RULE_index_including_params = 303
    RULE_opt_collate = 304
    RULE_opt_class = 305
    RULE_opt_asc_desc = 306
    RULE_opt_nulls_order = 307
    RULE_createfunctionstmt = 308
    RULE_opt_or_replace = 309
    RULE_func_args = 310
    RULE_func_args_list = 311
    RULE_function_with_argtypes_list = 312
    RULE_function_with_argtypes = 313
    RULE_func_args_with_defaults = 314
    RULE_func_args_with_defaults_list = 315
    RULE_func_arg = 316
    RULE_arg_class = 317
    RULE_param_name = 318
    RULE_func_return = 319
    RULE_func_type = 320
    RULE_func_arg_with_default = 321
    RULE_aggr_arg = 322
    RULE_aggr_args = 323
    RULE_aggr_args_list = 324
    RULE_aggregate_with_argtypes = 325
    RULE_aggregate_with_argtypes_list = 326
    RULE_createfunc_opt_list = 327
    RULE_common_func_opt_item = 328
    RULE_createfunc_opt_item = 329
    RULE_func_as = 330
    RULE_transform_type_list = 331
    RULE_opt_definition = 332
    RULE_table_func_column = 333
    RULE_table_func_column_list = 334
    RULE_alterfunctionstmt = 335
    RULE_alterfunc_opt_list = 336
    RULE_opt_restrict = 337
    RULE_removefuncstmt = 338
    RULE_removeaggrstmt = 339
    RULE_removeoperstmt = 340
    RULE_oper_argtypes = 341
    RULE_any_operator = 342
    RULE_operator_with_argtypes_list = 343
    RULE_operator_with_argtypes = 344
    RULE_dostmt = 345
    RULE_dostmt_opt_list = 346
    RULE_dostmt_opt_item = 347
    RULE_createcaststmt = 348
    RULE_cast_context = 349
    RULE_dropcaststmt = 350
    RULE_opt_if_exists = 351
    RULE_createtransformstmt = 352
    RULE_transform_element_list = 353
    RULE_droptransformstmt = 354
    RULE_reindexstmt = 355
    RULE_reindex_target_type = 356
    RULE_reindex_target_multitable = 357
    RULE_reindex_option_list = 358
    RULE_reindex_option_elem = 359
    RULE_altertblspcstmt = 360
    RULE_renamestmt = 361
    RULE_opt_column = 362
    RULE_opt_set_data = 363
    RULE_alterobjectdependsstmt = 364
    RULE_opt_no = 365
    RULE_alterobjectschemastmt = 366
    RULE_alteroperatorstmt = 367
    RULE_operator_def_list = 368
    RULE_operator_def_elem = 369
    RULE_operator_def_arg = 370
    RULE_altertypestmt = 371
    RULE_alterownerstmt = 372
    RULE_createpublicationstmt = 373
    RULE_opt_publication_for_tables = 374
    RULE_publication_for_tables = 375
    RULE_alterpublicationstmt = 376
    RULE_createsubscriptionstmt = 377
    RULE_publication_name_list = 378
    RULE_publication_name_item = 379
    RULE_altersubscriptionstmt = 380
    RULE_dropsubscriptionstmt = 381
    RULE_rulestmt = 382
    RULE_ruleactionlist = 383
    RULE_ruleactionmulti = 384
    RULE_ruleactionstmt = 385
    RULE_ruleactionstmtOrEmpty = 386
    RULE_event = 387
    RULE_opt_instead = 388
    RULE_notifystmt = 389
    RULE_notify_payload = 390
    RULE_listenstmt = 391
    RULE_unlistenstmt = 392
    RULE_transactionstmt = 393
    RULE_opt_transaction = 394
    RULE_transaction_mode_item = 395
    RULE_transaction_mode_list = 396
    RULE_transaction_mode_list_or_empty = 397
    RULE_opt_transaction_chain = 398
    RULE_viewstmt = 399
    RULE_opt_check_option = 400
    RULE_loadstmt = 401
    RULE_createdbstmt = 402
    RULE_createdb_opt_list = 403
    RULE_createdb_opt_items = 404
    RULE_createdb_opt_item = 405
    RULE_createdb_opt_name = 406
    RULE_opt_equal = 407
    RULE_alterdatabasestmt = 408
    RULE_alterdatabasesetstmt = 409
    RULE_dropdbstmt = 410
    RULE_drop_option_list = 411
    RULE_drop_option = 412
    RULE_altercollationstmt = 413
    RULE_altersystemstmt = 414
    RULE_createdomainstmt = 415
    RULE_alterdomainstmt = 416
    RULE_opt_as = 417
    RULE_altertsdictionarystmt = 418
    RULE_altertsconfigurationstmt = 419
    RULE_any_with = 420
    RULE_createconversionstmt = 421
    RULE_clusterstmt = 422
    RULE_cluster_index_specification = 423
    RULE_vacuumstmt = 424
    RULE_analyzestmt = 425
    RULE_vac_analyze_option_list = 426
    RULE_analyze_keyword = 427
    RULE_vac_analyze_option_elem = 428
    RULE_vac_analyze_option_name = 429
    RULE_vac_analyze_option_arg = 430
    RULE_opt_analyze = 431
    RULE_opt_verbose = 432
    RULE_opt_full = 433
    RULE_opt_freeze = 434
    RULE_opt_name_list = 435
    RULE_vacuum_relation = 436
    RULE_vacuum_relation_list = 437
    RULE_opt_vacuum_relation_list = 438
    RULE_explainstmt = 439
    RULE_explainablestmt = 440
    RULE_explain_option_list = 441
    RULE_explain_option_elem = 442
    RULE_explain_option_name = 443
    RULE_explain_option_arg = 444
    RULE_preparestmt = 445
    RULE_prep_type_clause = 446
    RULE_preparablestmt = 447
    RULE_executestmt = 448
    RULE_execute_param_clause = 449
    RULE_deallocatestmt = 450
    RULE_insertstmt = 451
    RULE_insert_target = 452
    RULE_insert_rest = 453
    RULE_override_kind = 454
    RULE_insert_column_list = 455
    RULE_insert_column_item = 456
    RULE_opt_on_conflict = 457
    RULE_opt_conf_expr = 458
    RULE_returning_clause = 459
    RULE_mergestmt = 460
    RULE_merge_insert_clause = 461
    RULE_merge_update_clause = 462
    RULE_merge_delete_clause = 463
    RULE_deletestmt = 464
    RULE_using_clause = 465
    RULE_lockstmt = 466
    RULE_opt_lock = 467
    RULE_lock_type = 468
    RULE_opt_nowait = 469
    RULE_opt_nowait_or_skip = 470
    RULE_updatestmt = 471
    RULE_set_clause_list = 472
    RULE_set_clause = 473
    RULE_set_target = 474
    RULE_set_target_list = 475
    RULE_declarecursorstmt = 476
    RULE_cursor_name = 477
    RULE_cursor_options = 478
    RULE_opt_hold = 479
    RULE_selectstmt = 480
    RULE_select_with_parens = 481
    RULE_select_no_parens = 482
    RULE_select_clause = 483
    RULE_simple_select_intersect = 484
    RULE_simple_select_pramary = 485
    RULE_with_clause = 486
    RULE_cte_list = 487
    RULE_common_table_expr = 488
    RULE_opt_materialized = 489
    RULE_opt_with_clause = 490
    RULE_into_clause = 491
    RULE_opt_strict = 492
    RULE_opttempTableName = 493
    RULE_opt_table = 494
    RULE_all_or_distinct = 495
    RULE_distinct_clause = 496
    RULE_opt_all_clause = 497
    RULE_opt_sort_clause = 498
    RULE_sort_clause = 499
    RULE_sortby_list = 500
    RULE_sortby = 501
    RULE_select_limit = 502
    RULE_opt_select_limit = 503
    RULE_limit_clause = 504
    RULE_offset_clause = 505
    RULE_select_limit_value = 506
    RULE_select_offset_value = 507
    RULE_select_fetch_first_value = 508
    RULE_i_or_f_const = 509
    RULE_row_or_rows = 510
    RULE_first_or_next = 511
    RULE_group_clause = 512
    RULE_group_by_list = 513
    RULE_group_by_item = 514
    RULE_empty_grouping_set = 515
    RULE_rollup_clause = 516
    RULE_cube_clause = 517
    RULE_grouping_sets_clause = 518
    RULE_having_clause = 519
    RULE_for_locking_clause = 520
    RULE_opt_for_locking_clause = 521
    RULE_for_locking_items = 522
    RULE_for_locking_item = 523
    RULE_for_locking_strength = 524
    RULE_locked_rels_list = 525
    RULE_values_clause = 526
    RULE_from_clause = 527
    RULE_from_list = 528
    RULE_non_ansi_join = 529
    RULE_table_ref = 530
    RULE_alias_clause = 531
    RULE_opt_alias_clause = 532
    RULE_table_alias_clause = 533
    RULE_func_alias_clause = 534
    RULE_join_type = 535
    RULE_join_qual = 536
    RULE_relation_expr = 537
    RULE_relation_expr_list = 538
    RULE_relation_expr_opt_alias = 539
    RULE_tablesample_clause = 540
    RULE_opt_repeatable_clause = 541
    RULE_func_table = 542
    RULE_rowsfrom_item = 543
    RULE_rowsfrom_list = 544
    RULE_opt_col_def_list = 545
    RULE_opt_ordinality = 546
    RULE_where_clause = 547
    RULE_where_or_current_clause = 548
    RULE_opttablefuncelementlist = 549
    RULE_tablefuncelementlist = 550
    RULE_tablefuncelement = 551
    RULE_xmltable = 552
    RULE_xmltable_column_list = 553
    RULE_xmltable_column_el = 554
    RULE_xmltable_column_option_list = 555
    RULE_xmltable_column_option_el = 556
    RULE_xml_namespace_list = 557
    RULE_xml_namespace_el = 558
    RULE_typename = 559
    RULE_opt_array_bounds = 560
    RULE_simpletypename = 561
    RULE_consttypename = 562
    RULE_generictype = 563
    RULE_opt_type_modifiers = 564
    RULE_numeric = 565
    RULE_opt_float = 566
    RULE_bit = 567
    RULE_constbit = 568
    RULE_bitwithlength = 569
    RULE_bitwithoutlength = 570
    RULE_character = 571
    RULE_constcharacter = 572
    RULE_character_c = 573
    RULE_opt_varying = 574
    RULE_constdatetime = 575
    RULE_constinterval = 576
    RULE_opt_timezone = 577
    RULE_opt_interval = 578
    RULE_interval_second = 579
    RULE_opt_escape = 580
    RULE_a_expr = 581
    RULE_a_expr_qual = 582
    RULE_a_expr_lessless = 583
    RULE_a_expr_or = 584
    RULE_a_expr_and = 585
    RULE_a_expr_between = 586
    RULE_a_expr_in = 587
    RULE_a_expr_unary_not = 588
    RULE_a_expr_isnull = 589
    RULE_a_expr_is_not = 590
    RULE_a_expr_compare = 591
    RULE_a_expr_like = 592
    RULE_a_expr_qual_op = 593
    RULE_a_expr_unary_qualop = 594
    RULE_a_expr_add = 595
    RULE_a_expr_mul = 596
    RULE_a_expr_caret = 597
    RULE_a_expr_unary_sign = 598
    RULE_a_expr_at_time_zone = 599
    RULE_a_expr_collate = 600
    RULE_a_expr_typecast = 601
    RULE_b_expr = 602
    RULE_c_expr = 603
    RULE_plsqlvariablename = 604
    RULE_func_application = 605
    RULE_func_expr = 606
    RULE_func_expr_windowless = 607
    RULE_func_expr_common_subexpr = 608
    RULE_xml_root_version = 609
    RULE_opt_xml_root_standalone = 610
    RULE_xml_attributes = 611
    RULE_xml_attribute_list = 612
    RULE_xml_attribute_el = 613
    RULE_document_or_content = 614
    RULE_xml_whitespace_option = 615
    RULE_xmlexists_argument = 616
    RULE_xml_passing_mech = 617
    RULE_within_group_clause = 618
    RULE_filter_clause = 619
    RULE_window_clause = 620
    RULE_window_definition_list = 621
    RULE_window_definition = 622
    RULE_over_clause = 623
    RULE_window_specification = 624
    RULE_opt_existing_window_name = 625
    RULE_opt_partition_clause = 626
    RULE_opt_frame_clause = 627
    RULE_frame_extent = 628
    RULE_frame_bound = 629
    RULE_opt_window_exclusion_clause = 630
    RULE_row = 631
    RULE_explicit_row = 632
    RULE_implicit_row = 633
    RULE_sub_type = 634
    RULE_all_op = 635
    RULE_mathop = 636
    RULE_qual_op = 637
    RULE_qual_all_op = 638
    RULE_subquery_Op = 639
    RULE_expr_list = 640
    RULE_func_arg_list = 641
    RULE_func_arg_expr = 642
    RULE_type_list = 643
    RULE_array_expr = 644
    RULE_array_expr_list = 645
    RULE_extract_list = 646
    RULE_extract_arg = 647
    RULE_unicode_normal_form = 648
    RULE_overlay_list = 649
    RULE_position_list = 650
    RULE_substr_list = 651
    RULE_trim_list = 652
    RULE_in_expr = 653
    RULE_case_expr = 654
    RULE_when_clause_list = 655
    RULE_when_clause = 656
    RULE_case_default = 657
    RULE_case_arg = 658
    RULE_columnref = 659
    RULE_indirection_el = 660
    RULE_opt_slice_bound = 661
    RULE_indirection = 662
    RULE_opt_indirection = 663
    RULE_opt_target_list = 664
    RULE_target_list = 665
    RULE_target_el = 666
    RULE_qualified_name_list = 667
    RULE_qualified_name = 668
    RULE_name_list = 669
    RULE_name = 670
    RULE_attr_name = 671
    RULE_file_name = 672
    RULE_func_name = 673
    RULE_aexprconst = 674
    RULE_xconst = 675
    RULE_bconst = 676
    RULE_fconst = 677
    RULE_iconst = 678
    RULE_sconst = 679
    RULE_anysconst = 680
    RULE_opt_uescape = 681
    RULE_signediconst = 682
    RULE_roleid = 683
    RULE_rolespec = 684
    RULE_role_list = 685
    RULE_colid = 686
    RULE_table_alias = 687
    RULE_type_function_name = 688
    RULE_nonreservedword = 689
    RULE_collabel = 690
    RULE_identifier = 691
    RULE_plsqlidentifier = 692
    RULE_unreserved_keyword = 693
    RULE_col_name_keyword = 694
    RULE_type_func_name_keyword = 695
    RULE_reserved_keyword = 696
    RULE_builtin_function_name = 697
    RULE_pl_function = 698
    RULE_comp_options = 699
    RULE_comp_option = 700
    RULE_sharp = 701
    RULE_option_value = 702
    RULE_opt_semi = 703
    RULE_pl_block = 704
    RULE_decl_sect = 705
    RULE_decl_start = 706
    RULE_decl_stmts = 707
    RULE_label_decl = 708
    RULE_decl_stmt = 709
    RULE_decl_statement = 710
    RULE_opt_scrollable = 711
    RULE_decl_cursor_query = 712
    RULE_decl_cursor_args = 713
    RULE_decl_cursor_arglist = 714
    RULE_decl_cursor_arg = 715
    RULE_decl_is_for = 716
    RULE_decl_aliasitem = 717
    RULE_decl_varname = 718
    RULE_decl_const = 719
    RULE_decl_datatype = 720
    RULE_decl_collate = 721
    RULE_decl_notnull = 722
    RULE_decl_defval = 723
    RULE_decl_defkey = 724
    RULE_assign_operator = 725
    RULE_proc_sect = 726
    RULE_proc_stmt = 727
    RULE_stmt_perform = 728
    RULE_stmt_call = 729
    RULE_opt_expr_list = 730
    RULE_stmt_assign = 731
    RULE_stmt_getdiag = 732
    RULE_getdiag_area_opt = 733
    RULE_getdiag_list = 734
    RULE_getdiag_list_item = 735
    RULE_getdiag_item = 736
    RULE_getdiag_target = 737
    RULE_assign_var = 738
    RULE_stmt_if = 739
    RULE_stmt_elsifs = 740
    RULE_stmt_else = 741
    RULE_stmt_case = 742
    RULE_opt_expr_until_when = 743
    RULE_case_when_list = 744
    RULE_case_when = 745
    RULE_opt_case_else = 746
    RULE_stmt_loop = 747
    RULE_stmt_while = 748
    RULE_stmt_for = 749
    RULE_for_control = 750
    RULE_opt_for_using_expression = 751
    RULE_opt_cursor_parameters = 752
    RULE_opt_reverse = 753
    RULE_opt_by_expression = 754
    RULE_for_variable = 755
    RULE_stmt_foreach_a = 756
    RULE_foreach_slice = 757
    RULE_stmt_exit = 758
    RULE_exit_type = 759
    RULE_stmt_return = 760
    RULE_opt_return_result = 761
    RULE_stmt_raise = 762
    RULE_opt_stmt_raise_level = 763
    RULE_opt_raise_list = 764
    RULE_opt_raise_using = 765
    RULE_opt_raise_using_elem = 766
    RULE_opt_raise_using_elem_list = 767
    RULE_stmt_assert = 768
    RULE_opt_stmt_assert_message = 769
    RULE_loop_body = 770
    RULE_stmt_execsql = 771
    RULE_stmt_dynexecute = 772
    RULE_opt_execute_using = 773
    RULE_opt_execute_using_list = 774
    RULE_opt_execute_into = 775
    RULE_stmt_open = 776
    RULE_opt_open_bound_list_item = 777
    RULE_opt_open_bound_list = 778
    RULE_opt_open_using = 779
    RULE_opt_scroll_option = 780
    RULE_opt_scroll_option_no = 781
    RULE_stmt_fetch = 782
    RULE_into_target = 783
    RULE_opt_cursor_from = 784
    RULE_opt_fetch_direction = 785
    RULE_stmt_move = 786
    RULE_stmt_close = 787
    RULE_stmt_null = 788
    RULE_stmt_commit = 789
    RULE_stmt_rollback = 790
    RULE_plsql_opt_transaction_chain = 791
    RULE_stmt_set = 792
    RULE_cursor_variable = 793
    RULE_exception_sect = 794
    RULE_proc_exceptions = 795
    RULE_proc_exception = 796
    RULE_proc_conditions = 797
    RULE_proc_condition = 798
    RULE_opt_block_label = 799
    RULE_opt_loop_label = 800
    RULE_opt_label = 801
    RULE_opt_exitcond = 802
    RULE_any_identifier = 803
    RULE_plsql_unreserved_keyword = 804
    RULE_sql_expression = 805
    RULE_expr_until_then = 806
    RULE_expr_until_semi = 807
    RULE_expr_until_rightbracket = 808
    RULE_expr_until_loop = 809
    RULE_make_execsql_stmt = 810
    RULE_opt_returning_clause_into = 811

    ruleNames =  [ "root", "plsqlroot", "stmtblock", "stmtmulti", "stmt", 
                   "plsqlconsolecommand", "callstmt", "createrolestmt", 
                   "opt_with", "optrolelist", "alteroptrolelist", "alteroptroleelem", 
                   "createoptroleelem", "createuserstmt", "alterrolestmt", 
                   "opt_in_database", "alterrolesetstmt", "droprolestmt", 
                   "creategroupstmt", "altergroupstmt", "add_drop", "createschemastmt", 
                   "optschemaname", "optschemaeltlist", "schema_stmt", "variablesetstmt", 
                   "set_rest", "generic_set", "set_rest_more", "var_name", 
                   "var_list", "var_value", "iso_level", "opt_boolean_or_string", 
                   "zone_value", "opt_encoding", "nonreservedword_or_sconst", 
                   "variableresetstmt", "reset_rest", "generic_reset", "setresetclause", 
                   "functionsetresetclause", "variableshowstmt", "constraintssetstmt", 
                   "constraints_set_list", "constraints_set_mode", "checkpointstmt", 
                   "discardstmt", "altertablestmt", "alter_table_cmds", 
                   "partition_cmd", "index_partition_cmd", "alter_table_cmd", 
                   "alter_column_default", "opt_drop_behavior", "opt_collate_clause", 
                   "alter_using", "replica_identity", "reloptions", "opt_reloptions", 
                   "reloption_list", "reloption_elem", "alter_identity_column_option_list", 
                   "alter_identity_column_option", "partitionboundspec", 
                   "hash_partbound_elem", "hash_partbound", "altercompositetypestmt", 
                   "alter_type_cmds", "alter_type_cmd", "closeportalstmt", 
                   "copystmt", "copy_from", "opt_program", "copy_file_name", 
                   "copy_options", "copy_opt_list", "copy_opt_item", "opt_binary", 
                   "copy_delimiter", "opt_using", "copy_generic_opt_list", 
                   "copy_generic_opt_elem", "copy_generic_opt_arg", "copy_generic_opt_arg_list", 
                   "copy_generic_opt_arg_list_item", "createstmt", "opttemp", 
                   "opttableelementlist", "opttypedtableelementlist", "tableelementlist", 
                   "typedtableelementlist", "tableelement", "typedtableelement", 
                   "columnDef", "columnOptions", "colquallist", "colconstraint", 
                   "colconstraintelem", "generated_when", "constraintattr", 
                   "tablelikeclause", "tablelikeoptionlist", "tablelikeoption", 
                   "tableconstraint", "constraintelem", "opt_no_inherit", 
                   "opt_column_list", "columnlist", "columnElem", "opt_c_include", 
                   "key_match", "exclusionconstraintlist", "exclusionconstraintelem", 
                   "exclusionwhereclause", "key_actions", "key_update", 
                   "key_delete", "key_action", "optinherit", "optpartitionspec", 
                   "partitionspec", "part_params", "part_elem", "table_access_method_clause", 
                   "optwith", "oncommitoption", "opttablespace", "optconstablespace", 
                   "existingindex", "createstatsstmt", "alterstatsstmt", 
                   "createasstmt", "create_as_target", "opt_with_data", 
                   "creatematviewstmt", "create_mv_target", "optnolog", 
                   "refreshmatviewstmt", "createseqstmt", "alterseqstmt", 
                   "optseqoptlist", "optparenthesizedseqoptlist", "seqoptlist", 
                   "seqoptelem", "opt_by", "numericonly", "numericonly_list", 
                   "createplangstmt", "opt_trusted", "handler_name", "opt_inline_handler", 
                   "validator_clause", "opt_validator", "opt_procedural", 
                   "createtablespacestmt", "opttablespaceowner", "droptablespacestmt", 
                   "createextensionstmt", "create_extension_opt_list", "create_extension_opt_item", 
                   "alterextensionstmt", "alter_extension_opt_list", "alter_extension_opt_item", 
                   "alterextensioncontentsstmt", "createfdwstmt", "fdw_option", 
                   "fdw_options", "opt_fdw_options", "alterfdwstmt", "create_generic_options", 
                   "generic_option_list", "alter_generic_options", "alter_generic_option_list", 
                   "alter_generic_option_elem", "generic_option_elem", "generic_option_name", 
                   "generic_option_arg", "createforeignserverstmt", "opt_type", 
                   "foreign_server_version", "opt_foreign_server_version", 
                   "alterforeignserverstmt", "createforeigntablestmt", "importforeignschemastmt", 
                   "import_qualification_type", "import_qualification", 
                   "createusermappingstmt", "auth_ident", "dropusermappingstmt", 
                   "alterusermappingstmt", "createpolicystmt", "alterpolicystmt", 
                   "rowsecurityoptionalexpr", "rowsecurityoptionalwithcheck", 
                   "rowsecuritydefaulttorole", "rowsecurityoptionaltorole", 
                   "rowsecuritydefaultpermissive", "rowsecuritydefaultforcmd", 
                   "row_security_cmd", "createamstmt", "am_type", "createtrigstmt", 
                   "triggeractiontime", "triggerevents", "triggeroneevent", 
                   "triggerreferencing", "triggertransitions", "triggertransition", 
                   "transitionoldornew", "transitionrowortable", "transitionrelname", 
                   "triggerforspec", "triggerforopteach", "triggerfortype", 
                   "triggerwhen", "function_or_procedure", "triggerfuncargs", 
                   "triggerfuncarg", "optconstrfromtable", "constraintattributespec", 
                   "constraintattributeElem", "createeventtrigstmt", "event_trigger_when_list", 
                   "event_trigger_when_item", "event_trigger_value_list", 
                   "altereventtrigstmt", "enable_trigger", "createassertionstmt", 
                   "definestmt", "definition", "def_list", "def_elem", "def_arg", 
                   "old_aggr_definition", "old_aggr_list", "old_aggr_elem", 
                   "opt_enum_val_list", "enum_val_list", "alterenumstmt", 
                   "opt_if_not_exists", "createopclassstmt", "opclass_item_list", 
                   "opclass_item", "opt_default", "opt_opfamily", "opclass_purpose", 
                   "opt_recheck", "createopfamilystmt", "alteropfamilystmt", 
                   "opclass_drop_list", "opclass_drop", "dropopclassstmt", 
                   "dropopfamilystmt", "dropownedstmt", "reassignownedstmt", 
                   "dropstmt", "object_type_any_name", "object_type_name", 
                   "drop_type_name", "object_type_name_on_any_name", "any_name_list", 
                   "any_name", "attrs", "type_name_list", "truncatestmt", 
                   "opt_restart_seqs", "commentstmt", "comment_text", "seclabelstmt", 
                   "opt_provider", "security_label", "fetchstmt", "fetch_args", 
                   "from_in", "opt_from_in", "grantstmt", "revokestmt", 
                   "privileges", "privilege_list", "privilege", "privilege_target", 
                   "grantee_list", "grantee", "opt_grant_grant_option", 
                   "grantrolestmt", "revokerolestmt", "opt_grant_admin_option", 
                   "opt_granted_by", "alterdefaultprivilegesstmt", "defacloptionlist", 
                   "defacloption", "defaclaction", "defacl_privilege_target", 
                   "indexstmt", "opt_unique", "opt_concurrently", "opt_index_name", 
                   "access_method_clause", "index_params", "index_elem_options", 
                   "index_elem", "opt_include", "index_including_params", 
                   "opt_collate", "opt_class", "opt_asc_desc", "opt_nulls_order", 
                   "createfunctionstmt", "opt_or_replace", "func_args", 
                   "func_args_list", "function_with_argtypes_list", "function_with_argtypes", 
                   "func_args_with_defaults", "func_args_with_defaults_list", 
                   "func_arg", "arg_class", "param_name", "func_return", 
                   "func_type", "func_arg_with_default", "aggr_arg", "aggr_args", 
                   "aggr_args_list", "aggregate_with_argtypes", "aggregate_with_argtypes_list", 
                   "createfunc_opt_list", "common_func_opt_item", "createfunc_opt_item", 
                   "func_as", "transform_type_list", "opt_definition", "table_func_column", 
                   "table_func_column_list", "alterfunctionstmt", "alterfunc_opt_list", 
                   "opt_restrict", "removefuncstmt", "removeaggrstmt", "removeoperstmt", 
                   "oper_argtypes", "any_operator", "operator_with_argtypes_list", 
                   "operator_with_argtypes", "dostmt", "dostmt_opt_list", 
                   "dostmt_opt_item", "createcaststmt", "cast_context", 
                   "dropcaststmt", "opt_if_exists", "createtransformstmt", 
                   "transform_element_list", "droptransformstmt", "reindexstmt", 
                   "reindex_target_type", "reindex_target_multitable", "reindex_option_list", 
                   "reindex_option_elem", "altertblspcstmt", "renamestmt", 
                   "opt_column", "opt_set_data", "alterobjectdependsstmt", 
                   "opt_no", "alterobjectschemastmt", "alteroperatorstmt", 
                   "operator_def_list", "operator_def_elem", "operator_def_arg", 
                   "altertypestmt", "alterownerstmt", "createpublicationstmt", 
                   "opt_publication_for_tables", "publication_for_tables", 
                   "alterpublicationstmt", "createsubscriptionstmt", "publication_name_list", 
                   "publication_name_item", "altersubscriptionstmt", "dropsubscriptionstmt", 
                   "rulestmt", "ruleactionlist", "ruleactionmulti", "ruleactionstmt", 
                   "ruleactionstmtOrEmpty", "event", "opt_instead", "notifystmt", 
                   "notify_payload", "listenstmt", "unlistenstmt", "transactionstmt", 
                   "opt_transaction", "transaction_mode_item", "transaction_mode_list", 
                   "transaction_mode_list_or_empty", "opt_transaction_chain", 
                   "viewstmt", "opt_check_option", "loadstmt", "createdbstmt", 
                   "createdb_opt_list", "createdb_opt_items", "createdb_opt_item", 
                   "createdb_opt_name", "opt_equal", "alterdatabasestmt", 
                   "alterdatabasesetstmt", "dropdbstmt", "drop_option_list", 
                   "drop_option", "altercollationstmt", "altersystemstmt", 
                   "createdomainstmt", "alterdomainstmt", "opt_as", "altertsdictionarystmt", 
                   "altertsconfigurationstmt", "any_with", "createconversionstmt", 
                   "clusterstmt", "cluster_index_specification", "vacuumstmt", 
                   "analyzestmt", "vac_analyze_option_list", "analyze_keyword", 
                   "vac_analyze_option_elem", "vac_analyze_option_name", 
                   "vac_analyze_option_arg", "opt_analyze", "opt_verbose", 
                   "opt_full", "opt_freeze", "opt_name_list", "vacuum_relation", 
                   "vacuum_relation_list", "opt_vacuum_relation_list", "explainstmt", 
                   "explainablestmt", "explain_option_list", "explain_option_elem", 
                   "explain_option_name", "explain_option_arg", "preparestmt", 
                   "prep_type_clause", "preparablestmt", "executestmt", 
                   "execute_param_clause", "deallocatestmt", "insertstmt", 
                   "insert_target", "insert_rest", "override_kind", "insert_column_list", 
                   "insert_column_item", "opt_on_conflict", "opt_conf_expr", 
                   "returning_clause", "mergestmt", "merge_insert_clause", 
                   "merge_update_clause", "merge_delete_clause", "deletestmt", 
                   "using_clause", "lockstmt", "opt_lock", "lock_type", 
                   "opt_nowait", "opt_nowait_or_skip", "updatestmt", "set_clause_list", 
                   "set_clause", "set_target", "set_target_list", "declarecursorstmt", 
                   "cursor_name", "cursor_options", "opt_hold", "selectstmt", 
                   "select_with_parens", "select_no_parens", "select_clause", 
                   "simple_select_intersect", "simple_select_pramary", "with_clause", 
                   "cte_list", "common_table_expr", "opt_materialized", 
                   "opt_with_clause", "into_clause", "opt_strict", "opttempTableName", 
                   "opt_table", "all_or_distinct", "distinct_clause", "opt_all_clause", 
                   "opt_sort_clause", "sort_clause", "sortby_list", "sortby", 
                   "select_limit", "opt_select_limit", "limit_clause", "offset_clause", 
                   "select_limit_value", "select_offset_value", "select_fetch_first_value", 
                   "i_or_f_const", "row_or_rows", "first_or_next", "group_clause", 
                   "group_by_list", "group_by_item", "empty_grouping_set", 
                   "rollup_clause", "cube_clause", "grouping_sets_clause", 
                   "having_clause", "for_locking_clause", "opt_for_locking_clause", 
                   "for_locking_items", "for_locking_item", "for_locking_strength", 
                   "locked_rels_list", "values_clause", "from_clause", "from_list", 
                   "non_ansi_join", "table_ref", "alias_clause", "opt_alias_clause", 
                   "table_alias_clause", "func_alias_clause", "join_type", 
                   "join_qual", "relation_expr", "relation_expr_list", "relation_expr_opt_alias", 
                   "tablesample_clause", "opt_repeatable_clause", "func_table", 
                   "rowsfrom_item", "rowsfrom_list", "opt_col_def_list", 
                   "opt_ordinality", "where_clause", "where_or_current_clause", 
                   "opttablefuncelementlist", "tablefuncelementlist", "tablefuncelement", 
                   "xmltable", "xmltable_column_list", "xmltable_column_el", 
                   "xmltable_column_option_list", "xmltable_column_option_el", 
                   "xml_namespace_list", "xml_namespace_el", "typename", 
                   "opt_array_bounds", "simpletypename", "consttypename", 
                   "generictype", "opt_type_modifiers", "numeric", "opt_float", 
                   "bit", "constbit", "bitwithlength", "bitwithoutlength", 
                   "character", "constcharacter", "character_c", "opt_varying", 
                   "constdatetime", "constinterval", "opt_timezone", "opt_interval", 
                   "interval_second", "opt_escape", "a_expr", "a_expr_qual", 
                   "a_expr_lessless", "a_expr_or", "a_expr_and", "a_expr_between", 
                   "a_expr_in", "a_expr_unary_not", "a_expr_isnull", "a_expr_is_not", 
                   "a_expr_compare", "a_expr_like", "a_expr_qual_op", "a_expr_unary_qualop", 
                   "a_expr_add", "a_expr_mul", "a_expr_caret", "a_expr_unary_sign", 
                   "a_expr_at_time_zone", "a_expr_collate", "a_expr_typecast", 
                   "b_expr", "c_expr", "plsqlvariablename", "func_application", 
                   "func_expr", "func_expr_windowless", "func_expr_common_subexpr", 
                   "xml_root_version", "opt_xml_root_standalone", "xml_attributes", 
                   "xml_attribute_list", "xml_attribute_el", "document_or_content", 
                   "xml_whitespace_option", "xmlexists_argument", "xml_passing_mech", 
                   "within_group_clause", "filter_clause", "window_clause", 
                   "window_definition_list", "window_definition", "over_clause", 
                   "window_specification", "opt_existing_window_name", "opt_partition_clause", 
                   "opt_frame_clause", "frame_extent", "frame_bound", "opt_window_exclusion_clause", 
                   "row", "explicit_row", "implicit_row", "sub_type", "all_op", 
                   "mathop", "qual_op", "qual_all_op", "subquery_Op", "expr_list", 
                   "func_arg_list", "func_arg_expr", "type_list", "array_expr", 
                   "array_expr_list", "extract_list", "extract_arg", "unicode_normal_form", 
                   "overlay_list", "position_list", "substr_list", "trim_list", 
                   "in_expr", "case_expr", "when_clause_list", "when_clause", 
                   "case_default", "case_arg", "columnref", "indirection_el", 
                   "opt_slice_bound", "indirection", "opt_indirection", 
                   "opt_target_list", "target_list", "target_el", "qualified_name_list", 
                   "qualified_name", "name_list", "name", "attr_name", "file_name", 
                   "func_name", "aexprconst", "xconst", "bconst", "fconst", 
                   "iconst", "sconst", "anysconst", "opt_uescape", "signediconst", 
                   "roleid", "rolespec", "role_list", "colid", "table_alias", 
                   "type_function_name", "nonreservedword", "collabel", 
                   "identifier", "plsqlidentifier", "unreserved_keyword", 
                   "col_name_keyword", "type_func_name_keyword", "reserved_keyword", 
                   "builtin_function_name", "pl_function", "comp_options", 
                   "comp_option", "sharp", "option_value", "opt_semi", "pl_block", 
                   "decl_sect", "decl_start", "decl_stmts", "label_decl", 
                   "decl_stmt", "decl_statement", "opt_scrollable", "decl_cursor_query", 
                   "decl_cursor_args", "decl_cursor_arglist", "decl_cursor_arg", 
                   "decl_is_for", "decl_aliasitem", "decl_varname", "decl_const", 
                   "decl_datatype", "decl_collate", "decl_notnull", "decl_defval", 
                   "decl_defkey", "assign_operator", "proc_sect", "proc_stmt", 
                   "stmt_perform", "stmt_call", "opt_expr_list", "stmt_assign", 
                   "stmt_getdiag", "getdiag_area_opt", "getdiag_list", "getdiag_list_item", 
                   "getdiag_item", "getdiag_target", "assign_var", "stmt_if", 
                   "stmt_elsifs", "stmt_else", "stmt_case", "opt_expr_until_when", 
                   "case_when_list", "case_when", "opt_case_else", "stmt_loop", 
                   "stmt_while", "stmt_for", "for_control", "opt_for_using_expression", 
                   "opt_cursor_parameters", "opt_reverse", "opt_by_expression", 
                   "for_variable", "stmt_foreach_a", "foreach_slice", "stmt_exit", 
                   "exit_type", "stmt_return", "opt_return_result", "stmt_raise", 
                   "opt_stmt_raise_level", "opt_raise_list", "opt_raise_using", 
                   "opt_raise_using_elem", "opt_raise_using_elem_list", 
                   "stmt_assert", "opt_stmt_assert_message", "loop_body", 
                   "stmt_execsql", "stmt_dynexecute", "opt_execute_using", 
                   "opt_execute_using_list", "opt_execute_into", "stmt_open", 
                   "opt_open_bound_list_item", "opt_open_bound_list", "opt_open_using", 
                   "opt_scroll_option", "opt_scroll_option_no", "stmt_fetch", 
                   "into_target", "opt_cursor_from", "opt_fetch_direction", 
                   "stmt_move", "stmt_close", "stmt_null", "stmt_commit", 
                   "stmt_rollback", "plsql_opt_transaction_chain", "stmt_set", 
                   "cursor_variable", "exception_sect", "proc_exceptions", 
                   "proc_exception", "proc_conditions", "proc_condition", 
                   "opt_block_label", "opt_loop_label", "opt_label", "opt_exitcond", 
                   "any_identifier", "plsql_unreserved_keyword", "sql_expression", 
                   "expr_until_then", "expr_until_semi", "expr_until_rightbracket", 
                   "expr_until_loop", "make_execsql_stmt", "opt_returning_clause_into" ]

    EOF = Token.EOF
    Dollar=1
    OPEN_PAREN=2
    CLOSE_PAREN=3
    OPEN_BRACKET=4
    CLOSE_BRACKET=5
    COMMA=6
    SEMI=7
    COLON=8
    STAR=9
    EQUAL=10
    DOT=11
    PLUS=12
    MINUS=13
    SLASH=14
    CARET=15
    LT=16
    GT=17
    LESS_LESS=18
    GREATER_GREATER=19
    COLON_EQUALS=20
    LESS_EQUALS=21
    EQUALS_GREATER=22
    GREATER_EQUALS=23
    DOT_DOT=24
    NOT_EQUALS=25
    TYPECAST=26
    PERCENT=27
    PARAM=28
    Operator=29
    ALL=30
    ANALYSE=31
    ANALYZE=32
    AND=33
    ANY=34
    ARRAY=35
    AS=36
    ASC=37
    ASYMMETRIC=38
    BOTH=39
    CASE=40
    CAST=41
    CHECK=42
    COLLATE=43
    COLUMN=44
    CONSTRAINT=45
    CREATE=46
    CURRENT_CATALOG=47
    CURRENT_DATE=48
    CURRENT_ROLE=49
    CURRENT_TIME=50
    CURRENT_TIMESTAMP=51
    CURRENT_USER=52
    DEFAULT=53
    DEFERRABLE=54
    DESC=55
    DISTINCT=56
    DO=57
    ELSE=58
    EXCEPT=59
    FALSE_P=60
    FETCH=61
    FOR=62
    FOREIGN=63
    FROM=64
    GRANT=65
    GROUP_P=66
    HAVING=67
    IN_P=68
    INITIALLY=69
    INTERSECT=70
    INTO=71
    LATERAL_P=72
    LEADING=73
    LIMIT=74
    LOCALTIME=75
    LOCALTIMESTAMP=76
    NOT=77
    NULL_P=78
    OFFSET=79
    ON=80
    ONLY=81
    OR=82
    ORDER=83
    PLACING=84
    PRIMARY=85
    REFERENCES=86
    RETURNING=87
    SELECT=88
    SESSION_USER=89
    SOME=90
    SYMMETRIC=91
    TABLE=92
    THEN=93
    TO=94
    TRAILING=95
    TRUE_P=96
    UNION=97
    UNIQUE=98
    USER=99
    USING=100
    VARIADIC=101
    WHEN=102
    WHERE=103
    WINDOW=104
    WITH=105
    AUTHORIZATION=106
    BINARY=107
    COLLATION=108
    CONCURRENTLY=109
    CROSS=110
    CURRENT_SCHEMA=111
    FREEZE=112
    FULL=113
    ILIKE=114
    INNER_P=115
    IS=116
    ISNULL=117
    JOIN=118
    LEFT=119
    LIKE=120
    NATURAL=121
    NOTNULL=122
    OUTER_P=123
    OVER=124
    OVERLAPS=125
    RIGHT=126
    SIMILAR=127
    VERBOSE=128
    ABORT_P=129
    ABSOLUTE_P=130
    ACCESS=131
    ACTION=132
    ADD_P=133
    ADMIN=134
    AFTER=135
    AGGREGATE=136
    ALSO=137
    ALTER=138
    ALWAYS=139
    ASSERTION=140
    ASSIGNMENT=141
    AT=142
    ATTRIBUTE=143
    BACKWARD=144
    BEFORE=145
    BEGIN_P=146
    BY=147
    CACHE=148
    CALLED=149
    CASCADE=150
    CASCADED=151
    CATALOG=152
    CHAIN=153
    CHARACTERISTICS=154
    CHECKPOINT=155
    CLASS=156
    CLOSE=157
    CLUSTER=158
    COMMENT=159
    COMMENTS=160
    COMMIT=161
    COMMITTED=162
    CONFIGURATION=163
    CONNECTION=164
    CONSTRAINTS=165
    CONTENT_P=166
    CONTINUE_P=167
    CONVERSION_P=168
    COPY=169
    COST=170
    CSV=171
    CURSOR=172
    CYCLE=173
    DATA_P=174
    DATABASE=175
    DAY_P=176
    DEALLOCATE=177
    DECLARE=178
    DEFAULTS=179
    DEFERRED=180
    DEFINER=181
    DELETE_P=182
    DELIMITER=183
    DELIMITERS=184
    DICTIONARY=185
    DISABLE_P=186
    DISCARD=187
    DOCUMENT_P=188
    DOMAIN_P=189
    DOUBLE_P=190
    DROP=191
    EACH=192
    ENABLE_P=193
    ENCODING=194
    ENCRYPTED=195
    ENUM_P=196
    ESCAPE=197
    EVENT=198
    EXCLUDE=199
    EXCLUDING=200
    EXCLUSIVE=201
    EXECUTE=202
    EXPLAIN=203
    EXTENSION=204
    EXTERNAL=205
    FAMILY=206
    FIRST_P=207
    FOLLOWING=208
    FORCE=209
    FORWARD=210
    FUNCTION=211
    FUNCTIONS=212
    GLOBAL=213
    GRANTED=214
    HANDLER=215
    HEADER_P=216
    HOLD=217
    HOUR_P=218
    IDENTITY_P=219
    IF_P=220
    IMMEDIATE=221
    IMMUTABLE=222
    IMPLICIT_P=223
    INCLUDING=224
    INCREMENT=225
    INDEX=226
    INDEXES=227
    INHERIT=228
    INHERITS=229
    INLINE_P=230
    INSENSITIVE=231
    INSERT=232
    INSTEAD=233
    INVOKER=234
    ISOLATION=235
    KEY=236
    LABEL=237
    LANGUAGE=238
    LARGE_P=239
    LAST_P=240
    LEAKPROOF=241
    LEVEL=242
    LISTEN=243
    LOAD=244
    LOCAL=245
    LOCATION=246
    LOCK_P=247
    MAPPING=248
    MATCH=249
    MATCHED=250
    MATERIALIZED=251
    MAXVALUE=252
    MERGE=253
    MINUTE_P=254
    MINVALUE=255
    MODE=256
    MONTH_P=257
    MOVE=258
    NAME_P=259
    NAMES=260
    NEXT=261
    NO=262
    NOTHING=263
    NOTIFY=264
    NOWAIT=265
    NULLS_P=266
    OBJECT_P=267
    OF=268
    OFF=269
    OIDS=270
    OPERATOR=271
    OPTION=272
    OPTIONS=273
    OWNED=274
    OWNER=275
    PARSER=276
    PARTIAL=277
    PARTITION=278
    PASSING=279
    PASSWORD=280
    PLANS=281
    PRECEDING=282
    PREPARE=283
    PREPARED=284
    PRESERVE=285
    PRIOR=286
    PRIVILEGES=287
    PROCEDURAL=288
    PROCEDURE=289
    PROGRAM=290
    QUOTE=291
    RANGE=292
    READ=293
    REASSIGN=294
    RECHECK=295
    RECURSIVE=296
    REF=297
    REFRESH=298
    REINDEX=299
    RELATIVE_P=300
    RELEASE=301
    RENAME=302
    REPEATABLE=303
    REPLACE=304
    REPLICA=305
    RESET=306
    RESTART=307
    RESTRICT=308
    RETURNS=309
    REVOKE=310
    ROLE=311
    ROLLBACK=312
    ROWS=313
    RULE=314
    SAVEPOINT=315
    SCHEMA=316
    SCROLL=317
    SEARCH=318
    SECOND_P=319
    SECURITY=320
    SEQUENCE=321
    SEQUENCES=322
    SERIALIZABLE=323
    SERVER=324
    SESSION=325
    SET=326
    SHARE=327
    SHOW=328
    SIMPLE=329
    SNAPSHOT=330
    STABLE=331
    STANDALONE_P=332
    START=333
    STATEMENT=334
    STATISTICS=335
    STDIN=336
    STDOUT=337
    STORAGE=338
    STRICT_P=339
    STRIP_P=340
    SYSID=341
    SYSTEM_P=342
    TABLES=343
    TABLESPACE=344
    TEMP=345
    TEMPLATE=346
    TEMPORARY=347
    TEXT_P=348
    TRANSACTION=349
    TRIGGER=350
    TRUNCATE=351
    TRUSTED=352
    TYPE_P=353
    TYPES_P=354
    UNBOUNDED=355
    UNCOMMITTED=356
    UNENCRYPTED=357
    UNKNOWN=358
    UNLISTEN=359
    UNLOGGED=360
    UNTIL=361
    UPDATE=362
    VACUUM=363
    VALID=364
    VALIDATE=365
    VALIDATOR=366
    VARYING=367
    VERSION_P=368
    VIEW=369
    VOLATILE=370
    WHITESPACE_P=371
    WITHOUT=372
    WORK=373
    WRAPPER=374
    WRITE=375
    XML_P=376
    YEAR_P=377
    YES_P=378
    ZONE=379
    BETWEEN=380
    BIGINT=381
    BIT=382
    BOOLEAN_P=383
    CHAR_P=384
    CHARACTER=385
    COALESCE=386
    DEC=387
    DECIMAL_P=388
    EXISTS=389
    EXTRACT=390
    FLOAT_P=391
    GREATEST=392
    INOUT=393
    INT_P=394
    INTEGER=395
    INTERVAL=396
    LEAST=397
    NATIONAL=398
    NCHAR=399
    NONE=400
    NULLIF=401
    NUMERIC=402
    OVERLAY=403
    POSITION=404
    PRECISION=405
    REAL=406
    ROW=407
    SETOF=408
    SMALLINT=409
    SUBSTRING=410
    TIME=411
    TIMESTAMP=412
    TREAT=413
    TRIM=414
    VALUES=415
    VARCHAR=416
    XMLATTRIBUTES=417
    XMLCOMMENT=418
    XMLAGG=419
    XML_IS_WELL_FORMED=420
    XML_IS_WELL_FORMED_DOCUMENT=421
    XML_IS_WELL_FORMED_CONTENT=422
    XPATH=423
    XPATH_EXISTS=424
    XMLCONCAT=425
    XMLELEMENT=426
    XMLEXISTS=427
    XMLFOREST=428
    XMLPARSE=429
    XMLPI=430
    XMLROOT=431
    XMLSERIALIZE=432
    CALL=433
    CURRENT_P=434
    ATTACH=435
    DETACH=436
    EXPRESSION=437
    GENERATED=438
    LOGGED=439
    STORED=440
    INCLUDE=441
    ROUTINE=442
    TRANSFORM=443
    IMPORT_P=444
    POLICY=445
    METHOD=446
    REFERENCING=447
    NEW=448
    OLD=449
    VALUE_P=450
    SUBSCRIPTION=451
    PUBLICATION=452
    OUT_P=453
    END_P=454
    ROUTINES=455
    SCHEMAS=456
    PROCEDURES=457
    INPUT_P=458
    SUPPORT=459
    PARALLEL=460
    SQL_P=461
    DEPENDS=462
    OVERRIDING=463
    CONFLICT=464
    SKIP_P=465
    LOCKED=466
    TIES=467
    ROLLUP=468
    CUBE=469
    GROUPING=470
    SETS=471
    TABLESAMPLE=472
    ORDINALITY=473
    XMLTABLE=474
    COLUMNS=475
    XMLNAMESPACES=476
    ROWTYPE=477
    NORMALIZED=478
    WITHIN=479
    FILTER=480
    GROUPS=481
    OTHERS=482
    NFC=483
    NFD=484
    NFKC=485
    NFKD=486
    UESCAPE=487
    VIEWS=488
    NORMALIZE=489
    DUMP=490
    PRINT_STRICT_PARAMS=491
    VARIABLE_CONFLICT=492
    ERROR=493
    USE_VARIABLE=494
    USE_COLUMN=495
    ALIAS=496
    CONSTANT=497
    PERFORM=498
    GET=499
    DIAGNOSTICS=500
    STACKED=501
    ELSIF=502
    WHILE=503
    REVERSE=504
    FOREACH=505
    SLICE=506
    EXIT=507
    RETURN=508
    QUERY=509
    RAISE=510
    SQLSTATE=511
    DEBUG=512
    LOG=513
    INFO=514
    NOTICE=515
    WARNING=516
    EXCEPTION=517
    ASSERT=518
    LOOP=519
    OPEN=520
    ABS=521
    CBRT=522
    CEIL=523
    CEILING=524
    DEGREES=525
    DIV=526
    EXP=527
    FACTORIAL=528
    FLOOR=529
    GCD=530
    LCM=531
    LN=532
    LOG10=533
    MIN_SCALE=534
    MOD=535
    PI=536
    POWER=537
    RADIANS=538
    ROUND=539
    SCALE=540
    SIGN=541
    SQRT=542
    TRIM_SCALE=543
    TRUNC=544
    WIDTH_BUCKET=545
    RANDOM=546
    SETSEED=547
    ACOS=548
    ACOSD=549
    ASIN=550
    ASIND=551
    ATAN=552
    ATAND=553
    ATAN2=554
    ATAN2D=555
    COS=556
    COSD=557
    COT=558
    COTD=559
    SIN=560
    SIND=561
    TAN=562
    TAND=563
    SINH=564
    COSH=565
    TANH=566
    ASINH=567
    ACOSH=568
    ATANH=569
    BIT_LENGTH=570
    CHAR_LENGTH=571
    CHARACTER_LENGTH=572
    LOWER=573
    OCTET_LENGTH=574
    UPPER=575
    ASCII=576
    BTRIM=577
    CHR=578
    CONCAT=579
    CONCAT_WS=580
    FORMAT=581
    INITCAP=582
    LENGTH=583
    LPAD=584
    LTRIM=585
    MD5=586
    PARSE_IDENT=587
    PG_CLIENT_ENCODING=588
    QUOTE_IDENT=589
    QUOTE_LITERAL=590
    QUOTE_NULLABLE=591
    REGEXP_COUNT=592
    REGEXP_INSTR=593
    REGEXP_LIKE=594
    REGEXP_MATCH=595
    REGEXP_MATCHES=596
    REGEXP_REPLACE=597
    REGEXP_SPLIT_TO_ARRAY=598
    REGEXP_SPLIT_TO_TABLE=599
    REGEXP_SUBSTR=600
    REPEAT=601
    RPAD=602
    RTRIM=603
    SPLIT_PART=604
    STARTS_WITH=605
    STRING_TO_ARRAY=606
    STRING_TO_TABLE=607
    STRPOS=608
    SUBSTR=609
    TO_ASCII=610
    TO_HEX=611
    TRANSLATE=612
    UNISTR=613
    AGE=614
    CLOCK_TIMESTAMP=615
    DATE_BIN=616
    DATE_PART=617
    DATE_TRUNC=618
    ISFINITE=619
    JUSTIFY_DAYS=620
    JUSTIFY_HOURS=621
    JUSTIFY_INTERVAL=622
    MAKE_DATE=623
    MAKE_INTERVAL=624
    MAKE_TIME=625
    MAKE_TIMESTAMP=626
    MAKE_TIMESTAMPTZ=627
    NOW=628
    STATEMENT_TIMESTAMP=629
    TIMEOFDAY=630
    TRANSACTION_TIMESTAMP=631
    TO_TIMESTAMP=632
    TO_CHAR=633
    TO_DATE=634
    TO_NUMBER=635
    Identifier=636
    QuotedIdentifier=637
    UnterminatedQuotedIdentifier=638
    InvalidQuotedIdentifier=639
    InvalidUnterminatedQuotedIdentifier=640
    UnicodeQuotedIdentifier=641
    UnterminatedUnicodeQuotedIdentifier=642
    InvalidUnicodeQuotedIdentifier=643
    InvalidUnterminatedUnicodeQuotedIdentifier=644
    StringConstant=645
    UnterminatedStringConstant=646
    UnicodeEscapeStringConstant=647
    UnterminatedUnicodeEscapeStringConstant=648
    BeginDollarStringConstant=649
    BinaryStringConstant=650
    UnterminatedBinaryStringConstant=651
    InvalidBinaryStringConstant=652
    InvalidUnterminatedBinaryStringConstant=653
    HexadecimalStringConstant=654
    UnterminatedHexadecimalStringConstant=655
    InvalidHexadecimalStringConstant=656
    InvalidUnterminatedHexadecimalStringConstant=657
    Integral=658
    NumericFail=659
    Numeric=660
    PLSQLVARIABLENAME=661
    PLSQLIDENTIFIER=662
    Whitespace=663
    Newline=664
    LineComment=665
    BlockComment=666
    UnterminatedBlockComment=667
    MetaCommand=668
    EndMetaCommand=669
    ErrorCharacter=670
    EscapeStringConstant=671
    UnterminatedEscapeStringConstant=672
    InvalidEscapeStringConstant=673
    InvalidUnterminatedEscapeStringConstant=674
    AfterEscapeStringConstantMode_NotContinued=675
    AfterEscapeStringConstantWithNewlineMode_NotContinued=676
    DollarText=677
    EndDollarStringConstant=678
    AfterEscapeStringConstantWithNewlineMode_Continued=679

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






    class RootContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def stmtblock(self):
            return self.getTypedRuleContext(PostgreSQLParser.StmtblockContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_root

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

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




    def root(self):

        localctx = PostgreSQLParser.RootContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_root)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1624
            self.stmtblock()
            self.state = 1625
            self.match(PostgreSQLParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PlsqlrootContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def pl_function(self):
            return self.getTypedRuleContext(PostgreSQLParser.Pl_functionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_plsqlroot

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

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




    def plsqlroot(self):

        localctx = PostgreSQLParser.PlsqlrootContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_plsqlroot)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1627
            self.pl_function()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StmtblockContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def stmtmulti(self):
            return self.getTypedRuleContext(PostgreSQLParser.StmtmultiContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmtblock

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

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




    def stmtblock(self):

        localctx = PostgreSQLParser.StmtblockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_stmtblock)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1629
            self.stmtmulti()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StmtmultiContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmtmulti

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

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




    def stmtmulti(self):

        localctx = PostgreSQLParser.StmtmultiContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_stmtmulti)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1637
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 2450028572476178436) != 0) or ((((_la - 65)) & ~0x3f) == 0 and ((1 << (_la - 65)) & 1099654234113) != 0) or ((((_la - 129)) & ~0x3f) == 0 and ((1 << (_la - 129)) & 4909769124516856321) != 0) or ((((_la - 202)) & ~0x3f) == 0 and ((1 << (_la - 202)) & 4686037194794598403) != 0) or ((((_la - 283)) & ~0x3f) == 0 and ((1 << (_la - 283)) & 1170022785714177) != 0) or ((((_la - 351)) & ~0x3f) == 0 and ((1 << (_la - 351)) & 6401) != 0) or ((((_la - 415)) & ~0x3f) == 0 and ((1 << (_la - 415)) & 550292946945) != 0) or _la==668:
                self.state = 1631
                self.stmt()
                self.state = 1633
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==7:
                    self.state = 1632
                    self.match(PostgreSQLParser.SEMI)


                self.state = 1639
                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 StmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def altereventtrigstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltereventtrigstmtContext,0)


        def altercollationstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltercollationstmtContext,0)


        def alterdatabasestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterdatabasestmtContext,0)


        def alterdatabasesetstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterdatabasesetstmtContext,0)


        def alterdefaultprivilegesstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterdefaultprivilegesstmtContext,0)


        def alterdomainstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterdomainstmtContext,0)


        def alterenumstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterenumstmtContext,0)


        def alterextensionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterextensionstmtContext,0)


        def alterextensioncontentsstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterextensioncontentsstmtContext,0)


        def alterfdwstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterfdwstmtContext,0)


        def alterforeignserverstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterforeignserverstmtContext,0)


        def alterfunctionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterfunctionstmtContext,0)


        def altergroupstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltergroupstmtContext,0)


        def alterobjectdependsstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterobjectdependsstmtContext,0)


        def alterobjectschemastmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterobjectschemastmtContext,0)


        def alterownerstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterownerstmtContext,0)


        def alteroperatorstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlteroperatorstmtContext,0)


        def altertypestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltertypestmtContext,0)


        def alterpolicystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterpolicystmtContext,0)


        def alterseqstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterseqstmtContext,0)


        def altersystemstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltersystemstmtContext,0)


        def altertablestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltertablestmtContext,0)


        def altertblspcstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltertblspcstmtContext,0)


        def altercompositetypestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltercompositetypestmtContext,0)


        def alterpublicationstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterpublicationstmtContext,0)


        def alterrolesetstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterrolesetstmtContext,0)


        def alterrolestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterrolestmtContext,0)


        def altersubscriptionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltersubscriptionstmtContext,0)


        def alterstatsstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterstatsstmtContext,0)


        def altertsconfigurationstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltertsconfigurationstmtContext,0)


        def altertsdictionarystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AltertsdictionarystmtContext,0)


        def alterusermappingstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlterusermappingstmtContext,0)


        def analyzestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AnalyzestmtContext,0)


        def callstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CallstmtContext,0)


        def checkpointstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CheckpointstmtContext,0)


        def closeportalstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CloseportalstmtContext,0)


        def clusterstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ClusterstmtContext,0)


        def commentstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CommentstmtContext,0)


        def constraintssetstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstraintssetstmtContext,0)


        def copystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CopystmtContext,0)


        def createamstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateamstmtContext,0)


        def createasstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateasstmtContext,0)


        def createassertionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateassertionstmtContext,0)


        def createcaststmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatecaststmtContext,0)


        def createconversionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateconversionstmtContext,0)


        def createdomainstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatedomainstmtContext,0)


        def createextensionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateextensionstmtContext,0)


        def createfdwstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatefdwstmtContext,0)


        def createforeignserverstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateforeignserverstmtContext,0)


        def createforeigntablestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateforeigntablestmtContext,0)


        def createfunctionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatefunctionstmtContext,0)


        def creategroupstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreategroupstmtContext,0)


        def creatematviewstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatematviewstmtContext,0)


        def createopclassstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateopclassstmtContext,0)


        def createopfamilystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateopfamilystmtContext,0)


        def createpublicationstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatepublicationstmtContext,0)


        def alteropfamilystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlteropfamilystmtContext,0)


        def createpolicystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatepolicystmtContext,0)


        def createplangstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateplangstmtContext,0)


        def createschemastmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateschemastmtContext,0)


        def createseqstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateseqstmtContext,0)


        def createstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatestmtContext,0)


        def createsubscriptionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatesubscriptionstmtContext,0)


        def createstatsstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatestatsstmtContext,0)


        def createtablespacestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatetablespacestmtContext,0)


        def createtransformstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatetransformstmtContext,0)


        def createtrigstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatetrigstmtContext,0)


        def createeventtrigstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateeventtrigstmtContext,0)


        def createrolestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreaterolestmtContext,0)


        def createuserstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateuserstmtContext,0)


        def createusermappingstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateusermappingstmtContext,0)


        def createdbstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatedbstmtContext,0)


        def deallocatestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DeallocatestmtContext,0)


        def declarecursorstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DeclarecursorstmtContext,0)


        def definestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DefinestmtContext,0)


        def deletestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DeletestmtContext,0)


        def discardstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DiscardstmtContext,0)


        def dostmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DostmtContext,0)


        def dropcaststmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DropcaststmtContext,0)


        def dropopclassstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DropopclassstmtContext,0)


        def dropopfamilystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DropopfamilystmtContext,0)


        def dropownedstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DropownedstmtContext,0)


        def dropstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DropstmtContext,0)


        def dropsubscriptionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DropsubscriptionstmtContext,0)


        def droptablespacestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DroptablespacestmtContext,0)


        def droptransformstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DroptransformstmtContext,0)


        def droprolestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DroprolestmtContext,0)


        def dropusermappingstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DropusermappingstmtContext,0)


        def dropdbstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DropdbstmtContext,0)


        def executestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ExecutestmtContext,0)


        def explainstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ExplainstmtContext,0)


        def fetchstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.FetchstmtContext,0)


        def grantstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.GrantstmtContext,0)


        def grantrolestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.GrantrolestmtContext,0)


        def importforeignschemastmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ImportforeignschemastmtContext,0)


        def indexstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.IndexstmtContext,0)


        def insertstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.InsertstmtContext,0)


        def mergestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.MergestmtContext,0)


        def listenstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ListenstmtContext,0)


        def refreshmatviewstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RefreshmatviewstmtContext,0)


        def loadstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.LoadstmtContext,0)


        def lockstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.LockstmtContext,0)


        def notifystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.NotifystmtContext,0)


        def preparestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.PreparestmtContext,0)


        def reassignownedstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ReassignownedstmtContext,0)


        def reindexstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ReindexstmtContext,0)


        def removeaggrstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RemoveaggrstmtContext,0)


        def removefuncstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RemovefuncstmtContext,0)


        def removeoperstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RemoveoperstmtContext,0)


        def renamestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RenamestmtContext,0)


        def revokestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RevokestmtContext,0)


        def revokerolestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RevokerolestmtContext,0)


        def rulestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RulestmtContext,0)


        def seclabelstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SeclabelstmtContext,0)


        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def transactionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.TransactionstmtContext,0)


        def truncatestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.TruncatestmtContext,0)


        def unlistenstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.UnlistenstmtContext,0)


        def updatestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.UpdatestmtContext,0)


        def vacuumstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.VacuumstmtContext,0)


        def variableresetstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.VariableresetstmtContext,0)


        def variablesetstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.VariablesetstmtContext,0)


        def variableshowstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.VariableshowstmtContext,0)


        def viewstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ViewstmtContext,0)


        def plsqlconsolecommand(self):
            return self.getTypedRuleContext(PostgreSQLParser.PlsqlconsolecommandContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt

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

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




    def stmt(self):

        localctx = PostgreSQLParser.StmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_stmt)
        try:
            self.state = 1765
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,2,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1640
                self.altereventtrigstmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 1641
                self.altercollationstmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 1642
                self.alterdatabasestmt()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 1643
                self.alterdatabasesetstmt()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 1644
                self.alterdefaultprivilegesstmt()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 1645
                self.alterdomainstmt()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 1646
                self.alterenumstmt()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 1647
                self.alterextensionstmt()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 1648
                self.alterextensioncontentsstmt()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 1649
                self.alterfdwstmt()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 1650
                self.alterforeignserverstmt()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 1651
                self.alterfunctionstmt()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 1652
                self.altergroupstmt()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 1653
                self.alterobjectdependsstmt()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 1654
                self.alterobjectschemastmt()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 1655
                self.alterownerstmt()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 1656
                self.alteroperatorstmt()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 1657
                self.altertypestmt()
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 1658
                self.alterpolicystmt()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 1659
                self.alterseqstmt()
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 1660
                self.altersystemstmt()
                pass

            elif la_ == 22:
                self.enterOuterAlt(localctx, 22)
                self.state = 1661
                self.altertablestmt()
                pass

            elif la_ == 23:
                self.enterOuterAlt(localctx, 23)
                self.state = 1662
                self.altertblspcstmt()
                pass

            elif la_ == 24:
                self.enterOuterAlt(localctx, 24)
                self.state = 1663
                self.altercompositetypestmt()
                pass

            elif la_ == 25:
                self.enterOuterAlt(localctx, 25)
                self.state = 1664
                self.alterpublicationstmt()
                pass

            elif la_ == 26:
                self.enterOuterAlt(localctx, 26)
                self.state = 1665
                self.alterrolesetstmt()
                pass

            elif la_ == 27:
                self.enterOuterAlt(localctx, 27)
                self.state = 1666
                self.alterrolestmt()
                pass

            elif la_ == 28:
                self.enterOuterAlt(localctx, 28)
                self.state = 1667
                self.altersubscriptionstmt()
                pass

            elif la_ == 29:
                self.enterOuterAlt(localctx, 29)
                self.state = 1668
                self.alterstatsstmt()
                pass

            elif la_ == 30:
                self.enterOuterAlt(localctx, 30)
                self.state = 1669
                self.altertsconfigurationstmt()
                pass

            elif la_ == 31:
                self.enterOuterAlt(localctx, 31)
                self.state = 1670
                self.altertsdictionarystmt()
                pass

            elif la_ == 32:
                self.enterOuterAlt(localctx, 32)
                self.state = 1671
                self.alterusermappingstmt()
                pass

            elif la_ == 33:
                self.enterOuterAlt(localctx, 33)
                self.state = 1672
                self.analyzestmt()
                pass

            elif la_ == 34:
                self.enterOuterAlt(localctx, 34)
                self.state = 1673
                self.callstmt()
                pass

            elif la_ == 35:
                self.enterOuterAlt(localctx, 35)
                self.state = 1674
                self.checkpointstmt()
                pass

            elif la_ == 36:
                self.enterOuterAlt(localctx, 36)
                self.state = 1675
                self.closeportalstmt()
                pass

            elif la_ == 37:
                self.enterOuterAlt(localctx, 37)
                self.state = 1676
                self.clusterstmt()
                pass

            elif la_ == 38:
                self.enterOuterAlt(localctx, 38)
                self.state = 1677
                self.commentstmt()
                pass

            elif la_ == 39:
                self.enterOuterAlt(localctx, 39)
                self.state = 1678
                self.constraintssetstmt()
                pass

            elif la_ == 40:
                self.enterOuterAlt(localctx, 40)
                self.state = 1679
                self.copystmt()
                pass

            elif la_ == 41:
                self.enterOuterAlt(localctx, 41)
                self.state = 1680
                self.createamstmt()
                pass

            elif la_ == 42:
                self.enterOuterAlt(localctx, 42)
                self.state = 1681
                self.createasstmt()
                pass

            elif la_ == 43:
                self.enterOuterAlt(localctx, 43)
                self.state = 1682
                self.createassertionstmt()
                pass

            elif la_ == 44:
                self.enterOuterAlt(localctx, 44)
                self.state = 1683
                self.createcaststmt()
                pass

            elif la_ == 45:
                self.enterOuterAlt(localctx, 45)
                self.state = 1684
                self.createconversionstmt()
                pass

            elif la_ == 46:
                self.enterOuterAlt(localctx, 46)
                self.state = 1685
                self.createdomainstmt()
                pass

            elif la_ == 47:
                self.enterOuterAlt(localctx, 47)
                self.state = 1686
                self.createextensionstmt()
                pass

            elif la_ == 48:
                self.enterOuterAlt(localctx, 48)
                self.state = 1687
                self.createfdwstmt()
                pass

            elif la_ == 49:
                self.enterOuterAlt(localctx, 49)
                self.state = 1688
                self.createforeignserverstmt()
                pass

            elif la_ == 50:
                self.enterOuterAlt(localctx, 50)
                self.state = 1689
                self.createforeigntablestmt()
                pass

            elif la_ == 51:
                self.enterOuterAlt(localctx, 51)
                self.state = 1690
                self.createfunctionstmt()
                pass

            elif la_ == 52:
                self.enterOuterAlt(localctx, 52)
                self.state = 1691
                self.creategroupstmt()
                pass

            elif la_ == 53:
                self.enterOuterAlt(localctx, 53)
                self.state = 1692
                self.creatematviewstmt()
                pass

            elif la_ == 54:
                self.enterOuterAlt(localctx, 54)
                self.state = 1693
                self.createopclassstmt()
                pass

            elif la_ == 55:
                self.enterOuterAlt(localctx, 55)
                self.state = 1694
                self.createopfamilystmt()
                pass

            elif la_ == 56:
                self.enterOuterAlt(localctx, 56)
                self.state = 1695
                self.createpublicationstmt()
                pass

            elif la_ == 57:
                self.enterOuterAlt(localctx, 57)
                self.state = 1696
                self.alteropfamilystmt()
                pass

            elif la_ == 58:
                self.enterOuterAlt(localctx, 58)
                self.state = 1697
                self.createpolicystmt()
                pass

            elif la_ == 59:
                self.enterOuterAlt(localctx, 59)
                self.state = 1698
                self.createplangstmt()
                pass

            elif la_ == 60:
                self.enterOuterAlt(localctx, 60)
                self.state = 1699
                self.createschemastmt()
                pass

            elif la_ == 61:
                self.enterOuterAlt(localctx, 61)
                self.state = 1700
                self.createseqstmt()
                pass

            elif la_ == 62:
                self.enterOuterAlt(localctx, 62)
                self.state = 1701
                self.createstmt()
                pass

            elif la_ == 63:
                self.enterOuterAlt(localctx, 63)
                self.state = 1702
                self.createsubscriptionstmt()
                pass

            elif la_ == 64:
                self.enterOuterAlt(localctx, 64)
                self.state = 1703
                self.createstatsstmt()
                pass

            elif la_ == 65:
                self.enterOuterAlt(localctx, 65)
                self.state = 1704
                self.createtablespacestmt()
                pass

            elif la_ == 66:
                self.enterOuterAlt(localctx, 66)
                self.state = 1705
                self.createtransformstmt()
                pass

            elif la_ == 67:
                self.enterOuterAlt(localctx, 67)
                self.state = 1706
                self.createtrigstmt()
                pass

            elif la_ == 68:
                self.enterOuterAlt(localctx, 68)
                self.state = 1707
                self.createeventtrigstmt()
                pass

            elif la_ == 69:
                self.enterOuterAlt(localctx, 69)
                self.state = 1708
                self.createrolestmt()
                pass

            elif la_ == 70:
                self.enterOuterAlt(localctx, 70)
                self.state = 1709
                self.createuserstmt()
                pass

            elif la_ == 71:
                self.enterOuterAlt(localctx, 71)
                self.state = 1710
                self.createusermappingstmt()
                pass

            elif la_ == 72:
                self.enterOuterAlt(localctx, 72)
                self.state = 1711
                self.createdbstmt()
                pass

            elif la_ == 73:
                self.enterOuterAlt(localctx, 73)
                self.state = 1712
                self.deallocatestmt()
                pass

            elif la_ == 74:
                self.enterOuterAlt(localctx, 74)
                self.state = 1713
                self.declarecursorstmt()
                pass

            elif la_ == 75:
                self.enterOuterAlt(localctx, 75)
                self.state = 1714
                self.definestmt()
                pass

            elif la_ == 76:
                self.enterOuterAlt(localctx, 76)
                self.state = 1715
                self.deletestmt()
                pass

            elif la_ == 77:
                self.enterOuterAlt(localctx, 77)
                self.state = 1716
                self.discardstmt()
                pass

            elif la_ == 78:
                self.enterOuterAlt(localctx, 78)
                self.state = 1717
                self.dostmt()
                pass

            elif la_ == 79:
                self.enterOuterAlt(localctx, 79)
                self.state = 1718
                self.dropcaststmt()
                pass

            elif la_ == 80:
                self.enterOuterAlt(localctx, 80)
                self.state = 1719
                self.dropopclassstmt()
                pass

            elif la_ == 81:
                self.enterOuterAlt(localctx, 81)
                self.state = 1720
                self.dropopfamilystmt()
                pass

            elif la_ == 82:
                self.enterOuterAlt(localctx, 82)
                self.state = 1721
                self.dropownedstmt()
                pass

            elif la_ == 83:
                self.enterOuterAlt(localctx, 83)
                self.state = 1722
                self.dropstmt()
                pass

            elif la_ == 84:
                self.enterOuterAlt(localctx, 84)
                self.state = 1723
                self.dropsubscriptionstmt()
                pass

            elif la_ == 85:
                self.enterOuterAlt(localctx, 85)
                self.state = 1724
                self.droptablespacestmt()
                pass

            elif la_ == 86:
                self.enterOuterAlt(localctx, 86)
                self.state = 1725
                self.droptransformstmt()
                pass

            elif la_ == 87:
                self.enterOuterAlt(localctx, 87)
                self.state = 1726
                self.droprolestmt()
                pass

            elif la_ == 88:
                self.enterOuterAlt(localctx, 88)
                self.state = 1727
                self.dropusermappingstmt()
                pass

            elif la_ == 89:
                self.enterOuterAlt(localctx, 89)
                self.state = 1728
                self.dropdbstmt()
                pass

            elif la_ == 90:
                self.enterOuterAlt(localctx, 90)
                self.state = 1729
                self.executestmt()
                pass

            elif la_ == 91:
                self.enterOuterAlt(localctx, 91)
                self.state = 1730
                self.explainstmt()
                pass

            elif la_ == 92:
                self.enterOuterAlt(localctx, 92)
                self.state = 1731
                self.fetchstmt()
                pass

            elif la_ == 93:
                self.enterOuterAlt(localctx, 93)
                self.state = 1732
                self.grantstmt()
                pass

            elif la_ == 94:
                self.enterOuterAlt(localctx, 94)
                self.state = 1733
                self.grantrolestmt()
                pass

            elif la_ == 95:
                self.enterOuterAlt(localctx, 95)
                self.state = 1734
                self.importforeignschemastmt()
                pass

            elif la_ == 96:
                self.enterOuterAlt(localctx, 96)
                self.state = 1735
                self.indexstmt()
                pass

            elif la_ == 97:
                self.enterOuterAlt(localctx, 97)
                self.state = 1736
                self.insertstmt()
                pass

            elif la_ == 98:
                self.enterOuterAlt(localctx, 98)
                self.state = 1737
                self.mergestmt()
                pass

            elif la_ == 99:
                self.enterOuterAlt(localctx, 99)
                self.state = 1738
                self.listenstmt()
                pass

            elif la_ == 100:
                self.enterOuterAlt(localctx, 100)
                self.state = 1739
                self.refreshmatviewstmt()
                pass

            elif la_ == 101:
                self.enterOuterAlt(localctx, 101)
                self.state = 1740
                self.loadstmt()
                pass

            elif la_ == 102:
                self.enterOuterAlt(localctx, 102)
                self.state = 1741
                self.lockstmt()
                pass

            elif la_ == 103:
                self.enterOuterAlt(localctx, 103)
                self.state = 1742
                self.notifystmt()
                pass

            elif la_ == 104:
                self.enterOuterAlt(localctx, 104)
                self.state = 1743
                self.preparestmt()
                pass

            elif la_ == 105:
                self.enterOuterAlt(localctx, 105)
                self.state = 1744
                self.reassignownedstmt()
                pass

            elif la_ == 106:
                self.enterOuterAlt(localctx, 106)
                self.state = 1745
                self.reindexstmt()
                pass

            elif la_ == 107:
                self.enterOuterAlt(localctx, 107)
                self.state = 1746
                self.removeaggrstmt()
                pass

            elif la_ == 108:
                self.enterOuterAlt(localctx, 108)
                self.state = 1747
                self.removefuncstmt()
                pass

            elif la_ == 109:
                self.enterOuterAlt(localctx, 109)
                self.state = 1748
                self.removeoperstmt()
                pass

            elif la_ == 110:
                self.enterOuterAlt(localctx, 110)
                self.state = 1749
                self.renamestmt()
                pass

            elif la_ == 111:
                self.enterOuterAlt(localctx, 111)
                self.state = 1750
                self.revokestmt()
                pass

            elif la_ == 112:
                self.enterOuterAlt(localctx, 112)
                self.state = 1751
                self.revokerolestmt()
                pass

            elif la_ == 113:
                self.enterOuterAlt(localctx, 113)
                self.state = 1752
                self.rulestmt()
                pass

            elif la_ == 114:
                self.enterOuterAlt(localctx, 114)
                self.state = 1753
                self.seclabelstmt()
                pass

            elif la_ == 115:
                self.enterOuterAlt(localctx, 115)
                self.state = 1754
                self.selectstmt()
                pass

            elif la_ == 116:
                self.enterOuterAlt(localctx, 116)
                self.state = 1755
                self.transactionstmt()
                pass

            elif la_ == 117:
                self.enterOuterAlt(localctx, 117)
                self.state = 1756
                self.truncatestmt()
                pass

            elif la_ == 118:
                self.enterOuterAlt(localctx, 118)
                self.state = 1757
                self.unlistenstmt()
                pass

            elif la_ == 119:
                self.enterOuterAlt(localctx, 119)
                self.state = 1758
                self.updatestmt()
                pass

            elif la_ == 120:
                self.enterOuterAlt(localctx, 120)
                self.state = 1759
                self.vacuumstmt()
                pass

            elif la_ == 121:
                self.enterOuterAlt(localctx, 121)
                self.state = 1760
                self.variableresetstmt()
                pass

            elif la_ == 122:
                self.enterOuterAlt(localctx, 122)
                self.state = 1761
                self.variablesetstmt()
                pass

            elif la_ == 123:
                self.enterOuterAlt(localctx, 123)
                self.state = 1762
                self.variableshowstmt()
                pass

            elif la_ == 124:
                self.enterOuterAlt(localctx, 124)
                self.state = 1763
                self.viewstmt()
                pass

            elif la_ == 125:
                self.enterOuterAlt(localctx, 125)
                self.state = 1764
                self.plsqlconsolecommand()
                pass


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


    class PlsqlconsolecommandContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_plsqlconsolecommand

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

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




    def plsqlconsolecommand(self):

        localctx = PostgreSQLParser.PlsqlconsolecommandContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_plsqlconsolecommand)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1767
            self.match(PostgreSQLParser.MetaCommand)
            self.state = 1769
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==669:
                self.state = 1768
                self.match(PostgreSQLParser.EndMetaCommand)


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


    class CallstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def func_application(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_applicationContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_callstmt

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

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




    def callstmt(self):

        localctx = PostgreSQLParser.CallstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_callstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1771
            self.match(PostgreSQLParser.CALL)
            self.state = 1772
            self.func_application()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreaterolestmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def roleid(self):
            return self.getTypedRuleContext(PostgreSQLParser.RoleidContext,0)


        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def optrolelist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptrolelistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createrolestmt

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

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




    def createrolestmt(self):

        localctx = PostgreSQLParser.CreaterolestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_createrolestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1774
            self.match(PostgreSQLParser.CREATE)
            self.state = 1775
            self.match(PostgreSQLParser.ROLE)
            self.state = 1776
            self.roleid()
            self.state = 1777
            self.opt_with()
            self.state = 1778
            self.optrolelist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_withContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_with

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

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




    def opt_with(self):

        localctx = PostgreSQLParser.Opt_withContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_opt_with)
        try:
            self.state = 1782
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,4,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1780
                self.match(PostgreSQLParser.WITH)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


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


    class OptrolelistContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optrolelist

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

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




    def optrolelist(self):

        localctx = PostgreSQLParser.OptrolelistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_optrolelist)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1787
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,5,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 1784
                    self.createoptroleelem() 
                self.state = 1789
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,5,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 AlteroptrolelistContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alteroptrolelist

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

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




    def alteroptrolelist(self):

        localctx = PostgreSQLParser.AlteroptrolelistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_alteroptrolelist)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1793
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,6,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 1790
                    self.alteroptroleelem() 
                self.state = 1795
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,6,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 AlteroptroleelemContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


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

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

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

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

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

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

        def signediconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SignediconstContext,0)


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

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

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

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alteroptroleelem

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

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




    def alteroptroleelem(self):

        localctx = PostgreSQLParser.AlteroptroleelemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_alteroptroleelem)
        self._la = 0 # Token type
        try:
            self.state = 1814
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [280]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1796
                self.match(PostgreSQLParser.PASSWORD)
                self.state = 1799
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [645, 647, 649, 671]:
                    self.state = 1797
                    self.sconst()
                    pass
                elif token in [78]:
                    self.state = 1798
                    self.match(PostgreSQLParser.NULL_P)
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [195, 357]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1801
                _la = self._input.LA(1)
                if not(_la==195 or _la==357):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 1802
                self.match(PostgreSQLParser.PASSWORD)
                self.state = 1803
                self.sconst()
                pass
            elif token in [228]:
                self.enterOuterAlt(localctx, 3)
                self.state = 1804
                self.match(PostgreSQLParser.INHERIT)
                pass
            elif token in [164]:
                self.enterOuterAlt(localctx, 4)
                self.state = 1805
                self.match(PostgreSQLParser.CONNECTION)
                self.state = 1806
                self.match(PostgreSQLParser.LIMIT)
                self.state = 1807
                self.signediconst()
                pass
            elif token in [364]:
                self.enterOuterAlt(localctx, 5)
                self.state = 1808
                self.match(PostgreSQLParser.VALID)
                self.state = 1809
                self.match(PostgreSQLParser.UNTIL)
                self.state = 1810
                self.sconst()
                pass
            elif token in [99]:
                self.enterOuterAlt(localctx, 6)
                self.state = 1811
                self.match(PostgreSQLParser.USER)
                self.state = 1812
                self.role_list()
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 123, 130, 144, 153, 157, 161, 167, 172, 207, 210, 232, 240, 258, 261, 262, 272, 286, 300, 306, 312, 316, 317, 326, 353, 433, 434, 477, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 7)
                self.state = 1813
                self.identifier()
                pass
            else:
                raise NoViableAltException(self)

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


    class CreateoptroleelemContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def alteroptroleelem(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlteroptroleelemContext,0)


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

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


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

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createoptroleelem

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

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




    def createoptroleelem(self):

        localctx = PostgreSQLParser.CreateoptroleelemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_createoptroleelem)
        self._la = 0 # Token type
        try:
            self.state = 1826
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 99, 116, 123, 130, 144, 153, 157, 161, 164, 167, 172, 195, 207, 210, 228, 232, 240, 258, 261, 262, 272, 280, 286, 300, 306, 312, 316, 317, 326, 353, 357, 364, 433, 434, 477, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1816
                self.alteroptroleelem()
                pass
            elif token in [341]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1817
                self.match(PostgreSQLParser.SYSID)
                self.state = 1818
                self.iconst()
                pass
            elif token in [134]:
                self.enterOuterAlt(localctx, 3)
                self.state = 1819
                self.match(PostgreSQLParser.ADMIN)
                self.state = 1820
                self.role_list()
                pass
            elif token in [311]:
                self.enterOuterAlt(localctx, 4)
                self.state = 1821
                self.match(PostgreSQLParser.ROLE)
                self.state = 1822
                self.role_list()
                pass
            elif token in [68]:
                self.enterOuterAlt(localctx, 5)
                self.state = 1823
                self.match(PostgreSQLParser.IN_P)
                self.state = 1824
                _la = self._input.LA(1)
                if not(_la==66 or _la==311):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 1825
                self.role_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 CreateuserstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def roleid(self):
            return self.getTypedRuleContext(PostgreSQLParser.RoleidContext,0)


        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def optrolelist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptrolelistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createuserstmt

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

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




    def createuserstmt(self):

        localctx = PostgreSQLParser.CreateuserstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_createuserstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1828
            self.match(PostgreSQLParser.CREATE)
            self.state = 1829
            self.match(PostgreSQLParser.USER)
            self.state = 1830
            self.roleid()
            self.state = 1831
            self.opt_with()
            self.state = 1832
            self.optrolelist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterrolestmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def alteroptrolelist(self):
            return self.getTypedRuleContext(PostgreSQLParser.AlteroptrolelistContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterrolestmt

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

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




    def alterrolestmt(self):

        localctx = PostgreSQLParser.AlterrolestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_alterrolestmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1834
            self.match(PostgreSQLParser.ALTER)
            self.state = 1835
            _la = self._input.LA(1)
            if not(_la==99 or _la==311):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 1836
            self.rolespec()
            self.state = 1837
            self.opt_with()
            self.state = 1838
            self.alteroptrolelist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_in_databaseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_in_database

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

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




    def opt_in_database(self):

        localctx = PostgreSQLParser.Opt_in_databaseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_opt_in_database)
        try:
            self.state = 1844
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [306, 326]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [68]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1841
                self.match(PostgreSQLParser.IN_P)
                self.state = 1842
                self.match(PostgreSQLParser.DATABASE)
                self.state = 1843
                self.name()
                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 AlterrolesetstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def opt_in_database(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_in_databaseContext,0)


        def setresetclause(self):
            return self.getTypedRuleContext(PostgreSQLParser.SetresetclauseContext,0)


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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterrolesetstmt

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

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




    def alterrolesetstmt(self):

        localctx = PostgreSQLParser.AlterrolesetstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_alterrolesetstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1846
            self.match(PostgreSQLParser.ALTER)
            self.state = 1847
            _la = self._input.LA(1)
            if not(_la==99 or _la==311):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 1849
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==30:
                self.state = 1848
                self.match(PostgreSQLParser.ALL)


            self.state = 1851
            self.rolespec()
            self.state = 1852
            self.opt_in_database()
            self.state = 1853
            self.setresetclause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DroprolestmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_droprolestmt

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

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




    def droprolestmt(self):

        localctx = PostgreSQLParser.DroprolestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_droprolestmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1855
            self.match(PostgreSQLParser.DROP)
            self.state = 1856
            _la = self._input.LA(1)
            if not(_la==66 or _la==99 or _la==311):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 1859
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
            if la_ == 1:
                self.state = 1857
                self.match(PostgreSQLParser.IF_P)
                self.state = 1858
                self.match(PostgreSQLParser.EXISTS)


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


    class CreategroupstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def roleid(self):
            return self.getTypedRuleContext(PostgreSQLParser.RoleidContext,0)


        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def optrolelist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptrolelistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_creategroupstmt

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

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




    def creategroupstmt(self):

        localctx = PostgreSQLParser.CreategroupstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_creategroupstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1863
            self.match(PostgreSQLParser.CREATE)
            self.state = 1864
            self.match(PostgreSQLParser.GROUP_P)
            self.state = 1865
            self.roleid()
            self.state = 1866
            self.opt_with()
            self.state = 1867
            self.optrolelist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AltergroupstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def add_drop(self):
            return self.getTypedRuleContext(PostgreSQLParser.Add_dropContext,0)


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

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altergroupstmt

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

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




    def altergroupstmt(self):

        localctx = PostgreSQLParser.AltergroupstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_altergroupstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1869
            self.match(PostgreSQLParser.ALTER)
            self.state = 1870
            self.match(PostgreSQLParser.GROUP_P)
            self.state = 1871
            self.rolespec()
            self.state = 1872
            self.add_drop()
            self.state = 1873
            self.match(PostgreSQLParser.USER)
            self.state = 1874
            self.role_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Add_dropContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_add_drop

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

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




    def add_drop(self):

        localctx = PostgreSQLParser.Add_dropContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_add_drop)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1876
            _la = self._input.LA(1)
            if not(_la==133 or _la==191):
                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 CreateschemastmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def optschemaeltlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptschemaeltlistContext,0)


        def optschemaname(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptschemanameContext,0)


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

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createschemastmt

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

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




    def createschemastmt(self):

        localctx = PostgreSQLParser.CreateschemastmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_createschemastmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1878
            self.match(PostgreSQLParser.CREATE)
            self.state = 1879
            self.match(PostgreSQLParser.SCHEMA)
            self.state = 1883
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,13,self._ctx)
            if la_ == 1:
                self.state = 1880
                self.match(PostgreSQLParser.IF_P)
                self.state = 1881
                self.match(PostgreSQLParser.NOT)
                self.state = 1882
                self.match(PostgreSQLParser.EXISTS)


            self.state = 1890
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,14,self._ctx)
            if la_ == 1:
                self.state = 1885
                self.optschemaname()
                self.state = 1886
                self.match(PostgreSQLParser.AUTHORIZATION)
                self.state = 1887
                self.rolespec()
                pass

            elif la_ == 2:
                self.state = 1889
                self.colid()
                pass


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


    class OptschemanameContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optschemaname

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

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




    def optschemaname(self):

        localctx = PostgreSQLParser.OptschemanameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_optschemaname)
        try:
            self.state = 1896
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1894
                self.colid()
                pass
            elif token in [106]:
                self.enterOuterAlt(localctx, 2)

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

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

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optschemaeltlist

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

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




    def optschemaeltlist(self):

        localctx = PostgreSQLParser.OptschemaeltlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_optschemaeltlist)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1901
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,16,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 1898
                    self.schema_stmt() 
                self.state = 1903
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,16,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 Schema_stmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def createstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatestmtContext,0)


        def indexstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.IndexstmtContext,0)


        def createseqstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateseqstmtContext,0)


        def createtrigstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatetrigstmtContext,0)


        def grantstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.GrantstmtContext,0)


        def viewstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ViewstmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_schema_stmt

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

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




    def schema_stmt(self):

        localctx = PostgreSQLParser.Schema_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_schema_stmt)
        try:
            self.state = 1910
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1904
                self.createstmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 1905
                self.indexstmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 1906
                self.createseqstmt()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 1907
                self.createtrigstmt()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 1908
                self.grantstmt()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 1909
                self.viewstmt()
                pass


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


    class VariablesetstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def set_rest(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_restContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_variablesetstmt

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

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




    def variablesetstmt(self):

        localctx = PostgreSQLParser.VariablesetstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_variablesetstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1912
            self.match(PostgreSQLParser.SET)
            self.state = 1914
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
            if la_ == 1:
                self.state = 1913
                _la = self._input.LA(1)
                if not(_la==245 or _la==325):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


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


    class Set_restContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def transaction_mode_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Transaction_mode_listContext,0)


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

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

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

        def set_rest_more(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_rest_moreContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_set_rest

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

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




    def set_rest(self):

        localctx = PostgreSQLParser.Set_restContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_set_rest)
        try:
            self.state = 1926
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1918
                self.match(PostgreSQLParser.TRANSACTION)
                self.state = 1919
                self.transaction_mode_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 1920
                self.match(PostgreSQLParser.SESSION)
                self.state = 1921
                self.match(PostgreSQLParser.CHARACTERISTICS)
                self.state = 1922
                self.match(PostgreSQLParser.AS)
                self.state = 1923
                self.match(PostgreSQLParser.TRANSACTION)
                self.state = 1924
                self.transaction_mode_list()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 1925
                self.set_rest_more()
                pass


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


    class Generic_setContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def var_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Var_nameContext,0)


        def var_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Var_listContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_generic_set

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

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




    def generic_set(self):

        localctx = PostgreSQLParser.Generic_setContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_generic_set)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1928
            self.var_name()
            self.state = 1929
            _la = self._input.LA(1)
            if not(_la==10 or _la==94):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 1930
            self.var_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Set_rest_moreContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def generic_set(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generic_setContext,0)


        def var_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Var_nameContext,0)


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

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

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

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

        def zone_value(self):
            return self.getTypedRuleContext(PostgreSQLParser.Zone_valueContext,0)


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

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


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

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

        def opt_encoding(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_encodingContext,0)


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

        def nonreservedword_or_sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.Nonreservedword_or_sconstContext,0)


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

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

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

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

        def document_or_content(self):
            return self.getTypedRuleContext(PostgreSQLParser.Document_or_contentContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_set_rest_more

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

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




    def set_rest_more(self):

        localctx = PostgreSQLParser.Set_rest_moreContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_set_rest_more)
        try:
            self.state = 1957
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,20,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1932
                self.generic_set()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 1933
                self.var_name()
                self.state = 1934
                self.match(PostgreSQLParser.FROM)
                self.state = 1935
                self.match(PostgreSQLParser.CURRENT_P)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 1937
                self.match(PostgreSQLParser.TIME)
                self.state = 1938
                self.match(PostgreSQLParser.ZONE)
                self.state = 1939
                self.zone_value()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 1940
                self.match(PostgreSQLParser.CATALOG)
                self.state = 1941
                self.sconst()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 1942
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 1943
                self.sconst()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 1944
                self.match(PostgreSQLParser.NAMES)
                self.state = 1945
                self.opt_encoding()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 1946
                self.match(PostgreSQLParser.ROLE)
                self.state = 1947
                self.nonreservedword_or_sconst()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 1948
                self.match(PostgreSQLParser.SESSION)
                self.state = 1949
                self.match(PostgreSQLParser.AUTHORIZATION)
                self.state = 1950
                self.nonreservedword_or_sconst()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 1951
                self.match(PostgreSQLParser.XML_P)
                self.state = 1952
                self.match(PostgreSQLParser.OPTION)
                self.state = 1953
                self.document_or_content()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 1954
                self.match(PostgreSQLParser.TRANSACTION)
                self.state = 1955
                self.match(PostgreSQLParser.SNAPSHOT)
                self.state = 1956
                self.sconst()
                pass


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


    class Var_nameContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_var_name

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

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




    def var_name(self):

        localctx = PostgreSQLParser.Var_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_var_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1959
            self.colid()
            self.state = 1964
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==11:
                self.state = 1960
                self.match(PostgreSQLParser.DOT)
                self.state = 1961
                self.colid()
                self.state = 1966
                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 Var_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def var_value(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Var_valueContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Var_valueContext,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_var_list

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

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




    def var_list(self):

        localctx = PostgreSQLParser.Var_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_var_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1967
            self.var_value()
            self.state = 1972
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 1968
                self.match(PostgreSQLParser.COMMA)
                self.state = 1969
                self.var_value()
                self.state = 1974
                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 Var_valueContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def opt_boolean_or_string(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_boolean_or_stringContext,0)


        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_var_value

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

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




    def var_value(self):

        localctx = PostgreSQLParser.Var_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_var_value)
        try:
            self.state = 1977
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 60, 61, 80, 92, 96, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1975
                self.opt_boolean_or_string()
                pass
            elif token in [12, 13, 658, 660]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1976
                self.numericonly()
                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 Iso_levelContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_iso_level

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

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




    def iso_level(self):

        localctx = PostgreSQLParser.Iso_levelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_iso_level)
        self._la = 0 # Token type
        try:
            self.state = 1984
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [293]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1979
                self.match(PostgreSQLParser.READ)
                self.state = 1980
                _la = self._input.LA(1)
                if not(_la==162 or _la==356):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [303]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1981
                self.match(PostgreSQLParser.REPEATABLE)
                self.state = 1982
                self.match(PostgreSQLParser.READ)
                pass
            elif token in [323]:
                self.enterOuterAlt(localctx, 3)
                self.state = 1983
                self.match(PostgreSQLParser.SERIALIZABLE)
                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 Opt_boolean_or_stringContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

        def nonreservedword_or_sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.Nonreservedword_or_sconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_boolean_or_string

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

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




    def opt_boolean_or_string(self):

        localctx = PostgreSQLParser.Opt_boolean_or_stringContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_opt_boolean_or_string)
        try:
            self.state = 1990
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [96]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1986
                self.match(PostgreSQLParser.TRUE_P)
                pass
            elif token in [60]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1987
                self.match(PostgreSQLParser.FALSE_P)
                pass
            elif token in [80]:
                self.enterOuterAlt(localctx, 3)
                self.state = 1988
                self.match(PostgreSQLParser.ON)
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 661, 662, 671]:
                self.enterOuterAlt(localctx, 4)
                self.state = 1989
                self.nonreservedword_or_sconst()
                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 Zone_valueContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


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


        def constinterval(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstintervalContext,0)


        def opt_interval(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_intervalContext,0)


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

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


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

        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_zone_value

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

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




    def zone_value(self):

        localctx = PostgreSQLParser.Zone_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_zone_value)
        try:
            self.state = 2007
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,26,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1992
                self.sconst()
                pass

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

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 1994
                self.constinterval()
                self.state = 1995
                self.sconst()
                self.state = 1996
                self.opt_interval()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 1998
                self.constinterval()
                self.state = 1999
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2000
                self.iconst()
                self.state = 2001
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 2002
                self.sconst()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 2004
                self.numericonly()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 2005
                self.match(PostgreSQLParser.DEFAULT)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 2006
                self.match(PostgreSQLParser.LOCAL)
                pass


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


    class Opt_encodingContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_encoding

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

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




    def opt_encoding(self):

        localctx = PostgreSQLParser.Opt_encodingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_opt_encoding)
        try:
            self.state = 2012
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2009
                self.sconst()
                pass
            elif token in [53]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2010
                self.match(PostgreSQLParser.DEFAULT)
                pass
            elif token in [-1, 2, 7, 31, 32, 36, 46, 57, 61, 65, 71, 77, 88, 92, 104, 105, 129, 138, 146, 149, 155, 157, 158, 159, 161, 169, 170, 177, 178, 182, 187, 191, 202, 203, 205, 222, 232, 238, 241, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 308, 309, 310, 312, 313, 315, 320, 326, 328, 331, 333, 339, 351, 359, 362, 363, 370, 415, 433, 443, 444, 454, 459, 460, 668]:
                self.enterOuterAlt(localctx, 3)

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

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

        def nonreservedword(self):
            return self.getTypedRuleContext(PostgreSQLParser.NonreservedwordContext,0)


        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_nonreservedword_or_sconst

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

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




    def nonreservedword_or_sconst(self):

        localctx = PostgreSQLParser.Nonreservedword_or_sconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_nonreservedword_or_sconst)
        try:
            self.state = 2016
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2014
                self.nonreservedword()
                pass
            elif token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2015
                self.sconst()
                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 VariableresetstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def reset_rest(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reset_restContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_variableresetstmt

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

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




    def variableresetstmt(self):

        localctx = PostgreSQLParser.VariableresetstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_variableresetstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2018
            self.match(PostgreSQLParser.RESET)
            self.state = 2019
            self.reset_rest()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Reset_restContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def generic_reset(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generic_resetContext,0)


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

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reset_rest

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

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




    def reset_rest(self):

        localctx = PostgreSQLParser.Reset_restContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_reset_rest)
        try:
            self.state = 2029
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,29,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2021
                self.generic_reset()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2022
                self.match(PostgreSQLParser.TIME)
                self.state = 2023
                self.match(PostgreSQLParser.ZONE)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 2024
                self.match(PostgreSQLParser.TRANSACTION)
                self.state = 2025
                self.match(PostgreSQLParser.ISOLATION)
                self.state = 2026
                self.match(PostgreSQLParser.LEVEL)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 2027
                self.match(PostgreSQLParser.SESSION)
                self.state = 2028
                self.match(PostgreSQLParser.AUTHORIZATION)
                pass


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


    class Generic_resetContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def var_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Var_nameContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_generic_reset

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

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




    def generic_reset(self):

        localctx = PostgreSQLParser.Generic_resetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_generic_reset)
        try:
            self.state = 2033
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2031
                self.var_name()
                pass
            elif token in [30]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2032
                self.match(PostgreSQLParser.ALL)
                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 SetresetclauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def set_rest(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_restContext,0)


        def variableresetstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.VariableresetstmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_setresetclause

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

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




    def setresetclause(self):

        localctx = PostgreSQLParser.SetresetclauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_setresetclause)
        try:
            self.state = 2038
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [326]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2035
                self.match(PostgreSQLParser.SET)
                self.state = 2036
                self.set_rest()
                pass
            elif token in [306]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2037
                self.variableresetstmt()
                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 FunctionsetresetclauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def set_rest_more(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_rest_moreContext,0)


        def variableresetstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.VariableresetstmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_functionsetresetclause

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

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




    def functionsetresetclause(self):

        localctx = PostgreSQLParser.FunctionsetresetclauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_functionsetresetclause)
        try:
            self.state = 2043
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [326]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2040
                self.match(PostgreSQLParser.SET)
                self.state = 2041
                self.set_rest_more()
                pass
            elif token in [306]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2042
                self.variableresetstmt()
                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 VariableshowstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def var_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Var_nameContext,0)


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

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

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_variableshowstmt

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

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




    def variableshowstmt(self):

        localctx = PostgreSQLParser.VariableshowstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_variableshowstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2045
            self.match(PostgreSQLParser.SHOW)
            self.state = 2055
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,33,self._ctx)
            if la_ == 1:
                self.state = 2046
                self.var_name()
                pass

            elif la_ == 2:
                self.state = 2047
                self.match(PostgreSQLParser.TIME)
                self.state = 2048
                self.match(PostgreSQLParser.ZONE)
                pass

            elif la_ == 3:
                self.state = 2049
                self.match(PostgreSQLParser.TRANSACTION)
                self.state = 2050
                self.match(PostgreSQLParser.ISOLATION)
                self.state = 2051
                self.match(PostgreSQLParser.LEVEL)
                pass

            elif la_ == 4:
                self.state = 2052
                self.match(PostgreSQLParser.SESSION)
                self.state = 2053
                self.match(PostgreSQLParser.AUTHORIZATION)
                pass

            elif la_ == 5:
                self.state = 2054
                self.match(PostgreSQLParser.ALL)
                pass


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


    class ConstraintssetstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def constraints_set_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Constraints_set_listContext,0)


        def constraints_set_mode(self):
            return self.getTypedRuleContext(PostgreSQLParser.Constraints_set_modeContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constraintssetstmt

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

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




    def constraintssetstmt(self):

        localctx = PostgreSQLParser.ConstraintssetstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_constraintssetstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2057
            self.match(PostgreSQLParser.SET)
            self.state = 2058
            self.match(PostgreSQLParser.CONSTRAINTS)
            self.state = 2059
            self.constraints_set_list()
            self.state = 2060
            self.constraints_set_mode()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Constraints_set_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def qualified_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_name_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constraints_set_list

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

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




    def constraints_set_list(self):

        localctx = PostgreSQLParser.Constraints_set_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_constraints_set_list)
        try:
            self.state = 2064
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [30]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2062
                self.match(PostgreSQLParser.ALL)
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2063
                self.qualified_name_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 Constraints_set_modeContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constraints_set_mode

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

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




    def constraints_set_mode(self):

        localctx = PostgreSQLParser.Constraints_set_modeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_constraints_set_mode)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2066
            _la = self._input.LA(1)
            if not(_la==180 or _la==221):
                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 CheckpointstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_checkpointstmt

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

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




    def checkpointstmt(self):

        localctx = PostgreSQLParser.CheckpointstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_checkpointstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2068
            self.match(PostgreSQLParser.CHECKPOINT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DiscardstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_discardstmt

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

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




    def discardstmt(self):

        localctx = PostgreSQLParser.DiscardstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_discardstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2070
            self.match(PostgreSQLParser.DISCARD)
            self.state = 2071
            _la = self._input.LA(1)
            if not(_la==30 or _la==281 or _la==322 or _la==345 or _la==347):
                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 AltertablestmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def relation_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_exprContext,0)


        def alter_table_cmds(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_table_cmdsContext,0)


        def partition_cmd(self):
            return self.getTypedRuleContext(PostgreSQLParser.Partition_cmdContext,0)


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

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

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

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

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

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


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

        def opt_nowait(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_nowaitContext,0)


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

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

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


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

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def index_partition_cmd(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_partition_cmdContext,0)


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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altertablestmt

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

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




    def altertablestmt(self):

        localctx = PostgreSQLParser.AltertablestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_altertablestmt)
        self._la = 0 # Token type
        try:
            self.state = 2182
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,46,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2073
                self.match(PostgreSQLParser.ALTER)
                self.state = 2074
                self.match(PostgreSQLParser.TABLE)
                self.state = 2077
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,35,self._ctx)
                if la_ == 1:
                    self.state = 2075
                    self.match(PostgreSQLParser.IF_P)
                    self.state = 2076
                    self.match(PostgreSQLParser.EXISTS)


                self.state = 2079
                self.relation_expr()
                self.state = 2082
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [77, 133, 138, 158, 186, 191, 193, 209, 228, 262, 268, 273, 275, 305, 306, 326, 365]:
                    self.state = 2080
                    self.alter_table_cmds()
                    pass
                elif token in [435, 436]:
                    self.state = 2081
                    self.partition_cmd()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2084
                self.match(PostgreSQLParser.ALTER)
                self.state = 2085
                self.match(PostgreSQLParser.TABLE)
                self.state = 2086
                self.match(PostgreSQLParser.ALL)
                self.state = 2087
                self.match(PostgreSQLParser.IN_P)
                self.state = 2088
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 2089
                self.name()
                self.state = 2093
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==274:
                    self.state = 2090
                    self.match(PostgreSQLParser.OWNED)
                    self.state = 2091
                    self.match(PostgreSQLParser.BY)
                    self.state = 2092
                    self.role_list()


                self.state = 2095
                self.match(PostgreSQLParser.SET)
                self.state = 2096
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 2097
                self.name()
                self.state = 2098
                self.opt_nowait()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 2100
                self.match(PostgreSQLParser.ALTER)
                self.state = 2101
                self.match(PostgreSQLParser.INDEX)
                self.state = 2104
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,38,self._ctx)
                if la_ == 1:
                    self.state = 2102
                    self.match(PostgreSQLParser.IF_P)
                    self.state = 2103
                    self.match(PostgreSQLParser.EXISTS)


                self.state = 2106
                self.qualified_name()
                self.state = 2109
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [77, 133, 138, 158, 186, 191, 193, 209, 228, 262, 268, 273, 275, 305, 306, 326, 365]:
                    self.state = 2107
                    self.alter_table_cmds()
                    pass
                elif token in [435]:
                    self.state = 2108
                    self.index_partition_cmd()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 2111
                self.match(PostgreSQLParser.ALTER)
                self.state = 2112
                self.match(PostgreSQLParser.INDEX)
                self.state = 2113
                self.match(PostgreSQLParser.ALL)
                self.state = 2114
                self.match(PostgreSQLParser.IN_P)
                self.state = 2115
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 2116
                self.name()
                self.state = 2120
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==274:
                    self.state = 2117
                    self.match(PostgreSQLParser.OWNED)
                    self.state = 2118
                    self.match(PostgreSQLParser.BY)
                    self.state = 2119
                    self.role_list()


                self.state = 2122
                self.match(PostgreSQLParser.SET)
                self.state = 2123
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 2124
                self.name()
                self.state = 2125
                self.opt_nowait()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 2127
                self.match(PostgreSQLParser.ALTER)
                self.state = 2128
                self.match(PostgreSQLParser.SEQUENCE)
                self.state = 2131
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,41,self._ctx)
                if la_ == 1:
                    self.state = 2129
                    self.match(PostgreSQLParser.IF_P)
                    self.state = 2130
                    self.match(PostgreSQLParser.EXISTS)


                self.state = 2133
                self.qualified_name()
                self.state = 2134
                self.alter_table_cmds()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 2136
                self.match(PostgreSQLParser.ALTER)
                self.state = 2137
                self.match(PostgreSQLParser.VIEW)
                self.state = 2140
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,42,self._ctx)
                if la_ == 1:
                    self.state = 2138
                    self.match(PostgreSQLParser.IF_P)
                    self.state = 2139
                    self.match(PostgreSQLParser.EXISTS)


                self.state = 2142
                self.qualified_name()
                self.state = 2143
                self.alter_table_cmds()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 2145
                self.match(PostgreSQLParser.ALTER)
                self.state = 2146
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 2147
                self.match(PostgreSQLParser.VIEW)
                self.state = 2150
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
                if la_ == 1:
                    self.state = 2148
                    self.match(PostgreSQLParser.IF_P)
                    self.state = 2149
                    self.match(PostgreSQLParser.EXISTS)


                self.state = 2152
                self.qualified_name()
                self.state = 2153
                self.alter_table_cmds()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 2155
                self.match(PostgreSQLParser.ALTER)
                self.state = 2156
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 2157
                self.match(PostgreSQLParser.VIEW)
                self.state = 2158
                self.match(PostgreSQLParser.ALL)
                self.state = 2159
                self.match(PostgreSQLParser.IN_P)
                self.state = 2160
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 2161
                self.name()
                self.state = 2165
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==274:
                    self.state = 2162
                    self.match(PostgreSQLParser.OWNED)
                    self.state = 2163
                    self.match(PostgreSQLParser.BY)
                    self.state = 2164
                    self.role_list()


                self.state = 2167
                self.match(PostgreSQLParser.SET)
                self.state = 2168
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 2169
                self.name()
                self.state = 2170
                self.opt_nowait()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 2172
                self.match(PostgreSQLParser.ALTER)
                self.state = 2173
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 2174
                self.match(PostgreSQLParser.TABLE)
                self.state = 2177
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,45,self._ctx)
                if la_ == 1:
                    self.state = 2175
                    self.match(PostgreSQLParser.IF_P)
                    self.state = 2176
                    self.match(PostgreSQLParser.EXISTS)


                self.state = 2179
                self.relation_expr()
                self.state = 2180
                self.alter_table_cmds()
                pass


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


    class Alter_table_cmdsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def alter_table_cmd(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Alter_table_cmdContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Alter_table_cmdContext,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_alter_table_cmds

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

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




    def alter_table_cmds(self):

        localctx = PostgreSQLParser.Alter_table_cmdsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_alter_table_cmds)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2184
            self.alter_table_cmd()
            self.state = 2189
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 2185
                self.match(PostgreSQLParser.COMMA)
                self.state = 2186
                self.alter_table_cmd()
                self.state = 2191
                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 Partition_cmdContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def partitionboundspec(self):
            return self.getTypedRuleContext(PostgreSQLParser.PartitionboundspecContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_partition_cmd

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

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




    def partition_cmd(self):

        localctx = PostgreSQLParser.Partition_cmdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_partition_cmd)
        try:
            self.state = 2200
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [435]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2192
                self.match(PostgreSQLParser.ATTACH)
                self.state = 2193
                self.match(PostgreSQLParser.PARTITION)
                self.state = 2194
                self.qualified_name()
                self.state = 2195
                self.partitionboundspec()
                pass
            elif token in [436]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2197
                self.match(PostgreSQLParser.DETACH)
                self.state = 2198
                self.match(PostgreSQLParser.PARTITION)
                self.state = 2199
                self.qualified_name()
                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_partition_cmdContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_index_partition_cmd

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

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




    def index_partition_cmd(self):

        localctx = PostgreSQLParser.Index_partition_cmdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_index_partition_cmd)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2202
            self.match(PostgreSQLParser.ATTACH)
            self.state = 2203
            self.match(PostgreSQLParser.PARTITION)
            self.state = 2204
            self.qualified_name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Alter_table_cmdContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def columnDef(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnDefContext,0)


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

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

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

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

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

        def opt_column(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_columnContext,0)


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


        def alter_column_default(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_column_defaultContext,0)


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

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

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

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

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

        def signediconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SignediconstContext,0)


        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.ReloptionsContext,0)


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

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

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

        def generated_when(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generated_whenContext,0)


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

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

        def optparenthesizedseqoptlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptparenthesizedseqoptlistContext,0)


        def alter_identity_column_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_identity_column_option_listContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def opt_set_data(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_set_dataContext,0)


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

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def opt_collate_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_collate_clauseContext,0)


        def alter_using(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_usingContext,0)


        def alter_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_generic_optionsContext,0)


        def tableconstraint(self):
            return self.getTypedRuleContext(PostgreSQLParser.TableconstraintContext,0)


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

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def constraintattributespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstraintattributespecContext,0)


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


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

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

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


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

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

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


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

        def replica_identity(self):
            return self.getTypedRuleContext(PostgreSQLParser.Replica_identityContext,0)


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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_table_cmd

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

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




    def alter_table_cmd(self):

        localctx = PostgreSQLParser.Alter_table_cmdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_alter_table_cmd)
        try:
            self.state = 2458
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,49,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2206
                self.match(PostgreSQLParser.ADD_P)
                self.state = 2207
                self.columnDef()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2208
                self.match(PostgreSQLParser.ADD_P)
                self.state = 2209
                self.match(PostgreSQLParser.IF_P)
                self.state = 2210
                self.match(PostgreSQLParser.NOT)
                self.state = 2211
                self.match(PostgreSQLParser.EXISTS)
                self.state = 2212
                self.columnDef()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 2213
                self.match(PostgreSQLParser.ADD_P)
                self.state = 2214
                self.match(PostgreSQLParser.COLUMN)
                self.state = 2215
                self.columnDef()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 2216
                self.match(PostgreSQLParser.ADD_P)
                self.state = 2217
                self.match(PostgreSQLParser.COLUMN)
                self.state = 2218
                self.match(PostgreSQLParser.IF_P)
                self.state = 2219
                self.match(PostgreSQLParser.NOT)
                self.state = 2220
                self.match(PostgreSQLParser.EXISTS)
                self.state = 2221
                self.columnDef()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 2222
                self.match(PostgreSQLParser.ALTER)
                self.state = 2223
                self.opt_column()
                self.state = 2224
                self.colid()
                self.state = 2225
                self.alter_column_default()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 2227
                self.match(PostgreSQLParser.ALTER)
                self.state = 2228
                self.opt_column()
                self.state = 2229
                self.colid()
                self.state = 2230
                self.match(PostgreSQLParser.DROP)
                self.state = 2231
                self.match(PostgreSQLParser.NOT)
                self.state = 2232
                self.match(PostgreSQLParser.NULL_P)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 2234
                self.match(PostgreSQLParser.ALTER)
                self.state = 2235
                self.opt_column()
                self.state = 2236
                self.colid()
                self.state = 2237
                self.match(PostgreSQLParser.SET)
                self.state = 2238
                self.match(PostgreSQLParser.NOT)
                self.state = 2239
                self.match(PostgreSQLParser.NULL_P)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 2241
                self.match(PostgreSQLParser.ALTER)
                self.state = 2242
                self.opt_column()
                self.state = 2243
                self.colid()
                self.state = 2244
                self.match(PostgreSQLParser.DROP)
                self.state = 2245
                self.match(PostgreSQLParser.EXPRESSION)
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 2247
                self.match(PostgreSQLParser.ALTER)
                self.state = 2248
                self.opt_column()
                self.state = 2249
                self.colid()
                self.state = 2250
                self.match(PostgreSQLParser.DROP)
                self.state = 2251
                self.match(PostgreSQLParser.EXPRESSION)
                self.state = 2252
                self.match(PostgreSQLParser.IF_P)
                self.state = 2253
                self.match(PostgreSQLParser.EXISTS)
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 2255
                self.match(PostgreSQLParser.ALTER)
                self.state = 2256
                self.opt_column()
                self.state = 2257
                self.colid()
                self.state = 2258
                self.match(PostgreSQLParser.SET)
                self.state = 2259
                self.match(PostgreSQLParser.STATISTICS)
                self.state = 2260
                self.signediconst()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 2262
                self.match(PostgreSQLParser.ALTER)
                self.state = 2263
                self.opt_column()
                self.state = 2264
                self.iconst()
                self.state = 2265
                self.match(PostgreSQLParser.SET)
                self.state = 2266
                self.match(PostgreSQLParser.STATISTICS)
                self.state = 2267
                self.signediconst()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 2269
                self.match(PostgreSQLParser.ALTER)
                self.state = 2270
                self.opt_column()
                self.state = 2271
                self.colid()
                self.state = 2272
                self.match(PostgreSQLParser.SET)
                self.state = 2273
                self.reloptions()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 2275
                self.match(PostgreSQLParser.ALTER)
                self.state = 2276
                self.opt_column()
                self.state = 2277
                self.colid()
                self.state = 2278
                self.match(PostgreSQLParser.RESET)
                self.state = 2279
                self.reloptions()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 2281
                self.match(PostgreSQLParser.ALTER)
                self.state = 2282
                self.opt_column()
                self.state = 2283
                self.colid()
                self.state = 2284
                self.match(PostgreSQLParser.SET)
                self.state = 2285
                self.match(PostgreSQLParser.STORAGE)
                self.state = 2286
                self.colid()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 2288
                self.match(PostgreSQLParser.ALTER)
                self.state = 2289
                self.opt_column()
                self.state = 2290
                self.colid()
                self.state = 2291
                self.match(PostgreSQLParser.ADD_P)
                self.state = 2292
                self.match(PostgreSQLParser.GENERATED)
                self.state = 2293
                self.generated_when()
                self.state = 2294
                self.match(PostgreSQLParser.AS)
                self.state = 2295
                self.match(PostgreSQLParser.IDENTITY_P)
                self.state = 2296
                self.optparenthesizedseqoptlist()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 2298
                self.match(PostgreSQLParser.ALTER)
                self.state = 2299
                self.opt_column()
                self.state = 2300
                self.colid()
                self.state = 2301
                self.alter_identity_column_option_list()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 2303
                self.match(PostgreSQLParser.ALTER)
                self.state = 2304
                self.opt_column()
                self.state = 2305
                self.colid()
                self.state = 2306
                self.match(PostgreSQLParser.DROP)
                self.state = 2307
                self.match(PostgreSQLParser.IDENTITY_P)
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 2309
                self.match(PostgreSQLParser.ALTER)
                self.state = 2310
                self.opt_column()
                self.state = 2311
                self.colid()
                self.state = 2312
                self.match(PostgreSQLParser.DROP)
                self.state = 2313
                self.match(PostgreSQLParser.IDENTITY_P)
                self.state = 2314
                self.match(PostgreSQLParser.IF_P)
                self.state = 2315
                self.match(PostgreSQLParser.EXISTS)
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 2317
                self.match(PostgreSQLParser.DROP)
                self.state = 2318
                self.opt_column()
                self.state = 2319
                self.match(PostgreSQLParser.IF_P)
                self.state = 2320
                self.match(PostgreSQLParser.EXISTS)
                self.state = 2321
                self.colid()
                self.state = 2322
                self.opt_drop_behavior()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 2324
                self.match(PostgreSQLParser.DROP)
                self.state = 2325
                self.opt_column()
                self.state = 2326
                self.colid()
                self.state = 2327
                self.opt_drop_behavior()
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 2329
                self.match(PostgreSQLParser.ALTER)
                self.state = 2330
                self.opt_column()
                self.state = 2331
                self.colid()
                self.state = 2332
                self.opt_set_data()
                self.state = 2333
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 2334
                self.typename()
                self.state = 2335
                self.opt_collate_clause()
                self.state = 2336
                self.alter_using()
                pass

            elif la_ == 22:
                self.enterOuterAlt(localctx, 22)
                self.state = 2338
                self.match(PostgreSQLParser.ALTER)
                self.state = 2339
                self.opt_column()
                self.state = 2340
                self.colid()
                self.state = 2341
                self.alter_generic_options()
                pass

            elif la_ == 23:
                self.enterOuterAlt(localctx, 23)
                self.state = 2343
                self.match(PostgreSQLParser.ADD_P)
                self.state = 2344
                self.tableconstraint()
                pass

            elif la_ == 24:
                self.enterOuterAlt(localctx, 24)
                self.state = 2345
                self.match(PostgreSQLParser.ALTER)
                self.state = 2346
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 2347
                self.name()
                self.state = 2348
                self.constraintattributespec()
                pass

            elif la_ == 25:
                self.enterOuterAlt(localctx, 25)
                self.state = 2350
                self.match(PostgreSQLParser.VALIDATE)
                self.state = 2351
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 2352
                self.name()
                pass

            elif la_ == 26:
                self.enterOuterAlt(localctx, 26)
                self.state = 2353
                self.match(PostgreSQLParser.DROP)
                self.state = 2354
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 2355
                self.match(PostgreSQLParser.IF_P)
                self.state = 2356
                self.match(PostgreSQLParser.EXISTS)
                self.state = 2357
                self.name()
                self.state = 2358
                self.opt_drop_behavior()
                pass

            elif la_ == 27:
                self.enterOuterAlt(localctx, 27)
                self.state = 2360
                self.match(PostgreSQLParser.DROP)
                self.state = 2361
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 2362
                self.name()
                self.state = 2363
                self.opt_drop_behavior()
                pass

            elif la_ == 28:
                self.enterOuterAlt(localctx, 28)
                self.state = 2365
                self.match(PostgreSQLParser.SET)
                self.state = 2366
                self.match(PostgreSQLParser.WITHOUT)
                self.state = 2367
                self.match(PostgreSQLParser.OIDS)
                pass

            elif la_ == 29:
                self.enterOuterAlt(localctx, 29)
                self.state = 2368
                self.match(PostgreSQLParser.CLUSTER)
                self.state = 2369
                self.match(PostgreSQLParser.ON)
                self.state = 2370
                self.name()
                pass

            elif la_ == 30:
                self.enterOuterAlt(localctx, 30)
                self.state = 2371
                self.match(PostgreSQLParser.SET)
                self.state = 2372
                self.match(PostgreSQLParser.WITHOUT)
                self.state = 2373
                self.match(PostgreSQLParser.CLUSTER)
                pass

            elif la_ == 31:
                self.enterOuterAlt(localctx, 31)
                self.state = 2374
                self.match(PostgreSQLParser.SET)
                self.state = 2375
                self.match(PostgreSQLParser.LOGGED)
                pass

            elif la_ == 32:
                self.enterOuterAlt(localctx, 32)
                self.state = 2376
                self.match(PostgreSQLParser.SET)
                self.state = 2377
                self.match(PostgreSQLParser.UNLOGGED)
                pass

            elif la_ == 33:
                self.enterOuterAlt(localctx, 33)
                self.state = 2378
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2379
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 2380
                self.name()
                pass

            elif la_ == 34:
                self.enterOuterAlt(localctx, 34)
                self.state = 2381
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2382
                self.match(PostgreSQLParser.ALWAYS)
                self.state = 2383
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 2384
                self.name()
                pass

            elif la_ == 35:
                self.enterOuterAlt(localctx, 35)
                self.state = 2385
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2386
                self.match(PostgreSQLParser.REPLICA)
                self.state = 2387
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 2388
                self.name()
                pass

            elif la_ == 36:
                self.enterOuterAlt(localctx, 36)
                self.state = 2389
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2390
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 2391
                self.match(PostgreSQLParser.ALL)
                pass

            elif la_ == 37:
                self.enterOuterAlt(localctx, 37)
                self.state = 2392
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2393
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 2394
                self.match(PostgreSQLParser.USER)
                pass

            elif la_ == 38:
                self.enterOuterAlt(localctx, 38)
                self.state = 2395
                self.match(PostgreSQLParser.DISABLE_P)
                self.state = 2396
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 2397
                self.name()
                pass

            elif la_ == 39:
                self.enterOuterAlt(localctx, 39)
                self.state = 2398
                self.match(PostgreSQLParser.DISABLE_P)
                self.state = 2399
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 2400
                self.match(PostgreSQLParser.ALL)
                pass

            elif la_ == 40:
                self.enterOuterAlt(localctx, 40)
                self.state = 2401
                self.match(PostgreSQLParser.DISABLE_P)
                self.state = 2402
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 2403
                self.match(PostgreSQLParser.USER)
                pass

            elif la_ == 41:
                self.enterOuterAlt(localctx, 41)
                self.state = 2404
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2405
                self.match(PostgreSQLParser.RULE)
                self.state = 2406
                self.name()
                pass

            elif la_ == 42:
                self.enterOuterAlt(localctx, 42)
                self.state = 2407
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2408
                self.match(PostgreSQLParser.ALWAYS)
                self.state = 2409
                self.match(PostgreSQLParser.RULE)
                self.state = 2410
                self.name()
                pass

            elif la_ == 43:
                self.enterOuterAlt(localctx, 43)
                self.state = 2411
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2412
                self.match(PostgreSQLParser.REPLICA)
                self.state = 2413
                self.match(PostgreSQLParser.RULE)
                self.state = 2414
                self.name()
                pass

            elif la_ == 44:
                self.enterOuterAlt(localctx, 44)
                self.state = 2415
                self.match(PostgreSQLParser.DISABLE_P)
                self.state = 2416
                self.match(PostgreSQLParser.RULE)
                self.state = 2417
                self.name()
                pass

            elif la_ == 45:
                self.enterOuterAlt(localctx, 45)
                self.state = 2418
                self.match(PostgreSQLParser.INHERIT)
                self.state = 2419
                self.qualified_name()
                pass

            elif la_ == 46:
                self.enterOuterAlt(localctx, 46)
                self.state = 2420
                self.match(PostgreSQLParser.NO)
                self.state = 2421
                self.match(PostgreSQLParser.INHERIT)
                self.state = 2422
                self.qualified_name()
                pass

            elif la_ == 47:
                self.enterOuterAlt(localctx, 47)
                self.state = 2423
                self.match(PostgreSQLParser.OF)
                self.state = 2424
                self.any_name()
                pass

            elif la_ == 48:
                self.enterOuterAlt(localctx, 48)
                self.state = 2425
                self.match(PostgreSQLParser.NOT)
                self.state = 2426
                self.match(PostgreSQLParser.OF)
                pass

            elif la_ == 49:
                self.enterOuterAlt(localctx, 49)
                self.state = 2427
                self.match(PostgreSQLParser.OWNER)
                self.state = 2428
                self.match(PostgreSQLParser.TO)
                self.state = 2429
                self.rolespec()
                pass

            elif la_ == 50:
                self.enterOuterAlt(localctx, 50)
                self.state = 2430
                self.match(PostgreSQLParser.SET)
                self.state = 2431
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 2432
                self.name()
                pass

            elif la_ == 51:
                self.enterOuterAlt(localctx, 51)
                self.state = 2433
                self.match(PostgreSQLParser.SET)
                self.state = 2434
                self.reloptions()
                pass

            elif la_ == 52:
                self.enterOuterAlt(localctx, 52)
                self.state = 2435
                self.match(PostgreSQLParser.RESET)
                self.state = 2436
                self.reloptions()
                pass

            elif la_ == 53:
                self.enterOuterAlt(localctx, 53)
                self.state = 2437
                self.match(PostgreSQLParser.REPLICA)
                self.state = 2438
                self.match(PostgreSQLParser.IDENTITY_P)
                self.state = 2439
                self.replica_identity()
                pass

            elif la_ == 54:
                self.enterOuterAlt(localctx, 54)
                self.state = 2440
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 2441
                self.match(PostgreSQLParser.ROW)
                self.state = 2442
                self.match(PostgreSQLParser.LEVEL)
                self.state = 2443
                self.match(PostgreSQLParser.SECURITY)
                pass

            elif la_ == 55:
                self.enterOuterAlt(localctx, 55)
                self.state = 2444
                self.match(PostgreSQLParser.DISABLE_P)
                self.state = 2445
                self.match(PostgreSQLParser.ROW)
                self.state = 2446
                self.match(PostgreSQLParser.LEVEL)
                self.state = 2447
                self.match(PostgreSQLParser.SECURITY)
                pass

            elif la_ == 56:
                self.enterOuterAlt(localctx, 56)
                self.state = 2448
                self.match(PostgreSQLParser.FORCE)
                self.state = 2449
                self.match(PostgreSQLParser.ROW)
                self.state = 2450
                self.match(PostgreSQLParser.LEVEL)
                self.state = 2451
                self.match(PostgreSQLParser.SECURITY)
                pass

            elif la_ == 57:
                self.enterOuterAlt(localctx, 57)
                self.state = 2452
                self.match(PostgreSQLParser.NO)
                self.state = 2453
                self.match(PostgreSQLParser.FORCE)
                self.state = 2454
                self.match(PostgreSQLParser.ROW)
                self.state = 2455
                self.match(PostgreSQLParser.LEVEL)
                self.state = 2456
                self.match(PostgreSQLParser.SECURITY)
                pass

            elif la_ == 58:
                self.enterOuterAlt(localctx, 58)
                self.state = 2457
                self.alter_generic_options()
                pass


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


    class Alter_column_defaultContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_column_default

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

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




    def alter_column_default(self):

        localctx = PostgreSQLParser.Alter_column_defaultContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_alter_column_default)
        try:
            self.state = 2465
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [326]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2460
                self.match(PostgreSQLParser.SET)
                self.state = 2461
                self.match(PostgreSQLParser.DEFAULT)
                self.state = 2462
                self.a_expr()
                pass
            elif token in [191]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2463
                self.match(PostgreSQLParser.DROP)
                self.state = 2464
                self.match(PostgreSQLParser.DEFAULT)
                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 Opt_drop_behaviorContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_drop_behavior

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

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




    def opt_drop_behavior(self):

        localctx = PostgreSQLParser.Opt_drop_behaviorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_opt_drop_behavior)
        try:
            self.state = 2470
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [150]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2467
                self.match(PostgreSQLParser.CASCADE)
                pass
            elif token in [308]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2468
                self.match(PostgreSQLParser.RESTRICT)
                pass
            elif token in [-1, 2, 6, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 3)

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

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

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

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_collate_clause

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

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




    def opt_collate_clause(self):

        localctx = PostgreSQLParser.Opt_collate_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_opt_collate_clause)
        try:
            self.state = 2475
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [43]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2472
                self.match(PostgreSQLParser.COLLATE)
                self.state = 2473
                self.any_name()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 100, 105, 129, 138, 146, 150, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 308, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

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

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_using

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

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




    def alter_using(self):

        localctx = PostgreSQLParser.Alter_usingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_alter_using)
        try:
            self.state = 2480
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2477
                self.match(PostgreSQLParser.USING)
                self.state = 2478
                self.a_expr()
                pass
            elif token in [-1, 2, 6, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

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

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

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

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

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

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_replica_identity

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

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




    def replica_identity(self):

        localctx = PostgreSQLParser.Replica_identityContext(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_replica_identity)
        try:
            self.state = 2488
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [263]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2482
                self.match(PostgreSQLParser.NOTHING)
                pass
            elif token in [113]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2483
                self.match(PostgreSQLParser.FULL)
                pass
            elif token in [53]:
                self.enterOuterAlt(localctx, 3)
                self.state = 2484
                self.match(PostgreSQLParser.DEFAULT)
                pass
            elif token in [100]:
                self.enterOuterAlt(localctx, 4)
                self.state = 2485
                self.match(PostgreSQLParser.USING)
                self.state = 2486
                self.match(PostgreSQLParser.INDEX)
                self.state = 2487
                self.name()
                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 ReloptionsContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def reloption_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reloption_listContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reloptions

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

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




    def reloptions(self):

        localctx = PostgreSQLParser.ReloptionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_reloptions)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2490
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 2491
            self.reloption_list()
            self.state = 2492
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_reloptionsContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.ReloptionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_reloptions

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

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




    def opt_reloptions(self):

        localctx = PostgreSQLParser.Opt_reloptionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 118, self.RULE_opt_reloptions)
        try:
            self.state = 2497
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,55,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2494
                self.match(PostgreSQLParser.WITH)
                self.state = 2495
                self.reloptions()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


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


    class Reloption_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def reloption_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Reloption_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Reloption_elemContext,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_reloption_list

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

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




    def reloption_list(self):

        localctx = PostgreSQLParser.Reloption_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_reloption_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2499
            self.reloption_elem()
            self.state = 2504
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 2500
                self.match(PostgreSQLParser.COMMA)
                self.state = 2501
                self.reloption_elem()
                self.state = 2506
                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 Reloption_elemContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


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

        def def_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Def_argContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reloption_elem

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

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




    def reloption_elem(self):

        localctx = PostgreSQLParser.Reloption_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 122, self.RULE_reloption_elem)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2507
            self.collabel()
            self.state = 2516
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [10]:
                self.state = 2508
                self.match(PostgreSQLParser.EQUAL)
                self.state = 2509
                self.def_arg()
                pass
            elif token in [11]:
                self.state = 2510
                self.match(PostgreSQLParser.DOT)
                self.state = 2511
                self.collabel()
                self.state = 2514
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==10:
                    self.state = 2512
                    self.match(PostgreSQLParser.EQUAL)
                    self.state = 2513
                    self.def_arg()


                pass
            elif token in [3, 6]:
                pass
            else:
                pass
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Alter_identity_column_option_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_identity_column_option_list

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

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




    def alter_identity_column_option_list(self):

        localctx = PostgreSQLParser.Alter_identity_column_option_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_alter_identity_column_option_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2519 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 2518
                    self.alter_identity_column_option()

                else:
                    raise NoViableAltException(self)
                self.state = 2521 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,59,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 Alter_identity_column_optionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


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

        def seqoptelem(self):
            return self.getTypedRuleContext(PostgreSQLParser.SeqoptelemContext,0)


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

        def generated_when(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generated_whenContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_identity_column_option

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

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




    def alter_identity_column_option(self):

        localctx = PostgreSQLParser.Alter_identity_column_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 126, self.RULE_alter_identity_column_option)
        try:
            self.state = 2535
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [307]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2523
                self.match(PostgreSQLParser.RESTART)
                self.state = 2527
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,60,self._ctx)
                if la_ == 1:
                    self.state = 2524
                    self.opt_with()
                    self.state = 2525
                    self.numericonly()


                pass
            elif token in [326]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2529
                self.match(PostgreSQLParser.SET)
                self.state = 2533
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [36, 148, 173, 225, 252, 255, 262, 274, 307, 321, 333]:
                    self.state = 2530
                    self.seqoptelem()
                    pass
                elif token in [438]:
                    self.state = 2531
                    self.match(PostgreSQLParser.GENERATED)
                    self.state = 2532
                    self.generated_when()
                    pass
                else:
                    raise NoViableAltException(self)

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

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

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

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

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

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

        def hash_partbound(self):
            return self.getTypedRuleContext(PostgreSQLParser.Hash_partboundContext,0)


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

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

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


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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_partitionboundspec

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

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




    def partitionboundspec(self):

        localctx = PostgreSQLParser.PartitionboundspecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_partitionboundspec)
        try:
            self.state = 2563
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,63,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2537
                self.match(PostgreSQLParser.FOR)
                self.state = 2538
                self.match(PostgreSQLParser.VALUES)
                self.state = 2539
                self.match(PostgreSQLParser.WITH)
                self.state = 2540
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2541
                self.hash_partbound()
                self.state = 2542
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2544
                self.match(PostgreSQLParser.FOR)
                self.state = 2545
                self.match(PostgreSQLParser.VALUES)
                self.state = 2546
                self.match(PostgreSQLParser.IN_P)
                self.state = 2547
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2548
                self.expr_list()
                self.state = 2549
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 2551
                self.match(PostgreSQLParser.FOR)
                self.state = 2552
                self.match(PostgreSQLParser.VALUES)
                self.state = 2553
                self.match(PostgreSQLParser.FROM)
                self.state = 2554
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2555
                self.expr_list()
                self.state = 2556
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 2557
                self.match(PostgreSQLParser.TO)
                self.state = 2558
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2559
                self.expr_list()
                self.state = 2560
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 2562
                self.match(PostgreSQLParser.DEFAULT)
                pass


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


    class Hash_partbound_elemContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def nonreservedword(self):
            return self.getTypedRuleContext(PostgreSQLParser.NonreservedwordContext,0)


        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_hash_partbound_elem

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

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




    def hash_partbound_elem(self):

        localctx = PostgreSQLParser.Hash_partbound_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_hash_partbound_elem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2565
            self.nonreservedword()
            self.state = 2566
            self.iconst()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Hash_partboundContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def hash_partbound_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Hash_partbound_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Hash_partbound_elemContext,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_hash_partbound

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

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




    def hash_partbound(self):

        localctx = PostgreSQLParser.Hash_partboundContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_hash_partbound)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2568
            self.hash_partbound_elem()
            self.state = 2573
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 2569
                self.match(PostgreSQLParser.COMMA)
                self.state = 2570
                self.hash_partbound_elem()
                self.state = 2575
                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 AltercompositetypestmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def alter_type_cmds(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_type_cmdsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altercompositetypestmt

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

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




    def altercompositetypestmt(self):

        localctx = PostgreSQLParser.AltercompositetypestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 134, self.RULE_altercompositetypestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2576
            self.match(PostgreSQLParser.ALTER)
            self.state = 2577
            self.match(PostgreSQLParser.TYPE_P)
            self.state = 2578
            self.any_name()
            self.state = 2579
            self.alter_type_cmds()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Alter_type_cmdsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def alter_type_cmd(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Alter_type_cmdContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Alter_type_cmdContext,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_alter_type_cmds

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

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




    def alter_type_cmds(self):

        localctx = PostgreSQLParser.Alter_type_cmdsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_alter_type_cmds)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2581
            self.alter_type_cmd()
            self.state = 2586
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 2582
                self.match(PostgreSQLParser.COMMA)
                self.state = 2583
                self.alter_type_cmd()
                self.state = 2588
                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 Alter_type_cmdContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def tablefuncelement(self):
            return self.getTypedRuleContext(PostgreSQLParser.TablefuncelementContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


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

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


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

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

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

        def opt_set_data(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_set_dataContext,0)


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

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def opt_collate_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_collate_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_type_cmd

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

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




    def alter_type_cmd(self):

        localctx = PostgreSQLParser.Alter_type_cmdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_alter_type_cmd)
        try:
            self.state = 2612
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [133]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2589
                self.match(PostgreSQLParser.ADD_P)
                self.state = 2590
                self.match(PostgreSQLParser.ATTRIBUTE)
                self.state = 2591
                self.tablefuncelement()
                self.state = 2592
                self.opt_drop_behavior()
                pass
            elif token in [191]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2594
                self.match(PostgreSQLParser.DROP)
                self.state = 2595
                self.match(PostgreSQLParser.ATTRIBUTE)
                self.state = 2598
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,66,self._ctx)
                if la_ == 1:
                    self.state = 2596
                    self.match(PostgreSQLParser.IF_P)
                    self.state = 2597
                    self.match(PostgreSQLParser.EXISTS)


                self.state = 2600
                self.colid()
                self.state = 2601
                self.opt_drop_behavior()
                pass
            elif token in [138]:
                self.enterOuterAlt(localctx, 3)
                self.state = 2603
                self.match(PostgreSQLParser.ALTER)
                self.state = 2604
                self.match(PostgreSQLParser.ATTRIBUTE)
                self.state = 2605
                self.colid()
                self.state = 2606
                self.opt_set_data()
                self.state = 2607
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 2608
                self.typename()
                self.state = 2609
                self.opt_collate_clause()
                self.state = 2610
                self.opt_drop_behavior()
                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 CloseportalstmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def cursor_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_nameContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_closeportalstmt

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

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




    def closeportalstmt(self):

        localctx = PostgreSQLParser.CloseportalstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_closeportalstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2614
            self.match(PostgreSQLParser.CLOSE)
            self.state = 2617
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.state = 2615
                self.cursor_name()
                pass
            elif token in [30]:
                self.state = 2616
                self.match(PostgreSQLParser.ALL)
                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 CopystmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def opt_binary(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_binaryContext,0)


        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def opt_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_column_listContext,0)


        def copy_from(self):
            return self.getTypedRuleContext(PostgreSQLParser.Copy_fromContext,0)


        def opt_program(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_programContext,0)


        def copy_file_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Copy_file_nameContext,0)


        def copy_delimiter(self):
            return self.getTypedRuleContext(PostgreSQLParser.Copy_delimiterContext,0)


        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def copy_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Copy_optionsContext,0)


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


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

        def preparablestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.PreparablestmtContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copystmt

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

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




    def copystmt(self):

        localctx = PostgreSQLParser.CopystmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 142, self.RULE_copystmt)
        try:
            self.state = 2641
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,69,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2619
                self.match(PostgreSQLParser.COPY)
                self.state = 2620
                self.opt_binary()
                self.state = 2621
                self.qualified_name()
                self.state = 2622
                self.opt_column_list()
                self.state = 2623
                self.copy_from()
                self.state = 2624
                self.opt_program()
                self.state = 2625
                self.copy_file_name()
                self.state = 2626
                self.copy_delimiter()
                self.state = 2627
                self.opt_with()
                self.state = 2628
                self.copy_options()
                self.state = 2629
                self.where_clause()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2631
                self.match(PostgreSQLParser.COPY)
                self.state = 2632
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2633
                self.preparablestmt()
                self.state = 2634
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 2635
                self.match(PostgreSQLParser.TO)
                self.state = 2636
                self.opt_program()
                self.state = 2637
                self.copy_file_name()
                self.state = 2638
                self.opt_with()
                self.state = 2639
                self.copy_options()
                pass


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


    class Copy_fromContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_from

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

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




    def copy_from(self):

        localctx = PostgreSQLParser.Copy_fromContext(self, self._ctx, self.state)
        self.enterRule(localctx, 144, self.RULE_copy_from)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2643
            _la = self._input.LA(1)
            if not(_la==64 or _la==94):
                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 Opt_programContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_program

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

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




    def opt_program(self):

        localctx = PostgreSQLParser.Opt_programContext(self, self._ctx, self.state)
        self.enterRule(localctx, 146, self.RULE_opt_program)
        try:
            self.state = 2647
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [290]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2645
                self.match(PostgreSQLParser.PROGRAM)
                pass
            elif token in [336, 337, 645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 2)

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

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

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_file_name

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

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




    def copy_file_name(self):

        localctx = PostgreSQLParser.Copy_file_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 148, self.RULE_copy_file_name)
        try:
            self.state = 2652
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2649
                self.sconst()
                pass
            elif token in [336]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2650
                self.match(PostgreSQLParser.STDIN)
                pass
            elif token in [337]:
                self.enterOuterAlt(localctx, 3)
                self.state = 2651
                self.match(PostgreSQLParser.STDOUT)
                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 Copy_optionsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def copy_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Copy_opt_listContext,0)


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

        def copy_generic_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Copy_generic_opt_listContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_options

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

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




    def copy_options(self):

        localctx = PostgreSQLParser.Copy_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 150, self.RULE_copy_options)
        try:
            self.state = 2659
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,72,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2654
                self.copy_opt_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2655
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2656
                self.copy_generic_opt_list()
                self.state = 2657
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass


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


    class Copy_opt_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_opt_list

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

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




    def copy_opt_list(self):

        localctx = PostgreSQLParser.Copy_opt_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 152, self.RULE_copy_opt_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2664
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 78)) & ~0x3f) == 0 and ((1 << (_la - 78)) & 17716740097) != 0) or ((((_la - 171)) & ~0x3f) == 0 and ((1 << (_la - 171)) & 35459325497345) != 0) or _la==291:
                self.state = 2661
                self.copy_opt_item()
                self.state = 2666
                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 Copy_opt_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        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 FREEZE(self):
            return self.getToken(PostgreSQLParser.FREEZE, 0)

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

        def opt_as(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_asContext,0)


        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


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

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

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

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

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

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

        def columnlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnlistContext,0)


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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_opt_item

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

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




    def copy_opt_item(self):

        localctx = PostgreSQLParser.Copy_opt_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 154, self.RULE_copy_opt_item)
        try:
            self.state = 2702
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,74,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2667
                self.match(PostgreSQLParser.BINARY)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2668
                self.match(PostgreSQLParser.FREEZE)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 2669
                self.match(PostgreSQLParser.DELIMITER)
                self.state = 2670
                self.opt_as()
                self.state = 2671
                self.sconst()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 2673
                self.match(PostgreSQLParser.NULL_P)
                self.state = 2674
                self.opt_as()
                self.state = 2675
                self.sconst()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 2677
                self.match(PostgreSQLParser.CSV)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 2678
                self.match(PostgreSQLParser.HEADER_P)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 2679
                self.match(PostgreSQLParser.QUOTE)
                self.state = 2680
                self.opt_as()
                self.state = 2681
                self.sconst()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 2683
                self.match(PostgreSQLParser.ESCAPE)
                self.state = 2684
                self.opt_as()
                self.state = 2685
                self.sconst()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 2687
                self.match(PostgreSQLParser.FORCE)
                self.state = 2688
                self.match(PostgreSQLParser.QUOTE)
                self.state = 2689
                self.columnlist()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 2690
                self.match(PostgreSQLParser.FORCE)
                self.state = 2691
                self.match(PostgreSQLParser.QUOTE)
                self.state = 2692
                self.match(PostgreSQLParser.STAR)
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 2693
                self.match(PostgreSQLParser.FORCE)
                self.state = 2694
                self.match(PostgreSQLParser.NOT)
                self.state = 2695
                self.match(PostgreSQLParser.NULL_P)
                self.state = 2696
                self.columnlist()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 2697
                self.match(PostgreSQLParser.FORCE)
                self.state = 2698
                self.match(PostgreSQLParser.NULL_P)
                self.state = 2699
                self.columnlist()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 2700
                self.match(PostgreSQLParser.ENCODING)
                self.state = 2701
                self.sconst()
                pass


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


    class Opt_binaryContext(ParserRuleContext):
        __slots__ = 'parser'

        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 getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_binary

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

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




    def opt_binary(self):

        localctx = PostgreSQLParser.Opt_binaryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 156, self.RULE_opt_binary)
        try:
            self.state = 2706
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [107]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2704
                self.match(PostgreSQLParser.BINARY)
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 2)

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

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

        def opt_using(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_usingContext,0)


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

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_delimiter

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

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




    def copy_delimiter(self):

        localctx = PostgreSQLParser.Copy_delimiterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 158, self.RULE_copy_delimiter)
        try:
            self.state = 2713
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100, 184]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2708
                self.opt_using()
                self.state = 2709
                self.match(PostgreSQLParser.DELIMITERS)
                self.state = 2710
                self.sconst()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 78, 88, 92, 103, 105, 107, 112, 129, 138, 146, 155, 157, 158, 159, 161, 169, 171, 177, 178, 182, 183, 187, 191, 194, 197, 202, 203, 209, 216, 232, 243, 244, 247, 253, 258, 264, 283, 291, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_using

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

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




    def opt_using(self):

        localctx = PostgreSQLParser.Opt_usingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 160, self.RULE_opt_using)
        try:
            self.state = 2717
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2715
                self.match(PostgreSQLParser.USING)
                pass
            elif token in [184]:
                self.enterOuterAlt(localctx, 2)

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

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

        def copy_generic_opt_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Copy_generic_opt_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Copy_generic_opt_elemContext,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_copy_generic_opt_list

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

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




    def copy_generic_opt_list(self):

        localctx = PostgreSQLParser.Copy_generic_opt_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 162, self.RULE_copy_generic_opt_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2719
            self.copy_generic_opt_elem()
            self.state = 2724
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 2720
                self.match(PostgreSQLParser.COMMA)
                self.state = 2721
                self.copy_generic_opt_elem()
                self.state = 2726
                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 Copy_generic_opt_elemContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def copy_generic_opt_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Copy_generic_opt_argContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_generic_opt_elem

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

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




    def copy_generic_opt_elem(self):

        localctx = PostgreSQLParser.Copy_generic_opt_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 164, self.RULE_copy_generic_opt_elem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2727
            self.collabel()
            self.state = 2728
            self.copy_generic_opt_arg()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Copy_generic_opt_argContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def opt_boolean_or_string(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_boolean_or_stringContext,0)


        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


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

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

        def copy_generic_opt_arg_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Copy_generic_opt_arg_listContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_generic_opt_arg

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

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




    def copy_generic_opt_arg(self):

        localctx = PostgreSQLParser.Copy_generic_opt_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 166, self.RULE_copy_generic_opt_arg)
        try:
            self.state = 2738
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 60, 61, 80, 92, 96, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2730
                self.opt_boolean_or_string()
                pass
            elif token in [12, 13, 658, 660]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2731
                self.numericonly()
                pass
            elif token in [9]:
                self.enterOuterAlt(localctx, 3)
                self.state = 2732
                self.match(PostgreSQLParser.STAR)
                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 4)
                self.state = 2733
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2734
                self.copy_generic_opt_arg_list()
                self.state = 2735
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [3, 6]:
                self.enterOuterAlt(localctx, 5)

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

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

        def copy_generic_opt_arg_list_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Copy_generic_opt_arg_list_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Copy_generic_opt_arg_list_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_copy_generic_opt_arg_list

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

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




    def copy_generic_opt_arg_list(self):

        localctx = PostgreSQLParser.Copy_generic_opt_arg_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 168, self.RULE_copy_generic_opt_arg_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2740
            self.copy_generic_opt_arg_list_item()
            self.state = 2745
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 2741
                self.match(PostgreSQLParser.COMMA)
                self.state = 2742
                self.copy_generic_opt_arg_list_item()
                self.state = 2747
                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 Copy_generic_opt_arg_list_itemContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def opt_boolean_or_string(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_boolean_or_stringContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_copy_generic_opt_arg_list_item

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

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




    def copy_generic_opt_arg_list_item(self):

        localctx = PostgreSQLParser.Copy_generic_opt_arg_list_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 170, self.RULE_copy_generic_opt_arg_list_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2748
            self.opt_boolean_or_string()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatestmtContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def opttemp(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttempContext,0)


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

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


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

        def opttableelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttableelementlistContext,0)


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

        def optinherit(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptinheritContext,0)


        def optpartitionspec(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptpartitionspecContext,0)


        def table_access_method_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_access_method_clauseContext,0)


        def optwith(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptwithContext,0)


        def oncommitoption(self):
            return self.getTypedRuleContext(PostgreSQLParser.OncommitoptionContext,0)


        def opttablespace(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttablespaceContext,0)


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

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def opttypedtableelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttypedtableelementlistContext,0)


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

        def partitionboundspec(self):
            return self.getTypedRuleContext(PostgreSQLParser.PartitionboundspecContext,0)


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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createstmt

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

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




    def createstmt(self):

        localctx = PostgreSQLParser.CreatestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 172, self.RULE_createstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2750
            self.match(PostgreSQLParser.CREATE)
            self.state = 2751
            self.opttemp()
            self.state = 2752
            self.match(PostgreSQLParser.TABLE)
            self.state = 2756
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,81,self._ctx)
            if la_ == 1:
                self.state = 2753
                self.match(PostgreSQLParser.IF_P)
                self.state = 2754
                self.match(PostgreSQLParser.NOT)
                self.state = 2755
                self.match(PostgreSQLParser.EXISTS)


            self.state = 2758
            self.qualified_name()
            self.state = 2789
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2]:
                self.state = 2759
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2760
                self.opttableelementlist()
                self.state = 2761
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 2762
                self.optinherit()
                self.state = 2763
                self.optpartitionspec()
                self.state = 2764
                self.table_access_method_clause()
                self.state = 2765
                self.optwith()
                self.state = 2766
                self.oncommitoption()
                self.state = 2767
                self.opttablespace()
                pass
            elif token in [268]:
                self.state = 2769
                self.match(PostgreSQLParser.OF)
                self.state = 2770
                self.any_name()
                self.state = 2771
                self.opttypedtableelementlist()
                self.state = 2772
                self.optpartitionspec()
                self.state = 2773
                self.table_access_method_clause()
                self.state = 2774
                self.optwith()
                self.state = 2775
                self.oncommitoption()
                self.state = 2776
                self.opttablespace()
                pass
            elif token in [278]:
                self.state = 2778
                self.match(PostgreSQLParser.PARTITION)
                self.state = 2779
                self.match(PostgreSQLParser.OF)
                self.state = 2780
                self.qualified_name()
                self.state = 2781
                self.opttypedtableelementlist()
                self.state = 2782
                self.partitionboundspec()
                self.state = 2783
                self.optpartitionspec()
                self.state = 2784
                self.table_access_method_clause()
                self.state = 2785
                self.optwith()
                self.state = 2786
                self.oncommitoption()
                self.state = 2787
                self.opttablespace()
                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 OpttempContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opttemp

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

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




    def opttemp(self):

        localctx = PostgreSQLParser.OpttempContext(self, self._ctx, self.state)
        self.enterRule(localctx, 174, self.RULE_opttemp)
        self._la = 0 # Token type
        try:
            self.state = 2799
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [347]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2791
                self.match(PostgreSQLParser.TEMPORARY)
                pass
            elif token in [345]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2792
                self.match(PostgreSQLParser.TEMP)
                pass
            elif token in [245]:
                self.enterOuterAlt(localctx, 3)
                self.state = 2793
                self.match(PostgreSQLParser.LOCAL)
                self.state = 2794
                _la = self._input.LA(1)
                if not(_la==345 or _la==347):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [213]:
                self.enterOuterAlt(localctx, 4)
                self.state = 2795
                self.match(PostgreSQLParser.GLOBAL)
                self.state = 2796
                _la = self._input.LA(1)
                if not(_la==345 or _la==347):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [360]:
                self.enterOuterAlt(localctx, 5)
                self.state = 2797
                self.match(PostgreSQLParser.UNLOGGED)
                pass
            elif token in [92, 296, 321, 369]:
                self.enterOuterAlt(localctx, 6)

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

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

        def tableelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.TableelementlistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opttableelementlist

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

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




    def opttableelementlist(self):

        localctx = PostgreSQLParser.OpttableelementlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 176, self.RULE_opttableelementlist)
        try:
            self.state = 2803
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 42, 43, 44, 45, 53, 57, 61, 63, 85, 92, 98, 116, 119, 120, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2801
                self.tableelementlist()
                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 2)

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

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

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

        def typedtableelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypedtableelementlistContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opttypedtableelementlist

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

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




    def opttypedtableelementlist(self):

        localctx = PostgreSQLParser.OpttypedtableelementlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 178, self.RULE_opttypedtableelementlist)
        try:
            self.state = 2810
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,85,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2805
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2806
                self.typedtableelementlist()
                self.state = 2807
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


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


    class TableelementlistContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def tableelement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TableelementContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TableelementContext,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_tableelementlist

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

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




    def tableelementlist(self):

        localctx = PostgreSQLParser.TableelementlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 180, self.RULE_tableelementlist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2812
            self.tableelement()
            self.state = 2817
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 2813
                self.match(PostgreSQLParser.COMMA)
                self.state = 2814
                self.tableelement()
                self.state = 2819
                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 TypedtableelementlistContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def typedtableelement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypedtableelementContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypedtableelementContext,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_typedtableelementlist

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

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




    def typedtableelementlist(self):

        localctx = PostgreSQLParser.TypedtableelementlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 182, self.RULE_typedtableelementlist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2820
            self.typedtableelement()
            self.state = 2825
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 2821
                self.match(PostgreSQLParser.COMMA)
                self.state = 2822
                self.typedtableelement()
                self.state = 2827
                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 TableelementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def tableconstraint(self):
            return self.getTypedRuleContext(PostgreSQLParser.TableconstraintContext,0)


        def tablelikeclause(self):
            return self.getTypedRuleContext(PostgreSQLParser.TablelikeclauseContext,0)


        def columnDef(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnDefContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_tableelement

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

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




    def tableelement(self):

        localctx = PostgreSQLParser.TableelementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 184, self.RULE_tableelement)
        try:
            self.state = 2831
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,88,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2828
                self.tableconstraint()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2829
                self.tablelikeclause()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 2830
                self.columnDef()
                pass


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


    class TypedtableelementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def columnOptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnOptionsContext,0)


        def tableconstraint(self):
            return self.getTypedRuleContext(PostgreSQLParser.TableconstraintContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_typedtableelement

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

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




    def typedtableelement(self):

        localctx = PostgreSQLParser.TypedtableelementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 186, self.RULE_typedtableelement)
        try:
            self.state = 2835
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,89,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2833
                self.columnOptions()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2834
                self.tableconstraint()
                pass


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


    class ColumnDefContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def create_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_generic_optionsContext,0)


        def colquallist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColquallistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_columnDef

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

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




    def columnDef(self):

        localctx = PostgreSQLParser.ColumnDefContext(self, self._ctx, self.state)
        self.enterRule(localctx, 188, self.RULE_columnDef)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2837
            self.colid()
            self.state = 2838
            self.typename()
            self.state = 2839
            self.create_generic_options()
            self.state = 2840
            self.colquallist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ColumnOptionsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def colquallist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColquallistContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_columnOptions

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

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




    def columnOptions(self):

        localctx = PostgreSQLParser.ColumnOptionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 190, self.RULE_columnOptions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2842
            self.colid()
            self.state = 2845
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==105:
                self.state = 2843
                self.match(PostgreSQLParser.WITH)
                self.state = 2844
                self.match(PostgreSQLParser.OPTIONS)


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


    class ColquallistContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_colquallist

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

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




    def colquallist(self):

        localctx = PostgreSQLParser.ColquallistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 192, self.RULE_colquallist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2852
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 42)) & ~0x3f) == 0 and ((1 << (_la - 42)) & 72084085530433547) != 0) or _la==438:
                self.state = 2849
                self.colconstraint()
                self.state = 2854
                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 ColconstraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def colconstraintelem(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColconstraintelemContext,0)


        def constraintattr(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstraintattrContext,0)


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

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_colconstraint

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

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




    def colconstraint(self):

        localctx = PostgreSQLParser.ColconstraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 194, self.RULE_colconstraint)
        try:
            self.state = 2863
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,92,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 2855
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 2856
                self.name()
                self.state = 2857
                self.colconstraintelem()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 2859
                self.colconstraintelem()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 2860
                self.constraintattr()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 2861
                self.match(PostgreSQLParser.COLLATE)
                self.state = 2862
                self.any_name()
                pass


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


    class ColconstraintelemContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

        def opt_definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_definitionContext,0)


        def optconstablespace(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptconstablespaceContext,0)


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

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

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

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

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


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

        def opt_no_inherit(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_no_inheritContext,0)


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

        def b_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.B_exprContext,0)


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

        def generated_when(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generated_whenContext,0)


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

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

        def optparenthesizedseqoptlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptparenthesizedseqoptlistContext,0)


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

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

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def opt_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_column_listContext,0)


        def key_match(self):
            return self.getTypedRuleContext(PostgreSQLParser.Key_matchContext,0)


        def key_actions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Key_actionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_colconstraintelem

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

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




    def colconstraintelem(self):

        localctx = PostgreSQLParser.ColconstraintelemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 196, self.RULE_colconstraintelem)
        try:
            self.state = 2903
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [77]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2865
                self.match(PostgreSQLParser.NOT)
                self.state = 2866
                self.match(PostgreSQLParser.NULL_P)
                pass
            elif token in [78]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2867
                self.match(PostgreSQLParser.NULL_P)
                pass
            elif token in [98]:
                self.enterOuterAlt(localctx, 3)
                self.state = 2868
                self.match(PostgreSQLParser.UNIQUE)
                self.state = 2869
                self.opt_definition()
                self.state = 2870
                self.optconstablespace()
                pass
            elif token in [85]:
                self.enterOuterAlt(localctx, 4)
                self.state = 2872
                self.match(PostgreSQLParser.PRIMARY)
                self.state = 2873
                self.match(PostgreSQLParser.KEY)
                self.state = 2874
                self.opt_definition()
                self.state = 2875
                self.optconstablespace()
                pass
            elif token in [42]:
                self.enterOuterAlt(localctx, 5)
                self.state = 2877
                self.match(PostgreSQLParser.CHECK)
                self.state = 2878
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2879
                self.a_expr()
                self.state = 2880
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 2881
                self.opt_no_inherit()
                pass
            elif token in [53]:
                self.enterOuterAlt(localctx, 6)
                self.state = 2883
                self.match(PostgreSQLParser.DEFAULT)
                self.state = 2884
                self.b_expr(0)
                pass
            elif token in [438]:
                self.enterOuterAlt(localctx, 7)
                self.state = 2885
                self.match(PostgreSQLParser.GENERATED)
                self.state = 2886
                self.generated_when()
                self.state = 2887
                self.match(PostgreSQLParser.AS)
                self.state = 2895
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [219]:
                    self.state = 2888
                    self.match(PostgreSQLParser.IDENTITY_P)
                    self.state = 2889
                    self.optparenthesizedseqoptlist()
                    pass
                elif token in [2]:
                    self.state = 2890
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 2891
                    self.a_expr()
                    self.state = 2892
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    self.state = 2893
                    self.match(PostgreSQLParser.STORED)
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [86]:
                self.enterOuterAlt(localctx, 8)
                self.state = 2897
                self.match(PostgreSQLParser.REFERENCES)
                self.state = 2898
                self.qualified_name()
                self.state = 2899
                self.opt_column_list()
                self.state = 2900
                self.key_match()
                self.state = 2901
                self.key_actions()
                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 Generated_whenContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_generated_when

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

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




    def generated_when(self):

        localctx = PostgreSQLParser.Generated_whenContext(self, self._ctx, self.state)
        self.enterRule(localctx, 198, self.RULE_generated_when)
        try:
            self.state = 2908
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [139]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2905
                self.match(PostgreSQLParser.ALWAYS)
                pass
            elif token in [147]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2906
                self.match(PostgreSQLParser.BY)
                self.state = 2907
                self.match(PostgreSQLParser.DEFAULT)
                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 ConstraintattrContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constraintattr

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

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




    def constraintattr(self):

        localctx = PostgreSQLParser.ConstraintattrContext(self, self._ctx, self.state)
        self.enterRule(localctx, 200, self.RULE_constraintattr)
        self._la = 0 # Token type
        try:
            self.state = 2915
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [54]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2910
                self.match(PostgreSQLParser.DEFERRABLE)
                pass
            elif token in [77]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2911
                self.match(PostgreSQLParser.NOT)
                self.state = 2912
                self.match(PostgreSQLParser.DEFERRABLE)
                pass
            elif token in [69]:
                self.enterOuterAlt(localctx, 3)
                self.state = 2913
                self.match(PostgreSQLParser.INITIALLY)
                self.state = 2914
                _la = self._input.LA(1)
                if not(_la==180 or _la==221):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                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 TablelikeclauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def tablelikeoptionlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.TablelikeoptionlistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_tablelikeclause

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

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




    def tablelikeclause(self):

        localctx = PostgreSQLParser.TablelikeclauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 202, self.RULE_tablelikeclause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2917
            self.match(PostgreSQLParser.LIKE)
            self.state = 2918
            self.qualified_name()
            self.state = 2919
            self.tablelikeoptionlist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TablelikeoptionlistContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_tablelikeoptionlist

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

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




    def tablelikeoptionlist(self):

        localctx = PostgreSQLParser.TablelikeoptionlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 204, self.RULE_tablelikeoptionlist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2925
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==200 or _la==224:
                self.state = 2921
                _la = self._input.LA(1)
                if not(_la==200 or _la==224):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 2922
                self.tablelikeoption()
                self.state = 2927
                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 TablelikeoptionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_tablelikeoption

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

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




    def tablelikeoption(self):

        localctx = PostgreSQLParser.TablelikeoptionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 206, self.RULE_tablelikeoption)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 2928
            _la = self._input.LA(1)
            if not(_la==30 or ((((_la - 160)) & ~0x3f) == 0 and ((1 << (_la - 160)) & 576460752303947809) != 0) or _la==227 or _la==335 or _la==338 or _la==438):
                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 TableconstraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def constraintelem(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstraintelemContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_tableconstraint

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

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




    def tableconstraint(self):

        localctx = PostgreSQLParser.TableconstraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 208, self.RULE_tableconstraint)
        try:
            self.state = 2935
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [45]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2930
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 2931
                self.name()
                self.state = 2932
                self.constraintelem()
                pass
            elif token in [42, 63, 85, 98, 199]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2934
                self.constraintelem()
                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 ConstraintelemContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


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

        def constraintattributespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstraintattributespecContext,0)


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

        def columnlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnlistContext,0)


        def opt_c_include(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_c_includeContext,0)


        def opt_definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_definitionContext,0)


        def optconstablespace(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptconstablespaceContext,0)


        def existingindex(self):
            return self.getTypedRuleContext(PostgreSQLParser.ExistingindexContext,0)


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

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

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

        def access_method_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Access_method_clauseContext,0)


        def exclusionconstraintlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ExclusionconstraintlistContext,0)


        def exclusionwhereclause(self):
            return self.getTypedRuleContext(PostgreSQLParser.ExclusionwhereclauseContext,0)


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

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

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def opt_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_column_listContext,0)


        def key_match(self):
            return self.getTypedRuleContext(PostgreSQLParser.Key_matchContext,0)


        def key_actions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Key_actionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constraintelem

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

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




    def constraintelem(self):

        localctx = PostgreSQLParser.ConstraintelemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 210, self.RULE_constraintelem)
        try:
            self.state = 2995
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [42]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2937
                self.match(PostgreSQLParser.CHECK)
                self.state = 2938
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2939
                self.a_expr()
                self.state = 2940
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 2941
                self.constraintattributespec()
                pass
            elif token in [98]:
                self.enterOuterAlt(localctx, 2)
                self.state = 2943
                self.match(PostgreSQLParser.UNIQUE)
                self.state = 2955
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [2]:
                    self.state = 2944
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 2945
                    self.columnlist()
                    self.state = 2946
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    self.state = 2947
                    self.opt_c_include()
                    self.state = 2948
                    self.opt_definition()
                    self.state = 2949
                    self.optconstablespace()
                    self.state = 2950
                    self.constraintattributespec()
                    pass
                elif token in [100]:
                    self.state = 2952
                    self.existingindex()
                    self.state = 2953
                    self.constraintattributespec()
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [85]:
                self.enterOuterAlt(localctx, 3)
                self.state = 2957
                self.match(PostgreSQLParser.PRIMARY)
                self.state = 2958
                self.match(PostgreSQLParser.KEY)
                self.state = 2970
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [2]:
                    self.state = 2959
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 2960
                    self.columnlist()
                    self.state = 2961
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    self.state = 2962
                    self.opt_c_include()
                    self.state = 2963
                    self.opt_definition()
                    self.state = 2964
                    self.optconstablespace()
                    self.state = 2965
                    self.constraintattributespec()
                    pass
                elif token in [100]:
                    self.state = 2967
                    self.existingindex()
                    self.state = 2968
                    self.constraintattributespec()
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [199]:
                self.enterOuterAlt(localctx, 4)
                self.state = 2972
                self.match(PostgreSQLParser.EXCLUDE)
                self.state = 2973
                self.access_method_clause()
                self.state = 2974
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2975
                self.exclusionconstraintlist()
                self.state = 2976
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 2977
                self.opt_c_include()
                self.state = 2978
                self.opt_definition()
                self.state = 2979
                self.optconstablespace()
                self.state = 2980
                self.exclusionwhereclause()
                self.state = 2981
                self.constraintattributespec()
                pass
            elif token in [63]:
                self.enterOuterAlt(localctx, 5)
                self.state = 2983
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 2984
                self.match(PostgreSQLParser.KEY)
                self.state = 2985
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 2986
                self.columnlist()
                self.state = 2987
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 2988
                self.match(PostgreSQLParser.REFERENCES)
                self.state = 2989
                self.qualified_name()
                self.state = 2990
                self.opt_column_list()
                self.state = 2991
                self.key_match()
                self.state = 2992
                self.key_actions()
                self.state = 2993
                self.constraintattributespec()
                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 Opt_no_inheritContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_no_inherit

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

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




    def opt_no_inherit(self):

        localctx = PostgreSQLParser.Opt_no_inheritContext(self, self._ctx, self.state)
        self.enterRule(localctx, 212, self.RULE_opt_no_inherit)
        try:
            self.state = 3000
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [262]:
                self.enterOuterAlt(localctx, 1)
                self.state = 2997
                self.match(PostgreSQLParser.NO)
                self.state = 2998
                self.match(PostgreSQLParser.INHERIT)
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 42, 43, 45, 46, 53, 54, 57, 61, 65, 69, 71, 77, 78, 85, 86, 88, 92, 98, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 438, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

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

        def columnlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnlistContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_column_list

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

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




    def opt_column_list(self):

        localctx = PostgreSQLParser.Opt_column_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 214, self.RULE_opt_column_list)
        try:
            self.state = 3007
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,103,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3002
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3003
                self.columnlist()
                self.state = 3004
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


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


    class ColumnlistContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def columnElem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.ColumnElemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.ColumnElemContext,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_columnlist

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

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




    def columnlist(self):

        localctx = PostgreSQLParser.ColumnlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 216, self.RULE_columnlist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3009
            self.columnElem()
            self.state = 3014
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 3010
                self.match(PostgreSQLParser.COMMA)
                self.state = 3011
                self.columnElem()
                self.state = 3016
                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 ColumnElemContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_columnElem

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

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




    def columnElem(self):

        localctx = PostgreSQLParser.ColumnElemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 218, self.RULE_columnElem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3017
            self.colid()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_c_includeContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def columnlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnlistContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_c_include

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

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




    def opt_c_include(self):

        localctx = PostgreSQLParser.Opt_c_includeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 220, self.RULE_opt_c_include)
        try:
            self.state = 3025
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [441]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3019
                self.match(PostgreSQLParser.INCLUDE)
                self.state = 3020
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3021
                self.columnlist()
                self.state = 3022
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 54, 57, 61, 65, 69, 71, 77, 88, 92, 100, 103, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 262, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_key_match

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

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




    def key_match(self):

        localctx = PostgreSQLParser.Key_matchContext(self, self._ctx, self.state)
        self.enterRule(localctx, 222, self.RULE_key_match)
        self._la = 0 # Token type
        try:
            self.state = 3030
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [249]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3027
                self.match(PostgreSQLParser.MATCH)
                self.state = 3028
                _la = self._input.LA(1)
                if not(_la==113 or _la==277 or _la==329):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 42, 43, 45, 46, 53, 54, 57, 61, 65, 69, 71, 77, 78, 80, 85, 86, 88, 92, 98, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 262, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 438, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

        def exclusionconstraintelem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.ExclusionconstraintelemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.ExclusionconstraintelemContext,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_exclusionconstraintlist

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

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




    def exclusionconstraintlist(self):

        localctx = PostgreSQLParser.ExclusionconstraintlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 224, self.RULE_exclusionconstraintlist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3032
            self.exclusionconstraintelem()
            self.state = 3037
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 3033
                self.match(PostgreSQLParser.COMMA)
                self.state = 3034
                self.exclusionconstraintelem()
                self.state = 3039
                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 ExclusionconstraintelemContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def index_elem(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_elemContext,0)


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

        def any_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_operatorContext,0)


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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_exclusionconstraintelem

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

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




    def exclusionconstraintelem(self):

        localctx = PostgreSQLParser.ExclusionconstraintelemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 226, self.RULE_exclusionconstraintelem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3040
            self.index_elem()
            self.state = 3041
            self.match(PostgreSQLParser.WITH)
            self.state = 3048
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,108,self._ctx)
            if la_ == 1:
                self.state = 3042
                self.any_operator()
                pass

            elif la_ == 2:
                self.state = 3043
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 3044
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3045
                self.any_operator()
                self.state = 3046
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass


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


    class ExclusionwhereclauseContext(ParserRuleContext):
        __slots__ = 'parser'

        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 OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_exclusionwhereclause

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

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




    def exclusionwhereclause(self):

        localctx = PostgreSQLParser.ExclusionwhereclauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 228, self.RULE_exclusionwhereclause)
        try:
            self.state = 3056
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [103]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3050
                self.match(PostgreSQLParser.WHERE)
                self.state = 3051
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3052
                self.a_expr()
                self.state = 3053
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 54, 57, 61, 65, 69, 71, 77, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 262, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

        def key_update(self):
            return self.getTypedRuleContext(PostgreSQLParser.Key_updateContext,0)


        def key_delete(self):
            return self.getTypedRuleContext(PostgreSQLParser.Key_deleteContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_key_actions

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

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




    def key_actions(self):

        localctx = PostgreSQLParser.Key_actionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 230, self.RULE_key_actions)
        try:
            self.state = 3067
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,110,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3058
                self.key_update()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3059
                self.key_delete()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 3060
                self.key_update()
                self.state = 3061
                self.key_delete()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 3063
                self.key_delete()
                self.state = 3064
                self.key_update()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)

                pass


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


    class Key_updateContext(ParserRuleContext):
        __slots__ = 'parser'

        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 UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def key_action(self):
            return self.getTypedRuleContext(PostgreSQLParser.Key_actionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_key_update

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

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




    def key_update(self):

        localctx = PostgreSQLParser.Key_updateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 232, self.RULE_key_update)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3069
            self.match(PostgreSQLParser.ON)
            self.state = 3070
            self.match(PostgreSQLParser.UPDATE)
            self.state = 3071
            self.key_action()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Key_deleteContext(ParserRuleContext):
        __slots__ = 'parser'

        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 DELETE_P(self):
            return self.getToken(PostgreSQLParser.DELETE_P, 0)

        def key_action(self):
            return self.getTypedRuleContext(PostgreSQLParser.Key_actionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_key_delete

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

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




    def key_delete(self):

        localctx = PostgreSQLParser.Key_deleteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 234, self.RULE_key_delete)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3073
            self.match(PostgreSQLParser.ON)
            self.state = 3074
            self.match(PostgreSQLParser.DELETE_P)
            self.state = 3075
            self.key_action()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Key_actionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_key_action

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

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




    def key_action(self):

        localctx = PostgreSQLParser.Key_actionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 236, self.RULE_key_action)
        self._la = 0 # Token type
        try:
            self.state = 3083
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [262]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3077
                self.match(PostgreSQLParser.NO)
                self.state = 3078
                self.match(PostgreSQLParser.ACTION)
                pass
            elif token in [308]:
                self.enterOuterAlt(localctx, 2)
                self.state = 3079
                self.match(PostgreSQLParser.RESTRICT)
                pass
            elif token in [150]:
                self.enterOuterAlt(localctx, 3)
                self.state = 3080
                self.match(PostgreSQLParser.CASCADE)
                pass
            elif token in [326]:
                self.enterOuterAlt(localctx, 4)
                self.state = 3081
                self.match(PostgreSQLParser.SET)
                self.state = 3082
                _la = self._input.LA(1)
                if not(_la==53 or _la==78):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                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 OptinheritContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def qualified_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_name_listContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optinherit

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

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




    def optinherit(self):

        localctx = PostgreSQLParser.OptinheritContext(self, self._ctx, self.state)
        self.enterRule(localctx, 238, self.RULE_optinherit)
        try:
            self.state = 3091
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [229]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3085
                self.match(PostgreSQLParser.INHERITS)
                self.state = 3086
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3087
                self.qualified_name_list()
                self.state = 3088
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 80, 88, 92, 100, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 278, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 324, 326, 328, 333, 344, 351, 359, 362, 363, 372, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

        def partitionspec(self):
            return self.getTypedRuleContext(PostgreSQLParser.PartitionspecContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optpartitionspec

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

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




    def optpartitionspec(self):

        localctx = PostgreSQLParser.OptpartitionspecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 240, self.RULE_optpartitionspec)
        try:
            self.state = 3095
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [278]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3093
                self.partitionspec()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 80, 88, 92, 100, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 344, 351, 359, 362, 363, 372, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

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

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

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


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

        def part_params(self):
            return self.getTypedRuleContext(PostgreSQLParser.Part_paramsContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_partitionspec

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

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




    def partitionspec(self):

        localctx = PostgreSQLParser.PartitionspecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 242, self.RULE_partitionspec)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3097
            self.match(PostgreSQLParser.PARTITION)
            self.state = 3098
            self.match(PostgreSQLParser.BY)
            self.state = 3099
            self.colid()
            self.state = 3100
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 3101
            self.part_params()
            self.state = 3102
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Part_paramsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def part_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Part_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Part_elemContext,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_part_params

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

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




    def part_params(self):

        localctx = PostgreSQLParser.Part_paramsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 244, self.RULE_part_params)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3104
            self.part_elem()
            self.state = 3109
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 3105
                self.match(PostgreSQLParser.COMMA)
                self.state = 3106
                self.part_elem()
                self.state = 3111
                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 Part_elemContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def opt_collate(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_collateContext,0)


        def opt_class(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_classContext,0)


        def func_expr_windowless(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_expr_windowlessContext,0)


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

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_part_elem

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

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




    def part_elem(self):

        localctx = PostgreSQLParser.Part_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 246, self.RULE_part_elem)
        try:
            self.state = 3126
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,115,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3112
                self.colid()
                self.state = 3113
                self.opt_collate()
                self.state = 3114
                self.opt_class()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3116
                self.func_expr_windowless()
                self.state = 3117
                self.opt_collate()
                self.state = 3118
                self.opt_class()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 3120
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3121
                self.a_expr()
                self.state = 3122
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 3123
                self.opt_collate()
                self.state = 3124
                self.opt_class()
                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_access_method_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_access_method_clause

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

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




    def table_access_method_clause(self):

        localctx = PostgreSQLParser.Table_access_method_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 248, self.RULE_table_access_method_clause)
        try:
            self.state = 3131
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3128
                self.match(PostgreSQLParser.USING)
                self.state = 3129
                self.name()
                pass
            elif token in [-1, 2, 7, 31, 32, 36, 46, 57, 61, 65, 71, 80, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 344, 351, 359, 362, 363, 372, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

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

        def reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.ReloptionsContext,0)


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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optwith

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

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




    def optwith(self):

        localctx = PostgreSQLParser.OptwithContext(self, self._ctx, self.state)
        self.enterRule(localctx, 250, self.RULE_optwith)
        try:
            self.state = 3138
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,117,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3133
                self.match(PostgreSQLParser.WITH)
                self.state = 3134
                self.reloptions()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3135
                self.match(PostgreSQLParser.WITHOUT)
                self.state = 3136
                self.match(PostgreSQLParser.OIDS)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)

                pass


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


    class OncommitoptionContext(ParserRuleContext):
        __slots__ = 'parser'

        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 COMMIT(self):
            return self.getToken(PostgreSQLParser.COMMIT, 0)

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

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

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

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

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_oncommitoption

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

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




    def oncommitoption(self):

        localctx = PostgreSQLParser.OncommitoptionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 252, self.RULE_oncommitoption)
        try:
            self.state = 3150
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [80]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3140
                self.match(PostgreSQLParser.ON)
                self.state = 3141
                self.match(PostgreSQLParser.COMMIT)
                self.state = 3147
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [191]:
                    self.state = 3142
                    self.match(PostgreSQLParser.DROP)
                    pass
                elif token in [182]:
                    self.state = 3143
                    self.match(PostgreSQLParser.DELETE_P)
                    self.state = 3144
                    self.match(PostgreSQLParser.ROWS)
                    pass
                elif token in [285]:
                    self.state = 3145
                    self.match(PostgreSQLParser.PRESERVE)
                    self.state = 3146
                    self.match(PostgreSQLParser.ROWS)
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [-1, 2, 7, 31, 32, 36, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 344, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

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

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

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opttablespace

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpttablespace" ):
                listener.enterOpttablespace(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpttablespace" ):
                listener.exitOpttablespace(self)




    def opttablespace(self):

        localctx = PostgreSQLParser.OpttablespaceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 254, self.RULE_opttablespace)
        try:
            self.state = 3155
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [344]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3152
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 3153
                self.name()
                pass
            elif token in [-1, 2, 7, 31, 32, 36, 46, 57, 61, 65, 71, 88, 92, 103, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 OptconstablespaceContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optconstablespace

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOptconstablespace" ):
                listener.enterOptconstablespace(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOptconstablespace" ):
                listener.exitOptconstablespace(self)




    def optconstablespace(self):

        localctx = PostgreSQLParser.OptconstablespaceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 256, self.RULE_optconstablespace)
        try:
            self.state = 3162
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3157
                self.match(PostgreSQLParser.USING)
                self.state = 3158
                self.match(PostgreSQLParser.INDEX)
                self.state = 3159
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 3160
                self.name()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 42, 43, 45, 46, 53, 54, 57, 61, 65, 69, 71, 77, 78, 85, 86, 88, 92, 98, 103, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 262, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 438, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 ExistingindexContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_existingindex

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExistingindex" ):
                listener.enterExistingindex(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExistingindex" ):
                listener.exitExistingindex(self)




    def existingindex(self):

        localctx = PostgreSQLParser.ExistingindexContext(self, self._ctx, self.state)
        self.enterRule(localctx, 258, self.RULE_existingindex)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3164
            self.match(PostgreSQLParser.USING)
            self.state = 3165
            self.match(PostgreSQLParser.INDEX)
            self.state = 3166
            self.name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatestatsstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def STATISTICS(self):
            return self.getToken(PostgreSQLParser.STATISTICS, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def opt_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_name_listContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def from_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.From_listContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createstatsstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatestatsstmt" ):
                listener.enterCreatestatsstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatestatsstmt" ):
                listener.exitCreatestatsstmt(self)




    def createstatsstmt(self):

        localctx = PostgreSQLParser.CreatestatsstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 260, self.RULE_createstatsstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3168
            self.match(PostgreSQLParser.CREATE)
            self.state = 3169
            self.match(PostgreSQLParser.STATISTICS)
            self.state = 3173
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,122,self._ctx)
            if la_ == 1:
                self.state = 3170
                self.match(PostgreSQLParser.IF_P)
                self.state = 3171
                self.match(PostgreSQLParser.NOT)
                self.state = 3172
                self.match(PostgreSQLParser.EXISTS)


            self.state = 3175
            self.any_name()
            self.state = 3176
            self.opt_name_list()
            self.state = 3177
            self.match(PostgreSQLParser.ON)
            self.state = 3178
            self.expr_list()
            self.state = 3179
            self.match(PostgreSQLParser.FROM)
            self.state = 3180
            self.from_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterstatsstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def STATISTICS(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.STATISTICS)
            else:
                return self.getToken(PostgreSQLParser.STATISTICS, i)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def signediconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SignediconstContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterstatsstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterstatsstmt" ):
                listener.enterAlterstatsstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterstatsstmt" ):
                listener.exitAlterstatsstmt(self)




    def alterstatsstmt(self):

        localctx = PostgreSQLParser.AlterstatsstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 262, self.RULE_alterstatsstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3182
            self.match(PostgreSQLParser.ALTER)
            self.state = 3183
            self.match(PostgreSQLParser.STATISTICS)
            self.state = 3186
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,123,self._ctx)
            if la_ == 1:
                self.state = 3184
                self.match(PostgreSQLParser.IF_P)
                self.state = 3185
                self.match(PostgreSQLParser.EXISTS)


            self.state = 3188
            self.any_name()
            self.state = 3189
            self.match(PostgreSQLParser.SET)
            self.state = 3190
            self.match(PostgreSQLParser.STATISTICS)
            self.state = 3191
            self.signediconst()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreateasstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opttemp(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttempContext,0)


        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def create_as_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_as_targetContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def opt_with_data(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_with_dataContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createasstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateasstmt" ):
                listener.enterCreateasstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateasstmt" ):
                listener.exitCreateasstmt(self)




    def createasstmt(self):

        localctx = PostgreSQLParser.CreateasstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 264, self.RULE_createasstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3193
            self.match(PostgreSQLParser.CREATE)
            self.state = 3194
            self.opttemp()
            self.state = 3195
            self.match(PostgreSQLParser.TABLE)
            self.state = 3199
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,124,self._ctx)
            if la_ == 1:
                self.state = 3196
                self.match(PostgreSQLParser.IF_P)
                self.state = 3197
                self.match(PostgreSQLParser.NOT)
                self.state = 3198
                self.match(PostgreSQLParser.EXISTS)


            self.state = 3201
            self.create_as_target()
            self.state = 3202
            self.match(PostgreSQLParser.AS)
            self.state = 3203
            self.selectstmt()
            self.state = 3204
            self.opt_with_data()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Create_as_targetContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def opt_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_column_listContext,0)


        def table_access_method_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_access_method_clauseContext,0)


        def optwith(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptwithContext,0)


        def oncommitoption(self):
            return self.getTypedRuleContext(PostgreSQLParser.OncommitoptionContext,0)


        def opttablespace(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttablespaceContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_create_as_target

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreate_as_target" ):
                listener.enterCreate_as_target(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreate_as_target" ):
                listener.exitCreate_as_target(self)




    def create_as_target(self):

        localctx = PostgreSQLParser.Create_as_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 266, self.RULE_create_as_target)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3206
            self.qualified_name()
            self.state = 3207
            self.opt_column_list()
            self.state = 3208
            self.table_access_method_clause()
            self.state = 3209
            self.optwith()
            self.state = 3210
            self.oncommitoption()
            self.state = 3211
            self.opttablespace()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_with_dataContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_with_data

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_with_data" ):
                listener.enterOpt_with_data(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_with_data" ):
                listener.exitOpt_with_data(self)




    def opt_with_data(self):

        localctx = PostgreSQLParser.Opt_with_dataContext(self, self._ctx, self.state)
        self.enterRule(localctx, 268, self.RULE_opt_with_data)
        try:
            self.state = 3220
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,126,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3213
                self.match(PostgreSQLParser.WITH)
                self.state = 3217
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [174]:
                    self.state = 3214
                    self.match(PostgreSQLParser.DATA_P)
                    pass
                elif token in [262]:
                    self.state = 3215
                    self.match(PostgreSQLParser.NO)
                    self.state = 3216
                    self.match(PostgreSQLParser.DATA_P)
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatematviewstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def optnolog(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptnologContext,0)


        def MATERIALIZED(self):
            return self.getToken(PostgreSQLParser.MATERIALIZED, 0)

        def VIEW(self):
            return self.getToken(PostgreSQLParser.VIEW, 0)

        def create_mv_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_mv_targetContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def opt_with_data(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_with_dataContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_creatematviewstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatematviewstmt" ):
                listener.enterCreatematviewstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatematviewstmt" ):
                listener.exitCreatematviewstmt(self)




    def creatematviewstmt(self):

        localctx = PostgreSQLParser.CreatematviewstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 270, self.RULE_creatematviewstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3222
            self.match(PostgreSQLParser.CREATE)
            self.state = 3223
            self.optnolog()
            self.state = 3224
            self.match(PostgreSQLParser.MATERIALIZED)
            self.state = 3225
            self.match(PostgreSQLParser.VIEW)
            self.state = 3229
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,127,self._ctx)
            if la_ == 1:
                self.state = 3226
                self.match(PostgreSQLParser.IF_P)
                self.state = 3227
                self.match(PostgreSQLParser.NOT)
                self.state = 3228
                self.match(PostgreSQLParser.EXISTS)


            self.state = 3231
            self.create_mv_target()
            self.state = 3232
            self.match(PostgreSQLParser.AS)
            self.state = 3233
            self.selectstmt()
            self.state = 3234
            self.opt_with_data()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Create_mv_targetContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def opt_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_column_listContext,0)


        def table_access_method_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_access_method_clauseContext,0)


        def opt_reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_reloptionsContext,0)


        def opttablespace(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttablespaceContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_create_mv_target

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreate_mv_target" ):
                listener.enterCreate_mv_target(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreate_mv_target" ):
                listener.exitCreate_mv_target(self)




    def create_mv_target(self):

        localctx = PostgreSQLParser.Create_mv_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 272, self.RULE_create_mv_target)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3236
            self.qualified_name()
            self.state = 3237
            self.opt_column_list()
            self.state = 3238
            self.table_access_method_clause()
            self.state = 3239
            self.opt_reloptions()
            self.state = 3240
            self.opttablespace()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OptnologContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def UNLOGGED(self):
            return self.getToken(PostgreSQLParser.UNLOGGED, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optnolog

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOptnolog" ):
                listener.enterOptnolog(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOptnolog" ):
                listener.exitOptnolog(self)




    def optnolog(self):

        localctx = PostgreSQLParser.OptnologContext(self, self._ctx, self.state)
        self.enterRule(localctx, 274, self.RULE_optnolog)
        try:
            self.state = 3244
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [360]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3242
                self.match(PostgreSQLParser.UNLOGGED)
                pass
            elif token in [251]:
                self.enterOuterAlt(localctx, 2)

                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 RefreshmatviewstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def REFRESH(self):
            return self.getToken(PostgreSQLParser.REFRESH, 0)

        def MATERIALIZED(self):
            return self.getToken(PostgreSQLParser.MATERIALIZED, 0)

        def VIEW(self):
            return self.getToken(PostgreSQLParser.VIEW, 0)

        def opt_concurrently(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_concurrentlyContext,0)


        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def opt_with_data(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_with_dataContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_refreshmatviewstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRefreshmatviewstmt" ):
                listener.enterRefreshmatviewstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRefreshmatviewstmt" ):
                listener.exitRefreshmatviewstmt(self)




    def refreshmatviewstmt(self):

        localctx = PostgreSQLParser.RefreshmatviewstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 276, self.RULE_refreshmatviewstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3246
            self.match(PostgreSQLParser.REFRESH)
            self.state = 3247
            self.match(PostgreSQLParser.MATERIALIZED)
            self.state = 3248
            self.match(PostgreSQLParser.VIEW)
            self.state = 3249
            self.opt_concurrently()
            self.state = 3250
            self.qualified_name()
            self.state = 3251
            self.opt_with_data()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreateseqstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opttemp(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttempContext,0)


        def SEQUENCE(self):
            return self.getToken(PostgreSQLParser.SEQUENCE, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def optseqoptlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptseqoptlistContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createseqstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateseqstmt" ):
                listener.enterCreateseqstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateseqstmt" ):
                listener.exitCreateseqstmt(self)




    def createseqstmt(self):

        localctx = PostgreSQLParser.CreateseqstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 278, self.RULE_createseqstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3253
            self.match(PostgreSQLParser.CREATE)
            self.state = 3254
            self.opttemp()
            self.state = 3255
            self.match(PostgreSQLParser.SEQUENCE)
            self.state = 3259
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,129,self._ctx)
            if la_ == 1:
                self.state = 3256
                self.match(PostgreSQLParser.IF_P)
                self.state = 3257
                self.match(PostgreSQLParser.NOT)
                self.state = 3258
                self.match(PostgreSQLParser.EXISTS)


            self.state = 3261
            self.qualified_name()
            self.state = 3262
            self.optseqoptlist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterseqstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def SEQUENCE(self):
            return self.getToken(PostgreSQLParser.SEQUENCE, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def seqoptlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.SeqoptlistContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterseqstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterseqstmt" ):
                listener.enterAlterseqstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterseqstmt" ):
                listener.exitAlterseqstmt(self)




    def alterseqstmt(self):

        localctx = PostgreSQLParser.AlterseqstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 280, self.RULE_alterseqstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3264
            self.match(PostgreSQLParser.ALTER)
            self.state = 3265
            self.match(PostgreSQLParser.SEQUENCE)
            self.state = 3268
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,130,self._ctx)
            if la_ == 1:
                self.state = 3266
                self.match(PostgreSQLParser.IF_P)
                self.state = 3267
                self.match(PostgreSQLParser.EXISTS)


            self.state = 3270
            self.qualified_name()
            self.state = 3271
            self.seqoptlist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OptseqoptlistContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def seqoptlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.SeqoptlistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optseqoptlist

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOptseqoptlist" ):
                listener.enterOptseqoptlist(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOptseqoptlist" ):
                listener.exitOptseqoptlist(self)




    def optseqoptlist(self):

        localctx = PostgreSQLParser.OptseqoptlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 282, self.RULE_optseqoptlist)
        try:
            self.state = 3275
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,131,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3273
                self.seqoptlist()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OptparenthesizedseqoptlistContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def seqoptlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.SeqoptlistContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optparenthesizedseqoptlist

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOptparenthesizedseqoptlist" ):
                listener.enterOptparenthesizedseqoptlist(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOptparenthesizedseqoptlist" ):
                listener.exitOptparenthesizedseqoptlist(self)




    def optparenthesizedseqoptlist(self):

        localctx = PostgreSQLParser.OptparenthesizedseqoptlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 284, self.RULE_optparenthesizedseqoptlist)
        try:
            self.state = 3282
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,132,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3277
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3278
                self.seqoptlist()
                self.state = 3279
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SeqoptlistContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def seqoptelem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SeqoptelemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SeqoptelemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_seqoptlist

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSeqoptlist" ):
                listener.enterSeqoptlist(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSeqoptlist" ):
                listener.exitSeqoptlist(self)




    def seqoptlist(self):

        localctx = PostgreSQLParser.SeqoptlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 286, self.RULE_seqoptlist)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3285 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 3284
                    self.seqoptelem()

                else:
                    raise NoViableAltException(self)
                self.state = 3287 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,133,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 SeqoptelemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def simpletypename(self):
            return self.getTypedRuleContext(PostgreSQLParser.SimpletypenameContext,0)


        def CACHE(self):
            return self.getToken(PostgreSQLParser.CACHE, 0)

        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def CYCLE(self):
            return self.getToken(PostgreSQLParser.CYCLE, 0)

        def INCREMENT(self):
            return self.getToken(PostgreSQLParser.INCREMENT, 0)

        def opt_by(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_byContext,0)


        def MAXVALUE(self):
            return self.getToken(PostgreSQLParser.MAXVALUE, 0)

        def MINVALUE(self):
            return self.getToken(PostgreSQLParser.MINVALUE, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def OWNED(self):
            return self.getToken(PostgreSQLParser.OWNED, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def SEQUENCE(self):
            return self.getToken(PostgreSQLParser.SEQUENCE, 0)

        def NAME_P(self):
            return self.getToken(PostgreSQLParser.NAME_P, 0)

        def START(self):
            return self.getToken(PostgreSQLParser.START, 0)

        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def RESTART(self):
            return self.getToken(PostgreSQLParser.RESTART, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_seqoptelem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSeqoptelem" ):
                listener.enterSeqoptelem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSeqoptelem" ):
                listener.exitSeqoptelem(self)




    def seqoptelem(self):

        localctx = PostgreSQLParser.SeqoptelemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 288, self.RULE_seqoptelem)
        self._la = 0 # Token type
        try:
            self.state = 3319
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [36]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3289
                self.match(PostgreSQLParser.AS)
                self.state = 3290
                self.simpletypename()
                pass
            elif token in [148]:
                self.enterOuterAlt(localctx, 2)
                self.state = 3291
                self.match(PostgreSQLParser.CACHE)
                self.state = 3292
                self.numericonly()
                pass
            elif token in [173]:
                self.enterOuterAlt(localctx, 3)
                self.state = 3293
                self.match(PostgreSQLParser.CYCLE)
                pass
            elif token in [225]:
                self.enterOuterAlt(localctx, 4)
                self.state = 3294
                self.match(PostgreSQLParser.INCREMENT)
                self.state = 3295
                self.opt_by()
                self.state = 3296
                self.numericonly()
                pass
            elif token in [252]:
                self.enterOuterAlt(localctx, 5)
                self.state = 3298
                self.match(PostgreSQLParser.MAXVALUE)
                self.state = 3299
                self.numericonly()
                pass
            elif token in [255]:
                self.enterOuterAlt(localctx, 6)
                self.state = 3300
                self.match(PostgreSQLParser.MINVALUE)
                self.state = 3301
                self.numericonly()
                pass
            elif token in [262]:
                self.enterOuterAlt(localctx, 7)
                self.state = 3302
                self.match(PostgreSQLParser.NO)
                self.state = 3303
                _la = self._input.LA(1)
                if not(_la==173 or _la==252 or _la==255):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [274]:
                self.enterOuterAlt(localctx, 8)
                self.state = 3304
                self.match(PostgreSQLParser.OWNED)
                self.state = 3305
                self.match(PostgreSQLParser.BY)
                self.state = 3306
                self.any_name()
                pass
            elif token in [321]:
                self.enterOuterAlt(localctx, 9)
                self.state = 3307
                self.match(PostgreSQLParser.SEQUENCE)
                self.state = 3308
                self.match(PostgreSQLParser.NAME_P)
                self.state = 3309
                self.any_name()
                pass
            elif token in [333]:
                self.enterOuterAlt(localctx, 10)
                self.state = 3310
                self.match(PostgreSQLParser.START)
                self.state = 3311
                self.opt_with()
                self.state = 3312
                self.numericonly()
                pass
            elif token in [307]:
                self.enterOuterAlt(localctx, 11)
                self.state = 3314
                self.match(PostgreSQLParser.RESTART)
                self.state = 3315
                self.opt_with()
                self.state = 3317
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==12 or _la==13 or _la==658 or _la==660:
                    self.state = 3316
                    self.numericonly()


                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 Opt_byContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_by

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_by" ):
                listener.enterOpt_by(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_by" ):
                listener.exitOpt_by(self)




    def opt_by(self):

        localctx = PostgreSQLParser.Opt_byContext(self, self._ctx, self.state)
        self.enterRule(localctx, 290, self.RULE_opt_by)
        try:
            self.state = 3323
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [147]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3321
                self.match(PostgreSQLParser.BY)
                pass
            elif token in [12, 13, 658, 660]:
                self.enterOuterAlt(localctx, 2)

                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 NumericonlyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def fconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.FconstContext,0)


        def PLUS(self):
            return self.getToken(PostgreSQLParser.PLUS, 0)

        def MINUS(self):
            return self.getToken(PostgreSQLParser.MINUS, 0)

        def signediconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SignediconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_numericonly

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumericonly" ):
                listener.enterNumericonly(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumericonly" ):
                listener.exitNumericonly(self)




    def numericonly(self):

        localctx = PostgreSQLParser.NumericonlyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 292, self.RULE_numericonly)
        try:
            self.state = 3331
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,137,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3325
                self.fconst()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3326
                self.match(PostgreSQLParser.PLUS)
                self.state = 3327
                self.fconst()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 3328
                self.match(PostgreSQLParser.MINUS)
                self.state = 3329
                self.fconst()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 3330
                self.signediconst()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Numericonly_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def numericonly(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NumericonlyContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,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_numericonly_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumericonly_list" ):
                listener.enterNumericonly_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumericonly_list" ):
                listener.exitNumericonly_list(self)




    def numericonly_list(self):

        localctx = PostgreSQLParser.Numericonly_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 294, self.RULE_numericonly_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3333
            self.numericonly()
            self.state = 3338
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 3334
                self.match(PostgreSQLParser.COMMA)
                self.state = 3335
                self.numericonly()
                self.state = 3340
                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 CreateplangstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opt_or_replace(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_or_replaceContext,0)


        def opt_trusted(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_trustedContext,0)


        def opt_procedural(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_proceduralContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def HANDLER(self):
            return self.getToken(PostgreSQLParser.HANDLER, 0)

        def handler_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Handler_nameContext,0)


        def opt_inline_handler(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_inline_handlerContext,0)


        def opt_validator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_validatorContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createplangstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateplangstmt" ):
                listener.enterCreateplangstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateplangstmt" ):
                listener.exitCreateplangstmt(self)




    def createplangstmt(self):

        localctx = PostgreSQLParser.CreateplangstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 296, self.RULE_createplangstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3341
            self.match(PostgreSQLParser.CREATE)
            self.state = 3342
            self.opt_or_replace()
            self.state = 3343
            self.opt_trusted()
            self.state = 3344
            self.opt_procedural()
            self.state = 3345
            self.match(PostgreSQLParser.LANGUAGE)
            self.state = 3346
            self.name()
            self.state = 3352
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==215:
                self.state = 3347
                self.match(PostgreSQLParser.HANDLER)
                self.state = 3348
                self.handler_name()
                self.state = 3349
                self.opt_inline_handler()
                self.state = 3350
                self.opt_validator()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_trustedContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TRUSTED(self):
            return self.getToken(PostgreSQLParser.TRUSTED, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_trusted

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_trusted" ):
                listener.enterOpt_trusted(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_trusted" ):
                listener.exitOpt_trusted(self)




    def opt_trusted(self):

        localctx = PostgreSQLParser.Opt_trustedContext(self, self._ctx, self.state)
        self.enterRule(localctx, 298, self.RULE_opt_trusted)
        try:
            self.state = 3356
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [352]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3354
                self.match(PostgreSQLParser.TRUSTED)
                pass
            elif token in [238, 288]:
                self.enterOuterAlt(localctx, 2)

                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 Handler_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def attrs(self):
            return self.getTypedRuleContext(PostgreSQLParser.AttrsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_handler_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterHandler_name" ):
                listener.enterHandler_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitHandler_name" ):
                listener.exitHandler_name(self)




    def handler_name(self):

        localctx = PostgreSQLParser.Handler_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 300, self.RULE_handler_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3358
            self.name()
            self.state = 3360
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==11:
                self.state = 3359
                self.attrs()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_inline_handlerContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INLINE_P(self):
            return self.getToken(PostgreSQLParser.INLINE_P, 0)

        def handler_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Handler_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_inline_handler

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_inline_handler" ):
                listener.enterOpt_inline_handler(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_inline_handler" ):
                listener.exitOpt_inline_handler(self)




    def opt_inline_handler(self):

        localctx = PostgreSQLParser.Opt_inline_handlerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 302, self.RULE_opt_inline_handler)
        try:
            self.state = 3365
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [230]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3362
                self.match(PostgreSQLParser.INLINE_P)
                self.state = 3363
                self.handler_name()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 262, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 366, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Validator_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VALIDATOR(self):
            return self.getToken(PostgreSQLParser.VALIDATOR, 0)

        def handler_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Handler_nameContext,0)


        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_validator_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterValidator_clause" ):
                listener.enterValidator_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitValidator_clause" ):
                listener.exitValidator_clause(self)




    def validator_clause(self):

        localctx = PostgreSQLParser.Validator_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 304, self.RULE_validator_clause)
        try:
            self.state = 3371
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [366]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3367
                self.match(PostgreSQLParser.VALIDATOR)
                self.state = 3368
                self.handler_name()
                pass
            elif token in [262]:
                self.enterOuterAlt(localctx, 2)
                self.state = 3369
                self.match(PostgreSQLParser.NO)
                self.state = 3370
                self.match(PostgreSQLParser.VALIDATOR)
                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 Opt_validatorContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def validator_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Validator_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_validator

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_validator" ):
                listener.enterOpt_validator(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_validator" ):
                listener.exitOpt_validator(self)




    def opt_validator(self):

        localctx = PostgreSQLParser.Opt_validatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 306, self.RULE_opt_validator)
        try:
            self.state = 3375
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [262, 366]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3373
                self.validator_clause()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_proceduralContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PROCEDURAL(self):
            return self.getToken(PostgreSQLParser.PROCEDURAL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_procedural

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_procedural" ):
                listener.enterOpt_procedural(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_procedural" ):
                listener.exitOpt_procedural(self)




    def opt_procedural(self):

        localctx = PostgreSQLParser.Opt_proceduralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 308, self.RULE_opt_procedural)
        try:
            self.state = 3379
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [288]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3377
                self.match(PostgreSQLParser.PROCEDURAL)
                pass
            elif token in [238]:
                self.enterOuterAlt(localctx, 2)

                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 CreatetablespacestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opttablespaceowner(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttablespaceownerContext,0)


        def LOCATION(self):
            return self.getToken(PostgreSQLParser.LOCATION, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def opt_reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_reloptionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createtablespacestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatetablespacestmt" ):
                listener.enterCreatetablespacestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatetablespacestmt" ):
                listener.exitCreatetablespacestmt(self)




    def createtablespacestmt(self):

        localctx = PostgreSQLParser.CreatetablespacestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 310, self.RULE_createtablespacestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3381
            self.match(PostgreSQLParser.CREATE)
            self.state = 3382
            self.match(PostgreSQLParser.TABLESPACE)
            self.state = 3383
            self.name()
            self.state = 3384
            self.opttablespaceowner()
            self.state = 3385
            self.match(PostgreSQLParser.LOCATION)
            self.state = 3386
            self.sconst()
            self.state = 3387
            self.opt_reloptions()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OpttablespaceownerContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OWNER(self):
            return self.getToken(PostgreSQLParser.OWNER, 0)

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opttablespaceowner

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpttablespaceowner" ):
                listener.enterOpttablespaceowner(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpttablespaceowner" ):
                listener.exitOpttablespaceowner(self)




    def opttablespaceowner(self):

        localctx = PostgreSQLParser.OpttablespaceownerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 312, self.RULE_opttablespaceowner)
        try:
            self.state = 3392
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [275]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3389
                self.match(PostgreSQLParser.OWNER)
                self.state = 3390
                self.rolespec()
                pass
            elif token in [246]:
                self.enterOuterAlt(localctx, 2)

                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 DroptablespacestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_droptablespacestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDroptablespacestmt" ):
                listener.enterDroptablespacestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDroptablespacestmt" ):
                listener.exitDroptablespacestmt(self)




    def droptablespacestmt(self):

        localctx = PostgreSQLParser.DroptablespacestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 314, self.RULE_droptablespacestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3394
            self.match(PostgreSQLParser.DROP)
            self.state = 3395
            self.match(PostgreSQLParser.TABLESPACE)
            self.state = 3398
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,147,self._ctx)
            if la_ == 1:
                self.state = 3396
                self.match(PostgreSQLParser.IF_P)
                self.state = 3397
                self.match(PostgreSQLParser.EXISTS)


            self.state = 3400
            self.name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreateextensionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def EXTENSION(self):
            return self.getToken(PostgreSQLParser.EXTENSION, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def create_extension_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_extension_opt_listContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createextensionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateextensionstmt" ):
                listener.enterCreateextensionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateextensionstmt" ):
                listener.exitCreateextensionstmt(self)




    def createextensionstmt(self):

        localctx = PostgreSQLParser.CreateextensionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 316, self.RULE_createextensionstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3402
            self.match(PostgreSQLParser.CREATE)
            self.state = 3403
            self.match(PostgreSQLParser.EXTENSION)
            self.state = 3407
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,148,self._ctx)
            if la_ == 1:
                self.state = 3404
                self.match(PostgreSQLParser.IF_P)
                self.state = 3405
                self.match(PostgreSQLParser.NOT)
                self.state = 3406
                self.match(PostgreSQLParser.EXISTS)


            self.state = 3409
            self.name()
            self.state = 3410
            self.opt_with()
            self.state = 3411
            self.create_extension_opt_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Create_extension_opt_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def create_extension_opt_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Create_extension_opt_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Create_extension_opt_itemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_create_extension_opt_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreate_extension_opt_list" ):
                listener.enterCreate_extension_opt_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreate_extension_opt_list" ):
                listener.exitCreate_extension_opt_list(self)




    def create_extension_opt_list(self):

        localctx = PostgreSQLParser.Create_extension_opt_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 318, self.RULE_create_extension_opt_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3416
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==64 or _la==150 or _la==316 or _la==368:
                self.state = 3413
                self.create_extension_opt_item()
                self.state = 3418
                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 Create_extension_opt_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def VERSION_P(self):
            return self.getToken(PostgreSQLParser.VERSION_P, 0)

        def nonreservedword_or_sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.Nonreservedword_or_sconstContext,0)


        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def CASCADE(self):
            return self.getToken(PostgreSQLParser.CASCADE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_create_extension_opt_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreate_extension_opt_item" ):
                listener.enterCreate_extension_opt_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreate_extension_opt_item" ):
                listener.exitCreate_extension_opt_item(self)




    def create_extension_opt_item(self):

        localctx = PostgreSQLParser.Create_extension_opt_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 320, self.RULE_create_extension_opt_item)
        try:
            self.state = 3426
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [316]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3419
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 3420
                self.name()
                pass
            elif token in [368]:
                self.enterOuterAlt(localctx, 2)
                self.state = 3421
                self.match(PostgreSQLParser.VERSION_P)
                self.state = 3422
                self.nonreservedword_or_sconst()
                pass
            elif token in [64]:
                self.enterOuterAlt(localctx, 3)
                self.state = 3423
                self.match(PostgreSQLParser.FROM)
                self.state = 3424
                self.nonreservedword_or_sconst()
                pass
            elif token in [150]:
                self.enterOuterAlt(localctx, 4)
                self.state = 3425
                self.match(PostgreSQLParser.CASCADE)
                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 AlterextensionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def EXTENSION(self):
            return self.getToken(PostgreSQLParser.EXTENSION, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def alter_extension_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_extension_opt_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterextensionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterextensionstmt" ):
                listener.enterAlterextensionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterextensionstmt" ):
                listener.exitAlterextensionstmt(self)




    def alterextensionstmt(self):

        localctx = PostgreSQLParser.AlterextensionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 322, self.RULE_alterextensionstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3428
            self.match(PostgreSQLParser.ALTER)
            self.state = 3429
            self.match(PostgreSQLParser.EXTENSION)
            self.state = 3430
            self.name()
            self.state = 3431
            self.match(PostgreSQLParser.UPDATE)
            self.state = 3432
            self.alter_extension_opt_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Alter_extension_opt_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def alter_extension_opt_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Alter_extension_opt_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Alter_extension_opt_itemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_extension_opt_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlter_extension_opt_list" ):
                listener.enterAlter_extension_opt_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlter_extension_opt_list" ):
                listener.exitAlter_extension_opt_list(self)




    def alter_extension_opt_list(self):

        localctx = PostgreSQLParser.Alter_extension_opt_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 324, self.RULE_alter_extension_opt_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3437
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==94:
                self.state = 3434
                self.alter_extension_opt_item()
                self.state = 3439
                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 Alter_extension_opt_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def nonreservedword_or_sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.Nonreservedword_or_sconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_extension_opt_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlter_extension_opt_item" ):
                listener.enterAlter_extension_opt_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlter_extension_opt_item" ):
                listener.exitAlter_extension_opt_item(self)




    def alter_extension_opt_item(self):

        localctx = PostgreSQLParser.Alter_extension_opt_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 326, self.RULE_alter_extension_opt_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3440
            self.match(PostgreSQLParser.TO)
            self.state = 3441
            self.nonreservedword_or_sconst()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterextensioncontentsstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def EXTENSION(self):
            return self.getToken(PostgreSQLParser.EXTENSION, 0)

        def name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.NameContext,i)


        def add_drop(self):
            return self.getTypedRuleContext(PostgreSQLParser.Add_dropContext,0)


        def object_type_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_nameContext,0)


        def object_type_any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_any_nameContext,0)


        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def aggregate_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggregate_with_argtypesContext,0)


        def CAST(self):
            return self.getToken(PostgreSQLParser.CAST, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,i)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def operator_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_with_argtypesContext,0)


        def CLASS(self):
            return self.getToken(PostgreSQLParser.CLASS, 0)

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def TRANSFORM(self):
            return self.getToken(PostgreSQLParser.TRANSFORM, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterextensioncontentsstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterextensioncontentsstmt" ):
                listener.enterAlterextensioncontentsstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterextensioncontentsstmt" ):
                listener.exitAlterextensioncontentsstmt(self)




    def alterextensioncontentsstmt(self):

        localctx = PostgreSQLParser.AlterextensioncontentsstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 328, self.RULE_alterextensioncontentsstmt)
        try:
            self.state = 3547
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,152,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3443
                self.match(PostgreSQLParser.ALTER)
                self.state = 3444
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3445
                self.name()
                self.state = 3446
                self.add_drop()
                self.state = 3447
                self.object_type_name()
                self.state = 3448
                self.name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3450
                self.match(PostgreSQLParser.ALTER)
                self.state = 3451
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3452
                self.name()
                self.state = 3453
                self.add_drop()
                self.state = 3454
                self.object_type_any_name()
                self.state = 3455
                self.any_name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 3457
                self.match(PostgreSQLParser.ALTER)
                self.state = 3458
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3459
                self.name()
                self.state = 3460
                self.add_drop()
                self.state = 3461
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 3462
                self.aggregate_with_argtypes()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 3464
                self.match(PostgreSQLParser.ALTER)
                self.state = 3465
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3466
                self.name()
                self.state = 3467
                self.add_drop()
                self.state = 3468
                self.match(PostgreSQLParser.CAST)
                self.state = 3469
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3470
                self.typename()
                self.state = 3471
                self.match(PostgreSQLParser.AS)
                self.state = 3472
                self.typename()
                self.state = 3473
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 3475
                self.match(PostgreSQLParser.ALTER)
                self.state = 3476
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3477
                self.name()
                self.state = 3478
                self.add_drop()
                self.state = 3479
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 3480
                self.typename()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 3482
                self.match(PostgreSQLParser.ALTER)
                self.state = 3483
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3484
                self.name()
                self.state = 3485
                self.add_drop()
                self.state = 3486
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 3487
                self.function_with_argtypes()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 3489
                self.match(PostgreSQLParser.ALTER)
                self.state = 3490
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3491
                self.name()
                self.state = 3492
                self.add_drop()
                self.state = 3493
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 3494
                self.operator_with_argtypes()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 3496
                self.match(PostgreSQLParser.ALTER)
                self.state = 3497
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3498
                self.name()
                self.state = 3499
                self.add_drop()
                self.state = 3500
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 3501
                self.match(PostgreSQLParser.CLASS)
                self.state = 3502
                self.any_name()
                self.state = 3503
                self.match(PostgreSQLParser.USING)
                self.state = 3504
                self.name()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 3506
                self.match(PostgreSQLParser.ALTER)
                self.state = 3507
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3508
                self.name()
                self.state = 3509
                self.add_drop()
                self.state = 3510
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 3511
                self.match(PostgreSQLParser.FAMILY)
                self.state = 3512
                self.any_name()
                self.state = 3513
                self.match(PostgreSQLParser.USING)
                self.state = 3514
                self.name()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 3516
                self.match(PostgreSQLParser.ALTER)
                self.state = 3517
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3518
                self.name()
                self.state = 3519
                self.add_drop()
                self.state = 3520
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 3521
                self.function_with_argtypes()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 3523
                self.match(PostgreSQLParser.ALTER)
                self.state = 3524
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3525
                self.name()
                self.state = 3526
                self.add_drop()
                self.state = 3527
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 3528
                self.function_with_argtypes()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 3530
                self.match(PostgreSQLParser.ALTER)
                self.state = 3531
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3532
                self.name()
                self.state = 3533
                self.add_drop()
                self.state = 3534
                self.match(PostgreSQLParser.TRANSFORM)
                self.state = 3535
                self.match(PostgreSQLParser.FOR)
                self.state = 3536
                self.typename()
                self.state = 3537
                self.match(PostgreSQLParser.LANGUAGE)
                self.state = 3538
                self.name()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 3540
                self.match(PostgreSQLParser.ALTER)
                self.state = 3541
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 3542
                self.name()
                self.state = 3543
                self.add_drop()
                self.state = 3544
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 3545
                self.typename()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatefdwstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def WRAPPER(self):
            return self.getToken(PostgreSQLParser.WRAPPER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_fdw_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_fdw_optionsContext,0)


        def create_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_generic_optionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createfdwstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatefdwstmt" ):
                listener.enterCreatefdwstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatefdwstmt" ):
                listener.exitCreatefdwstmt(self)




    def createfdwstmt(self):

        localctx = PostgreSQLParser.CreatefdwstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 330, self.RULE_createfdwstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3549
            self.match(PostgreSQLParser.CREATE)
            self.state = 3550
            self.match(PostgreSQLParser.FOREIGN)
            self.state = 3551
            self.match(PostgreSQLParser.DATA_P)
            self.state = 3552
            self.match(PostgreSQLParser.WRAPPER)
            self.state = 3553
            self.name()
            self.state = 3554
            self.opt_fdw_options()
            self.state = 3555
            self.create_generic_options()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Fdw_optionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def HANDLER(self):
            return self.getToken(PostgreSQLParser.HANDLER, 0)

        def handler_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Handler_nameContext,0)


        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def VALIDATOR(self):
            return self.getToken(PostgreSQLParser.VALIDATOR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_fdw_option

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFdw_option" ):
                listener.enterFdw_option(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFdw_option" ):
                listener.exitFdw_option(self)




    def fdw_option(self):

        localctx = PostgreSQLParser.Fdw_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 332, self.RULE_fdw_option)
        try:
            self.state = 3565
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,153,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3557
                self.match(PostgreSQLParser.HANDLER)
                self.state = 3558
                self.handler_name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3559
                self.match(PostgreSQLParser.NO)
                self.state = 3560
                self.match(PostgreSQLParser.HANDLER)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 3561
                self.match(PostgreSQLParser.VALIDATOR)
                self.state = 3562
                self.handler_name()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 3563
                self.match(PostgreSQLParser.NO)
                self.state = 3564
                self.match(PostgreSQLParser.VALIDATOR)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Fdw_optionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def fdw_option(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Fdw_optionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Fdw_optionContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_fdw_options

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFdw_options" ):
                listener.enterFdw_options(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFdw_options" ):
                listener.exitFdw_options(self)




    def fdw_options(self):

        localctx = PostgreSQLParser.Fdw_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 334, self.RULE_fdw_options)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3568 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 3567
                self.fdw_option()
                self.state = 3570 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==215 or _la==262 or _la==366):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_fdw_optionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def fdw_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Fdw_optionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_fdw_options

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_fdw_options" ):
                listener.enterOpt_fdw_options(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_fdw_options" ):
                listener.exitOpt_fdw_options(self)




    def opt_fdw_options(self):

        localctx = PostgreSQLParser.Opt_fdw_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 336, self.RULE_opt_fdw_options)
        try:
            self.state = 3574
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [215, 262, 366]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3572
                self.fdw_options()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 273, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 AlterfdwstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def WRAPPER(self):
            return self.getToken(PostgreSQLParser.WRAPPER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_fdw_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_fdw_optionsContext,0)


        def alter_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_generic_optionsContext,0)


        def fdw_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Fdw_optionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterfdwstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterfdwstmt" ):
                listener.enterAlterfdwstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterfdwstmt" ):
                listener.exitAlterfdwstmt(self)




    def alterfdwstmt(self):

        localctx = PostgreSQLParser.AlterfdwstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 338, self.RULE_alterfdwstmt)
        try:
            self.state = 3591
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,156,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3576
                self.match(PostgreSQLParser.ALTER)
                self.state = 3577
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 3578
                self.match(PostgreSQLParser.DATA_P)
                self.state = 3579
                self.match(PostgreSQLParser.WRAPPER)
                self.state = 3580
                self.name()
                self.state = 3581
                self.opt_fdw_options()
                self.state = 3582
                self.alter_generic_options()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3584
                self.match(PostgreSQLParser.ALTER)
                self.state = 3585
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 3586
                self.match(PostgreSQLParser.DATA_P)
                self.state = 3587
                self.match(PostgreSQLParser.WRAPPER)
                self.state = 3588
                self.name()
                self.state = 3589
                self.fdw_options()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Create_generic_optionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPTIONS(self):
            return self.getToken(PostgreSQLParser.OPTIONS, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def generic_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generic_option_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_create_generic_options

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreate_generic_options" ):
                listener.enterCreate_generic_options(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreate_generic_options" ):
                listener.exitCreate_generic_options(self)




    def create_generic_options(self):

        localctx = PostgreSQLParser.Create_generic_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 340, self.RULE_create_generic_options)
        try:
            self.state = 3599
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [273]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3593
                self.match(PostgreSQLParser.OPTIONS)
                self.state = 3594
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3595
                self.generic_option_list()
                self.state = 3596
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 42, 43, 45, 46, 53, 54, 57, 61, 65, 69, 71, 77, 78, 85, 86, 88, 92, 98, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 438, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Generic_option_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def generic_option_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Generic_option_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Generic_option_elemContext,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_generic_option_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGeneric_option_list" ):
                listener.enterGeneric_option_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGeneric_option_list" ):
                listener.exitGeneric_option_list(self)




    def generic_option_list(self):

        localctx = PostgreSQLParser.Generic_option_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 342, self.RULE_generic_option_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3601
            self.generic_option_elem()
            self.state = 3606
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 3602
                self.match(PostgreSQLParser.COMMA)
                self.state = 3603
                self.generic_option_elem()
                self.state = 3608
                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 Alter_generic_optionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPTIONS(self):
            return self.getToken(PostgreSQLParser.OPTIONS, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def alter_generic_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_generic_option_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_generic_options

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlter_generic_options" ):
                listener.enterAlter_generic_options(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlter_generic_options" ):
                listener.exitAlter_generic_options(self)




    def alter_generic_options(self):

        localctx = PostgreSQLParser.Alter_generic_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 344, self.RULE_alter_generic_options)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3609
            self.match(PostgreSQLParser.OPTIONS)
            self.state = 3610
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 3611
            self.alter_generic_option_list()
            self.state = 3612
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Alter_generic_option_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def alter_generic_option_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Alter_generic_option_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Alter_generic_option_elemContext,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_alter_generic_option_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlter_generic_option_list" ):
                listener.enterAlter_generic_option_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlter_generic_option_list" ):
                listener.exitAlter_generic_option_list(self)




    def alter_generic_option_list(self):

        localctx = PostgreSQLParser.Alter_generic_option_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 346, self.RULE_alter_generic_option_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3614
            self.alter_generic_option_elem()
            self.state = 3619
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 3615
                self.match(PostgreSQLParser.COMMA)
                self.state = 3616
                self.alter_generic_option_elem()
                self.state = 3621
                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 Alter_generic_option_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def generic_option_elem(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generic_option_elemContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def ADD_P(self):
            return self.getToken(PostgreSQLParser.ADD_P, 0)

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def generic_option_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generic_option_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alter_generic_option_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlter_generic_option_elem" ):
                listener.enterAlter_generic_option_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlter_generic_option_elem" ):
                listener.exitAlter_generic_option_elem(self)




    def alter_generic_option_elem(self):

        localctx = PostgreSQLParser.Alter_generic_option_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 348, self.RULE_alter_generic_option_elem)
        try:
            self.state = 3629
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,160,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3622
                self.generic_option_elem()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3623
                self.match(PostgreSQLParser.SET)
                self.state = 3624
                self.generic_option_elem()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 3625
                self.match(PostgreSQLParser.ADD_P)
                self.state = 3626
                self.generic_option_elem()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 3627
                self.match(PostgreSQLParser.DROP)
                self.state = 3628
                self.generic_option_name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Generic_option_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def generic_option_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generic_option_nameContext,0)


        def generic_option_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generic_option_argContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_generic_option_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGeneric_option_elem" ):
                listener.enterGeneric_option_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGeneric_option_elem" ):
                listener.exitGeneric_option_elem(self)




    def generic_option_elem(self):

        localctx = PostgreSQLParser.Generic_option_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 350, self.RULE_generic_option_elem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3631
            self.generic_option_name()
            self.state = 3632
            self.generic_option_arg()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Generic_option_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_generic_option_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGeneric_option_name" ):
                listener.enterGeneric_option_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGeneric_option_name" ):
                listener.exitGeneric_option_name(self)




    def generic_option_name(self):

        localctx = PostgreSQLParser.Generic_option_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 352, self.RULE_generic_option_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3634
            self.collabel()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Generic_option_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_generic_option_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGeneric_option_arg" ):
                listener.enterGeneric_option_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGeneric_option_arg" ):
                listener.exitGeneric_option_arg(self)




    def generic_option_arg(self):

        localctx = PostgreSQLParser.Generic_option_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 354, self.RULE_generic_option_arg)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3636
            self.sconst()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreateforeignserverstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.NameContext,i)


        def opt_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_typeContext,0)


        def opt_foreign_server_version(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_foreign_server_versionContext,0)


        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def WRAPPER(self):
            return self.getToken(PostgreSQLParser.WRAPPER, 0)

        def create_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_generic_optionsContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createforeignserverstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateforeignserverstmt" ):
                listener.enterCreateforeignserverstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateforeignserverstmt" ):
                listener.exitCreateforeignserverstmt(self)




    def createforeignserverstmt(self):

        localctx = PostgreSQLParser.CreateforeignserverstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 356, self.RULE_createforeignserverstmt)
        try:
            self.state = 3663
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,161,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3638
                self.match(PostgreSQLParser.CREATE)
                self.state = 3639
                self.match(PostgreSQLParser.SERVER)
                self.state = 3640
                self.name()
                self.state = 3641
                self.opt_type()
                self.state = 3642
                self.opt_foreign_server_version()
                self.state = 3643
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 3644
                self.match(PostgreSQLParser.DATA_P)
                self.state = 3645
                self.match(PostgreSQLParser.WRAPPER)
                self.state = 3646
                self.name()
                self.state = 3647
                self.create_generic_options()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3649
                self.match(PostgreSQLParser.CREATE)
                self.state = 3650
                self.match(PostgreSQLParser.SERVER)
                self.state = 3651
                self.match(PostgreSQLParser.IF_P)
                self.state = 3652
                self.match(PostgreSQLParser.NOT)
                self.state = 3653
                self.match(PostgreSQLParser.EXISTS)
                self.state = 3654
                self.name()
                self.state = 3655
                self.opt_type()
                self.state = 3656
                self.opt_foreign_server_version()
                self.state = 3657
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 3658
                self.match(PostgreSQLParser.DATA_P)
                self.state = 3659
                self.match(PostgreSQLParser.WRAPPER)
                self.state = 3660
                self.name()
                self.state = 3661
                self.create_generic_options()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_type" ):
                listener.enterOpt_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_type" ):
                listener.exitOpt_type(self)




    def opt_type(self):

        localctx = PostgreSQLParser.Opt_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 358, self.RULE_opt_type)
        try:
            self.state = 3668
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [353]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3665
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 3666
                self.sconst()
                pass
            elif token in [63, 368]:
                self.enterOuterAlt(localctx, 2)

                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 Foreign_server_versionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VERSION_P(self):
            return self.getToken(PostgreSQLParser.VERSION_P, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_foreign_server_version

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterForeign_server_version" ):
                listener.enterForeign_server_version(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitForeign_server_version" ):
                listener.exitForeign_server_version(self)




    def foreign_server_version(self):

        localctx = PostgreSQLParser.Foreign_server_versionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 360, self.RULE_foreign_server_version)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3670
            self.match(PostgreSQLParser.VERSION_P)
            self.state = 3673
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [645, 647, 649, 671]:
                self.state = 3671
                self.sconst()
                pass
            elif token in [78]:
                self.state = 3672
                self.match(PostgreSQLParser.NULL_P)
                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 Opt_foreign_server_versionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def foreign_server_version(self):
            return self.getTypedRuleContext(PostgreSQLParser.Foreign_server_versionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_foreign_server_version

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_foreign_server_version" ):
                listener.enterOpt_foreign_server_version(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_foreign_server_version" ):
                listener.exitOpt_foreign_server_version(self)




    def opt_foreign_server_version(self):

        localctx = PostgreSQLParser.Opt_foreign_server_versionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 362, self.RULE_opt_foreign_server_version)
        try:
            self.state = 3677
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [368]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3675
                self.foreign_server_version()
                pass
            elif token in [63]:
                self.enterOuterAlt(localctx, 2)

                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 AlterforeignserverstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def alter_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_generic_optionsContext,0)


        def foreign_server_version(self):
            return self.getTypedRuleContext(PostgreSQLParser.Foreign_server_versionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterforeignserverstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterforeignserverstmt" ):
                listener.enterAlterforeignserverstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterforeignserverstmt" ):
                listener.exitAlterforeignserverstmt(self)




    def alterforeignserverstmt(self):

        localctx = PostgreSQLParser.AlterforeignserverstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 364, self.RULE_alterforeignserverstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3679
            self.match(PostgreSQLParser.ALTER)
            self.state = 3680
            self.match(PostgreSQLParser.SERVER)
            self.state = 3681
            self.name()
            self.state = 3687
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [273]:
                self.state = 3682
                self.alter_generic_options()
                pass
            elif token in [368]:
                self.state = 3683
                self.foreign_server_version()
                self.state = 3685
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==273:
                    self.state = 3684
                    self.alter_generic_options()


                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 CreateforeigntablestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def qualified_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Qualified_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,i)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def opttableelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttableelementlistContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def optinherit(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptinheritContext,0)


        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def create_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_generic_optionsContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def PARTITION(self):
            return self.getToken(PostgreSQLParser.PARTITION, 0)

        def OF(self):
            return self.getToken(PostgreSQLParser.OF, 0)

        def opttypedtableelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttypedtableelementlistContext,0)


        def partitionboundspec(self):
            return self.getTypedRuleContext(PostgreSQLParser.PartitionboundspecContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createforeigntablestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateforeigntablestmt" ):
                listener.enterCreateforeigntablestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateforeigntablestmt" ):
                listener.exitCreateforeigntablestmt(self)




    def createforeigntablestmt(self):

        localctx = PostgreSQLParser.CreateforeigntablestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 366, self.RULE_createforeigntablestmt)
        try:
            self.state = 3745
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,167,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3689
                self.match(PostgreSQLParser.CREATE)
                self.state = 3690
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 3691
                self.match(PostgreSQLParser.TABLE)
                self.state = 3692
                self.qualified_name()
                self.state = 3693
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3694
                self.opttableelementlist()
                self.state = 3695
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 3696
                self.optinherit()
                self.state = 3697
                self.match(PostgreSQLParser.SERVER)
                self.state = 3698
                self.name()
                self.state = 3699
                self.create_generic_options()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3701
                self.match(PostgreSQLParser.CREATE)
                self.state = 3702
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 3703
                self.match(PostgreSQLParser.TABLE)
                self.state = 3704
                self.match(PostgreSQLParser.IF_P)
                self.state = 3705
                self.match(PostgreSQLParser.NOT)
                self.state = 3706
                self.match(PostgreSQLParser.EXISTS)
                self.state = 3707
                self.qualified_name()
                self.state = 3708
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3709
                self.opttableelementlist()
                self.state = 3710
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 3711
                self.optinherit()
                self.state = 3712
                self.match(PostgreSQLParser.SERVER)
                self.state = 3713
                self.name()
                self.state = 3714
                self.create_generic_options()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 3716
                self.match(PostgreSQLParser.CREATE)
                self.state = 3717
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 3718
                self.match(PostgreSQLParser.TABLE)
                self.state = 3719
                self.qualified_name()
                self.state = 3720
                self.match(PostgreSQLParser.PARTITION)
                self.state = 3721
                self.match(PostgreSQLParser.OF)
                self.state = 3722
                self.qualified_name()
                self.state = 3723
                self.opttypedtableelementlist()
                self.state = 3724
                self.partitionboundspec()
                self.state = 3725
                self.match(PostgreSQLParser.SERVER)
                self.state = 3726
                self.name()
                self.state = 3727
                self.create_generic_options()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 3729
                self.match(PostgreSQLParser.CREATE)
                self.state = 3730
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 3731
                self.match(PostgreSQLParser.TABLE)
                self.state = 3732
                self.match(PostgreSQLParser.IF_P)
                self.state = 3733
                self.match(PostgreSQLParser.NOT)
                self.state = 3734
                self.match(PostgreSQLParser.EXISTS)
                self.state = 3735
                self.qualified_name()
                self.state = 3736
                self.match(PostgreSQLParser.PARTITION)
                self.state = 3737
                self.match(PostgreSQLParser.OF)
                self.state = 3738
                self.qualified_name()
                self.state = 3739
                self.opttypedtableelementlist()
                self.state = 3740
                self.partitionboundspec()
                self.state = 3741
                self.match(PostgreSQLParser.SERVER)
                self.state = 3742
                self.name()
                self.state = 3743
                self.create_generic_options()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ImportforeignschemastmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def IMPORT_P(self):
            return self.getToken(PostgreSQLParser.IMPORT_P, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.NameContext,i)


        def import_qualification(self):
            return self.getTypedRuleContext(PostgreSQLParser.Import_qualificationContext,0)


        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def INTO(self):
            return self.getToken(PostgreSQLParser.INTO, 0)

        def create_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_generic_optionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_importforeignschemastmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterImportforeignschemastmt" ):
                listener.enterImportforeignschemastmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitImportforeignschemastmt" ):
                listener.exitImportforeignschemastmt(self)




    def importforeignschemastmt(self):

        localctx = PostgreSQLParser.ImportforeignschemastmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 368, self.RULE_importforeignschemastmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3747
            self.match(PostgreSQLParser.IMPORT_P)
            self.state = 3748
            self.match(PostgreSQLParser.FOREIGN)
            self.state = 3749
            self.match(PostgreSQLParser.SCHEMA)
            self.state = 3750
            self.name()
            self.state = 3751
            self.import_qualification()
            self.state = 3752
            self.match(PostgreSQLParser.FROM)
            self.state = 3753
            self.match(PostgreSQLParser.SERVER)
            self.state = 3754
            self.name()
            self.state = 3755
            self.match(PostgreSQLParser.INTO)
            self.state = 3756
            self.name()
            self.state = 3757
            self.create_generic_options()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Import_qualification_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        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 TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def EXCEPT(self):
            return self.getToken(PostgreSQLParser.EXCEPT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_import_qualification_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterImport_qualification_type" ):
                listener.enterImport_qualification_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitImport_qualification_type" ):
                listener.exitImport_qualification_type(self)




    def import_qualification_type(self):

        localctx = PostgreSQLParser.Import_qualification_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 370, self.RULE_import_qualification_type)
        try:
            self.state = 3762
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [74]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3759
                self.match(PostgreSQLParser.LIMIT)
                self.state = 3760
                self.match(PostgreSQLParser.TO)
                pass
            elif token in [59]:
                self.enterOuterAlt(localctx, 2)
                self.state = 3761
                self.match(PostgreSQLParser.EXCEPT)
                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 Import_qualificationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def import_qualification_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Import_qualification_typeContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def relation_expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_import_qualification

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterImport_qualification" ):
                listener.enterImport_qualification(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitImport_qualification" ):
                listener.exitImport_qualification(self)




    def import_qualification(self):

        localctx = PostgreSQLParser.Import_qualificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 372, self.RULE_import_qualification)
        try:
            self.state = 3770
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [59, 74]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3764
                self.import_qualification_type()
                self.state = 3765
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3766
                self.relation_expr_list()
                self.state = 3767
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [64]:
                self.enterOuterAlt(localctx, 2)

                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 CreateusermappingstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def MAPPING(self):
            return self.getToken(PostgreSQLParser.MAPPING, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def auth_ident(self):
            return self.getTypedRuleContext(PostgreSQLParser.Auth_identContext,0)


        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def create_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_generic_optionsContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createusermappingstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateusermappingstmt" ):
                listener.enterCreateusermappingstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateusermappingstmt" ):
                listener.exitCreateusermappingstmt(self)




    def createusermappingstmt(self):

        localctx = PostgreSQLParser.CreateusermappingstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 374, self.RULE_createusermappingstmt)
        try:
            self.state = 3793
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,170,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3772
                self.match(PostgreSQLParser.CREATE)
                self.state = 3773
                self.match(PostgreSQLParser.USER)
                self.state = 3774
                self.match(PostgreSQLParser.MAPPING)
                self.state = 3775
                self.match(PostgreSQLParser.FOR)
                self.state = 3776
                self.auth_ident()
                self.state = 3777
                self.match(PostgreSQLParser.SERVER)
                self.state = 3778
                self.name()
                self.state = 3779
                self.create_generic_options()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3781
                self.match(PostgreSQLParser.CREATE)
                self.state = 3782
                self.match(PostgreSQLParser.USER)
                self.state = 3783
                self.match(PostgreSQLParser.MAPPING)
                self.state = 3784
                self.match(PostgreSQLParser.IF_P)
                self.state = 3785
                self.match(PostgreSQLParser.NOT)
                self.state = 3786
                self.match(PostgreSQLParser.EXISTS)
                self.state = 3787
                self.match(PostgreSQLParser.FOR)
                self.state = 3788
                self.auth_ident()
                self.state = 3789
                self.match(PostgreSQLParser.SERVER)
                self.state = 3790
                self.name()
                self.state = 3791
                self.create_generic_options()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Auth_identContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_auth_ident

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAuth_ident" ):
                listener.enterAuth_ident(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAuth_ident" ):
                listener.exitAuth_ident(self)




    def auth_ident(self):

        localctx = PostgreSQLParser.Auth_identContext(self, self._ctx, self.state)
        self.enterRule(localctx, 376, self.RULE_auth_ident)
        try:
            self.state = 3797
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 52, 53, 57, 61, 89, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3795
                self.rolespec()
                pass
            elif token in [99]:
                self.enterOuterAlt(localctx, 2)
                self.state = 3796
                self.match(PostgreSQLParser.USER)
                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 DropusermappingstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def MAPPING(self):
            return self.getToken(PostgreSQLParser.MAPPING, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def auth_ident(self):
            return self.getTypedRuleContext(PostgreSQLParser.Auth_identContext,0)


        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dropusermappingstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDropusermappingstmt" ):
                listener.enterDropusermappingstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDropusermappingstmt" ):
                listener.exitDropusermappingstmt(self)




    def dropusermappingstmt(self):

        localctx = PostgreSQLParser.DropusermappingstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 378, self.RULE_dropusermappingstmt)
        try:
            self.state = 3817
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,172,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3799
                self.match(PostgreSQLParser.DROP)
                self.state = 3800
                self.match(PostgreSQLParser.USER)
                self.state = 3801
                self.match(PostgreSQLParser.MAPPING)
                self.state = 3802
                self.match(PostgreSQLParser.FOR)
                self.state = 3803
                self.auth_ident()
                self.state = 3804
                self.match(PostgreSQLParser.SERVER)
                self.state = 3805
                self.name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3807
                self.match(PostgreSQLParser.DROP)
                self.state = 3808
                self.match(PostgreSQLParser.USER)
                self.state = 3809
                self.match(PostgreSQLParser.MAPPING)
                self.state = 3810
                self.match(PostgreSQLParser.IF_P)
                self.state = 3811
                self.match(PostgreSQLParser.EXISTS)
                self.state = 3812
                self.match(PostgreSQLParser.FOR)
                self.state = 3813
                self.auth_ident()
                self.state = 3814
                self.match(PostgreSQLParser.SERVER)
                self.state = 3815
                self.name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterusermappingstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def MAPPING(self):
            return self.getToken(PostgreSQLParser.MAPPING, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def auth_ident(self):
            return self.getTypedRuleContext(PostgreSQLParser.Auth_identContext,0)


        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def alter_generic_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_generic_optionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterusermappingstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterusermappingstmt" ):
                listener.enterAlterusermappingstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterusermappingstmt" ):
                listener.exitAlterusermappingstmt(self)




    def alterusermappingstmt(self):

        localctx = PostgreSQLParser.AlterusermappingstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 380, self.RULE_alterusermappingstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3819
            self.match(PostgreSQLParser.ALTER)
            self.state = 3820
            self.match(PostgreSQLParser.USER)
            self.state = 3821
            self.match(PostgreSQLParser.MAPPING)
            self.state = 3822
            self.match(PostgreSQLParser.FOR)
            self.state = 3823
            self.auth_ident()
            self.state = 3824
            self.match(PostgreSQLParser.SERVER)
            self.state = 3825
            self.name()
            self.state = 3826
            self.alter_generic_options()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatepolicystmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def POLICY(self):
            return self.getToken(PostgreSQLParser.POLICY, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def rowsecuritydefaultpermissive(self):
            return self.getTypedRuleContext(PostgreSQLParser.RowsecuritydefaultpermissiveContext,0)


        def rowsecuritydefaultforcmd(self):
            return self.getTypedRuleContext(PostgreSQLParser.RowsecuritydefaultforcmdContext,0)


        def rowsecuritydefaulttorole(self):
            return self.getTypedRuleContext(PostgreSQLParser.RowsecuritydefaulttoroleContext,0)


        def rowsecurityoptionalexpr(self):
            return self.getTypedRuleContext(PostgreSQLParser.RowsecurityoptionalexprContext,0)


        def rowsecurityoptionalwithcheck(self):
            return self.getTypedRuleContext(PostgreSQLParser.RowsecurityoptionalwithcheckContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createpolicystmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatepolicystmt" ):
                listener.enterCreatepolicystmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatepolicystmt" ):
                listener.exitCreatepolicystmt(self)




    def createpolicystmt(self):

        localctx = PostgreSQLParser.CreatepolicystmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 382, self.RULE_createpolicystmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3828
            self.match(PostgreSQLParser.CREATE)
            self.state = 3829
            self.match(PostgreSQLParser.POLICY)
            self.state = 3830
            self.name()
            self.state = 3831
            self.match(PostgreSQLParser.ON)
            self.state = 3832
            self.qualified_name()
            self.state = 3833
            self.rowsecuritydefaultpermissive()
            self.state = 3834
            self.rowsecuritydefaultforcmd()
            self.state = 3835
            self.rowsecuritydefaulttorole()
            self.state = 3836
            self.rowsecurityoptionalexpr()
            self.state = 3837
            self.rowsecurityoptionalwithcheck()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterpolicystmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def POLICY(self):
            return self.getToken(PostgreSQLParser.POLICY, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def rowsecurityoptionaltorole(self):
            return self.getTypedRuleContext(PostgreSQLParser.RowsecurityoptionaltoroleContext,0)


        def rowsecurityoptionalexpr(self):
            return self.getTypedRuleContext(PostgreSQLParser.RowsecurityoptionalexprContext,0)


        def rowsecurityoptionalwithcheck(self):
            return self.getTypedRuleContext(PostgreSQLParser.RowsecurityoptionalwithcheckContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterpolicystmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterpolicystmt" ):
                listener.enterAlterpolicystmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterpolicystmt" ):
                listener.exitAlterpolicystmt(self)




    def alterpolicystmt(self):

        localctx = PostgreSQLParser.AlterpolicystmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 384, self.RULE_alterpolicystmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3839
            self.match(PostgreSQLParser.ALTER)
            self.state = 3840
            self.match(PostgreSQLParser.POLICY)
            self.state = 3841
            self.name()
            self.state = 3842
            self.match(PostgreSQLParser.ON)
            self.state = 3843
            self.qualified_name()
            self.state = 3844
            self.rowsecurityoptionaltorole()
            self.state = 3845
            self.rowsecurityoptionalexpr()
            self.state = 3846
            self.rowsecurityoptionalwithcheck()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RowsecurityoptionalexprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rowsecurityoptionalexpr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRowsecurityoptionalexpr" ):
                listener.enterRowsecurityoptionalexpr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRowsecurityoptionalexpr" ):
                listener.exitRowsecurityoptionalexpr(self)




    def rowsecurityoptionalexpr(self):

        localctx = PostgreSQLParser.RowsecurityoptionalexprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 386, self.RULE_rowsecurityoptionalexpr)
        try:
            self.state = 3854
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3848
                self.match(PostgreSQLParser.USING)
                self.state = 3849
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3850
                self.a_expr()
                self.state = 3851
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 RowsecurityoptionalwithcheckContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def CHECK(self):
            return self.getToken(PostgreSQLParser.CHECK, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rowsecurityoptionalwithcheck

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRowsecurityoptionalwithcheck" ):
                listener.enterRowsecurityoptionalwithcheck(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRowsecurityoptionalwithcheck" ):
                listener.exitRowsecurityoptionalwithcheck(self)




    def rowsecurityoptionalwithcheck(self):

        localctx = PostgreSQLParser.RowsecurityoptionalwithcheckContext(self, self._ctx, self.state)
        self.enterRule(localctx, 388, self.RULE_rowsecurityoptionalwithcheck)
        try:
            self.state = 3863
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,174,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3856
                self.match(PostgreSQLParser.WITH)
                self.state = 3857
                self.match(PostgreSQLParser.CHECK)
                self.state = 3858
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3859
                self.a_expr()
                self.state = 3860
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RowsecuritydefaulttoroleContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rowsecuritydefaulttorole

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRowsecuritydefaulttorole" ):
                listener.enterRowsecuritydefaulttorole(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRowsecuritydefaulttorole" ):
                listener.exitRowsecuritydefaulttorole(self)




    def rowsecuritydefaulttorole(self):

        localctx = PostgreSQLParser.RowsecuritydefaulttoroleContext(self, self._ctx, self.state)
        self.enterRule(localctx, 390, self.RULE_rowsecuritydefaulttorole)
        try:
            self.state = 3868
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [94]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3865
                self.match(PostgreSQLParser.TO)
                self.state = 3866
                self.role_list()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 100, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 RowsecurityoptionaltoroleContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rowsecurityoptionaltorole

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRowsecurityoptionaltorole" ):
                listener.enterRowsecurityoptionaltorole(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRowsecurityoptionaltorole" ):
                listener.exitRowsecurityoptionaltorole(self)




    def rowsecurityoptionaltorole(self):

        localctx = PostgreSQLParser.RowsecurityoptionaltoroleContext(self, self._ctx, self.state)
        self.enterRule(localctx, 392, self.RULE_rowsecurityoptionaltorole)
        try:
            self.state = 3873
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [94]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3870
                self.match(PostgreSQLParser.TO)
                self.state = 3871
                self.role_list()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 100, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 RowsecuritydefaultpermissiveContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rowsecuritydefaultpermissive

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRowsecuritydefaultpermissive" ):
                listener.enterRowsecuritydefaultpermissive(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRowsecuritydefaultpermissive" ):
                listener.exitRowsecuritydefaultpermissive(self)




    def rowsecuritydefaultpermissive(self):

        localctx = PostgreSQLParser.RowsecuritydefaultpermissiveContext(self, self._ctx, self.state)
        self.enterRule(localctx, 394, self.RULE_rowsecuritydefaultpermissive)
        try:
            self.state = 3878
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [36]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3875
                self.match(PostgreSQLParser.AS)
                self.state = 3876
                self.identifier()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 62, 65, 71, 88, 92, 94, 100, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 RowsecuritydefaultforcmdContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def row_security_cmd(self):
            return self.getTypedRuleContext(PostgreSQLParser.Row_security_cmdContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rowsecuritydefaultforcmd

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRowsecuritydefaultforcmd" ):
                listener.enterRowsecuritydefaultforcmd(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRowsecuritydefaultforcmd" ):
                listener.exitRowsecuritydefaultforcmd(self)




    def rowsecuritydefaultforcmd(self):

        localctx = PostgreSQLParser.RowsecuritydefaultforcmdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 396, self.RULE_rowsecuritydefaultforcmd)
        try:
            self.state = 3883
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3880
                self.match(PostgreSQLParser.FOR)
                self.state = 3881
                self.row_security_cmd()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 94, 100, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Row_security_cmdContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def SELECT(self):
            return self.getToken(PostgreSQLParser.SELECT, 0)

        def INSERT(self):
            return self.getToken(PostgreSQLParser.INSERT, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def DELETE_P(self):
            return self.getToken(PostgreSQLParser.DELETE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_row_security_cmd

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRow_security_cmd" ):
                listener.enterRow_security_cmd(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRow_security_cmd" ):
                listener.exitRow_security_cmd(self)




    def row_security_cmd(self):

        localctx = PostgreSQLParser.Row_security_cmdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 398, self.RULE_row_security_cmd)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3885
            _la = self._input.LA(1)
            if not(_la==30 or _la==88 or _la==182 or _la==232 or _la==362):
                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 CreateamstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def ACCESS(self):
            return self.getToken(PostgreSQLParser.ACCESS, 0)

        def METHOD(self):
            return self.getToken(PostgreSQLParser.METHOD, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def am_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Am_typeContext,0)


        def HANDLER(self):
            return self.getToken(PostgreSQLParser.HANDLER, 0)

        def handler_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Handler_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createamstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateamstmt" ):
                listener.enterCreateamstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateamstmt" ):
                listener.exitCreateamstmt(self)




    def createamstmt(self):

        localctx = PostgreSQLParser.CreateamstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 400, self.RULE_createamstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3887
            self.match(PostgreSQLParser.CREATE)
            self.state = 3888
            self.match(PostgreSQLParser.ACCESS)
            self.state = 3889
            self.match(PostgreSQLParser.METHOD)
            self.state = 3890
            self.name()
            self.state = 3891
            self.match(PostgreSQLParser.TYPE_P)
            self.state = 3892
            self.am_type()
            self.state = 3893
            self.match(PostgreSQLParser.HANDLER)
            self.state = 3894
            self.handler_name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Am_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_am_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAm_type" ):
                listener.enterAm_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAm_type" ):
                listener.exitAm_type(self)




    def am_type(self):

        localctx = PostgreSQLParser.Am_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 402, self.RULE_am_type)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3896
            _la = self._input.LA(1)
            if not(_la==92 or _la==226):
                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 CreatetrigstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def triggeractiontime(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggeractiontimeContext,0)


        def triggerevents(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggereventsContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def triggerreferencing(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggerreferencingContext,0)


        def triggerforspec(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggerforspecContext,0)


        def triggerwhen(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggerwhenContext,0)


        def EXECUTE(self):
            return self.getToken(PostgreSQLParser.EXECUTE, 0)

        def function_or_procedure(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_or_procedureContext,0)


        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def triggerfuncargs(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggerfuncargsContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def CONSTRAINT(self):
            return self.getToken(PostgreSQLParser.CONSTRAINT, 0)

        def AFTER(self):
            return self.getToken(PostgreSQLParser.AFTER, 0)

        def optconstrfromtable(self):
            return self.getTypedRuleContext(PostgreSQLParser.OptconstrfromtableContext,0)


        def constraintattributespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstraintattributespecContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def EACH(self):
            return self.getToken(PostgreSQLParser.EACH, 0)

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createtrigstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatetrigstmt" ):
                listener.enterCreatetrigstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatetrigstmt" ):
                listener.exitCreatetrigstmt(self)




    def createtrigstmt(self):

        localctx = PostgreSQLParser.CreatetrigstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 404, self.RULE_createtrigstmt)
        try:
            self.state = 3936
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,179,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3898
                self.match(PostgreSQLParser.CREATE)
                self.state = 3899
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 3900
                self.name()
                self.state = 3901
                self.triggeractiontime()
                self.state = 3902
                self.triggerevents()
                self.state = 3903
                self.match(PostgreSQLParser.ON)
                self.state = 3904
                self.qualified_name()
                self.state = 3905
                self.triggerreferencing()
                self.state = 3906
                self.triggerforspec()
                self.state = 3907
                self.triggerwhen()
                self.state = 3908
                self.match(PostgreSQLParser.EXECUTE)
                self.state = 3909
                self.function_or_procedure()
                self.state = 3910
                self.func_name()
                self.state = 3911
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3912
                self.triggerfuncargs()
                self.state = 3913
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3915
                self.match(PostgreSQLParser.CREATE)
                self.state = 3916
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 3917
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 3918
                self.name()
                self.state = 3919
                self.match(PostgreSQLParser.AFTER)
                self.state = 3920
                self.triggerevents()
                self.state = 3921
                self.match(PostgreSQLParser.ON)
                self.state = 3922
                self.qualified_name()
                self.state = 3923
                self.optconstrfromtable()
                self.state = 3924
                self.constraintattributespec()
                self.state = 3925
                self.match(PostgreSQLParser.FOR)
                self.state = 3926
                self.match(PostgreSQLParser.EACH)
                self.state = 3927
                self.match(PostgreSQLParser.ROW)
                self.state = 3928
                self.triggerwhen()
                self.state = 3929
                self.match(PostgreSQLParser.EXECUTE)
                self.state = 3930
                self.function_or_procedure()
                self.state = 3931
                self.func_name()
                self.state = 3932
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3933
                self.triggerfuncargs()
                self.state = 3934
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TriggeractiontimeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BEFORE(self):
            return self.getToken(PostgreSQLParser.BEFORE, 0)

        def AFTER(self):
            return self.getToken(PostgreSQLParser.AFTER, 0)

        def INSTEAD(self):
            return self.getToken(PostgreSQLParser.INSTEAD, 0)

        def OF(self):
            return self.getToken(PostgreSQLParser.OF, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggeractiontime

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggeractiontime" ):
                listener.enterTriggeractiontime(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggeractiontime" ):
                listener.exitTriggeractiontime(self)




    def triggeractiontime(self):

        localctx = PostgreSQLParser.TriggeractiontimeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 406, self.RULE_triggeractiontime)
        try:
            self.state = 3942
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [145]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3938
                self.match(PostgreSQLParser.BEFORE)
                pass
            elif token in [135]:
                self.enterOuterAlt(localctx, 2)
                self.state = 3939
                self.match(PostgreSQLParser.AFTER)
                pass
            elif token in [233]:
                self.enterOuterAlt(localctx, 3)
                self.state = 3940
                self.match(PostgreSQLParser.INSTEAD)
                self.state = 3941
                self.match(PostgreSQLParser.OF)
                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 TriggereventsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def triggeroneevent(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TriggeroneeventContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TriggeroneeventContext,i)


        def OR(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.OR)
            else:
                return self.getToken(PostgreSQLParser.OR, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggerevents

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggerevents" ):
                listener.enterTriggerevents(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggerevents" ):
                listener.exitTriggerevents(self)




    def triggerevents(self):

        localctx = PostgreSQLParser.TriggereventsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 408, self.RULE_triggerevents)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3944
            self.triggeroneevent()
            self.state = 3949
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==82:
                self.state = 3945
                self.match(PostgreSQLParser.OR)
                self.state = 3946
                self.triggeroneevent()
                self.state = 3951
                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 TriggeroneeventContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INSERT(self):
            return self.getToken(PostgreSQLParser.INSERT, 0)

        def DELETE_P(self):
            return self.getToken(PostgreSQLParser.DELETE_P, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def OF(self):
            return self.getToken(PostgreSQLParser.OF, 0)

        def columnlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnlistContext,0)


        def TRUNCATE(self):
            return self.getToken(PostgreSQLParser.TRUNCATE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggeroneevent

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggeroneevent" ):
                listener.enterTriggeroneevent(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggeroneevent" ):
                listener.exitTriggeroneevent(self)




    def triggeroneevent(self):

        localctx = PostgreSQLParser.TriggeroneeventContext(self, self._ctx, self.state)
        self.enterRule(localctx, 410, self.RULE_triggeroneevent)
        try:
            self.state = 3959
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,182,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 3952
                self.match(PostgreSQLParser.INSERT)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 3953
                self.match(PostgreSQLParser.DELETE_P)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 3954
                self.match(PostgreSQLParser.UPDATE)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 3955
                self.match(PostgreSQLParser.UPDATE)
                self.state = 3956
                self.match(PostgreSQLParser.OF)
                self.state = 3957
                self.columnlist()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 3958
                self.match(PostgreSQLParser.TRUNCATE)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TriggerreferencingContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def REFERENCING(self):
            return self.getToken(PostgreSQLParser.REFERENCING, 0)

        def triggertransitions(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggertransitionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggerreferencing

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggerreferencing" ):
                listener.enterTriggerreferencing(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggerreferencing" ):
                listener.exitTriggerreferencing(self)




    def triggerreferencing(self):

        localctx = PostgreSQLParser.TriggerreferencingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 412, self.RULE_triggerreferencing)
        try:
            self.state = 3964
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [447]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3961
                self.match(PostgreSQLParser.REFERENCING)
                self.state = 3962
                self.triggertransitions()
                pass
            elif token in [62, 102, 202]:
                self.enterOuterAlt(localctx, 2)

                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 TriggertransitionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def triggertransition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TriggertransitionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TriggertransitionContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggertransitions

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggertransitions" ):
                listener.enterTriggertransitions(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggertransitions" ):
                listener.exitTriggertransitions(self)




    def triggertransitions(self):

        localctx = PostgreSQLParser.TriggertransitionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 414, self.RULE_triggertransitions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3967 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 3966
                self.triggertransition()
                self.state = 3969 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==448 or _la==449):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TriggertransitionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def transitionoldornew(self):
            return self.getTypedRuleContext(PostgreSQLParser.TransitionoldornewContext,0)


        def transitionrowortable(self):
            return self.getTypedRuleContext(PostgreSQLParser.TransitionrowortableContext,0)


        def opt_as(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_asContext,0)


        def transitionrelname(self):
            return self.getTypedRuleContext(PostgreSQLParser.TransitionrelnameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggertransition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggertransition" ):
                listener.enterTriggertransition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggertransition" ):
                listener.exitTriggertransition(self)




    def triggertransition(self):

        localctx = PostgreSQLParser.TriggertransitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 416, self.RULE_triggertransition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3971
            self.transitionoldornew()
            self.state = 3972
            self.transitionrowortable()
            self.state = 3973
            self.opt_as()
            self.state = 3974
            self.transitionrelname()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TransitionoldornewContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NEW(self):
            return self.getToken(PostgreSQLParser.NEW, 0)

        def OLD(self):
            return self.getToken(PostgreSQLParser.OLD, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_transitionoldornew

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransitionoldornew" ):
                listener.enterTransitionoldornew(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransitionoldornew" ):
                listener.exitTransitionoldornew(self)




    def transitionoldornew(self):

        localctx = PostgreSQLParser.TransitionoldornewContext(self, self._ctx, self.state)
        self.enterRule(localctx, 418, self.RULE_transitionoldornew)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3976
            _la = self._input.LA(1)
            if not(_la==448 or _la==449):
                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 TransitionrowortableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_transitionrowortable

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransitionrowortable" ):
                listener.enterTransitionrowortable(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransitionrowortable" ):
                listener.exitTransitionrowortable(self)




    def transitionrowortable(self):

        localctx = PostgreSQLParser.TransitionrowortableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 420, self.RULE_transitionrowortable)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3978
            _la = self._input.LA(1)
            if not(_la==92 or _la==407):
                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 TransitionrelnameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_transitionrelname

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransitionrelname" ):
                listener.enterTransitionrelname(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransitionrelname" ):
                listener.exitTransitionrelname(self)




    def transitionrelname(self):

        localctx = PostgreSQLParser.TransitionrelnameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 422, self.RULE_transitionrelname)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3980
            self.colid()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TriggerforspecContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def triggerforopteach(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggerforopteachContext,0)


        def triggerfortype(self):
            return self.getTypedRuleContext(PostgreSQLParser.TriggerfortypeContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggerforspec

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggerforspec" ):
                listener.enterTriggerforspec(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggerforspec" ):
                listener.exitTriggerforspec(self)




    def triggerforspec(self):

        localctx = PostgreSQLParser.TriggerforspecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 424, self.RULE_triggerforspec)
        try:
            self.state = 3987
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3982
                self.match(PostgreSQLParser.FOR)
                self.state = 3983
                self.triggerforopteach()
                self.state = 3984
                self.triggerfortype()
                pass
            elif token in [102, 202]:
                self.enterOuterAlt(localctx, 2)

                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 TriggerforopteachContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EACH(self):
            return self.getToken(PostgreSQLParser.EACH, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggerforopteach

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggerforopteach" ):
                listener.enterTriggerforopteach(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggerforopteach" ):
                listener.exitTriggerforopteach(self)




    def triggerforopteach(self):

        localctx = PostgreSQLParser.TriggerforopteachContext(self, self._ctx, self.state)
        self.enterRule(localctx, 426, self.RULE_triggerforopteach)
        try:
            self.state = 3991
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [192]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3989
                self.match(PostgreSQLParser.EACH)
                pass
            elif token in [334, 407]:
                self.enterOuterAlt(localctx, 2)

                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 TriggerfortypeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def STATEMENT(self):
            return self.getToken(PostgreSQLParser.STATEMENT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggerfortype

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggerfortype" ):
                listener.enterTriggerfortype(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggerfortype" ):
                listener.exitTriggerfortype(self)




    def triggerfortype(self):

        localctx = PostgreSQLParser.TriggerfortypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 428, self.RULE_triggerfortype)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 3993
            _la = self._input.LA(1)
            if not(_la==334 or _la==407):
                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 TriggerwhenContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggerwhen

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggerwhen" ):
                listener.enterTriggerwhen(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggerwhen" ):
                listener.exitTriggerwhen(self)




    def triggerwhen(self):

        localctx = PostgreSQLParser.TriggerwhenContext(self, self._ctx, self.state)
        self.enterRule(localctx, 430, self.RULE_triggerwhen)
        try:
            self.state = 4001
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [102]:
                self.enterOuterAlt(localctx, 1)
                self.state = 3995
                self.match(PostgreSQLParser.WHEN)
                self.state = 3996
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 3997
                self.a_expr()
                self.state = 3998
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [202]:
                self.enterOuterAlt(localctx, 2)

                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 Function_or_procedureContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_function_or_procedure

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunction_or_procedure" ):
                listener.enterFunction_or_procedure(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunction_or_procedure" ):
                listener.exitFunction_or_procedure(self)




    def function_or_procedure(self):

        localctx = PostgreSQLParser.Function_or_procedureContext(self, self._ctx, self.state)
        self.enterRule(localctx, 432, self.RULE_function_or_procedure)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4003
            _la = self._input.LA(1)
            if not(_la==211 or _la==289):
                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 TriggerfuncargsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def triggerfuncarg(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TriggerfuncargContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TriggerfuncargContext,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_triggerfuncargs

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggerfuncargs" ):
                listener.enterTriggerfuncargs(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggerfuncargs" ):
                listener.exitTriggerfuncargs(self)




    def triggerfuncargs(self):

        localctx = PostgreSQLParser.TriggerfuncargsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 434, self.RULE_triggerfuncargs)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4007
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 658, 660, 661, 662, 671]:
                self.state = 4005
                self.triggerfuncarg()
                pass
            elif token in [3, 6]:
                pass
            else:
                raise NoViableAltException(self)

            self.state = 4013
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4009
                self.match(PostgreSQLParser.COMMA)
                self.state = 4010
                self.triggerfuncarg()
                self.state = 4015
                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 TriggerfuncargContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def fconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.FconstContext,0)


        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_triggerfuncarg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTriggerfuncarg" ):
                listener.enterTriggerfuncarg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTriggerfuncarg" ):
                listener.exitTriggerfuncarg(self)




    def triggerfuncarg(self):

        localctx = PostgreSQLParser.TriggerfuncargContext(self, self._ctx, self.state)
        self.enterRule(localctx, 436, self.RULE_triggerfuncarg)
        try:
            self.state = 4020
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [658]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4016
                self.iconst()
                pass
            elif token in [660]:
                self.enterOuterAlt(localctx, 2)
                self.state = 4017
                self.fconst()
                pass
            elif token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 3)
                self.state = 4018
                self.sconst()
                pass
            elif token in [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 4)
                self.state = 4019
                self.collabel()
                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 OptconstrfromtableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_optconstrfromtable

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOptconstrfromtable" ):
                listener.enterOptconstrfromtable(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOptconstrfromtable" ):
                listener.exitOptconstrfromtable(self)




    def optconstrfromtable(self):

        localctx = PostgreSQLParser.OptconstrfromtableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 438, self.RULE_optconstrfromtable)
        try:
            self.state = 4025
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [64]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4022
                self.match(PostgreSQLParser.FROM)
                self.state = 4023
                self.qualified_name()
                pass
            elif token in [54, 62, 69, 77, 262]:
                self.enterOuterAlt(localctx, 2)

                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 ConstraintattributespecContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def constraintattributeElem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.ConstraintattributeElemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.ConstraintattributeElemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constraintattributespec

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterConstraintattributespec" ):
                listener.enterConstraintattributespec(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitConstraintattributespec" ):
                listener.exitConstraintattributespec(self)




    def constraintattributespec(self):

        localctx = PostgreSQLParser.ConstraintattributespecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 440, self.RULE_constraintattributespec)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4030
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 54)) & ~0x3f) == 0 and ((1 << (_la - 54)) & 8421377) != 0) or _la==262:
                self.state = 4027
                self.constraintattributeElem()
                self.state = 4032
                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 ConstraintattributeElemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def DEFERRABLE(self):
            return self.getToken(PostgreSQLParser.DEFERRABLE, 0)

        def INITIALLY(self):
            return self.getToken(PostgreSQLParser.INITIALLY, 0)

        def IMMEDIATE(self):
            return self.getToken(PostgreSQLParser.IMMEDIATE, 0)

        def DEFERRED(self):
            return self.getToken(PostgreSQLParser.DEFERRED, 0)

        def VALID(self):
            return self.getToken(PostgreSQLParser.VALID, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def INHERIT(self):
            return self.getToken(PostgreSQLParser.INHERIT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constraintattributeElem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterConstraintattributeElem" ):
                listener.enterConstraintattributeElem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitConstraintattributeElem" ):
                listener.exitConstraintattributeElem(self)




    def constraintattributeElem(self):

        localctx = PostgreSQLParser.ConstraintattributeElemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 442, self.RULE_constraintattributeElem)
        try:
            self.state = 4044
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,193,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4033
                self.match(PostgreSQLParser.NOT)
                self.state = 4034
                self.match(PostgreSQLParser.DEFERRABLE)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4035
                self.match(PostgreSQLParser.DEFERRABLE)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4036
                self.match(PostgreSQLParser.INITIALLY)
                self.state = 4037
                self.match(PostgreSQLParser.IMMEDIATE)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4038
                self.match(PostgreSQLParser.INITIALLY)
                self.state = 4039
                self.match(PostgreSQLParser.DEFERRED)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4040
                self.match(PostgreSQLParser.NOT)
                self.state = 4041
                self.match(PostgreSQLParser.VALID)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 4042
                self.match(PostgreSQLParser.NO)
                self.state = 4043
                self.match(PostgreSQLParser.INHERIT)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreateeventtrigstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def EVENT(self):
            return self.getToken(PostgreSQLParser.EVENT, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def EXECUTE(self):
            return self.getToken(PostgreSQLParser.EXECUTE, 0)

        def function_or_procedure(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_or_procedureContext,0)


        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def event_trigger_when_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Event_trigger_when_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createeventtrigstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateeventtrigstmt" ):
                listener.enterCreateeventtrigstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateeventtrigstmt" ):
                listener.exitCreateeventtrigstmt(self)




    def createeventtrigstmt(self):

        localctx = PostgreSQLParser.CreateeventtrigstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 444, self.RULE_createeventtrigstmt)
        try:
            self.state = 4072
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,194,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4046
                self.match(PostgreSQLParser.CREATE)
                self.state = 4047
                self.match(PostgreSQLParser.EVENT)
                self.state = 4048
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 4049
                self.name()
                self.state = 4050
                self.match(PostgreSQLParser.ON)
                self.state = 4051
                self.collabel()
                self.state = 4052
                self.match(PostgreSQLParser.EXECUTE)
                self.state = 4053
                self.function_or_procedure()
                self.state = 4054
                self.func_name()
                self.state = 4055
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 4056
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4058
                self.match(PostgreSQLParser.CREATE)
                self.state = 4059
                self.match(PostgreSQLParser.EVENT)
                self.state = 4060
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 4061
                self.name()
                self.state = 4062
                self.match(PostgreSQLParser.ON)
                self.state = 4063
                self.collabel()
                self.state = 4064
                self.match(PostgreSQLParser.WHEN)
                self.state = 4065
                self.event_trigger_when_list()
                self.state = 4066
                self.match(PostgreSQLParser.EXECUTE)
                self.state = 4067
                self.function_or_procedure()
                self.state = 4068
                self.func_name()
                self.state = 4069
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 4070
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Event_trigger_when_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def event_trigger_when_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Event_trigger_when_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Event_trigger_when_itemContext,i)


        def AND(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.AND)
            else:
                return self.getToken(PostgreSQLParser.AND, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_event_trigger_when_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEvent_trigger_when_list" ):
                listener.enterEvent_trigger_when_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEvent_trigger_when_list" ):
                listener.exitEvent_trigger_when_list(self)




    def event_trigger_when_list(self):

        localctx = PostgreSQLParser.Event_trigger_when_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 446, self.RULE_event_trigger_when_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4074
            self.event_trigger_when_item()
            self.state = 4079
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==33:
                self.state = 4075
                self.match(PostgreSQLParser.AND)
                self.state = 4076
                self.event_trigger_when_item()
                self.state = 4081
                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 Event_trigger_when_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def event_trigger_value_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Event_trigger_value_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_event_trigger_when_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEvent_trigger_when_item" ):
                listener.enterEvent_trigger_when_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEvent_trigger_when_item" ):
                listener.exitEvent_trigger_when_item(self)




    def event_trigger_when_item(self):

        localctx = PostgreSQLParser.Event_trigger_when_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 448, self.RULE_event_trigger_when_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4082
            self.colid()
            self.state = 4083
            self.match(PostgreSQLParser.IN_P)
            self.state = 4084
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 4085
            self.event_trigger_value_list()
            self.state = 4086
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Event_trigger_value_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sconst(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SconstContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SconstContext,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_event_trigger_value_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEvent_trigger_value_list" ):
                listener.enterEvent_trigger_value_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEvent_trigger_value_list" ):
                listener.exitEvent_trigger_value_list(self)




    def event_trigger_value_list(self):

        localctx = PostgreSQLParser.Event_trigger_value_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 450, self.RULE_event_trigger_value_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4088
            self.sconst()
            self.state = 4093
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4089
                self.match(PostgreSQLParser.COMMA)
                self.state = 4090
                self.sconst()
                self.state = 4095
                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 AltereventtrigstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def EVENT(self):
            return self.getToken(PostgreSQLParser.EVENT, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def enable_trigger(self):
            return self.getTypedRuleContext(PostgreSQLParser.Enable_triggerContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altereventtrigstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAltereventtrigstmt" ):
                listener.enterAltereventtrigstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAltereventtrigstmt" ):
                listener.exitAltereventtrigstmt(self)




    def altereventtrigstmt(self):

        localctx = PostgreSQLParser.AltereventtrigstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 452, self.RULE_altereventtrigstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4096
            self.match(PostgreSQLParser.ALTER)
            self.state = 4097
            self.match(PostgreSQLParser.EVENT)
            self.state = 4098
            self.match(PostgreSQLParser.TRIGGER)
            self.state = 4099
            self.name()
            self.state = 4100
            self.enable_trigger()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Enable_triggerContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ENABLE_P(self):
            return self.getToken(PostgreSQLParser.ENABLE_P, 0)

        def REPLICA(self):
            return self.getToken(PostgreSQLParser.REPLICA, 0)

        def ALWAYS(self):
            return self.getToken(PostgreSQLParser.ALWAYS, 0)

        def DISABLE_P(self):
            return self.getToken(PostgreSQLParser.DISABLE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_enable_trigger

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEnable_trigger" ):
                listener.enterEnable_trigger(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEnable_trigger" ):
                listener.exitEnable_trigger(self)




    def enable_trigger(self):

        localctx = PostgreSQLParser.Enable_triggerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 454, self.RULE_enable_trigger)
        try:
            self.state = 4108
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,197,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4102
                self.match(PostgreSQLParser.ENABLE_P)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4103
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 4104
                self.match(PostgreSQLParser.REPLICA)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4105
                self.match(PostgreSQLParser.ENABLE_P)
                self.state = 4106
                self.match(PostgreSQLParser.ALWAYS)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4107
                self.match(PostgreSQLParser.DISABLE_P)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreateassertionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def ASSERTION(self):
            return self.getToken(PostgreSQLParser.ASSERTION, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def CHECK(self):
            return self.getToken(PostgreSQLParser.CHECK, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def constraintattributespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstraintattributespecContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createassertionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateassertionstmt" ):
                listener.enterCreateassertionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateassertionstmt" ):
                listener.exitCreateassertionstmt(self)




    def createassertionstmt(self):

        localctx = PostgreSQLParser.CreateassertionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 456, self.RULE_createassertionstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4110
            self.match(PostgreSQLParser.CREATE)
            self.state = 4111
            self.match(PostgreSQLParser.ASSERTION)
            self.state = 4112
            self.any_name()
            self.state = 4113
            self.match(PostgreSQLParser.CHECK)
            self.state = 4114
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 4115
            self.a_expr()
            self.state = 4116
            self.match(PostgreSQLParser.CLOSE_PAREN)
            self.state = 4117
            self.constraintattributespec()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DefinestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opt_or_replace(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_or_replaceContext,0)


        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def aggr_args(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggr_argsContext,0)


        def definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.DefinitionContext,0)


        def old_aggr_definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.Old_aggr_definitionContext,0)


        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def any_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_operatorContext,0)


        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def any_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Any_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,i)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def opttablefuncelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttablefuncelementlistContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def ENUM_P(self):
            return self.getToken(PostgreSQLParser.ENUM_P, 0)

        def opt_enum_val_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_enum_val_listContext,0)


        def RANGE(self):
            return self.getToken(PostgreSQLParser.RANGE, 0)

        def TEXT_P(self):
            return self.getToken(PostgreSQLParser.TEXT_P, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def PARSER(self):
            return self.getToken(PostgreSQLParser.PARSER, 0)

        def DICTIONARY(self):
            return self.getToken(PostgreSQLParser.DICTIONARY, 0)

        def TEMPLATE(self):
            return self.getToken(PostgreSQLParser.TEMPLATE, 0)

        def CONFIGURATION(self):
            return self.getToken(PostgreSQLParser.CONFIGURATION, 0)

        def COLLATION(self):
            return self.getToken(PostgreSQLParser.COLLATION, 0)

        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_definestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDefinestmt" ):
                listener.enterDefinestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDefinestmt" ):
                listener.exitDefinestmt(self)




    def definestmt(self):

        localctx = PostgreSQLParser.DefinestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 458, self.RULE_definestmt)
        try:
            self.state = 4225
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,198,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4119
                self.match(PostgreSQLParser.CREATE)
                self.state = 4120
                self.opt_or_replace()
                self.state = 4121
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 4122
                self.func_name()
                self.state = 4123
                self.aggr_args()
                self.state = 4124
                self.definition()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4126
                self.match(PostgreSQLParser.CREATE)
                self.state = 4127
                self.opt_or_replace()
                self.state = 4128
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 4129
                self.func_name()
                self.state = 4130
                self.old_aggr_definition()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4132
                self.match(PostgreSQLParser.CREATE)
                self.state = 4133
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4134
                self.any_operator()
                self.state = 4135
                self.definition()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4137
                self.match(PostgreSQLParser.CREATE)
                self.state = 4138
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4139
                self.any_name()
                self.state = 4140
                self.definition()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4142
                self.match(PostgreSQLParser.CREATE)
                self.state = 4143
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4144
                self.any_name()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 4145
                self.match(PostgreSQLParser.CREATE)
                self.state = 4146
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4147
                self.any_name()
                self.state = 4148
                self.match(PostgreSQLParser.AS)
                self.state = 4149
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 4150
                self.opttablefuncelementlist()
                self.state = 4151
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 4153
                self.match(PostgreSQLParser.CREATE)
                self.state = 4154
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4155
                self.any_name()
                self.state = 4156
                self.match(PostgreSQLParser.AS)
                self.state = 4157
                self.match(PostgreSQLParser.ENUM_P)
                self.state = 4158
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 4159
                self.opt_enum_val_list()
                self.state = 4160
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 4162
                self.match(PostgreSQLParser.CREATE)
                self.state = 4163
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4164
                self.any_name()
                self.state = 4165
                self.match(PostgreSQLParser.AS)
                self.state = 4166
                self.match(PostgreSQLParser.RANGE)
                self.state = 4167
                self.definition()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 4169
                self.match(PostgreSQLParser.CREATE)
                self.state = 4170
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 4171
                self.match(PostgreSQLParser.SEARCH)
                self.state = 4172
                self.match(PostgreSQLParser.PARSER)
                self.state = 4173
                self.any_name()
                self.state = 4174
                self.definition()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 4176
                self.match(PostgreSQLParser.CREATE)
                self.state = 4177
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 4178
                self.match(PostgreSQLParser.SEARCH)
                self.state = 4179
                self.match(PostgreSQLParser.DICTIONARY)
                self.state = 4180
                self.any_name()
                self.state = 4181
                self.definition()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 4183
                self.match(PostgreSQLParser.CREATE)
                self.state = 4184
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 4185
                self.match(PostgreSQLParser.SEARCH)
                self.state = 4186
                self.match(PostgreSQLParser.TEMPLATE)
                self.state = 4187
                self.any_name()
                self.state = 4188
                self.definition()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 4190
                self.match(PostgreSQLParser.CREATE)
                self.state = 4191
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 4192
                self.match(PostgreSQLParser.SEARCH)
                self.state = 4193
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 4194
                self.any_name()
                self.state = 4195
                self.definition()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 4197
                self.match(PostgreSQLParser.CREATE)
                self.state = 4198
                self.match(PostgreSQLParser.COLLATION)
                self.state = 4199
                self.any_name()
                self.state = 4200
                self.definition()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 4202
                self.match(PostgreSQLParser.CREATE)
                self.state = 4203
                self.match(PostgreSQLParser.COLLATION)
                self.state = 4204
                self.match(PostgreSQLParser.IF_P)
                self.state = 4205
                self.match(PostgreSQLParser.NOT)
                self.state = 4206
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4207
                self.any_name()
                self.state = 4208
                self.definition()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 4210
                self.match(PostgreSQLParser.CREATE)
                self.state = 4211
                self.match(PostgreSQLParser.COLLATION)
                self.state = 4212
                self.any_name()
                self.state = 4213
                self.match(PostgreSQLParser.FROM)
                self.state = 4214
                self.any_name()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 4216
                self.match(PostgreSQLParser.CREATE)
                self.state = 4217
                self.match(PostgreSQLParser.COLLATION)
                self.state = 4218
                self.match(PostgreSQLParser.IF_P)
                self.state = 4219
                self.match(PostgreSQLParser.NOT)
                self.state = 4220
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4221
                self.any_name()
                self.state = 4222
                self.match(PostgreSQLParser.FROM)
                self.state = 4223
                self.any_name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def def_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Def_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_definition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDefinition" ):
                listener.enterDefinition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDefinition" ):
                listener.exitDefinition(self)




    def definition(self):

        localctx = PostgreSQLParser.DefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 460, self.RULE_definition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4227
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 4228
            self.def_list()
            self.state = 4229
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Def_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def def_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Def_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Def_elemContext,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_def_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDef_list" ):
                listener.enterDef_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDef_list" ):
                listener.exitDef_list(self)




    def def_list(self):

        localctx = PostgreSQLParser.Def_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 462, self.RULE_def_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4231
            self.def_elem()
            self.state = 4236
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4232
                self.match(PostgreSQLParser.COMMA)
                self.state = 4233
                self.def_elem()
                self.state = 4238
                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 Def_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def def_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Def_argContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_def_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDef_elem" ):
                listener.enterDef_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDef_elem" ):
                listener.exitDef_elem(self)




    def def_elem(self):

        localctx = PostgreSQLParser.Def_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 464, self.RULE_def_elem)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4239
            self.collabel()
            self.state = 4242
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==10:
                self.state = 4240
                self.match(PostgreSQLParser.EQUAL)
                self.state = 4241
                self.def_arg()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Def_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_typeContext,0)


        def reserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reserved_keywordContext,0)


        def qual_all_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qual_all_opContext,0)


        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def NONE(self):
            return self.getToken(PostgreSQLParser.NONE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_def_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDef_arg" ):
                listener.enterDef_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDef_arg" ):
                listener.exitDef_arg(self)




    def def_arg(self):

        localctx = PostgreSQLParser.Def_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 466, self.RULE_def_arg)
        try:
            self.state = 4250
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,201,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4244
                self.func_type()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4245
                self.reserved_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4246
                self.qual_all_op()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4247
                self.numericonly()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4248
                self.sconst()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 4249
                self.match(PostgreSQLParser.NONE)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Old_aggr_definitionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def old_aggr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Old_aggr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_old_aggr_definition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOld_aggr_definition" ):
                listener.enterOld_aggr_definition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOld_aggr_definition" ):
                listener.exitOld_aggr_definition(self)




    def old_aggr_definition(self):

        localctx = PostgreSQLParser.Old_aggr_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 468, self.RULE_old_aggr_definition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4252
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 4253
            self.old_aggr_list()
            self.state = 4254
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Old_aggr_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def old_aggr_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Old_aggr_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Old_aggr_elemContext,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_old_aggr_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOld_aggr_list" ):
                listener.enterOld_aggr_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOld_aggr_list" ):
                listener.exitOld_aggr_list(self)




    def old_aggr_list(self):

        localctx = PostgreSQLParser.Old_aggr_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 470, self.RULE_old_aggr_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4256
            self.old_aggr_elem()
            self.state = 4261
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4257
                self.match(PostgreSQLParser.COMMA)
                self.state = 4258
                self.old_aggr_elem()
                self.state = 4263
                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 Old_aggr_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def def_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Def_argContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_old_aggr_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOld_aggr_elem" ):
                listener.enterOld_aggr_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOld_aggr_elem" ):
                listener.exitOld_aggr_elem(self)




    def old_aggr_elem(self):

        localctx = PostgreSQLParser.Old_aggr_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 472, self.RULE_old_aggr_elem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4264
            self.identifier()
            self.state = 4265
            self.match(PostgreSQLParser.EQUAL)
            self.state = 4266
            self.def_arg()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_enum_val_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def enum_val_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Enum_val_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_enum_val_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_enum_val_list" ):
                listener.enterOpt_enum_val_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_enum_val_list" ):
                listener.exitOpt_enum_val_list(self)




    def opt_enum_val_list(self):

        localctx = PostgreSQLParser.Opt_enum_val_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 474, self.RULE_opt_enum_val_list)
        try:
            self.state = 4270
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4268
                self.enum_val_list()
                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 2)

                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 Enum_val_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sconst(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SconstContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SconstContext,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_enum_val_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEnum_val_list" ):
                listener.enterEnum_val_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEnum_val_list" ):
                listener.exitEnum_val_list(self)




    def enum_val_list(self):

        localctx = PostgreSQLParser.Enum_val_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 476, self.RULE_enum_val_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4272
            self.sconst()
            self.state = 4277
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4273
                self.match(PostgreSQLParser.COMMA)
                self.state = 4274
                self.sconst()
                self.state = 4279
                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 AlterenumstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def ADD_P(self):
            return self.getToken(PostgreSQLParser.ADD_P, 0)

        def VALUE_P(self):
            return self.getToken(PostgreSQLParser.VALUE_P, 0)

        def opt_if_not_exists(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_if_not_existsContext,0)


        def sconst(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SconstContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SconstContext,i)


        def BEFORE(self):
            return self.getToken(PostgreSQLParser.BEFORE, 0)

        def AFTER(self):
            return self.getToken(PostgreSQLParser.AFTER, 0)

        def RENAME(self):
            return self.getToken(PostgreSQLParser.RENAME, 0)

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterenumstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterenumstmt" ):
                listener.enterAlterenumstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterenumstmt" ):
                listener.exitAlterenumstmt(self)




    def alterenumstmt(self):

        localctx = PostgreSQLParser.AlterenumstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 478, self.RULE_alterenumstmt)
        try:
            self.state = 4317
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,205,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4280
                self.match(PostgreSQLParser.ALTER)
                self.state = 4281
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4282
                self.any_name()
                self.state = 4283
                self.match(PostgreSQLParser.ADD_P)
                self.state = 4284
                self.match(PostgreSQLParser.VALUE_P)
                self.state = 4285
                self.opt_if_not_exists()
                self.state = 4286
                self.sconst()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4288
                self.match(PostgreSQLParser.ALTER)
                self.state = 4289
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4290
                self.any_name()
                self.state = 4291
                self.match(PostgreSQLParser.ADD_P)
                self.state = 4292
                self.match(PostgreSQLParser.VALUE_P)
                self.state = 4293
                self.opt_if_not_exists()
                self.state = 4294
                self.sconst()
                self.state = 4295
                self.match(PostgreSQLParser.BEFORE)
                self.state = 4296
                self.sconst()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4298
                self.match(PostgreSQLParser.ALTER)
                self.state = 4299
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4300
                self.any_name()
                self.state = 4301
                self.match(PostgreSQLParser.ADD_P)
                self.state = 4302
                self.match(PostgreSQLParser.VALUE_P)
                self.state = 4303
                self.opt_if_not_exists()
                self.state = 4304
                self.sconst()
                self.state = 4305
                self.match(PostgreSQLParser.AFTER)
                self.state = 4306
                self.sconst()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4308
                self.match(PostgreSQLParser.ALTER)
                self.state = 4309
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4310
                self.any_name()
                self.state = 4311
                self.match(PostgreSQLParser.RENAME)
                self.state = 4312
                self.match(PostgreSQLParser.VALUE_P)
                self.state = 4313
                self.sconst()
                self.state = 4314
                self.match(PostgreSQLParser.TO)
                self.state = 4315
                self.sconst()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_if_not_existsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_if_not_exists

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_if_not_exists" ):
                listener.enterOpt_if_not_exists(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_if_not_exists" ):
                listener.exitOpt_if_not_exists(self)




    def opt_if_not_exists(self):

        localctx = PostgreSQLParser.Opt_if_not_existsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 480, self.RULE_opt_if_not_exists)
        try:
            self.state = 4323
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [220]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4319
                self.match(PostgreSQLParser.IF_P)
                self.state = 4320
                self.match(PostgreSQLParser.NOT)
                self.state = 4321
                self.match(PostgreSQLParser.EXISTS)
                pass
            elif token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 2)

                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 CreateopclassstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def CLASS(self):
            return self.getToken(PostgreSQLParser.CLASS, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def opt_default(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_defaultContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_opfamily(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_opfamilyContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def opclass_item_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opclass_item_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createopclassstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateopclassstmt" ):
                listener.enterCreateopclassstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateopclassstmt" ):
                listener.exitCreateopclassstmt(self)




    def createopclassstmt(self):

        localctx = PostgreSQLParser.CreateopclassstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 482, self.RULE_createopclassstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4325
            self.match(PostgreSQLParser.CREATE)
            self.state = 4326
            self.match(PostgreSQLParser.OPERATOR)
            self.state = 4327
            self.match(PostgreSQLParser.CLASS)
            self.state = 4328
            self.any_name()
            self.state = 4329
            self.opt_default()
            self.state = 4330
            self.match(PostgreSQLParser.FOR)
            self.state = 4331
            self.match(PostgreSQLParser.TYPE_P)
            self.state = 4332
            self.typename()
            self.state = 4333
            self.match(PostgreSQLParser.USING)
            self.state = 4334
            self.name()
            self.state = 4335
            self.opt_opfamily()
            self.state = 4336
            self.match(PostgreSQLParser.AS)
            self.state = 4337
            self.opclass_item_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opclass_item_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opclass_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Opclass_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Opclass_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_opclass_item_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpclass_item_list" ):
                listener.enterOpclass_item_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpclass_item_list" ):
                listener.exitOpclass_item_list(self)




    def opclass_item_list(self):

        localctx = PostgreSQLParser.Opclass_item_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 484, self.RULE_opclass_item_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4339
            self.opclass_item()
            self.state = 4344
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4340
                self.match(PostgreSQLParser.COMMA)
                self.state = 4341
                self.opclass_item()
                self.state = 4346
                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 Opclass_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def any_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_operatorContext,0)


        def opclass_purpose(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opclass_purposeContext,0)


        def opt_recheck(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_recheckContext,0)


        def operator_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_with_argtypesContext,0)


        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def type_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def STORAGE(self):
            return self.getToken(PostgreSQLParser.STORAGE, 0)

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opclass_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpclass_item" ):
                listener.enterOpclass_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpclass_item" ):
                listener.exitOpclass_item(self)




    def opclass_item(self):

        localctx = PostgreSQLParser.Opclass_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 486, self.RULE_opclass_item)
        try:
            self.state = 4372
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,208,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4347
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4348
                self.iconst()
                self.state = 4349
                self.any_operator()
                self.state = 4350
                self.opclass_purpose()
                self.state = 4351
                self.opt_recheck()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4353
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4354
                self.iconst()
                self.state = 4355
                self.operator_with_argtypes()
                self.state = 4356
                self.opclass_purpose()
                self.state = 4357
                self.opt_recheck()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4359
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 4360
                self.iconst()
                self.state = 4361
                self.function_with_argtypes()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4363
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 4364
                self.iconst()
                self.state = 4365
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 4366
                self.type_list()
                self.state = 4367
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 4368
                self.function_with_argtypes()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4370
                self.match(PostgreSQLParser.STORAGE)
                self.state = 4371
                self.typename()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_defaultContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_default

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_default" ):
                listener.enterOpt_default(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_default" ):
                listener.exitOpt_default(self)




    def opt_default(self):

        localctx = PostgreSQLParser.Opt_defaultContext(self, self._ctx, self.state)
        self.enterRule(localctx, 488, self.RULE_opt_default)
        try:
            self.state = 4376
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [53]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4374
                self.match(PostgreSQLParser.DEFAULT)
                pass
            elif token in [62, 168]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_opfamilyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_opfamily

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_opfamily" ):
                listener.enterOpt_opfamily(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_opfamily" ):
                listener.exitOpt_opfamily(self)




    def opt_opfamily(self):

        localctx = PostgreSQLParser.Opt_opfamilyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 490, self.RULE_opt_opfamily)
        try:
            self.state = 4381
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [206]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4378
                self.match(PostgreSQLParser.FAMILY)
                self.state = 4379
                self.any_name()
                pass
            elif token in [36]:
                self.enterOuterAlt(localctx, 2)

                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 Opclass_purposeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def ORDER(self):
            return self.getToken(PostgreSQLParser.ORDER, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opclass_purpose

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpclass_purpose" ):
                listener.enterOpclass_purpose(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpclass_purpose" ):
                listener.exitOpclass_purpose(self)




    def opclass_purpose(self):

        localctx = PostgreSQLParser.Opclass_purposeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 492, self.RULE_opclass_purpose)
        try:
            self.state = 4390
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,211,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4383
                self.match(PostgreSQLParser.FOR)
                self.state = 4384
                self.match(PostgreSQLParser.SEARCH)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4385
                self.match(PostgreSQLParser.FOR)
                self.state = 4386
                self.match(PostgreSQLParser.ORDER)
                self.state = 4387
                self.match(PostgreSQLParser.BY)
                self.state = 4388
                self.any_name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_recheckContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def RECHECK(self):
            return self.getToken(PostgreSQLParser.RECHECK, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_recheck

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_recheck" ):
                listener.enterOpt_recheck(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_recheck" ):
                listener.exitOpt_recheck(self)




    def opt_recheck(self):

        localctx = PostgreSQLParser.Opt_recheckContext(self, self._ctx, self.state)
        self.enterRule(localctx, 494, self.RULE_opt_recheck)
        try:
            self.state = 4394
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [295]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4392
                self.match(PostgreSQLParser.RECHECK)
                pass
            elif token in [-1, 2, 6, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 CreateopfamilystmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createopfamilystmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateopfamilystmt" ):
                listener.enterCreateopfamilystmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateopfamilystmt" ):
                listener.exitCreateopfamilystmt(self)




    def createopfamilystmt(self):

        localctx = PostgreSQLParser.CreateopfamilystmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 496, self.RULE_createopfamilystmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4396
            self.match(PostgreSQLParser.CREATE)
            self.state = 4397
            self.match(PostgreSQLParser.OPERATOR)
            self.state = 4398
            self.match(PostgreSQLParser.FAMILY)
            self.state = 4399
            self.any_name()
            self.state = 4400
            self.match(PostgreSQLParser.USING)
            self.state = 4401
            self.name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlteropfamilystmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def ADD_P(self):
            return self.getToken(PostgreSQLParser.ADD_P, 0)

        def opclass_item_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opclass_item_listContext,0)


        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def opclass_drop_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opclass_drop_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alteropfamilystmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlteropfamilystmt" ):
                listener.enterAlteropfamilystmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlteropfamilystmt" ):
                listener.exitAlteropfamilystmt(self)




    def alteropfamilystmt(self):

        localctx = PostgreSQLParser.AlteropfamilystmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 498, self.RULE_alteropfamilystmt)
        try:
            self.state = 4421
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,213,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4403
                self.match(PostgreSQLParser.ALTER)
                self.state = 4404
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4405
                self.match(PostgreSQLParser.FAMILY)
                self.state = 4406
                self.any_name()
                self.state = 4407
                self.match(PostgreSQLParser.USING)
                self.state = 4408
                self.name()
                self.state = 4409
                self.match(PostgreSQLParser.ADD_P)
                self.state = 4410
                self.opclass_item_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4412
                self.match(PostgreSQLParser.ALTER)
                self.state = 4413
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4414
                self.match(PostgreSQLParser.FAMILY)
                self.state = 4415
                self.any_name()
                self.state = 4416
                self.match(PostgreSQLParser.USING)
                self.state = 4417
                self.name()
                self.state = 4418
                self.match(PostgreSQLParser.DROP)
                self.state = 4419
                self.opclass_drop_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 Opclass_drop_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opclass_drop(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Opclass_dropContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Opclass_dropContext,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_opclass_drop_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpclass_drop_list" ):
                listener.enterOpclass_drop_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpclass_drop_list" ):
                listener.exitOpclass_drop_list(self)




    def opclass_drop_list(self):

        localctx = PostgreSQLParser.Opclass_drop_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 500, self.RULE_opclass_drop_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4423
            self.opclass_drop()
            self.state = 4428
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4424
                self.match(PostgreSQLParser.COMMA)
                self.state = 4425
                self.opclass_drop()
                self.state = 4430
                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 Opclass_dropContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def type_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opclass_drop

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpclass_drop" ):
                listener.enterOpclass_drop(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpclass_drop" ):
                listener.exitOpclass_drop(self)




    def opclass_drop(self):

        localctx = PostgreSQLParser.Opclass_dropContext(self, self._ctx, self.state)
        self.enterRule(localctx, 502, self.RULE_opclass_drop)
        try:
            self.state = 4443
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [271]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4431
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4432
                self.iconst()
                self.state = 4433
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 4434
                self.type_list()
                self.state = 4435
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [211]:
                self.enterOuterAlt(localctx, 2)
                self.state = 4437
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 4438
                self.iconst()
                self.state = 4439
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 4440
                self.type_list()
                self.state = 4441
                self.match(PostgreSQLParser.CLOSE_PAREN)
                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 DropopclassstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def CLASS(self):
            return self.getToken(PostgreSQLParser.CLASS, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dropopclassstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDropopclassstmt" ):
                listener.enterDropopclassstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDropopclassstmt" ):
                listener.exitDropopclassstmt(self)




    def dropopclassstmt(self):

        localctx = PostgreSQLParser.DropopclassstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 504, self.RULE_dropopclassstmt)
        try:
            self.state = 4463
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,216,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4445
                self.match(PostgreSQLParser.DROP)
                self.state = 4446
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4447
                self.match(PostgreSQLParser.CLASS)
                self.state = 4448
                self.any_name()
                self.state = 4449
                self.match(PostgreSQLParser.USING)
                self.state = 4450
                self.name()
                self.state = 4451
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4453
                self.match(PostgreSQLParser.DROP)
                self.state = 4454
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4455
                self.match(PostgreSQLParser.CLASS)
                self.state = 4456
                self.match(PostgreSQLParser.IF_P)
                self.state = 4457
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4458
                self.any_name()
                self.state = 4459
                self.match(PostgreSQLParser.USING)
                self.state = 4460
                self.name()
                self.state = 4461
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DropopfamilystmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dropopfamilystmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDropopfamilystmt" ):
                listener.enterDropopfamilystmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDropopfamilystmt" ):
                listener.exitDropopfamilystmt(self)




    def dropopfamilystmt(self):

        localctx = PostgreSQLParser.DropopfamilystmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 506, self.RULE_dropopfamilystmt)
        try:
            self.state = 4483
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,217,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4465
                self.match(PostgreSQLParser.DROP)
                self.state = 4466
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4467
                self.match(PostgreSQLParser.FAMILY)
                self.state = 4468
                self.any_name()
                self.state = 4469
                self.match(PostgreSQLParser.USING)
                self.state = 4470
                self.name()
                self.state = 4471
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4473
                self.match(PostgreSQLParser.DROP)
                self.state = 4474
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4475
                self.match(PostgreSQLParser.FAMILY)
                self.state = 4476
                self.match(PostgreSQLParser.IF_P)
                self.state = 4477
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4478
                self.any_name()
                self.state = 4479
                self.match(PostgreSQLParser.USING)
                self.state = 4480
                self.name()
                self.state = 4481
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DropownedstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def OWNED(self):
            return self.getToken(PostgreSQLParser.OWNED, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dropownedstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDropownedstmt" ):
                listener.enterDropownedstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDropownedstmt" ):
                listener.exitDropownedstmt(self)




    def dropownedstmt(self):

        localctx = PostgreSQLParser.DropownedstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 508, self.RULE_dropownedstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4485
            self.match(PostgreSQLParser.DROP)
            self.state = 4486
            self.match(PostgreSQLParser.OWNED)
            self.state = 4487
            self.match(PostgreSQLParser.BY)
            self.state = 4488
            self.role_list()
            self.state = 4489
            self.opt_drop_behavior()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ReassignownedstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def REASSIGN(self):
            return self.getToken(PostgreSQLParser.REASSIGN, 0)

        def OWNED(self):
            return self.getToken(PostgreSQLParser.OWNED, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reassignownedstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReassignownedstmt" ):
                listener.enterReassignownedstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReassignownedstmt" ):
                listener.exitReassignownedstmt(self)




    def reassignownedstmt(self):

        localctx = PostgreSQLParser.ReassignownedstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 510, self.RULE_reassignownedstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4491
            self.match(PostgreSQLParser.REASSIGN)
            self.state = 4492
            self.match(PostgreSQLParser.OWNED)
            self.state = 4493
            self.match(PostgreSQLParser.BY)
            self.state = 4494
            self.role_list()
            self.state = 4495
            self.match(PostgreSQLParser.TO)
            self.state = 4496
            self.rolespec()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DropstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def object_type_any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_any_nameContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def any_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_name_listContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def drop_type_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Drop_type_nameContext,0)


        def name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Name_listContext,0)


        def object_type_name_on_any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_name_on_any_nameContext,0)


        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def type_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_name_listContext,0)


        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def CONCURRENTLY(self):
            return self.getToken(PostgreSQLParser.CONCURRENTLY, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dropstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDropstmt" ):
                listener.enterDropstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDropstmt" ):
                listener.exitDropstmt(self)




    def dropstmt(self):

        localctx = PostgreSQLParser.DropstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 512, self.RULE_dropstmt)
        try:
            self.state = 4576
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,218,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4498
                self.match(PostgreSQLParser.DROP)
                self.state = 4499
                self.object_type_any_name()
                self.state = 4500
                self.match(PostgreSQLParser.IF_P)
                self.state = 4501
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4502
                self.any_name_list()
                self.state = 4503
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4505
                self.match(PostgreSQLParser.DROP)
                self.state = 4506
                self.object_type_any_name()
                self.state = 4507
                self.any_name_list()
                self.state = 4508
                self.opt_drop_behavior()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4510
                self.match(PostgreSQLParser.DROP)
                self.state = 4511
                self.drop_type_name()
                self.state = 4512
                self.match(PostgreSQLParser.IF_P)
                self.state = 4513
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4514
                self.name_list()
                self.state = 4515
                self.opt_drop_behavior()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4517
                self.match(PostgreSQLParser.DROP)
                self.state = 4518
                self.drop_type_name()
                self.state = 4519
                self.name_list()
                self.state = 4520
                self.opt_drop_behavior()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4522
                self.match(PostgreSQLParser.DROP)
                self.state = 4523
                self.object_type_name_on_any_name()
                self.state = 4524
                self.name()
                self.state = 4525
                self.match(PostgreSQLParser.ON)
                self.state = 4526
                self.any_name()
                self.state = 4527
                self.opt_drop_behavior()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 4529
                self.match(PostgreSQLParser.DROP)
                self.state = 4530
                self.object_type_name_on_any_name()
                self.state = 4531
                self.match(PostgreSQLParser.IF_P)
                self.state = 4532
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4533
                self.name()
                self.state = 4534
                self.match(PostgreSQLParser.ON)
                self.state = 4535
                self.any_name()
                self.state = 4536
                self.opt_drop_behavior()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 4538
                self.match(PostgreSQLParser.DROP)
                self.state = 4539
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4540
                self.type_name_list()
                self.state = 4541
                self.opt_drop_behavior()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 4543
                self.match(PostgreSQLParser.DROP)
                self.state = 4544
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4545
                self.match(PostgreSQLParser.IF_P)
                self.state = 4546
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4547
                self.type_name_list()
                self.state = 4548
                self.opt_drop_behavior()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 4550
                self.match(PostgreSQLParser.DROP)
                self.state = 4551
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 4552
                self.type_name_list()
                self.state = 4553
                self.opt_drop_behavior()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 4555
                self.match(PostgreSQLParser.DROP)
                self.state = 4556
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 4557
                self.match(PostgreSQLParser.IF_P)
                self.state = 4558
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4559
                self.type_name_list()
                self.state = 4560
                self.opt_drop_behavior()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 4562
                self.match(PostgreSQLParser.DROP)
                self.state = 4563
                self.match(PostgreSQLParser.INDEX)
                self.state = 4564
                self.match(PostgreSQLParser.CONCURRENTLY)
                self.state = 4565
                self.any_name_list()
                self.state = 4566
                self.opt_drop_behavior()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 4568
                self.match(PostgreSQLParser.DROP)
                self.state = 4569
                self.match(PostgreSQLParser.INDEX)
                self.state = 4570
                self.match(PostgreSQLParser.CONCURRENTLY)
                self.state = 4571
                self.match(PostgreSQLParser.IF_P)
                self.state = 4572
                self.match(PostgreSQLParser.EXISTS)
                self.state = 4573
                self.any_name_list()
                self.state = 4574
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Object_type_any_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def SEQUENCE(self):
            return self.getToken(PostgreSQLParser.SEQUENCE, 0)

        def VIEW(self):
            return self.getToken(PostgreSQLParser.VIEW, 0)

        def MATERIALIZED(self):
            return self.getToken(PostgreSQLParser.MATERIALIZED, 0)

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def COLLATION(self):
            return self.getToken(PostgreSQLParser.COLLATION, 0)

        def CONVERSION_P(self):
            return self.getToken(PostgreSQLParser.CONVERSION_P, 0)

        def STATISTICS(self):
            return self.getToken(PostgreSQLParser.STATISTICS, 0)

        def TEXT_P(self):
            return self.getToken(PostgreSQLParser.TEXT_P, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def PARSER(self):
            return self.getToken(PostgreSQLParser.PARSER, 0)

        def DICTIONARY(self):
            return self.getToken(PostgreSQLParser.DICTIONARY, 0)

        def TEMPLATE(self):
            return self.getToken(PostgreSQLParser.TEMPLATE, 0)

        def CONFIGURATION(self):
            return self.getToken(PostgreSQLParser.CONFIGURATION, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_object_type_any_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterObject_type_any_name" ):
                listener.enterObject_type_any_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitObject_type_any_name" ):
                listener.exitObject_type_any_name(self)




    def object_type_any_name(self):

        localctx = PostgreSQLParser.Object_type_any_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 514, self.RULE_object_type_any_name)
        try:
            self.state = 4601
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,219,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4578
                self.match(PostgreSQLParser.TABLE)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4579
                self.match(PostgreSQLParser.SEQUENCE)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4580
                self.match(PostgreSQLParser.VIEW)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4581
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 4582
                self.match(PostgreSQLParser.VIEW)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4583
                self.match(PostgreSQLParser.INDEX)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 4584
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 4585
                self.match(PostgreSQLParser.TABLE)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 4586
                self.match(PostgreSQLParser.COLLATION)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 4587
                self.match(PostgreSQLParser.CONVERSION_P)
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 4588
                self.match(PostgreSQLParser.STATISTICS)
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 4589
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 4590
                self.match(PostgreSQLParser.SEARCH)
                self.state = 4591
                self.match(PostgreSQLParser.PARSER)
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 4592
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 4593
                self.match(PostgreSQLParser.SEARCH)
                self.state = 4594
                self.match(PostgreSQLParser.DICTIONARY)
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 4595
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 4596
                self.match(PostgreSQLParser.SEARCH)
                self.state = 4597
                self.match(PostgreSQLParser.TEMPLATE)
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 4598
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 4599
                self.match(PostgreSQLParser.SEARCH)
                self.state = 4600
                self.match(PostgreSQLParser.CONFIGURATION)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Object_type_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def drop_type_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Drop_type_nameContext,0)


        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def ROLE(self):
            return self.getToken(PostgreSQLParser.ROLE, 0)

        def SUBSCRIPTION(self):
            return self.getToken(PostgreSQLParser.SUBSCRIPTION, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_object_type_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterObject_type_name" ):
                listener.enterObject_type_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitObject_type_name" ):
                listener.exitObject_type_name(self)




    def object_type_name(self):

        localctx = PostgreSQLParser.Object_type_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 516, self.RULE_object_type_name)
        try:
            self.state = 4608
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [63, 131, 198, 204, 238, 288, 316, 324, 452]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4603
                self.drop_type_name()
                pass
            elif token in [175]:
                self.enterOuterAlt(localctx, 2)
                self.state = 4604
                self.match(PostgreSQLParser.DATABASE)
                pass
            elif token in [311]:
                self.enterOuterAlt(localctx, 3)
                self.state = 4605
                self.match(PostgreSQLParser.ROLE)
                pass
            elif token in [451]:
                self.enterOuterAlt(localctx, 4)
                self.state = 4606
                self.match(PostgreSQLParser.SUBSCRIPTION)
                pass
            elif token in [344]:
                self.enterOuterAlt(localctx, 5)
                self.state = 4607
                self.match(PostgreSQLParser.TABLESPACE)
                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 Drop_type_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ACCESS(self):
            return self.getToken(PostgreSQLParser.ACCESS, 0)

        def METHOD(self):
            return self.getToken(PostgreSQLParser.METHOD, 0)

        def EVENT(self):
            return self.getToken(PostgreSQLParser.EVENT, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def EXTENSION(self):
            return self.getToken(PostgreSQLParser.EXTENSION, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def WRAPPER(self):
            return self.getToken(PostgreSQLParser.WRAPPER, 0)

        def opt_procedural(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_proceduralContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def PUBLICATION(self):
            return self.getToken(PostgreSQLParser.PUBLICATION, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_drop_type_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDrop_type_name" ):
                listener.enterDrop_type_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDrop_type_name" ):
                listener.exitDrop_type_name(self)




    def drop_type_name(self):

        localctx = PostgreSQLParser.Drop_type_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 518, self.RULE_drop_type_name)
        try:
            self.state = 4624
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [131]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4610
                self.match(PostgreSQLParser.ACCESS)
                self.state = 4611
                self.match(PostgreSQLParser.METHOD)
                pass
            elif token in [198]:
                self.enterOuterAlt(localctx, 2)
                self.state = 4612
                self.match(PostgreSQLParser.EVENT)
                self.state = 4613
                self.match(PostgreSQLParser.TRIGGER)
                pass
            elif token in [204]:
                self.enterOuterAlt(localctx, 3)
                self.state = 4614
                self.match(PostgreSQLParser.EXTENSION)
                pass
            elif token in [63]:
                self.enterOuterAlt(localctx, 4)
                self.state = 4615
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 4616
                self.match(PostgreSQLParser.DATA_P)
                self.state = 4617
                self.match(PostgreSQLParser.WRAPPER)
                pass
            elif token in [238, 288]:
                self.enterOuterAlt(localctx, 5)
                self.state = 4618
                self.opt_procedural()
                self.state = 4619
                self.match(PostgreSQLParser.LANGUAGE)
                pass
            elif token in [452]:
                self.enterOuterAlt(localctx, 6)
                self.state = 4621
                self.match(PostgreSQLParser.PUBLICATION)
                pass
            elif token in [316]:
                self.enterOuterAlt(localctx, 7)
                self.state = 4622
                self.match(PostgreSQLParser.SCHEMA)
                pass
            elif token in [324]:
                self.enterOuterAlt(localctx, 8)
                self.state = 4623
                self.match(PostgreSQLParser.SERVER)
                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 Object_type_name_on_any_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def POLICY(self):
            return self.getToken(PostgreSQLParser.POLICY, 0)

        def RULE(self):
            return self.getToken(PostgreSQLParser.RULE, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_object_type_name_on_any_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterObject_type_name_on_any_name" ):
                listener.enterObject_type_name_on_any_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitObject_type_name_on_any_name" ):
                listener.exitObject_type_name_on_any_name(self)




    def object_type_name_on_any_name(self):

        localctx = PostgreSQLParser.Object_type_name_on_any_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 520, self.RULE_object_type_name_on_any_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4626
            _la = self._input.LA(1)
            if not(_la==314 or _la==350 or _la==445):
                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 Any_name_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def any_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Any_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Any_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_any_name_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAny_name_list" ):
                listener.enterAny_name_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAny_name_list" ):
                listener.exitAny_name_list(self)




    def any_name_list(self):

        localctx = PostgreSQLParser.Any_name_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 522, self.RULE_any_name_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4628
            self.any_name()
            self.state = 4633
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4629
                self.match(PostgreSQLParser.COMMA)
                self.state = 4630
                self.any_name()
                self.state = 4635
                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 Any_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def attrs(self):
            return self.getTypedRuleContext(PostgreSQLParser.AttrsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_any_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAny_name" ):
                listener.enterAny_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAny_name" ):
                listener.exitAny_name(self)




    def any_name(self):

        localctx = PostgreSQLParser.Any_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 524, self.RULE_any_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4636
            self.colid()
            self.state = 4638
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==11:
                self.state = 4637
                self.attrs()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AttrsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.DOT)
            else:
                return self.getToken(PostgreSQLParser.DOT, i)

        def attr_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Attr_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Attr_nameContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_attrs

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAttrs" ):
                listener.enterAttrs(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAttrs" ):
                listener.exitAttrs(self)




    def attrs(self):

        localctx = PostgreSQLParser.AttrsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 526, self.RULE_attrs)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4642 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 4640
                    self.match(PostgreSQLParser.DOT)
                    self.state = 4641
                    self.attr_name()

                else:
                    raise NoViableAltException(self)
                self.state = 4644 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,224,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 Type_name_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,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_type_name_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterType_name_list" ):
                listener.enterType_name_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitType_name_list" ):
                listener.exitType_name_list(self)




    def type_name_list(self):

        localctx = PostgreSQLParser.Type_name_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 528, self.RULE_type_name_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4646
            self.typename()
            self.state = 4651
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 4647
                self.match(PostgreSQLParser.COMMA)
                self.state = 4648
                self.typename()
                self.state = 4653
                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 TruncatestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TRUNCATE(self):
            return self.getToken(PostgreSQLParser.TRUNCATE, 0)

        def opt_table(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_tableContext,0)


        def relation_expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_expr_listContext,0)


        def opt_restart_seqs(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_restart_seqsContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_truncatestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTruncatestmt" ):
                listener.enterTruncatestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTruncatestmt" ):
                listener.exitTruncatestmt(self)




    def truncatestmt(self):

        localctx = PostgreSQLParser.TruncatestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 530, self.RULE_truncatestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4654
            self.match(PostgreSQLParser.TRUNCATE)
            self.state = 4655
            self.opt_table()
            self.state = 4656
            self.relation_expr_list()
            self.state = 4657
            self.opt_restart_seqs()
            self.state = 4658
            self.opt_drop_behavior()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_restart_seqsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CONTINUE_P(self):
            return self.getToken(PostgreSQLParser.CONTINUE_P, 0)

        def IDENTITY_P(self):
            return self.getToken(PostgreSQLParser.IDENTITY_P, 0)

        def RESTART(self):
            return self.getToken(PostgreSQLParser.RESTART, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_restart_seqs

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_restart_seqs" ):
                listener.enterOpt_restart_seqs(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_restart_seqs" ):
                listener.exitOpt_restart_seqs(self)




    def opt_restart_seqs(self):

        localctx = PostgreSQLParser.Opt_restart_seqsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 532, self.RULE_opt_restart_seqs)
        try:
            self.state = 4665
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [167]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4660
                self.match(PostgreSQLParser.CONTINUE_P)
                self.state = 4661
                self.match(PostgreSQLParser.IDENTITY_P)
                pass
            elif token in [307]:
                self.enterOuterAlt(localctx, 2)
                self.state = 4662
                self.match(PostgreSQLParser.RESTART)
                self.state = 4663
                self.match(PostgreSQLParser.IDENTITY_P)
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 150, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 308, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 3)

                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 CommentstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COMMENT(self):
            return self.getToken(PostgreSQLParser.COMMENT, 0)

        def ON(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.ON)
            else:
                return self.getToken(PostgreSQLParser.ON, i)

        def object_type_any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_any_nameContext,0)


        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def IS(self):
            return self.getToken(PostgreSQLParser.IS, 0)

        def comment_text(self):
            return self.getTypedRuleContext(PostgreSQLParser.Comment_textContext,0)


        def COLUMN(self):
            return self.getToken(PostgreSQLParser.COLUMN, 0)

        def object_type_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_nameContext,0)


        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,i)


        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def aggregate_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggregate_with_argtypesContext,0)


        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def operator_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_with_argtypesContext,0)


        def CONSTRAINT(self):
            return self.getToken(PostgreSQLParser.CONSTRAINT, 0)

        def object_type_name_on_any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_name_on_any_nameContext,0)


        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def TRANSFORM(self):
            return self.getToken(PostgreSQLParser.TRANSFORM, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def CLASS(self):
            return self.getToken(PostgreSQLParser.CLASS, 0)

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def LARGE_P(self):
            return self.getToken(PostgreSQLParser.LARGE_P, 0)

        def OBJECT_P(self):
            return self.getToken(PostgreSQLParser.OBJECT_P, 0)

        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def CAST(self):
            return self.getToken(PostgreSQLParser.CAST, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_commentstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCommentstmt" ):
                listener.enterCommentstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCommentstmt" ):
                listener.exitCommentstmt(self)




    def commentstmt(self):

        localctx = PostgreSQLParser.CommentstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 534, self.RULE_commentstmt)
        try:
            self.state = 4814
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,227,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4667
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4668
                self.match(PostgreSQLParser.ON)
                self.state = 4669
                self.object_type_any_name()
                self.state = 4670
                self.any_name()
                self.state = 4671
                self.match(PostgreSQLParser.IS)
                self.state = 4672
                self.comment_text()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4674
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4675
                self.match(PostgreSQLParser.ON)
                self.state = 4676
                self.match(PostgreSQLParser.COLUMN)
                self.state = 4677
                self.any_name()
                self.state = 4678
                self.match(PostgreSQLParser.IS)
                self.state = 4679
                self.comment_text()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4681
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4682
                self.match(PostgreSQLParser.ON)
                self.state = 4683
                self.object_type_name()
                self.state = 4684
                self.name()
                self.state = 4685
                self.match(PostgreSQLParser.IS)
                self.state = 4686
                self.comment_text()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4688
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4689
                self.match(PostgreSQLParser.ON)
                self.state = 4690
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4691
                self.typename()
                self.state = 4692
                self.match(PostgreSQLParser.IS)
                self.state = 4693
                self.comment_text()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4695
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4696
                self.match(PostgreSQLParser.ON)
                self.state = 4697
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 4698
                self.typename()
                self.state = 4699
                self.match(PostgreSQLParser.IS)
                self.state = 4700
                self.comment_text()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 4702
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4703
                self.match(PostgreSQLParser.ON)
                self.state = 4704
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 4705
                self.aggregate_with_argtypes()
                self.state = 4706
                self.match(PostgreSQLParser.IS)
                self.state = 4707
                self.comment_text()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 4709
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4710
                self.match(PostgreSQLParser.ON)
                self.state = 4711
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 4712
                self.function_with_argtypes()
                self.state = 4713
                self.match(PostgreSQLParser.IS)
                self.state = 4714
                self.comment_text()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 4716
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4717
                self.match(PostgreSQLParser.ON)
                self.state = 4718
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4719
                self.operator_with_argtypes()
                self.state = 4720
                self.match(PostgreSQLParser.IS)
                self.state = 4721
                self.comment_text()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 4723
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4724
                self.match(PostgreSQLParser.ON)
                self.state = 4725
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 4726
                self.name()
                self.state = 4727
                self.match(PostgreSQLParser.ON)
                self.state = 4728
                self.any_name()
                self.state = 4729
                self.match(PostgreSQLParser.IS)
                self.state = 4730
                self.comment_text()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 4732
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4733
                self.match(PostgreSQLParser.ON)
                self.state = 4734
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 4735
                self.name()
                self.state = 4736
                self.match(PostgreSQLParser.ON)
                self.state = 4737
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 4738
                self.any_name()
                self.state = 4739
                self.match(PostgreSQLParser.IS)
                self.state = 4740
                self.comment_text()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 4742
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4743
                self.match(PostgreSQLParser.ON)
                self.state = 4744
                self.object_type_name_on_any_name()
                self.state = 4745
                self.name()
                self.state = 4746
                self.match(PostgreSQLParser.ON)
                self.state = 4747
                self.any_name()
                self.state = 4748
                self.match(PostgreSQLParser.IS)
                self.state = 4749
                self.comment_text()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 4751
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4752
                self.match(PostgreSQLParser.ON)
                self.state = 4753
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 4754
                self.function_with_argtypes()
                self.state = 4755
                self.match(PostgreSQLParser.IS)
                self.state = 4756
                self.comment_text()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 4758
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4759
                self.match(PostgreSQLParser.ON)
                self.state = 4760
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 4761
                self.function_with_argtypes()
                self.state = 4762
                self.match(PostgreSQLParser.IS)
                self.state = 4763
                self.comment_text()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 4765
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4766
                self.match(PostgreSQLParser.ON)
                self.state = 4767
                self.match(PostgreSQLParser.TRANSFORM)
                self.state = 4768
                self.match(PostgreSQLParser.FOR)
                self.state = 4769
                self.typename()
                self.state = 4770
                self.match(PostgreSQLParser.LANGUAGE)
                self.state = 4771
                self.name()
                self.state = 4772
                self.match(PostgreSQLParser.IS)
                self.state = 4773
                self.comment_text()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 4775
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4776
                self.match(PostgreSQLParser.ON)
                self.state = 4777
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4778
                self.match(PostgreSQLParser.CLASS)
                self.state = 4779
                self.any_name()
                self.state = 4780
                self.match(PostgreSQLParser.USING)
                self.state = 4781
                self.name()
                self.state = 4782
                self.match(PostgreSQLParser.IS)
                self.state = 4783
                self.comment_text()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 4785
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4786
                self.match(PostgreSQLParser.ON)
                self.state = 4787
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 4788
                self.match(PostgreSQLParser.FAMILY)
                self.state = 4789
                self.any_name()
                self.state = 4790
                self.match(PostgreSQLParser.USING)
                self.state = 4791
                self.name()
                self.state = 4792
                self.match(PostgreSQLParser.IS)
                self.state = 4793
                self.comment_text()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 4795
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4796
                self.match(PostgreSQLParser.ON)
                self.state = 4797
                self.match(PostgreSQLParser.LARGE_P)
                self.state = 4798
                self.match(PostgreSQLParser.OBJECT_P)
                self.state = 4799
                self.numericonly()
                self.state = 4800
                self.match(PostgreSQLParser.IS)
                self.state = 4801
                self.comment_text()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 4803
                self.match(PostgreSQLParser.COMMENT)
                self.state = 4804
                self.match(PostgreSQLParser.ON)
                self.state = 4805
                self.match(PostgreSQLParser.CAST)
                self.state = 4806
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 4807
                self.typename()
                self.state = 4808
                self.match(PostgreSQLParser.AS)
                self.state = 4809
                self.typename()
                self.state = 4810
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 4811
                self.match(PostgreSQLParser.IS)
                self.state = 4812
                self.comment_text()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Comment_textContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_comment_text

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterComment_text" ):
                listener.enterComment_text(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitComment_text" ):
                listener.exitComment_text(self)




    def comment_text(self):

        localctx = PostgreSQLParser.Comment_textContext(self, self._ctx, self.state)
        self.enterRule(localctx, 536, self.RULE_comment_text)
        try:
            self.state = 4818
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4816
                self.sconst()
                pass
            elif token in [78]:
                self.enterOuterAlt(localctx, 2)
                self.state = 4817
                self.match(PostgreSQLParser.NULL_P)
                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 SeclabelstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SECURITY(self):
            return self.getToken(PostgreSQLParser.SECURITY, 0)

        def LABEL(self):
            return self.getToken(PostgreSQLParser.LABEL, 0)

        def opt_provider(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_providerContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def object_type_any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_any_nameContext,0)


        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def IS(self):
            return self.getToken(PostgreSQLParser.IS, 0)

        def security_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Security_labelContext,0)


        def COLUMN(self):
            return self.getToken(PostgreSQLParser.COLUMN, 0)

        def object_type_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Object_type_nameContext,0)


        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def aggregate_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggregate_with_argtypesContext,0)


        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def LARGE_P(self):
            return self.getToken(PostgreSQLParser.LARGE_P, 0)

        def OBJECT_P(self):
            return self.getToken(PostgreSQLParser.OBJECT_P, 0)

        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_seclabelstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSeclabelstmt" ):
                listener.enterSeclabelstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSeclabelstmt" ):
                listener.exitSeclabelstmt(self)




    def seclabelstmt(self):

        localctx = PostgreSQLParser.SeclabelstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 538, self.RULE_seclabelstmt)
        try:
            self.state = 4911
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,229,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4820
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4821
                self.match(PostgreSQLParser.LABEL)
                self.state = 4822
                self.opt_provider()
                self.state = 4823
                self.match(PostgreSQLParser.ON)
                self.state = 4824
                self.object_type_any_name()
                self.state = 4825
                self.any_name()
                self.state = 4826
                self.match(PostgreSQLParser.IS)
                self.state = 4827
                self.security_label()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4829
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4830
                self.match(PostgreSQLParser.LABEL)
                self.state = 4831
                self.opt_provider()
                self.state = 4832
                self.match(PostgreSQLParser.ON)
                self.state = 4833
                self.match(PostgreSQLParser.COLUMN)
                self.state = 4834
                self.any_name()
                self.state = 4835
                self.match(PostgreSQLParser.IS)
                self.state = 4836
                self.security_label()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4838
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4839
                self.match(PostgreSQLParser.LABEL)
                self.state = 4840
                self.opt_provider()
                self.state = 4841
                self.match(PostgreSQLParser.ON)
                self.state = 4842
                self.object_type_name()
                self.state = 4843
                self.name()
                self.state = 4844
                self.match(PostgreSQLParser.IS)
                self.state = 4845
                self.security_label()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4847
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4848
                self.match(PostgreSQLParser.LABEL)
                self.state = 4849
                self.opt_provider()
                self.state = 4850
                self.match(PostgreSQLParser.ON)
                self.state = 4851
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 4852
                self.typename()
                self.state = 4853
                self.match(PostgreSQLParser.IS)
                self.state = 4854
                self.security_label()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4856
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4857
                self.match(PostgreSQLParser.LABEL)
                self.state = 4858
                self.opt_provider()
                self.state = 4859
                self.match(PostgreSQLParser.ON)
                self.state = 4860
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 4861
                self.typename()
                self.state = 4862
                self.match(PostgreSQLParser.IS)
                self.state = 4863
                self.security_label()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 4865
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4866
                self.match(PostgreSQLParser.LABEL)
                self.state = 4867
                self.opt_provider()
                self.state = 4868
                self.match(PostgreSQLParser.ON)
                self.state = 4869
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 4870
                self.aggregate_with_argtypes()
                self.state = 4871
                self.match(PostgreSQLParser.IS)
                self.state = 4872
                self.security_label()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 4874
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4875
                self.match(PostgreSQLParser.LABEL)
                self.state = 4876
                self.opt_provider()
                self.state = 4877
                self.match(PostgreSQLParser.ON)
                self.state = 4878
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 4879
                self.function_with_argtypes()
                self.state = 4880
                self.match(PostgreSQLParser.IS)
                self.state = 4881
                self.security_label()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 4883
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4884
                self.match(PostgreSQLParser.LABEL)
                self.state = 4885
                self.opt_provider()
                self.state = 4886
                self.match(PostgreSQLParser.ON)
                self.state = 4887
                self.match(PostgreSQLParser.LARGE_P)
                self.state = 4888
                self.match(PostgreSQLParser.OBJECT_P)
                self.state = 4889
                self.numericonly()
                self.state = 4890
                self.match(PostgreSQLParser.IS)
                self.state = 4891
                self.security_label()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 4893
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4894
                self.match(PostgreSQLParser.LABEL)
                self.state = 4895
                self.opt_provider()
                self.state = 4896
                self.match(PostgreSQLParser.ON)
                self.state = 4897
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 4898
                self.function_with_argtypes()
                self.state = 4899
                self.match(PostgreSQLParser.IS)
                self.state = 4900
                self.security_label()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 4902
                self.match(PostgreSQLParser.SECURITY)
                self.state = 4903
                self.match(PostgreSQLParser.LABEL)
                self.state = 4904
                self.opt_provider()
                self.state = 4905
                self.match(PostgreSQLParser.ON)
                self.state = 4906
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 4907
                self.function_with_argtypes()
                self.state = 4908
                self.match(PostgreSQLParser.IS)
                self.state = 4909
                self.security_label()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_providerContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def nonreservedword_or_sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.Nonreservedword_or_sconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_provider

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_provider" ):
                listener.enterOpt_provider(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_provider" ):
                listener.exitOpt_provider(self)




    def opt_provider(self):

        localctx = PostgreSQLParser.Opt_providerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 540, self.RULE_opt_provider)
        try:
            self.state = 4916
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4913
                self.match(PostgreSQLParser.FOR)
                self.state = 4914
                self.nonreservedword_or_sconst()
                pass
            elif token in [80]:
                self.enterOuterAlt(localctx, 2)

                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 Security_labelContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_security_label

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSecurity_label" ):
                listener.enterSecurity_label(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSecurity_label" ):
                listener.exitSecurity_label(self)




    def security_label(self):

        localctx = PostgreSQLParser.Security_labelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 542, self.RULE_security_label)
        try:
            self.state = 4920
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4918
                self.sconst()
                pass
            elif token in [78]:
                self.enterOuterAlt(localctx, 2)
                self.state = 4919
                self.match(PostgreSQLParser.NULL_P)
                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 FetchstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FETCH(self):
            return self.getToken(PostgreSQLParser.FETCH, 0)

        def fetch_args(self):
            return self.getTypedRuleContext(PostgreSQLParser.Fetch_argsContext,0)


        def MOVE(self):
            return self.getToken(PostgreSQLParser.MOVE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_fetchstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFetchstmt" ):
                listener.enterFetchstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFetchstmt" ):
                listener.exitFetchstmt(self)




    def fetchstmt(self):

        localctx = PostgreSQLParser.FetchstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 544, self.RULE_fetchstmt)
        try:
            self.state = 4926
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [61]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4922
                self.match(PostgreSQLParser.FETCH)
                self.state = 4923
                self.fetch_args()
                pass
            elif token in [258]:
                self.enterOuterAlt(localctx, 2)
                self.state = 4924
                self.match(PostgreSQLParser.MOVE)
                self.state = 4925
                self.fetch_args()
                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 Fetch_argsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def cursor_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_nameContext,0)


        def from_in(self):
            return self.getTypedRuleContext(PostgreSQLParser.From_inContext,0)


        def NEXT(self):
            return self.getToken(PostgreSQLParser.NEXT, 0)

        def opt_from_in(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_from_inContext,0)


        def PRIOR(self):
            return self.getToken(PostgreSQLParser.PRIOR, 0)

        def FIRST_P(self):
            return self.getToken(PostgreSQLParser.FIRST_P, 0)

        def LAST_P(self):
            return self.getToken(PostgreSQLParser.LAST_P, 0)

        def ABSOLUTE_P(self):
            return self.getToken(PostgreSQLParser.ABSOLUTE_P, 0)

        def signediconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SignediconstContext,0)


        def RELATIVE_P(self):
            return self.getToken(PostgreSQLParser.RELATIVE_P, 0)

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def FORWARD(self):
            return self.getToken(PostgreSQLParser.FORWARD, 0)

        def BACKWARD(self):
            return self.getToken(PostgreSQLParser.BACKWARD, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_fetch_args

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFetch_args" ):
                listener.enterFetch_args(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFetch_args" ):
                listener.exitFetch_args(self)




    def fetch_args(self):

        localctx = PostgreSQLParser.Fetch_argsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 546, self.RULE_fetch_args)
        try:
            self.state = 4994
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,233,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 4928
                self.cursor_name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 4929
                self.from_in()
                self.state = 4930
                self.cursor_name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 4932
                self.match(PostgreSQLParser.NEXT)
                self.state = 4933
                self.opt_from_in()
                self.state = 4934
                self.cursor_name()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 4936
                self.match(PostgreSQLParser.PRIOR)
                self.state = 4937
                self.opt_from_in()
                self.state = 4938
                self.cursor_name()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 4940
                self.match(PostgreSQLParser.FIRST_P)
                self.state = 4941
                self.opt_from_in()
                self.state = 4942
                self.cursor_name()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 4944
                self.match(PostgreSQLParser.LAST_P)
                self.state = 4945
                self.opt_from_in()
                self.state = 4946
                self.cursor_name()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 4948
                self.match(PostgreSQLParser.ABSOLUTE_P)
                self.state = 4949
                self.signediconst()
                self.state = 4950
                self.opt_from_in()
                self.state = 4951
                self.cursor_name()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 4953
                self.match(PostgreSQLParser.RELATIVE_P)
                self.state = 4954
                self.signediconst()
                self.state = 4955
                self.opt_from_in()
                self.state = 4956
                self.cursor_name()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 4958
                self.signediconst()
                self.state = 4959
                self.opt_from_in()
                self.state = 4960
                self.cursor_name()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 4962
                self.match(PostgreSQLParser.ALL)
                self.state = 4963
                self.opt_from_in()
                self.state = 4964
                self.cursor_name()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 4966
                self.match(PostgreSQLParser.FORWARD)
                self.state = 4967
                self.opt_from_in()
                self.state = 4968
                self.cursor_name()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 4970
                self.match(PostgreSQLParser.FORWARD)
                self.state = 4971
                self.signediconst()
                self.state = 4972
                self.opt_from_in()
                self.state = 4973
                self.cursor_name()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 4975
                self.match(PostgreSQLParser.FORWARD)
                self.state = 4976
                self.match(PostgreSQLParser.ALL)
                self.state = 4977
                self.opt_from_in()
                self.state = 4978
                self.cursor_name()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 4980
                self.match(PostgreSQLParser.BACKWARD)
                self.state = 4981
                self.opt_from_in()
                self.state = 4982
                self.cursor_name()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 4984
                self.match(PostgreSQLParser.BACKWARD)
                self.state = 4985
                self.signediconst()
                self.state = 4986
                self.opt_from_in()
                self.state = 4987
                self.cursor_name()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 4989
                self.match(PostgreSQLParser.BACKWARD)
                self.state = 4990
                self.match(PostgreSQLParser.ALL)
                self.state = 4991
                self.opt_from_in()
                self.state = 4992
                self.cursor_name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class From_inContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_from_in

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFrom_in" ):
                listener.enterFrom_in(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFrom_in" ):
                listener.exitFrom_in(self)




    def from_in(self):

        localctx = PostgreSQLParser.From_inContext(self, self._ctx, self.state)
        self.enterRule(localctx, 548, self.RULE_from_in)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 4996
            _la = self._input.LA(1)
            if not(_la==64 or _la==68):
                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 Opt_from_inContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def from_in(self):
            return self.getTypedRuleContext(PostgreSQLParser.From_inContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_from_in

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_from_in" ):
                listener.enterOpt_from_in(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_from_in" ):
                listener.exitOpt_from_in(self)




    def opt_from_in(self):

        localctx = PostgreSQLParser.Opt_from_inContext(self, self._ctx, self.state)
        self.enterRule(localctx, 550, self.RULE_opt_from_in)
        try:
            self.state = 5000
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [64, 68]:
                self.enterOuterAlt(localctx, 1)
                self.state = 4998
                self.from_in()
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 2)

                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 GrantstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def GRANT(self):
            return self.getToken(PostgreSQLParser.GRANT, 0)

        def privileges(self):
            return self.getTypedRuleContext(PostgreSQLParser.PrivilegesContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def privilege_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Privilege_targetContext,0)


        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def grantee_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Grantee_listContext,0)


        def opt_grant_grant_option(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_grant_grant_optionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_grantstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGrantstmt" ):
                listener.enterGrantstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGrantstmt" ):
                listener.exitGrantstmt(self)




    def grantstmt(self):

        localctx = PostgreSQLParser.GrantstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 552, self.RULE_grantstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5002
            self.match(PostgreSQLParser.GRANT)
            self.state = 5003
            self.privileges()
            self.state = 5004
            self.match(PostgreSQLParser.ON)
            self.state = 5005
            self.privilege_target()
            self.state = 5006
            self.match(PostgreSQLParser.TO)
            self.state = 5007
            self.grantee_list()
            self.state = 5008
            self.opt_grant_grant_option()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RevokestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def REVOKE(self):
            return self.getToken(PostgreSQLParser.REVOKE, 0)

        def privileges(self):
            return self.getTypedRuleContext(PostgreSQLParser.PrivilegesContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def privilege_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Privilege_targetContext,0)


        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def grantee_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Grantee_listContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def GRANT(self):
            return self.getToken(PostgreSQLParser.GRANT, 0)

        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_revokestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRevokestmt" ):
                listener.enterRevokestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRevokestmt" ):
                listener.exitRevokestmt(self)




    def revokestmt(self):

        localctx = PostgreSQLParser.RevokestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 554, self.RULE_revokestmt)
        try:
            self.state = 5029
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,235,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5010
                self.match(PostgreSQLParser.REVOKE)
                self.state = 5011
                self.privileges()
                self.state = 5012
                self.match(PostgreSQLParser.ON)
                self.state = 5013
                self.privilege_target()
                self.state = 5014
                self.match(PostgreSQLParser.FROM)
                self.state = 5015
                self.grantee_list()
                self.state = 5016
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5018
                self.match(PostgreSQLParser.REVOKE)
                self.state = 5019
                self.match(PostgreSQLParser.GRANT)
                self.state = 5020
                self.match(PostgreSQLParser.OPTION)
                self.state = 5021
                self.match(PostgreSQLParser.FOR)
                self.state = 5022
                self.privileges()
                self.state = 5023
                self.match(PostgreSQLParser.ON)
                self.state = 5024
                self.privilege_target()
                self.state = 5025
                self.match(PostgreSQLParser.FROM)
                self.state = 5026
                self.grantee_list()
                self.state = 5027
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PrivilegesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def privilege_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Privilege_listContext,0)


        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def PRIVILEGES(self):
            return self.getToken(PostgreSQLParser.PRIVILEGES, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def columnlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnlistContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_privileges

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPrivileges" ):
                listener.enterPrivileges(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPrivileges" ):
                listener.exitPrivileges(self)




    def privileges(self):

        localctx = PostgreSQLParser.PrivilegesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 556, self.RULE_privileges)
        try:
            self.state = 5046
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,236,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5031
                self.privilege_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5032
                self.match(PostgreSQLParser.ALL)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5033
                self.match(PostgreSQLParser.ALL)
                self.state = 5034
                self.match(PostgreSQLParser.PRIVILEGES)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 5035
                self.match(PostgreSQLParser.ALL)
                self.state = 5036
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5037
                self.columnlist()
                self.state = 5038
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 5040
                self.match(PostgreSQLParser.ALL)
                self.state = 5041
                self.match(PostgreSQLParser.PRIVILEGES)
                self.state = 5042
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5043
                self.columnlist()
                self.state = 5044
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Privilege_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def privilege(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.PrivilegeContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.PrivilegeContext,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_privilege_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPrivilege_list" ):
                listener.enterPrivilege_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPrivilege_list" ):
                listener.exitPrivilege_list(self)




    def privilege_list(self):

        localctx = PostgreSQLParser.Privilege_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 558, self.RULE_privilege_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5048
            self.privilege()
            self.state = 5053
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5049
                self.match(PostgreSQLParser.COMMA)
                self.state = 5050
                self.privilege()
                self.state = 5055
                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 PrivilegeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SELECT(self):
            return self.getToken(PostgreSQLParser.SELECT, 0)

        def opt_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_column_listContext,0)


        def REFERENCES(self):
            return self.getToken(PostgreSQLParser.REFERENCES, 0)

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_privilege

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPrivilege" ):
                listener.enterPrivilege(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPrivilege" ):
                listener.exitPrivilege(self)




    def privilege(self):

        localctx = PostgreSQLParser.PrivilegeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 560, self.RULE_privilege)
        try:
            self.state = 5065
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [88]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5056
                self.match(PostgreSQLParser.SELECT)
                self.state = 5057
                self.opt_column_list()
                pass
            elif token in [86]:
                self.enterOuterAlt(localctx, 2)
                self.state = 5058
                self.match(PostgreSQLParser.REFERENCES)
                self.state = 5059
                self.opt_column_list()
                pass
            elif token in [46]:
                self.enterOuterAlt(localctx, 3)
                self.state = 5060
                self.match(PostgreSQLParser.CREATE)
                self.state = 5061
                self.opt_column_list()
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 4)
                self.state = 5062
                self.colid()
                self.state = 5063
                self.opt_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 Privilege_targetContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def qualified_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_name_listContext,0)


        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def SEQUENCE(self):
            return self.getToken(PostgreSQLParser.SEQUENCE, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def WRAPPER(self):
            return self.getToken(PostgreSQLParser.WRAPPER, 0)

        def name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Name_listContext,0)


        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypes_listContext,0)


        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def any_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_name_listContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def LARGE_P(self):
            return self.getToken(PostgreSQLParser.LARGE_P, 0)

        def OBJECT_P(self):
            return self.getToken(PostgreSQLParser.OBJECT_P, 0)

        def numericonly_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Numericonly_listContext,0)


        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def TABLES(self):
            return self.getToken(PostgreSQLParser.TABLES, 0)

        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def SEQUENCES(self):
            return self.getToken(PostgreSQLParser.SEQUENCES, 0)

        def FUNCTIONS(self):
            return self.getToken(PostgreSQLParser.FUNCTIONS, 0)

        def PROCEDURES(self):
            return self.getToken(PostgreSQLParser.PROCEDURES, 0)

        def ROUTINES(self):
            return self.getToken(PostgreSQLParser.ROUTINES, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_privilege_target

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPrivilege_target" ):
                listener.enterPrivilege_target(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPrivilege_target" ):
                listener.exitPrivilege_target(self)




    def privilege_target(self):

        localctx = PostgreSQLParser.Privilege_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 562, self.RULE_privilege_target)
        try:
            self.state = 5125
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,239,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5067
                self.qualified_name_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5068
                self.match(PostgreSQLParser.TABLE)
                self.state = 5069
                self.qualified_name_list()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5070
                self.match(PostgreSQLParser.SEQUENCE)
                self.state = 5071
                self.qualified_name_list()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 5072
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 5073
                self.match(PostgreSQLParser.DATA_P)
                self.state = 5074
                self.match(PostgreSQLParser.WRAPPER)
                self.state = 5075
                self.name_list()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 5076
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 5077
                self.match(PostgreSQLParser.SERVER)
                self.state = 5078
                self.name_list()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 5079
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5080
                self.function_with_argtypes_list()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 5081
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 5082
                self.function_with_argtypes_list()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 5083
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 5084
                self.function_with_argtypes_list()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 5085
                self.match(PostgreSQLParser.DATABASE)
                self.state = 5086
                self.name_list()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 5087
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 5088
                self.any_name_list()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 5089
                self.match(PostgreSQLParser.LANGUAGE)
                self.state = 5090
                self.name_list()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 5091
                self.match(PostgreSQLParser.LARGE_P)
                self.state = 5092
                self.match(PostgreSQLParser.OBJECT_P)
                self.state = 5093
                self.numericonly_list()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 5094
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 5095
                self.name_list()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 5096
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 5097
                self.name_list()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 5098
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 5099
                self.any_name_list()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 5100
                self.match(PostgreSQLParser.ALL)
                self.state = 5101
                self.match(PostgreSQLParser.TABLES)
                self.state = 5102
                self.match(PostgreSQLParser.IN_P)
                self.state = 5103
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 5104
                self.name_list()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 5105
                self.match(PostgreSQLParser.ALL)
                self.state = 5106
                self.match(PostgreSQLParser.SEQUENCES)
                self.state = 5107
                self.match(PostgreSQLParser.IN_P)
                self.state = 5108
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 5109
                self.name_list()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 5110
                self.match(PostgreSQLParser.ALL)
                self.state = 5111
                self.match(PostgreSQLParser.FUNCTIONS)
                self.state = 5112
                self.match(PostgreSQLParser.IN_P)
                self.state = 5113
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 5114
                self.name_list()
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 5115
                self.match(PostgreSQLParser.ALL)
                self.state = 5116
                self.match(PostgreSQLParser.PROCEDURES)
                self.state = 5117
                self.match(PostgreSQLParser.IN_P)
                self.state = 5118
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 5119
                self.name_list()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 5120
                self.match(PostgreSQLParser.ALL)
                self.state = 5121
                self.match(PostgreSQLParser.ROUTINES)
                self.state = 5122
                self.match(PostgreSQLParser.IN_P)
                self.state = 5123
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 5124
                self.name_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 Grantee_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def grantee(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.GranteeContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.GranteeContext,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_grantee_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGrantee_list" ):
                listener.enterGrantee_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGrantee_list" ):
                listener.exitGrantee_list(self)




    def grantee_list(self):

        localctx = PostgreSQLParser.Grantee_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 564, self.RULE_grantee_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5127
            self.grantee()
            self.state = 5132
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5128
                self.match(PostgreSQLParser.COMMA)
                self.state = 5129
                self.grantee()
                self.state = 5134
                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 GranteeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def GROUP_P(self):
            return self.getToken(PostgreSQLParser.GROUP_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_grantee

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGrantee" ):
                listener.enterGrantee(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGrantee" ):
                listener.exitGrantee(self)




    def grantee(self):

        localctx = PostgreSQLParser.GranteeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 566, self.RULE_grantee)
        try:
            self.state = 5138
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 52, 53, 57, 61, 89, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5135
                self.rolespec()
                pass
            elif token in [66]:
                self.enterOuterAlt(localctx, 2)
                self.state = 5136
                self.match(PostgreSQLParser.GROUP_P)
                self.state = 5137
                self.rolespec()
                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 Opt_grant_grant_optionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def GRANT(self):
            return self.getToken(PostgreSQLParser.GRANT, 0)

        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_grant_grant_option

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_grant_grant_option" ):
                listener.enterOpt_grant_grant_option(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_grant_grant_option" ):
                listener.exitOpt_grant_grant_option(self)




    def opt_grant_grant_option(self):

        localctx = PostgreSQLParser.Opt_grant_grant_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 568, self.RULE_opt_grant_grant_option)
        try:
            self.state = 5144
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,242,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5140
                self.match(PostgreSQLParser.WITH)
                self.state = 5141
                self.match(PostgreSQLParser.GRANT)
                self.state = 5142
                self.match(PostgreSQLParser.OPTION)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class GrantrolestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def GRANT(self):
            return self.getToken(PostgreSQLParser.GRANT, 0)

        def privilege_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Privilege_listContext,0)


        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


        def opt_grant_admin_option(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_grant_admin_optionContext,0)


        def opt_granted_by(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_granted_byContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_grantrolestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGrantrolestmt" ):
                listener.enterGrantrolestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGrantrolestmt" ):
                listener.exitGrantrolestmt(self)




    def grantrolestmt(self):

        localctx = PostgreSQLParser.GrantrolestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 570, self.RULE_grantrolestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5146
            self.match(PostgreSQLParser.GRANT)
            self.state = 5147
            self.privilege_list()
            self.state = 5148
            self.match(PostgreSQLParser.TO)
            self.state = 5149
            self.role_list()
            self.state = 5150
            self.opt_grant_admin_option()
            self.state = 5151
            self.opt_granted_by()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RevokerolestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def REVOKE(self):
            return self.getToken(PostgreSQLParser.REVOKE, 0)

        def privilege_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Privilege_listContext,0)


        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


        def opt_granted_by(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_granted_byContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def ADMIN(self):
            return self.getToken(PostgreSQLParser.ADMIN, 0)

        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_revokerolestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRevokerolestmt" ):
                listener.enterRevokerolestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRevokerolestmt" ):
                listener.exitRevokerolestmt(self)




    def revokerolestmt(self):

        localctx = PostgreSQLParser.RevokerolestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 572, self.RULE_revokerolestmt)
        try:
            self.state = 5170
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,243,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5153
                self.match(PostgreSQLParser.REVOKE)
                self.state = 5154
                self.privilege_list()
                self.state = 5155
                self.match(PostgreSQLParser.FROM)
                self.state = 5156
                self.role_list()
                self.state = 5157
                self.opt_granted_by()
                self.state = 5158
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5160
                self.match(PostgreSQLParser.REVOKE)
                self.state = 5161
                self.match(PostgreSQLParser.ADMIN)
                self.state = 5162
                self.match(PostgreSQLParser.OPTION)
                self.state = 5163
                self.match(PostgreSQLParser.FOR)
                self.state = 5164
                self.privilege_list()
                self.state = 5165
                self.match(PostgreSQLParser.FROM)
                self.state = 5166
                self.role_list()
                self.state = 5167
                self.opt_granted_by()
                self.state = 5168
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_grant_admin_optionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def ADMIN(self):
            return self.getToken(PostgreSQLParser.ADMIN, 0)

        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_grant_admin_option

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_grant_admin_option" ):
                listener.enterOpt_grant_admin_option(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_grant_admin_option" ):
                listener.exitOpt_grant_admin_option(self)




    def opt_grant_admin_option(self):

        localctx = PostgreSQLParser.Opt_grant_admin_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 574, self.RULE_opt_grant_admin_option)
        try:
            self.state = 5176
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,244,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5172
                self.match(PostgreSQLParser.WITH)
                self.state = 5173
                self.match(PostgreSQLParser.ADMIN)
                self.state = 5174
                self.match(PostgreSQLParser.OPTION)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_granted_byContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def GRANTED(self):
            return self.getToken(PostgreSQLParser.GRANTED, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_granted_by

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_granted_by" ):
                listener.enterOpt_granted_by(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_granted_by" ):
                listener.exitOpt_granted_by(self)




    def opt_granted_by(self):

        localctx = PostgreSQLParser.Opt_granted_byContext(self, self._ctx, self.state)
        self.enterRule(localctx, 576, self.RULE_opt_granted_by)
        try:
            self.state = 5182
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [214]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5178
                self.match(PostgreSQLParser.GRANTED)
                self.state = 5179
                self.match(PostgreSQLParser.BY)
                self.state = 5180
                self.rolespec()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 150, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 308, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 AlterdefaultprivilegesstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def PRIVILEGES(self):
            return self.getToken(PostgreSQLParser.PRIVILEGES, 0)

        def defacloptionlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.DefacloptionlistContext,0)


        def defaclaction(self):
            return self.getTypedRuleContext(PostgreSQLParser.DefaclactionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterdefaultprivilegesstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterdefaultprivilegesstmt" ):
                listener.enterAlterdefaultprivilegesstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterdefaultprivilegesstmt" ):
                listener.exitAlterdefaultprivilegesstmt(self)




    def alterdefaultprivilegesstmt(self):

        localctx = PostgreSQLParser.AlterdefaultprivilegesstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 578, self.RULE_alterdefaultprivilegesstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5184
            self.match(PostgreSQLParser.ALTER)
            self.state = 5185
            self.match(PostgreSQLParser.DEFAULT)
            self.state = 5186
            self.match(PostgreSQLParser.PRIVILEGES)
            self.state = 5187
            self.defacloptionlist()
            self.state = 5188
            self.defaclaction()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DefacloptionlistContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def defacloption(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.DefacloptionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.DefacloptionContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_defacloptionlist

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDefacloptionlist" ):
                listener.enterDefacloptionlist(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDefacloptionlist" ):
                listener.exitDefacloptionlist(self)




    def defacloptionlist(self):

        localctx = PostgreSQLParser.DefacloptionlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 580, self.RULE_defacloptionlist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5193
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==62 or _la==68:
                self.state = 5190
                self.defacloption()
                self.state = 5195
                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 DefacloptionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Name_listContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def ROLE(self):
            return self.getToken(PostgreSQLParser.ROLE, 0)

        def role_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Role_listContext,0)


        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_defacloption

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDefacloption" ):
                listener.enterDefacloption(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDefacloption" ):
                listener.exitDefacloption(self)




    def defacloption(self):

        localctx = PostgreSQLParser.DefacloptionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 582, self.RULE_defacloption)
        try:
            self.state = 5205
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,247,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5196
                self.match(PostgreSQLParser.IN_P)
                self.state = 5197
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 5198
                self.name_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5199
                self.match(PostgreSQLParser.FOR)
                self.state = 5200
                self.match(PostgreSQLParser.ROLE)
                self.state = 5201
                self.role_list()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5202
                self.match(PostgreSQLParser.FOR)
                self.state = 5203
                self.match(PostgreSQLParser.USER)
                self.state = 5204
                self.role_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 DefaclactionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def GRANT(self):
            return self.getToken(PostgreSQLParser.GRANT, 0)

        def privileges(self):
            return self.getTypedRuleContext(PostgreSQLParser.PrivilegesContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def defacl_privilege_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Defacl_privilege_targetContext,0)


        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def grantee_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Grantee_listContext,0)


        def opt_grant_grant_option(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_grant_grant_optionContext,0)


        def REVOKE(self):
            return self.getToken(PostgreSQLParser.REVOKE, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_defaclaction

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDefaclaction" ):
                listener.enterDefaclaction(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDefaclaction" ):
                listener.exitDefaclaction(self)




    def defaclaction(self):

        localctx = PostgreSQLParser.DefaclactionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 584, self.RULE_defaclaction)
        try:
            self.state = 5234
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,248,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5207
                self.match(PostgreSQLParser.GRANT)
                self.state = 5208
                self.privileges()
                self.state = 5209
                self.match(PostgreSQLParser.ON)
                self.state = 5210
                self.defacl_privilege_target()
                self.state = 5211
                self.match(PostgreSQLParser.TO)
                self.state = 5212
                self.grantee_list()
                self.state = 5213
                self.opt_grant_grant_option()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5215
                self.match(PostgreSQLParser.REVOKE)
                self.state = 5216
                self.privileges()
                self.state = 5217
                self.match(PostgreSQLParser.ON)
                self.state = 5218
                self.defacl_privilege_target()
                self.state = 5219
                self.match(PostgreSQLParser.FROM)
                self.state = 5220
                self.grantee_list()
                self.state = 5221
                self.opt_drop_behavior()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5223
                self.match(PostgreSQLParser.REVOKE)
                self.state = 5224
                self.match(PostgreSQLParser.GRANT)
                self.state = 5225
                self.match(PostgreSQLParser.OPTION)
                self.state = 5226
                self.match(PostgreSQLParser.FOR)
                self.state = 5227
                self.privileges()
                self.state = 5228
                self.match(PostgreSQLParser.ON)
                self.state = 5229
                self.defacl_privilege_target()
                self.state = 5230
                self.match(PostgreSQLParser.FROM)
                self.state = 5231
                self.grantee_list()
                self.state = 5232
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Defacl_privilege_targetContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TABLES(self):
            return self.getToken(PostgreSQLParser.TABLES, 0)

        def FUNCTIONS(self):
            return self.getToken(PostgreSQLParser.FUNCTIONS, 0)

        def ROUTINES(self):
            return self.getToken(PostgreSQLParser.ROUTINES, 0)

        def SEQUENCES(self):
            return self.getToken(PostgreSQLParser.SEQUENCES, 0)

        def TYPES_P(self):
            return self.getToken(PostgreSQLParser.TYPES_P, 0)

        def SCHEMAS(self):
            return self.getToken(PostgreSQLParser.SCHEMAS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_defacl_privilege_target

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDefacl_privilege_target" ):
                listener.enterDefacl_privilege_target(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDefacl_privilege_target" ):
                listener.exitDefacl_privilege_target(self)




    def defacl_privilege_target(self):

        localctx = PostgreSQLParser.Defacl_privilege_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 586, self.RULE_defacl_privilege_target)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5236
            _la = self._input.LA(1)
            if not(_la==212 or ((((_la - 322)) & ~0x3f) == 0 and ((1 << (_la - 322)) & 4297064449) != 0) or _la==455 or _la==456):
                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 IndexstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opt_unique(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_uniqueContext,0)


        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def opt_concurrently(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_concurrentlyContext,0)


        def opt_index_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_index_nameContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def relation_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_exprContext,0)


        def access_method_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Access_method_clauseContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def index_params(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_paramsContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def opt_include(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_includeContext,0)


        def opt_reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_reloptionsContext,0)


        def opttablespace(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttablespaceContext,0)


        def where_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_clauseContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_indexstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIndexstmt" ):
                listener.enterIndexstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIndexstmt" ):
                listener.exitIndexstmt(self)




    def indexstmt(self):

        localctx = PostgreSQLParser.IndexstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 588, self.RULE_indexstmt)
        try:
            self.state = 5273
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,249,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5238
                self.match(PostgreSQLParser.CREATE)
                self.state = 5239
                self.opt_unique()
                self.state = 5240
                self.match(PostgreSQLParser.INDEX)
                self.state = 5241
                self.opt_concurrently()
                self.state = 5242
                self.opt_index_name()
                self.state = 5243
                self.match(PostgreSQLParser.ON)
                self.state = 5244
                self.relation_expr()
                self.state = 5245
                self.access_method_clause()
                self.state = 5246
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5247
                self.index_params()
                self.state = 5248
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 5249
                self.opt_include()
                self.state = 5250
                self.opt_reloptions()
                self.state = 5251
                self.opttablespace()
                self.state = 5252
                self.where_clause()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5254
                self.match(PostgreSQLParser.CREATE)
                self.state = 5255
                self.opt_unique()
                self.state = 5256
                self.match(PostgreSQLParser.INDEX)
                self.state = 5257
                self.opt_concurrently()
                self.state = 5258
                self.match(PostgreSQLParser.IF_P)
                self.state = 5259
                self.match(PostgreSQLParser.NOT)
                self.state = 5260
                self.match(PostgreSQLParser.EXISTS)
                self.state = 5261
                self.name()
                self.state = 5262
                self.match(PostgreSQLParser.ON)
                self.state = 5263
                self.relation_expr()
                self.state = 5264
                self.access_method_clause()
                self.state = 5265
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5266
                self.index_params()
                self.state = 5267
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 5268
                self.opt_include()
                self.state = 5269
                self.opt_reloptions()
                self.state = 5270
                self.opttablespace()
                self.state = 5271
                self.where_clause()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_uniqueContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def UNIQUE(self):
            return self.getToken(PostgreSQLParser.UNIQUE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_unique

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_unique" ):
                listener.enterOpt_unique(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_unique" ):
                listener.exitOpt_unique(self)




    def opt_unique(self):

        localctx = PostgreSQLParser.Opt_uniqueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 590, self.RULE_opt_unique)
        try:
            self.state = 5277
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [98]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5275
                self.match(PostgreSQLParser.UNIQUE)
                pass
            elif token in [226]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_concurrentlyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CONCURRENTLY(self):
            return self.getToken(PostgreSQLParser.CONCURRENTLY, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_concurrently

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_concurrently" ):
                listener.enterOpt_concurrently(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_concurrently" ):
                listener.exitOpt_concurrently(self)




    def opt_concurrently(self):

        localctx = PostgreSQLParser.Opt_concurrentlyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 592, self.RULE_opt_concurrently)
        try:
            self.state = 5281
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [109]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5279
                self.match(PostgreSQLParser.CONCURRENTLY)
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 80, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_index_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_index_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_index_name" ):
                listener.enterOpt_index_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_index_name" ):
                listener.exitOpt_index_name(self)




    def opt_index_name(self):

        localctx = PostgreSQLParser.Opt_index_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 594, self.RULE_opt_index_name)
        try:
            self.state = 5285
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5283
                self.name()
                pass
            elif token in [80]:
                self.enterOuterAlt(localctx, 2)

                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 Access_method_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_access_method_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAccess_method_clause" ):
                listener.enterAccess_method_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAccess_method_clause" ):
                listener.exitAccess_method_clause(self)




    def access_method_clause(self):

        localctx = PostgreSQLParser.Access_method_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 596, self.RULE_access_method_clause)
        try:
            self.state = 5290
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5287
                self.match(PostgreSQLParser.USING)
                self.state = 5288
                self.name()
                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 2)

                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_paramsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def index_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Index_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Index_elemContext,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_params

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIndex_params" ):
                listener.enterIndex_params(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIndex_params" ):
                listener.exitIndex_params(self)




    def index_params(self):

        localctx = PostgreSQLParser.Index_paramsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 598, self.RULE_index_params)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5292
            self.index_elem()
            self.state = 5297
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5293
                self.match(PostgreSQLParser.COMMA)
                self.state = 5294
                self.index_elem()
                self.state = 5299
                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_elem_optionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_collate(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_collateContext,0)


        def opt_class(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_classContext,0)


        def opt_asc_desc(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_asc_descContext,0)


        def opt_nulls_order(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_nulls_orderContext,0)


        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.ReloptionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_index_elem_options

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIndex_elem_options" ):
                listener.enterIndex_elem_options(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIndex_elem_options" ):
                listener.exitIndex_elem_options(self)




    def index_elem_options(self):

        localctx = PostgreSQLParser.Index_elem_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 600, self.RULE_index_elem_options)
        try:
            self.state = 5311
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,255,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5300
                self.opt_collate()
                self.state = 5301
                self.opt_class()
                self.state = 5302
                self.opt_asc_desc()
                self.state = 5303
                self.opt_nulls_order()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5305
                self.opt_collate()
                self.state = 5306
                self.any_name()
                self.state = 5307
                self.reloptions()
                self.state = 5308
                self.opt_asc_desc()
                self.state = 5309
                self.opt_nulls_order()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Index_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def index_elem_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_elem_optionsContext,0)


        def func_expr_windowless(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_expr_windowlessContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_index_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIndex_elem" ):
                listener.enterIndex_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIndex_elem" ):
                listener.exitIndex_elem(self)




    def index_elem(self):

        localctx = PostgreSQLParser.Index_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 602, self.RULE_index_elem)
        try:
            self.state = 5324
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,256,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5313
                self.colid()
                self.state = 5314
                self.index_elem_options()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5316
                self.func_expr_windowless()
                self.state = 5317
                self.index_elem_options()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5319
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5320
                self.a_expr()
                self.state = 5321
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 5322
                self.index_elem_options()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_includeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INCLUDE(self):
            return self.getToken(PostgreSQLParser.INCLUDE, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def index_including_params(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_including_paramsContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_include

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_include" ):
                listener.enterOpt_include(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_include" ):
                listener.exitOpt_include(self)




    def opt_include(self):

        localctx = PostgreSQLParser.Opt_includeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 604, self.RULE_opt_include)
        try:
            self.state = 5332
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [441]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5326
                self.match(PostgreSQLParser.INCLUDE)
                self.state = 5327
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5328
                self.index_including_params()
                self.state = 5329
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 103, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 344, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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_including_paramsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def index_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Index_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Index_elemContext,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_including_params

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIndex_including_params" ):
                listener.enterIndex_including_params(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIndex_including_params" ):
                listener.exitIndex_including_params(self)




    def index_including_params(self):

        localctx = PostgreSQLParser.Index_including_paramsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 606, self.RULE_index_including_params)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5334
            self.index_elem()
            self.state = 5339
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5335
                self.match(PostgreSQLParser.COMMA)
                self.state = 5336
                self.index_elem()
                self.state = 5341
                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 Opt_collateContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COLLATE(self):
            return self.getToken(PostgreSQLParser.COLLATE, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_collate

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_collate" ):
                listener.enterOpt_collate(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_collate" ):
                listener.exitOpt_collate(self)




    def opt_collate(self):

        localctx = PostgreSQLParser.Opt_collateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 608, self.RULE_opt_collate)
        try:
            self.state = 5345
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,259,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5342
                self.match(PostgreSQLParser.COLLATE)
                self.state = 5343
                self.any_name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_classContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_class

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_class" ):
                listener.enterOpt_class(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_class" ):
                listener.exitOpt_class(self)




    def opt_class(self):

        localctx = PostgreSQLParser.Opt_classContext(self, self._ctx, self.state)
        self.enterRule(localctx, 610, self.RULE_opt_class)
        try:
            self.state = 5349
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,260,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5347
                self.any_name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_asc_descContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ASC(self):
            return self.getToken(PostgreSQLParser.ASC, 0)

        def DESC(self):
            return self.getToken(PostgreSQLParser.DESC, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_asc_desc

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_asc_desc" ):
                listener.enterOpt_asc_desc(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_asc_desc" ):
                listener.exitOpt_asc_desc(self)




    def opt_asc_desc(self):

        localctx = PostgreSQLParser.Opt_asc_descContext(self, self._ctx, self.state)
        self.enterRule(localctx, 612, self.RULE_opt_asc_desc)
        try:
            self.state = 5354
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [37]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5351
                self.match(PostgreSQLParser.ASC)
                pass
            elif token in [55]:
                self.enterOuterAlt(localctx, 2)
                self.state = 5352
                self.match(PostgreSQLParser.DESC)
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 57, 61, 62, 65, 71, 74, 79, 80, 87, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 266, 283, 292, 294, 298, 299, 301, 306, 310, 312, 313, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 481, 519, 668]:
                self.enterOuterAlt(localctx, 3)

                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 Opt_nulls_orderContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NULLS_P(self):
            return self.getToken(PostgreSQLParser.NULLS_P, 0)

        def FIRST_P(self):
            return self.getToken(PostgreSQLParser.FIRST_P, 0)

        def LAST_P(self):
            return self.getToken(PostgreSQLParser.LAST_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_nulls_order

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_nulls_order" ):
                listener.enterOpt_nulls_order(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_nulls_order" ):
                listener.exitOpt_nulls_order(self)




    def opt_nulls_order(self):

        localctx = PostgreSQLParser.Opt_nulls_orderContext(self, self._ctx, self.state)
        self.enterRule(localctx, 614, self.RULE_opt_nulls_order)
        try:
            self.state = 5361
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,262,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5356
                self.match(PostgreSQLParser.NULLS_P)
                self.state = 5357
                self.match(PostgreSQLParser.FIRST_P)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5358
                self.match(PostgreSQLParser.NULLS_P)
                self.state = 5359
                self.match(PostgreSQLParser.LAST_P)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatefunctionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opt_or_replace(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_or_replaceContext,0)


        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def func_args_with_defaults(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_args_with_defaultsContext,0)


        def createfunc_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Createfunc_opt_listContext,0)


        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def RETURNS(self):
            return self.getToken(PostgreSQLParser.RETURNS, 0)

        def func_return(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_returnContext,0)


        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def table_func_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_func_column_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createfunctionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatefunctionstmt" ):
                listener.enterCreatefunctionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatefunctionstmt" ):
                listener.exitCreatefunctionstmt(self)




    def createfunctionstmt(self):

        localctx = PostgreSQLParser.CreatefunctionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 616, self.RULE_createfunctionstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5363
            self.match(PostgreSQLParser.CREATE)
            self.state = 5364
            self.opt_or_replace()
            self.state = 5365
            _la = self._input.LA(1)
            if not(_la==211 or _la==289):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 5366
            self.func_name()
            self.state = 5367
            self.func_args_with_defaults()
            self.state = 5377
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,264,self._ctx)
            if la_ == 1:
                self.state = 5368
                self.match(PostgreSQLParser.RETURNS)
                self.state = 5375
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,263,self._ctx)
                if la_ == 1:
                    self.state = 5369
                    self.func_return()
                    pass

                elif la_ == 2:
                    self.state = 5370
                    self.match(PostgreSQLParser.TABLE)
                    self.state = 5371
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 5372
                    self.table_func_column_list()
                    self.state = 5373
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    pass




            self.state = 5379
            self.createfunc_opt_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_or_replaceContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OR(self):
            return self.getToken(PostgreSQLParser.OR, 0)

        def REPLACE(self):
            return self.getToken(PostgreSQLParser.REPLACE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_or_replace

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_or_replace" ):
                listener.enterOpt_or_replace(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_or_replace" ):
                listener.exitOpt_or_replace(self)




    def opt_or_replace(self):

        localctx = PostgreSQLParser.Opt_or_replaceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 618, self.RULE_opt_or_replace)
        try:
            self.state = 5384
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [82]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5381
                self.match(PostgreSQLParser.OR)
                self.state = 5382
                self.match(PostgreSQLParser.REPLACE)
                pass
            elif token in [136, 211, 238, 288, 289, 314, 352, 443]:
                self.enterOuterAlt(localctx, 2)

                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 Func_argsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def func_args_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_args_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_args

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_args" ):
                listener.enterFunc_args(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_args" ):
                listener.exitFunc_args(self)




    def func_args(self):

        localctx = PostgreSQLParser.Func_argsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 620, self.RULE_func_args)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5386
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 5388
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 33)) & ~0x3f) == 0 and ((1 << (_la - 33)) & 576460786949430277) != 0) or ((((_la - 101)) & ~0x3f) == 0 and ((1 << (_la - 101)) & -31) != 0) or ((((_la - 165)) & ~0x3f) == 0 and ((1 << (_la - 165)) & -1) != 0) or ((((_la - 229)) & ~0x3f) == 0 and ((1 << (_la - 229)) & -18874369) != 0) or ((((_la - 293)) & ~0x3f) == 0 and ((1 << (_la - 293)) & -1) != 0) or ((((_la - 357)) & ~0x3f) == 0 and ((1 << (_la - 357)) & -1) != 0) or ((((_la - 421)) & ~0x3f) == 0 and ((1 << (_la - 421)) & -8589934593) != 0) or ((((_la - 485)) & ~0x3f) == 0 and ((1 << (_la - 485)) & -17181179905) != 0) or ((((_la - 549)) & ~0x3f) == 0 and ((1 << (_la - 549)) & -1) != 0) or ((((_la - 613)) & ~0x3f) == 0 and ((1 << (_la - 613)) & 844425232121855) != 0):
                self.state = 5387
                self.func_args_list()


            self.state = 5390
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_args_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_arg(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Func_argContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Func_argContext,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_func_args_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_args_list" ):
                listener.enterFunc_args_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_args_list" ):
                listener.exitFunc_args_list(self)




    def func_args_list(self):

        localctx = PostgreSQLParser.Func_args_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 622, self.RULE_func_args_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5392
            self.func_arg()
            self.state = 5397
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5393
                self.match(PostgreSQLParser.COMMA)
                self.state = 5394
                self.func_arg()
                self.state = 5399
                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 Function_with_argtypes_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def function_with_argtypes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Function_with_argtypesContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,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_function_with_argtypes_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunction_with_argtypes_list" ):
                listener.enterFunction_with_argtypes_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunction_with_argtypes_list" ):
                listener.exitFunction_with_argtypes_list(self)




    def function_with_argtypes_list(self):

        localctx = PostgreSQLParser.Function_with_argtypes_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 624, self.RULE_function_with_argtypes_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5400
            self.function_with_argtypes()
            self.state = 5405
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5401
                self.match(PostgreSQLParser.COMMA)
                self.state = 5402
                self.function_with_argtypes()
                self.state = 5407
                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 Function_with_argtypesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def func_args(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_argsContext,0)


        def type_func_name_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_func_name_keywordContext,0)


        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def indirection(self):
            return self.getTypedRuleContext(PostgreSQLParser.IndirectionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_function_with_argtypes

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunction_with_argtypes" ):
                listener.enterFunction_with_argtypes(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunction_with_argtypes" ):
                listener.exitFunction_with_argtypes(self)




    def function_with_argtypes(self):

        localctx = PostgreSQLParser.Function_with_argtypesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 626, self.RULE_function_with_argtypes)
        self._la = 0 # Token type
        try:
            self.state = 5416
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,270,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5408
                self.func_name()
                self.state = 5409
                self.func_args()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5411
                self.type_func_name_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5412
                self.colid()
                self.state = 5414
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==4 or _la==11:
                    self.state = 5413
                    self.indirection()


                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_args_with_defaultsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def func_args_with_defaults_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_args_with_defaults_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_args_with_defaults

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_args_with_defaults" ):
                listener.enterFunc_args_with_defaults(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_args_with_defaults" ):
                listener.exitFunc_args_with_defaults(self)




    def func_args_with_defaults(self):

        localctx = PostgreSQLParser.Func_args_with_defaultsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 628, self.RULE_func_args_with_defaults)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5418
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 5420
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 33)) & ~0x3f) == 0 and ((1 << (_la - 33)) & 576460786949430277) != 0) or ((((_la - 101)) & ~0x3f) == 0 and ((1 << (_la - 101)) & -31) != 0) or ((((_la - 165)) & ~0x3f) == 0 and ((1 << (_la - 165)) & -1) != 0) or ((((_la - 229)) & ~0x3f) == 0 and ((1 << (_la - 229)) & -18874369) != 0) or ((((_la - 293)) & ~0x3f) == 0 and ((1 << (_la - 293)) & -1) != 0) or ((((_la - 357)) & ~0x3f) == 0 and ((1 << (_la - 357)) & -1) != 0) or ((((_la - 421)) & ~0x3f) == 0 and ((1 << (_la - 421)) & -8589934593) != 0) or ((((_la - 485)) & ~0x3f) == 0 and ((1 << (_la - 485)) & -17181179905) != 0) or ((((_la - 549)) & ~0x3f) == 0 and ((1 << (_la - 549)) & -1) != 0) or ((((_la - 613)) & ~0x3f) == 0 and ((1 << (_la - 613)) & 844425232121855) != 0):
                self.state = 5419
                self.func_args_with_defaults_list()


            self.state = 5422
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_args_with_defaults_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_arg_with_default(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Func_arg_with_defaultContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Func_arg_with_defaultContext,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_func_args_with_defaults_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_args_with_defaults_list" ):
                listener.enterFunc_args_with_defaults_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_args_with_defaults_list" ):
                listener.exitFunc_args_with_defaults_list(self)




    def func_args_with_defaults_list(self):

        localctx = PostgreSQLParser.Func_args_with_defaults_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 630, self.RULE_func_args_with_defaults_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5424
            self.func_arg_with_default()
            self.state = 5429
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5425
                self.match(PostgreSQLParser.COMMA)
                self.state = 5426
                self.func_arg_with_default()
                self.state = 5431
                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 Func_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def arg_class(self):
            return self.getTypedRuleContext(PostgreSQLParser.Arg_classContext,0)


        def func_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_typeContext,0)


        def param_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Param_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_arg" ):
                listener.enterFunc_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_arg" ):
                listener.exitFunc_arg(self)




    def func_arg(self):

        localctx = PostgreSQLParser.Func_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 632, self.RULE_func_arg)
        try:
            self.state = 5445
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,275,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5432
                self.arg_class()
                self.state = 5434
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,273,self._ctx)
                if la_ == 1:
                    self.state = 5433
                    self.param_name()


                self.state = 5436
                self.func_type()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5438
                self.param_name()
                self.state = 5440
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,274,self._ctx)
                if la_ == 1:
                    self.state = 5439
                    self.arg_class()


                self.state = 5442
                self.func_type()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5444
                self.func_type()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Arg_classContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def OUT_P(self):
            return self.getToken(PostgreSQLParser.OUT_P, 0)

        def INOUT(self):
            return self.getToken(PostgreSQLParser.INOUT, 0)

        def VARIADIC(self):
            return self.getToken(PostgreSQLParser.VARIADIC, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_arg_class

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterArg_class" ):
                listener.enterArg_class(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitArg_class" ):
                listener.exitArg_class(self)




    def arg_class(self):

        localctx = PostgreSQLParser.Arg_classContext(self, self._ctx, self.state)
        self.enterRule(localctx, 634, self.RULE_arg_class)
        try:
            self.state = 5454
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [68]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5447
                self.match(PostgreSQLParser.IN_P)
                self.state = 5449
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,276,self._ctx)
                if la_ == 1:
                    self.state = 5448
                    self.match(PostgreSQLParser.OUT_P)


                pass
            elif token in [453]:
                self.enterOuterAlt(localctx, 2)
                self.state = 5451
                self.match(PostgreSQLParser.OUT_P)
                pass
            elif token in [393]:
                self.enterOuterAlt(localctx, 3)
                self.state = 5452
                self.match(PostgreSQLParser.INOUT)
                pass
            elif token in [101]:
                self.enterOuterAlt(localctx, 4)
                self.state = 5453
                self.match(PostgreSQLParser.VARIADIC)
                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 Param_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def type_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_function_nameContext,0)


        def builtin_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Builtin_function_nameContext,0)


        def LEFT(self):
            return self.getToken(PostgreSQLParser.LEFT, 0)

        def RIGHT(self):
            return self.getToken(PostgreSQLParser.RIGHT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_param_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterParam_name" ):
                listener.enterParam_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitParam_name" ):
                listener.exitParam_name(self)




    def param_name(self):

        localctx = PostgreSQLParser.Param_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 636, self.RULE_param_name)
        try:
            self.state = 5460
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 471, 472, 473, 475, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5456
                self.type_function_name()
                pass
            elif token in [304, 418, 419, 420, 421, 422, 423, 424, 504, 513, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635]:
                self.enterOuterAlt(localctx, 2)
                self.state = 5457
                self.builtin_function_name()
                pass
            elif token in [119]:
                self.enterOuterAlt(localctx, 3)
                self.state = 5458
                self.match(PostgreSQLParser.LEFT)
                pass
            elif token in [126]:
                self.enterOuterAlt(localctx, 4)
                self.state = 5459
                self.match(PostgreSQLParser.RIGHT)
                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 Func_returnContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_typeContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_return

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_return" ):
                listener.enterFunc_return(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_return" ):
                listener.exitFunc_return(self)




    def func_return(self):

        localctx = PostgreSQLParser.Func_returnContext(self, self._ctx, self.state)
        self.enterRule(localctx, 638, self.RULE_func_return)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5462
            self.func_type()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def attrs(self):
            return self.getTypedRuleContext(PostgreSQLParser.AttrsContext,0)


        def PERCENT(self):
            return self.getToken(PostgreSQLParser.PERCENT, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def builtin_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Builtin_function_nameContext,0)


        def type_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_function_nameContext,0)


        def LEFT(self):
            return self.getToken(PostgreSQLParser.LEFT, 0)

        def RIGHT(self):
            return self.getToken(PostgreSQLParser.RIGHT, 0)

        def SETOF(self):
            return self.getToken(PostgreSQLParser.SETOF, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_type" ):
                listener.enterFunc_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_type" ):
                listener.exitFunc_type(self)




    def func_type(self):

        localctx = PostgreSQLParser.Func_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 640, self.RULE_func_type)
        self._la = 0 # Token type
        try:
            self.state = 5478
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,281,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5464
                self.typename()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5466
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==408:
                    self.state = 5465
                    self.match(PostgreSQLParser.SETOF)


                self.state = 5472
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [304, 418, 419, 420, 421, 422, 423, 424, 504, 513, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635]:
                    self.state = 5468
                    self.builtin_function_name()
                    pass
                elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 471, 472, 473, 475, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520, 636, 637, 641, 661, 662]:
                    self.state = 5469
                    self.type_function_name()
                    pass
                elif token in [119]:
                    self.state = 5470
                    self.match(PostgreSQLParser.LEFT)
                    pass
                elif token in [126]:
                    self.state = 5471
                    self.match(PostgreSQLParser.RIGHT)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 5474
                self.attrs()
                self.state = 5475
                self.match(PostgreSQLParser.PERCENT)
                self.state = 5476
                self.match(PostgreSQLParser.TYPE_P)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_arg_with_defaultContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_argContext,0)


        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_arg_with_default

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_arg_with_default" ):
                listener.enterFunc_arg_with_default(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_arg_with_default" ):
                listener.exitFunc_arg_with_default(self)




    def func_arg_with_default(self):

        localctx = PostgreSQLParser.Func_arg_with_defaultContext(self, self._ctx, self.state)
        self.enterRule(localctx, 642, self.RULE_func_arg_with_default)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5480
            self.func_arg()
            self.state = 5483
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==10 or _la==53:
                self.state = 5481
                _la = self._input.LA(1)
                if not(_la==10 or _la==53):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 5482
                self.a_expr()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Aggr_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_argContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_aggr_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAggr_arg" ):
                listener.enterAggr_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAggr_arg" ):
                listener.exitAggr_arg(self)




    def aggr_arg(self):

        localctx = PostgreSQLParser.Aggr_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 644, self.RULE_aggr_arg)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5485
            self.func_arg()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Aggr_argsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def STAR(self):
            return self.getToken(PostgreSQLParser.STAR, 0)

        def aggr_args_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Aggr_args_listContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Aggr_args_listContext,i)


        def ORDER(self):
            return self.getToken(PostgreSQLParser.ORDER, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_aggr_args

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAggr_args" ):
                listener.enterAggr_args(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAggr_args" ):
                listener.exitAggr_args(self)




    def aggr_args(self):

        localctx = PostgreSQLParser.Aggr_argsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 646, self.RULE_aggr_args)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5487
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 5498
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,283,self._ctx)
            if la_ == 1:
                self.state = 5488
                self.match(PostgreSQLParser.STAR)
                pass

            elif la_ == 2:
                self.state = 5489
                self.aggr_args_list()
                pass

            elif la_ == 3:
                self.state = 5490
                self.match(PostgreSQLParser.ORDER)
                self.state = 5491
                self.match(PostgreSQLParser.BY)
                self.state = 5492
                self.aggr_args_list()
                pass

            elif la_ == 4:
                self.state = 5493
                self.aggr_args_list()
                self.state = 5494
                self.match(PostgreSQLParser.ORDER)
                self.state = 5495
                self.match(PostgreSQLParser.BY)
                self.state = 5496
                self.aggr_args_list()
                pass


            self.state = 5500
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Aggr_args_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def aggr_arg(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Aggr_argContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Aggr_argContext,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_aggr_args_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAggr_args_list" ):
                listener.enterAggr_args_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAggr_args_list" ):
                listener.exitAggr_args_list(self)




    def aggr_args_list(self):

        localctx = PostgreSQLParser.Aggr_args_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 648, self.RULE_aggr_args_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5502
            self.aggr_arg()
            self.state = 5507
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5503
                self.match(PostgreSQLParser.COMMA)
                self.state = 5504
                self.aggr_arg()
                self.state = 5509
                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 Aggregate_with_argtypesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def aggr_args(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggr_argsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_aggregate_with_argtypes

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAggregate_with_argtypes" ):
                listener.enterAggregate_with_argtypes(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAggregate_with_argtypes" ):
                listener.exitAggregate_with_argtypes(self)




    def aggregate_with_argtypes(self):

        localctx = PostgreSQLParser.Aggregate_with_argtypesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 650, self.RULE_aggregate_with_argtypes)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5510
            self.func_name()
            self.state = 5511
            self.aggr_args()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Aggregate_with_argtypes_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def aggregate_with_argtypes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Aggregate_with_argtypesContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Aggregate_with_argtypesContext,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_aggregate_with_argtypes_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAggregate_with_argtypes_list" ):
                listener.enterAggregate_with_argtypes_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAggregate_with_argtypes_list" ):
                listener.exitAggregate_with_argtypes_list(self)




    def aggregate_with_argtypes_list(self):

        localctx = PostgreSQLParser.Aggregate_with_argtypes_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 652, self.RULE_aggregate_with_argtypes_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5513
            self.aggregate_with_argtypes()
            self.state = 5518
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5514
                self.match(PostgreSQLParser.COMMA)
                self.state = 5515
                self.aggregate_with_argtypes()
                self.state = 5520
                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 Createfunc_opt_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def createfunc_opt_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Createfunc_opt_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Createfunc_opt_itemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createfunc_opt_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatefunc_opt_list" ):
                listener.enterCreatefunc_opt_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatefunc_opt_list" ):
                listener.exitCreatefunc_opt_list(self)




    def createfunc_opt_list(self):

        localctx = PostgreSQLParser.Createfunc_opt_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 654, self.RULE_createfunc_opt_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5522 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 5521
                    self.createfunc_opt_item()

                else:
                    raise NoViableAltException(self)
                self.state = 5524 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,286,self._ctx)

            ParseRoutineBody(_localctx)
                        
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Common_func_opt_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CALLED(self):
            return self.getToken(PostgreSQLParser.CALLED, 0)

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def NULL_P(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.NULL_P)
            else:
                return self.getToken(PostgreSQLParser.NULL_P, i)

        def INPUT_P(self):
            return self.getToken(PostgreSQLParser.INPUT_P, 0)

        def RETURNS(self):
            return self.getToken(PostgreSQLParser.RETURNS, 0)

        def STRICT_P(self):
            return self.getToken(PostgreSQLParser.STRICT_P, 0)

        def IMMUTABLE(self):
            return self.getToken(PostgreSQLParser.IMMUTABLE, 0)

        def STABLE(self):
            return self.getToken(PostgreSQLParser.STABLE, 0)

        def VOLATILE(self):
            return self.getToken(PostgreSQLParser.VOLATILE, 0)

        def EXTERNAL(self):
            return self.getToken(PostgreSQLParser.EXTERNAL, 0)

        def SECURITY(self):
            return self.getToken(PostgreSQLParser.SECURITY, 0)

        def DEFINER(self):
            return self.getToken(PostgreSQLParser.DEFINER, 0)

        def INVOKER(self):
            return self.getToken(PostgreSQLParser.INVOKER, 0)

        def LEAKPROOF(self):
            return self.getToken(PostgreSQLParser.LEAKPROOF, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def COST(self):
            return self.getToken(PostgreSQLParser.COST, 0)

        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def ROWS(self):
            return self.getToken(PostgreSQLParser.ROWS, 0)

        def SUPPORT(self):
            return self.getToken(PostgreSQLParser.SUPPORT, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def functionsetresetclause(self):
            return self.getTypedRuleContext(PostgreSQLParser.FunctionsetresetclauseContext,0)


        def PARALLEL(self):
            return self.getToken(PostgreSQLParser.PARALLEL, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_common_func_opt_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCommon_func_opt_item" ):
                listener.enterCommon_func_opt_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCommon_func_opt_item" ):
                listener.exitCommon_func_opt_item(self)




    def common_func_opt_item(self):

        localctx = PostgreSQLParser.Common_func_opt_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 656, self.RULE_common_func_opt_item)
        try:
            self.state = 5563
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,287,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5528
                self.match(PostgreSQLParser.CALLED)
                self.state = 5529
                self.match(PostgreSQLParser.ON)
                self.state = 5530
                self.match(PostgreSQLParser.NULL_P)
                self.state = 5531
                self.match(PostgreSQLParser.INPUT_P)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5532
                self.match(PostgreSQLParser.RETURNS)
                self.state = 5533
                self.match(PostgreSQLParser.NULL_P)
                self.state = 5534
                self.match(PostgreSQLParser.ON)
                self.state = 5535
                self.match(PostgreSQLParser.NULL_P)
                self.state = 5536
                self.match(PostgreSQLParser.INPUT_P)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5537
                self.match(PostgreSQLParser.STRICT_P)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 5538
                self.match(PostgreSQLParser.IMMUTABLE)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 5539
                self.match(PostgreSQLParser.STABLE)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 5540
                self.match(PostgreSQLParser.VOLATILE)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 5541
                self.match(PostgreSQLParser.EXTERNAL)
                self.state = 5542
                self.match(PostgreSQLParser.SECURITY)
                self.state = 5543
                self.match(PostgreSQLParser.DEFINER)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 5544
                self.match(PostgreSQLParser.EXTERNAL)
                self.state = 5545
                self.match(PostgreSQLParser.SECURITY)
                self.state = 5546
                self.match(PostgreSQLParser.INVOKER)
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 5547
                self.match(PostgreSQLParser.SECURITY)
                self.state = 5548
                self.match(PostgreSQLParser.DEFINER)
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 5549
                self.match(PostgreSQLParser.SECURITY)
                self.state = 5550
                self.match(PostgreSQLParser.INVOKER)
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 5551
                self.match(PostgreSQLParser.LEAKPROOF)
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 5552
                self.match(PostgreSQLParser.NOT)
                self.state = 5553
                self.match(PostgreSQLParser.LEAKPROOF)
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 5554
                self.match(PostgreSQLParser.COST)
                self.state = 5555
                self.numericonly()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 5556
                self.match(PostgreSQLParser.ROWS)
                self.state = 5557
                self.numericonly()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 5558
                self.match(PostgreSQLParser.SUPPORT)
                self.state = 5559
                self.any_name()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 5560
                self.functionsetresetclause()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 5561
                self.match(PostgreSQLParser.PARALLEL)
                self.state = 5562
                self.colid()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Createfunc_opt_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def func_as(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_asContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def nonreservedword_or_sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.Nonreservedword_or_sconstContext,0)


        def TRANSFORM(self):
            return self.getToken(PostgreSQLParser.TRANSFORM, 0)

        def transform_type_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Transform_type_listContext,0)


        def WINDOW(self):
            return self.getToken(PostgreSQLParser.WINDOW, 0)

        def common_func_opt_item(self):
            return self.getTypedRuleContext(PostgreSQLParser.Common_func_opt_itemContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createfunc_opt_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatefunc_opt_item" ):
                listener.enterCreatefunc_opt_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatefunc_opt_item" ):
                listener.exitCreatefunc_opt_item(self)




    def createfunc_opt_item(self):

        localctx = PostgreSQLParser.Createfunc_opt_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 658, self.RULE_createfunc_opt_item)
        try:
            self.state = 5573
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [36]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5565
                self.match(PostgreSQLParser.AS)
                self.state = 5566
                self.func_as()
                pass
            elif token in [238]:
                self.enterOuterAlt(localctx, 2)
                self.state = 5567
                self.match(PostgreSQLParser.LANGUAGE)
                self.state = 5568
                self.nonreservedword_or_sconst()
                pass
            elif token in [443]:
                self.enterOuterAlt(localctx, 3)
                self.state = 5569
                self.match(PostgreSQLParser.TRANSFORM)
                self.state = 5570
                self.transform_type_list()
                pass
            elif token in [104]:
                self.enterOuterAlt(localctx, 4)
                self.state = 5571
                self.match(PostgreSQLParser.WINDOW)
                pass
            elif token in [77, 149, 170, 205, 222, 241, 306, 309, 313, 320, 326, 331, 339, 370, 459, 460]:
                self.enterOuterAlt(localctx, 5)
                self.state = 5572
                self.common_func_opt_item()
                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 Func_asContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.Definition = None
            self.def_ = None # SconstContext

        def sconst(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SconstContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SconstContext,i)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_as

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_as" ):
                listener.enterFunc_as(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_as" ):
                listener.exitFunc_as(self)




    def func_as(self):

        localctx = PostgreSQLParser.Func_asContext(self, self._ctx, self.state)
        self.enterRule(localctx, 660, self.RULE_func_as)
        try:
            self.state = 5580
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,289,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5575
                localctx.def_ = self.sconst()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5576
                self.sconst()
                self.state = 5577
                self.match(PostgreSQLParser.COMMA)
                self.state = 5578
                self.sconst()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Transform_type_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FOR(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.FOR)
            else:
                return self.getToken(PostgreSQLParser.FOR, i)

        def TYPE_P(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.TYPE_P)
            else:
                return self.getToken(PostgreSQLParser.TYPE_P, i)

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,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_transform_type_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransform_type_list" ):
                listener.enterTransform_type_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransform_type_list" ):
                listener.exitTransform_type_list(self)




    def transform_type_list(self):

        localctx = PostgreSQLParser.Transform_type_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 662, self.RULE_transform_type_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5582
            self.match(PostgreSQLParser.FOR)
            self.state = 5583
            self.match(PostgreSQLParser.TYPE_P)
            self.state = 5584
            self.typename()
            self.state = 5591
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5585
                self.match(PostgreSQLParser.COMMA)
                self.state = 5586
                self.match(PostgreSQLParser.FOR)
                self.state = 5587
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 5588
                self.typename()
                self.state = 5593
                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 Opt_definitionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.DefinitionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_definition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_definition" ):
                listener.enterOpt_definition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_definition" ):
                listener.exitOpt_definition(self)




    def opt_definition(self):

        localctx = PostgreSQLParser.Opt_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 664, self.RULE_opt_definition)
        try:
            self.state = 5597
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,291,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5594
                self.match(PostgreSQLParser.WITH)
                self.state = 5595
                self.definition()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                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_func_columnContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def param_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Param_nameContext,0)


        def func_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_typeContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_func_column

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTable_func_column" ):
                listener.enterTable_func_column(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTable_func_column" ):
                listener.exitTable_func_column(self)




    def table_func_column(self):

        localctx = PostgreSQLParser.Table_func_columnContext(self, self._ctx, self.state)
        self.enterRule(localctx, 666, self.RULE_table_func_column)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5599
            self.param_name()
            self.state = 5600
            self.func_type()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Table_func_column_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def table_func_column(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_func_columnContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_func_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 getRuleIndex(self):
            return PostgreSQLParser.RULE_table_func_column_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTable_func_column_list" ):
                listener.enterTable_func_column_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTable_func_column_list" ):
                listener.exitTable_func_column_list(self)




    def table_func_column_list(self):

        localctx = PostgreSQLParser.Table_func_column_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 668, self.RULE_table_func_column_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5602
            self.table_func_column()
            self.state = 5607
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5603
                self.match(PostgreSQLParser.COMMA)
                self.state = 5604
                self.table_func_column()
                self.state = 5609
                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 AlterfunctionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def alterfunc_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alterfunc_opt_listContext,0)


        def opt_restrict(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_restrictContext,0)


        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterfunctionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterfunctionstmt" ):
                listener.enterAlterfunctionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterfunctionstmt" ):
                listener.exitAlterfunctionstmt(self)




    def alterfunctionstmt(self):

        localctx = PostgreSQLParser.AlterfunctionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 670, self.RULE_alterfunctionstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5610
            self.match(PostgreSQLParser.ALTER)
            self.state = 5611
            _la = self._input.LA(1)
            if not(_la==211 or _la==289 or _la==442):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 5612
            self.function_with_argtypes()
            self.state = 5613
            self.alterfunc_opt_list()
            self.state = 5614
            self.opt_restrict()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Alterfunc_opt_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def common_func_opt_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Common_func_opt_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Common_func_opt_itemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterfunc_opt_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterfunc_opt_list" ):
                listener.enterAlterfunc_opt_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterfunc_opt_list" ):
                listener.exitAlterfunc_opt_list(self)




    def alterfunc_opt_list(self):

        localctx = PostgreSQLParser.Alterfunc_opt_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 672, self.RULE_alterfunc_opt_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5617 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 5616
                    self.common_func_opt_item()

                else:
                    raise NoViableAltException(self)
                self.state = 5619 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,293,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 Opt_restrictContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def RESTRICT(self):
            return self.getToken(PostgreSQLParser.RESTRICT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_restrict

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_restrict" ):
                listener.enterOpt_restrict(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_restrict" ):
                listener.exitOpt_restrict(self)




    def opt_restrict(self):

        localctx = PostgreSQLParser.Opt_restrictContext(self, self._ctx, self.state)
        self.enterRule(localctx, 674, self.RULE_opt_restrict)
        try:
            self.state = 5623
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [308]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5621
                self.match(PostgreSQLParser.RESTRICT)
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 RemovefuncstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypes_listContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_removefuncstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRemovefuncstmt" ):
                listener.enterRemovefuncstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRemovefuncstmt" ):
                listener.exitRemovefuncstmt(self)




    def removefuncstmt(self):

        localctx = PostgreSQLParser.RemovefuncstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 676, self.RULE_removefuncstmt)
        try:
            self.state = 5661
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,295,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5625
                self.match(PostgreSQLParser.DROP)
                self.state = 5626
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5627
                self.function_with_argtypes_list()
                self.state = 5628
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5630
                self.match(PostgreSQLParser.DROP)
                self.state = 5631
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5632
                self.match(PostgreSQLParser.IF_P)
                self.state = 5633
                self.match(PostgreSQLParser.EXISTS)
                self.state = 5634
                self.function_with_argtypes_list()
                self.state = 5635
                self.opt_drop_behavior()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5637
                self.match(PostgreSQLParser.DROP)
                self.state = 5638
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 5639
                self.function_with_argtypes_list()
                self.state = 5640
                self.opt_drop_behavior()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 5642
                self.match(PostgreSQLParser.DROP)
                self.state = 5643
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 5644
                self.match(PostgreSQLParser.IF_P)
                self.state = 5645
                self.match(PostgreSQLParser.EXISTS)
                self.state = 5646
                self.function_with_argtypes_list()
                self.state = 5647
                self.opt_drop_behavior()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 5649
                self.match(PostgreSQLParser.DROP)
                self.state = 5650
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 5651
                self.function_with_argtypes_list()
                self.state = 5652
                self.opt_drop_behavior()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 5654
                self.match(PostgreSQLParser.DROP)
                self.state = 5655
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 5656
                self.match(PostgreSQLParser.IF_P)
                self.state = 5657
                self.match(PostgreSQLParser.EXISTS)
                self.state = 5658
                self.function_with_argtypes_list()
                self.state = 5659
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RemoveaggrstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def aggregate_with_argtypes_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggregate_with_argtypes_listContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_removeaggrstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRemoveaggrstmt" ):
                listener.enterRemoveaggrstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRemoveaggrstmt" ):
                listener.exitRemoveaggrstmt(self)




    def removeaggrstmt(self):

        localctx = PostgreSQLParser.RemoveaggrstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 678, self.RULE_removeaggrstmt)
        try:
            self.state = 5675
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,296,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5663
                self.match(PostgreSQLParser.DROP)
                self.state = 5664
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 5665
                self.aggregate_with_argtypes_list()
                self.state = 5666
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5668
                self.match(PostgreSQLParser.DROP)
                self.state = 5669
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 5670
                self.match(PostgreSQLParser.IF_P)
                self.state = 5671
                self.match(PostgreSQLParser.EXISTS)
                self.state = 5672
                self.aggregate_with_argtypes_list()
                self.state = 5673
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RemoveoperstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def operator_with_argtypes_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_with_argtypes_listContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_removeoperstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRemoveoperstmt" ):
                listener.enterRemoveoperstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRemoveoperstmt" ):
                listener.exitRemoveoperstmt(self)




    def removeoperstmt(self):

        localctx = PostgreSQLParser.RemoveoperstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 680, self.RULE_removeoperstmt)
        try:
            self.state = 5689
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,297,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5677
                self.match(PostgreSQLParser.DROP)
                self.state = 5678
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 5679
                self.operator_with_argtypes_list()
                self.state = 5680
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5682
                self.match(PostgreSQLParser.DROP)
                self.state = 5683
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 5684
                self.match(PostgreSQLParser.IF_P)
                self.state = 5685
                self.match(PostgreSQLParser.EXISTS)
                self.state = 5686
                self.operator_with_argtypes_list()
                self.state = 5687
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Oper_argtypesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,i)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def NONE(self):
            return self.getToken(PostgreSQLParser.NONE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_oper_argtypes

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOper_argtypes" ):
                listener.enterOper_argtypes(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOper_argtypes" ):
                listener.exitOper_argtypes(self)




    def oper_argtypes(self):

        localctx = PostgreSQLParser.Oper_argtypesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 682, self.RULE_oper_argtypes)
        try:
            self.state = 5713
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,298,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5691
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5692
                self.typename()
                self.state = 5693
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5695
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5696
                self.typename()
                self.state = 5697
                self.match(PostgreSQLParser.COMMA)
                self.state = 5698
                self.typename()
                self.state = 5699
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5701
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5702
                self.match(PostgreSQLParser.NONE)
                self.state = 5703
                self.match(PostgreSQLParser.COMMA)
                self.state = 5704
                self.typename()
                self.state = 5705
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 5707
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5708
                self.typename()
                self.state = 5709
                self.match(PostgreSQLParser.COMMA)
                self.state = 5710
                self.match(PostgreSQLParser.NONE)
                self.state = 5711
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Any_operatorContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def all_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.All_opContext,0)


        def colid(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.ColidContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.ColidContext,i)


        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.DOT)
            else:
                return self.getToken(PostgreSQLParser.DOT, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_any_operator

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAny_operator" ):
                listener.enterAny_operator(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAny_operator" ):
                listener.exitAny_operator(self)




    def any_operator(self):

        localctx = PostgreSQLParser.Any_operatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 684, self.RULE_any_operator)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5720
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 2459027012145119232) != 0) or ((((_la - 92)) & ~0x3f) == 0 and ((1 << (_la - 92)) & -113665638399) != 0) or ((((_la - 156)) & ~0x3f) == 0 and ((1 << (_la - 156)) & -1) != 0) or ((((_la - 220)) & ~0x3f) == 0 and ((1 << (_la - 220)) & -9663676417) != 0) or ((((_la - 284)) & ~0x3f) == 0 and ((1 << (_la - 284)) & -1) != 0) or ((((_la - 348)) & ~0x3f) == 0 and ((1 << (_la - 348)) & -1) != 0) or ((((_la - 412)) & ~0x3f) == 0 and ((1 << (_la - 412)) & -1152925902653358081) != 0) or ((((_la - 476)) & ~0x3f) == 0 and ((1 << (_la - 476)) & -8796764110849) != 0) or ((((_la - 540)) & ~0x3f) == 0 and ((1 << (_la - 540)) & -1) != 0) or ((((_la - 604)) & ~0x3f) == 0 and ((1 << (_la - 604)) & 432345718846390271) != 0):
                self.state = 5715
                self.colid()
                self.state = 5716
                self.match(PostgreSQLParser.DOT)
                self.state = 5722
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 5723
            self.all_op()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Operator_with_argtypes_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def operator_with_argtypes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Operator_with_argtypesContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Operator_with_argtypesContext,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_operator_with_argtypes_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOperator_with_argtypes_list" ):
                listener.enterOperator_with_argtypes_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOperator_with_argtypes_list" ):
                listener.exitOperator_with_argtypes_list(self)




    def operator_with_argtypes_list(self):

        localctx = PostgreSQLParser.Operator_with_argtypes_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 686, self.RULE_operator_with_argtypes_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5725
            self.operator_with_argtypes()
            self.state = 5730
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5726
                self.match(PostgreSQLParser.COMMA)
                self.state = 5727
                self.operator_with_argtypes()
                self.state = 5732
                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 Operator_with_argtypesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def any_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_operatorContext,0)


        def oper_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Oper_argtypesContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_operator_with_argtypes

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOperator_with_argtypes" ):
                listener.enterOperator_with_argtypes(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOperator_with_argtypes" ):
                listener.exitOperator_with_argtypes(self)




    def operator_with_argtypes(self):

        localctx = PostgreSQLParser.Operator_with_argtypesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 688, self.RULE_operator_with_argtypes)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5733
            self.any_operator()
            self.state = 5734
            self.oper_argtypes()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DostmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DO(self):
            return self.getToken(PostgreSQLParser.DO, 0)

        def dostmt_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Dostmt_opt_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dostmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDostmt" ):
                listener.enterDostmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDostmt" ):
                listener.exitDostmt(self)




    def dostmt(self):

        localctx = PostgreSQLParser.DostmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 690, self.RULE_dostmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5736
            self.match(PostgreSQLParser.DO)
            self.state = 5737
            self.dostmt_opt_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Dostmt_opt_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def dostmt_opt_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Dostmt_opt_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Dostmt_opt_itemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dostmt_opt_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDostmt_opt_list" ):
                listener.enterDostmt_opt_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDostmt_opt_list" ):
                listener.exitDostmt_opt_list(self)




    def dostmt_opt_list(self):

        localctx = PostgreSQLParser.Dostmt_opt_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 692, self.RULE_dostmt_opt_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5740 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 5739
                self.dostmt_opt_item()
                self.state = 5742 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==238 or ((((_la - 645)) & ~0x3f) == 0 and ((1 << (_la - 645)) & 67108885) != 0)):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Dostmt_opt_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def nonreservedword_or_sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.Nonreservedword_or_sconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dostmt_opt_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDostmt_opt_item" ):
                listener.enterDostmt_opt_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDostmt_opt_item" ):
                listener.exitDostmt_opt_item(self)




    def dostmt_opt_item(self):

        localctx = PostgreSQLParser.Dostmt_opt_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 694, self.RULE_dostmt_opt_item)
        try:
            self.state = 5747
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5744
                self.sconst()
                pass
            elif token in [238]:
                self.enterOuterAlt(localctx, 2)
                self.state = 5745
                self.match(PostgreSQLParser.LANGUAGE)
                self.state = 5746
                self.nonreservedword_or_sconst()
                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 CreatecaststmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def CAST(self):
            return self.getToken(PostgreSQLParser.CAST, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,i)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def cast_context(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cast_contextContext,0)


        def WITHOUT(self):
            return self.getToken(PostgreSQLParser.WITHOUT, 0)

        def INOUT(self):
            return self.getToken(PostgreSQLParser.INOUT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createcaststmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatecaststmt" ):
                listener.enterCreatecaststmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatecaststmt" ):
                listener.exitCreatecaststmt(self)




    def createcaststmt(self):

        localctx = PostgreSQLParser.CreatecaststmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 696, self.RULE_createcaststmt)
        try:
            self.state = 5783
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,303,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5749
                self.match(PostgreSQLParser.CREATE)
                self.state = 5750
                self.match(PostgreSQLParser.CAST)
                self.state = 5751
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5752
                self.typename()
                self.state = 5753
                self.match(PostgreSQLParser.AS)
                self.state = 5754
                self.typename()
                self.state = 5755
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 5756
                self.match(PostgreSQLParser.WITH)
                self.state = 5757
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5758
                self.function_with_argtypes()
                self.state = 5759
                self.cast_context()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5761
                self.match(PostgreSQLParser.CREATE)
                self.state = 5762
                self.match(PostgreSQLParser.CAST)
                self.state = 5763
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5764
                self.typename()
                self.state = 5765
                self.match(PostgreSQLParser.AS)
                self.state = 5766
                self.typename()
                self.state = 5767
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 5768
                self.match(PostgreSQLParser.WITHOUT)
                self.state = 5769
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5770
                self.cast_context()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5772
                self.match(PostgreSQLParser.CREATE)
                self.state = 5773
                self.match(PostgreSQLParser.CAST)
                self.state = 5774
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5775
                self.typename()
                self.state = 5776
                self.match(PostgreSQLParser.AS)
                self.state = 5777
                self.typename()
                self.state = 5778
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 5779
                self.match(PostgreSQLParser.WITH)
                self.state = 5780
                self.match(PostgreSQLParser.INOUT)
                self.state = 5781
                self.cast_context()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Cast_contextContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def IMPLICIT_P(self):
            return self.getToken(PostgreSQLParser.IMPLICIT_P, 0)

        def ASSIGNMENT(self):
            return self.getToken(PostgreSQLParser.ASSIGNMENT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_cast_context

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCast_context" ):
                listener.enterCast_context(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCast_context" ):
                listener.exitCast_context(self)




    def cast_context(self):

        localctx = PostgreSQLParser.Cast_contextContext(self, self._ctx, self.state)
        self.enterRule(localctx, 698, self.RULE_cast_context)
        try:
            self.state = 5790
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,304,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5785
                self.match(PostgreSQLParser.AS)
                self.state = 5786
                self.match(PostgreSQLParser.IMPLICIT_P)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5787
                self.match(PostgreSQLParser.AS)
                self.state = 5788
                self.match(PostgreSQLParser.ASSIGNMENT)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DropcaststmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def CAST(self):
            return self.getToken(PostgreSQLParser.CAST, 0)

        def opt_if_exists(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_if_existsContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,i)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dropcaststmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDropcaststmt" ):
                listener.enterDropcaststmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDropcaststmt" ):
                listener.exitDropcaststmt(self)




    def dropcaststmt(self):

        localctx = PostgreSQLParser.DropcaststmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 700, self.RULE_dropcaststmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5792
            self.match(PostgreSQLParser.DROP)
            self.state = 5793
            self.match(PostgreSQLParser.CAST)
            self.state = 5794
            self.opt_if_exists()
            self.state = 5795
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 5796
            self.typename()
            self.state = 5797
            self.match(PostgreSQLParser.AS)
            self.state = 5798
            self.typename()
            self.state = 5799
            self.match(PostgreSQLParser.CLOSE_PAREN)
            self.state = 5800
            self.opt_drop_behavior()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_if_existsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_if_exists

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_if_exists" ):
                listener.enterOpt_if_exists(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_if_exists" ):
                listener.exitOpt_if_exists(self)




    def opt_if_exists(self):

        localctx = PostgreSQLParser.Opt_if_existsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 702, self.RULE_opt_if_exists)
        try:
            self.state = 5805
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [220]:
                self.enterOuterAlt(localctx, 1)
                self.state = 5802
                self.match(PostgreSQLParser.IF_P)
                self.state = 5803
                self.match(PostgreSQLParser.EXISTS)
                pass
            elif token in [2, 62]:
                self.enterOuterAlt(localctx, 2)

                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 CreatetransformstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opt_or_replace(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_or_replaceContext,0)


        def TRANSFORM(self):
            return self.getToken(PostgreSQLParser.TRANSFORM, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def transform_element_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Transform_element_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createtransformstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatetransformstmt" ):
                listener.enterCreatetransformstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatetransformstmt" ):
                listener.exitCreatetransformstmt(self)




    def createtransformstmt(self):

        localctx = PostgreSQLParser.CreatetransformstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 704, self.RULE_createtransformstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5807
            self.match(PostgreSQLParser.CREATE)
            self.state = 5808
            self.opt_or_replace()
            self.state = 5809
            self.match(PostgreSQLParser.TRANSFORM)
            self.state = 5810
            self.match(PostgreSQLParser.FOR)
            self.state = 5811
            self.typename()
            self.state = 5812
            self.match(PostgreSQLParser.LANGUAGE)
            self.state = 5813
            self.name()
            self.state = 5814
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 5815
            self.transform_element_list()
            self.state = 5816
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Transform_element_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def SQL_P(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.SQL_P)
            else:
                return self.getToken(PostgreSQLParser.SQL_P, i)

        def WITH(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.WITH)
            else:
                return self.getToken(PostgreSQLParser.WITH, i)

        def FUNCTION(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.FUNCTION)
            else:
                return self.getToken(PostgreSQLParser.FUNCTION, i)

        def function_with_argtypes(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Function_with_argtypesContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,i)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_transform_element_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransform_element_list" ):
                listener.enterTransform_element_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransform_element_list" ):
                listener.exitTransform_element_list(self)




    def transform_element_list(self):

        localctx = PostgreSQLParser.Transform_element_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 706, self.RULE_transform_element_list)
        try:
            self.state = 5852
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,306,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5818
                self.match(PostgreSQLParser.FROM)
                self.state = 5819
                self.match(PostgreSQLParser.SQL_P)
                self.state = 5820
                self.match(PostgreSQLParser.WITH)
                self.state = 5821
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5822
                self.function_with_argtypes()
                self.state = 5823
                self.match(PostgreSQLParser.COMMA)
                self.state = 5824
                self.match(PostgreSQLParser.TO)
                self.state = 5825
                self.match(PostgreSQLParser.SQL_P)
                self.state = 5826
                self.match(PostgreSQLParser.WITH)
                self.state = 5827
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5828
                self.function_with_argtypes()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5830
                self.match(PostgreSQLParser.TO)
                self.state = 5831
                self.match(PostgreSQLParser.SQL_P)
                self.state = 5832
                self.match(PostgreSQLParser.WITH)
                self.state = 5833
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5834
                self.function_with_argtypes()
                self.state = 5835
                self.match(PostgreSQLParser.COMMA)
                self.state = 5836
                self.match(PostgreSQLParser.FROM)
                self.state = 5837
                self.match(PostgreSQLParser.SQL_P)
                self.state = 5838
                self.match(PostgreSQLParser.WITH)
                self.state = 5839
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5840
                self.function_with_argtypes()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5842
                self.match(PostgreSQLParser.FROM)
                self.state = 5843
                self.match(PostgreSQLParser.SQL_P)
                self.state = 5844
                self.match(PostgreSQLParser.WITH)
                self.state = 5845
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5846
                self.function_with_argtypes()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 5847
                self.match(PostgreSQLParser.TO)
                self.state = 5848
                self.match(PostgreSQLParser.SQL_P)
                self.state = 5849
                self.match(PostgreSQLParser.WITH)
                self.state = 5850
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5851
                self.function_with_argtypes()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DroptransformstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def TRANSFORM(self):
            return self.getToken(PostgreSQLParser.TRANSFORM, 0)

        def opt_if_exists(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_if_existsContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_droptransformstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDroptransformstmt" ):
                listener.enterDroptransformstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDroptransformstmt" ):
                listener.exitDroptransformstmt(self)




    def droptransformstmt(self):

        localctx = PostgreSQLParser.DroptransformstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 708, self.RULE_droptransformstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5854
            self.match(PostgreSQLParser.DROP)
            self.state = 5855
            self.match(PostgreSQLParser.TRANSFORM)
            self.state = 5856
            self.opt_if_exists()
            self.state = 5857
            self.match(PostgreSQLParser.FOR)
            self.state = 5858
            self.typename()
            self.state = 5859
            self.match(PostgreSQLParser.LANGUAGE)
            self.state = 5860
            self.name()
            self.state = 5861
            self.opt_drop_behavior()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ReindexstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def REINDEX(self):
            return self.getToken(PostgreSQLParser.REINDEX, 0)

        def reindex_target_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reindex_target_typeContext,0)


        def opt_concurrently(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_concurrentlyContext,0)


        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def reindex_target_multitable(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reindex_target_multitableContext,0)


        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def reindex_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reindex_option_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reindexstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReindexstmt" ):
                listener.enterReindexstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReindexstmt" ):
                listener.exitReindexstmt(self)




    def reindexstmt(self):

        localctx = PostgreSQLParser.ReindexstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 710, self.RULE_reindexstmt)
        try:
            self.state = 5889
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,307,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5863
                self.match(PostgreSQLParser.REINDEX)
                self.state = 5864
                self.reindex_target_type()
                self.state = 5865
                self.opt_concurrently()
                self.state = 5866
                self.qualified_name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5868
                self.match(PostgreSQLParser.REINDEX)
                self.state = 5869
                self.reindex_target_multitable()
                self.state = 5870
                self.opt_concurrently()
                self.state = 5871
                self.name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5873
                self.match(PostgreSQLParser.REINDEX)
                self.state = 5874
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5875
                self.reindex_option_list()
                self.state = 5876
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 5877
                self.reindex_target_type()
                self.state = 5878
                self.opt_concurrently()
                self.state = 5879
                self.qualified_name()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 5881
                self.match(PostgreSQLParser.REINDEX)
                self.state = 5882
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 5883
                self.reindex_option_list()
                self.state = 5884
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 5885
                self.reindex_target_multitable()
                self.state = 5886
                self.opt_concurrently()
                self.state = 5887
                self.name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Reindex_target_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def SYSTEM_P(self):
            return self.getToken(PostgreSQLParser.SYSTEM_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reindex_target_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReindex_target_type" ):
                listener.enterReindex_target_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReindex_target_type" ):
                listener.exitReindex_target_type(self)




    def reindex_target_type(self):

        localctx = PostgreSQLParser.Reindex_target_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 712, self.RULE_reindex_target_type)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5891
            _la = self._input.LA(1)
            if not(_la==92 or _la==175 or _la==226 or _la==316 or _la==342):
                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 Reindex_target_multitableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def SYSTEM_P(self):
            return self.getToken(PostgreSQLParser.SYSTEM_P, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reindex_target_multitable

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReindex_target_multitable" ):
                listener.enterReindex_target_multitable(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReindex_target_multitable" ):
                listener.exitReindex_target_multitable(self)




    def reindex_target_multitable(self):

        localctx = PostgreSQLParser.Reindex_target_multitableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 714, self.RULE_reindex_target_multitable)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5893
            _la = self._input.LA(1)
            if not(_la==175 or _la==316 or _la==342):
                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 Reindex_option_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def reindex_option_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Reindex_option_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Reindex_option_elemContext,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_reindex_option_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReindex_option_list" ):
                listener.enterReindex_option_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReindex_option_list" ):
                listener.exitReindex_option_list(self)




    def reindex_option_list(self):

        localctx = PostgreSQLParser.Reindex_option_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 716, self.RULE_reindex_option_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5895
            self.reindex_option_elem()
            self.state = 5900
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 5896
                self.match(PostgreSQLParser.COMMA)
                self.state = 5897
                self.reindex_option_elem()
                self.state = 5902
                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 Reindex_option_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VERBOSE(self):
            return self.getToken(PostgreSQLParser.VERBOSE, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def CONCURRENTLY(self):
            return self.getToken(PostgreSQLParser.CONCURRENTLY, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reindex_option_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReindex_option_elem" ):
                listener.enterReindex_option_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReindex_option_elem" ):
                listener.exitReindex_option_elem(self)




    def reindex_option_elem(self):

        localctx = PostgreSQLParser.Reindex_option_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 718, self.RULE_reindex_option_elem)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 5903
            _la = self._input.LA(1)
            if not(_la==109 or _la==128 or _la==344):
                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 AltertblspcstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.ReloptionsContext,0)


        def RESET(self):
            return self.getToken(PostgreSQLParser.RESET, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altertblspcstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAltertblspcstmt" ):
                listener.enterAltertblspcstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAltertblspcstmt" ):
                listener.exitAltertblspcstmt(self)




    def altertblspcstmt(self):

        localctx = PostgreSQLParser.AltertblspcstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 720, self.RULE_altertblspcstmt)
        try:
            self.state = 5917
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,309,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5905
                self.match(PostgreSQLParser.ALTER)
                self.state = 5906
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 5907
                self.name()
                self.state = 5908
                self.match(PostgreSQLParser.SET)
                self.state = 5909
                self.reloptions()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5911
                self.match(PostgreSQLParser.ALTER)
                self.state = 5912
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 5913
                self.name()
                self.state = 5914
                self.match(PostgreSQLParser.RESET)
                self.state = 5915
                self.reloptions()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RenamestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def aggregate_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggregate_with_argtypesContext,0)


        def RENAME(self):
            return self.getToken(PostgreSQLParser.RENAME, 0)

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.NameContext,i)


        def COLLATION(self):
            return self.getToken(PostgreSQLParser.COLLATION, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def CONVERSION_P(self):
            return self.getToken(PostgreSQLParser.CONVERSION_P, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def CONSTRAINT(self):
            return self.getToken(PostgreSQLParser.CONSTRAINT, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def WRAPPER(self):
            return self.getToken(PostgreSQLParser.WRAPPER, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def GROUP_P(self):
            return self.getToken(PostgreSQLParser.GROUP_P, 0)

        def roleid(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.RoleidContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.RoleidContext,i)


        def opt_procedural(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_proceduralContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def CLASS(self):
            return self.getToken(PostgreSQLParser.CLASS, 0)

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def POLICY(self):
            return self.getToken(PostgreSQLParser.POLICY, 0)

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def PUBLICATION(self):
            return self.getToken(PostgreSQLParser.PUBLICATION, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def SUBSCRIPTION(self):
            return self.getToken(PostgreSQLParser.SUBSCRIPTION, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def relation_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_exprContext,0)


        def SEQUENCE(self):
            return self.getToken(PostgreSQLParser.SEQUENCE, 0)

        def VIEW(self):
            return self.getToken(PostgreSQLParser.VIEW, 0)

        def MATERIALIZED(self):
            return self.getToken(PostgreSQLParser.MATERIALIZED, 0)

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def opt_column(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_columnContext,0)


        def RULE(self):
            return self.getToken(PostgreSQLParser.RULE, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def EVENT(self):
            return self.getToken(PostgreSQLParser.EVENT, 0)

        def ROLE(self):
            return self.getToken(PostgreSQLParser.ROLE, 0)

        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def STATISTICS(self):
            return self.getToken(PostgreSQLParser.STATISTICS, 0)

        def TEXT_P(self):
            return self.getToken(PostgreSQLParser.TEXT_P, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def PARSER(self):
            return self.getToken(PostgreSQLParser.PARSER, 0)

        def DICTIONARY(self):
            return self.getToken(PostgreSQLParser.DICTIONARY, 0)

        def TEMPLATE(self):
            return self.getToken(PostgreSQLParser.TEMPLATE, 0)

        def CONFIGURATION(self):
            return self.getToken(PostgreSQLParser.CONFIGURATION, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def ATTRIBUTE(self):
            return self.getToken(PostgreSQLParser.ATTRIBUTE, 0)

        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_renamestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRenamestmt" ):
                listener.enterRenamestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRenamestmt" ):
                listener.exitRenamestmt(self)




    def renamestmt(self):

        localctx = PostgreSQLParser.RenamestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 722, self.RULE_renamestmt)
        try:
            self.state = 6387
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,310,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 5919
                self.match(PostgreSQLParser.ALTER)
                self.state = 5920
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 5921
                self.aggregate_with_argtypes()
                self.state = 5922
                self.match(PostgreSQLParser.RENAME)
                self.state = 5923
                self.match(PostgreSQLParser.TO)
                self.state = 5924
                self.name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 5926
                self.match(PostgreSQLParser.ALTER)
                self.state = 5927
                self.match(PostgreSQLParser.COLLATION)
                self.state = 5928
                self.any_name()
                self.state = 5929
                self.match(PostgreSQLParser.RENAME)
                self.state = 5930
                self.match(PostgreSQLParser.TO)
                self.state = 5931
                self.name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 5933
                self.match(PostgreSQLParser.ALTER)
                self.state = 5934
                self.match(PostgreSQLParser.CONVERSION_P)
                self.state = 5935
                self.any_name()
                self.state = 5936
                self.match(PostgreSQLParser.RENAME)
                self.state = 5937
                self.match(PostgreSQLParser.TO)
                self.state = 5938
                self.name()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 5940
                self.match(PostgreSQLParser.ALTER)
                self.state = 5941
                self.match(PostgreSQLParser.DATABASE)
                self.state = 5942
                self.name()
                self.state = 5943
                self.match(PostgreSQLParser.RENAME)
                self.state = 5944
                self.match(PostgreSQLParser.TO)
                self.state = 5945
                self.name()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 5947
                self.match(PostgreSQLParser.ALTER)
                self.state = 5948
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 5949
                self.any_name()
                self.state = 5950
                self.match(PostgreSQLParser.RENAME)
                self.state = 5951
                self.match(PostgreSQLParser.TO)
                self.state = 5952
                self.name()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 5954
                self.match(PostgreSQLParser.ALTER)
                self.state = 5955
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 5956
                self.any_name()
                self.state = 5957
                self.match(PostgreSQLParser.RENAME)
                self.state = 5958
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 5959
                self.name()
                self.state = 5960
                self.match(PostgreSQLParser.TO)
                self.state = 5961
                self.name()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 5963
                self.match(PostgreSQLParser.ALTER)
                self.state = 5964
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 5965
                self.match(PostgreSQLParser.DATA_P)
                self.state = 5966
                self.match(PostgreSQLParser.WRAPPER)
                self.state = 5967
                self.name()
                self.state = 5968
                self.match(PostgreSQLParser.RENAME)
                self.state = 5969
                self.match(PostgreSQLParser.TO)
                self.state = 5970
                self.name()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 5972
                self.match(PostgreSQLParser.ALTER)
                self.state = 5973
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 5974
                self.function_with_argtypes()
                self.state = 5975
                self.match(PostgreSQLParser.RENAME)
                self.state = 5976
                self.match(PostgreSQLParser.TO)
                self.state = 5977
                self.name()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 5979
                self.match(PostgreSQLParser.ALTER)
                self.state = 5980
                self.match(PostgreSQLParser.GROUP_P)
                self.state = 5981
                self.roleid()
                self.state = 5982
                self.match(PostgreSQLParser.RENAME)
                self.state = 5983
                self.match(PostgreSQLParser.TO)
                self.state = 5984
                self.roleid()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 5986
                self.match(PostgreSQLParser.ALTER)
                self.state = 5987
                self.opt_procedural()
                self.state = 5988
                self.match(PostgreSQLParser.LANGUAGE)
                self.state = 5989
                self.name()
                self.state = 5990
                self.match(PostgreSQLParser.RENAME)
                self.state = 5991
                self.match(PostgreSQLParser.TO)
                self.state = 5992
                self.name()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 5994
                self.match(PostgreSQLParser.ALTER)
                self.state = 5995
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 5996
                self.match(PostgreSQLParser.CLASS)
                self.state = 5997
                self.any_name()
                self.state = 5998
                self.match(PostgreSQLParser.USING)
                self.state = 5999
                self.name()
                self.state = 6000
                self.match(PostgreSQLParser.RENAME)
                self.state = 6001
                self.match(PostgreSQLParser.TO)
                self.state = 6002
                self.name()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 6004
                self.match(PostgreSQLParser.ALTER)
                self.state = 6005
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 6006
                self.match(PostgreSQLParser.FAMILY)
                self.state = 6007
                self.any_name()
                self.state = 6008
                self.match(PostgreSQLParser.USING)
                self.state = 6009
                self.name()
                self.state = 6010
                self.match(PostgreSQLParser.RENAME)
                self.state = 6011
                self.match(PostgreSQLParser.TO)
                self.state = 6012
                self.name()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 6014
                self.match(PostgreSQLParser.ALTER)
                self.state = 6015
                self.match(PostgreSQLParser.POLICY)
                self.state = 6016
                self.name()
                self.state = 6017
                self.match(PostgreSQLParser.ON)
                self.state = 6018
                self.qualified_name()
                self.state = 6019
                self.match(PostgreSQLParser.RENAME)
                self.state = 6020
                self.match(PostgreSQLParser.TO)
                self.state = 6021
                self.name()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 6023
                self.match(PostgreSQLParser.ALTER)
                self.state = 6024
                self.match(PostgreSQLParser.POLICY)
                self.state = 6025
                self.match(PostgreSQLParser.IF_P)
                self.state = 6026
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6027
                self.name()
                self.state = 6028
                self.match(PostgreSQLParser.ON)
                self.state = 6029
                self.qualified_name()
                self.state = 6030
                self.match(PostgreSQLParser.RENAME)
                self.state = 6031
                self.match(PostgreSQLParser.TO)
                self.state = 6032
                self.name()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 6034
                self.match(PostgreSQLParser.ALTER)
                self.state = 6035
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 6036
                self.function_with_argtypes()
                self.state = 6037
                self.match(PostgreSQLParser.RENAME)
                self.state = 6038
                self.match(PostgreSQLParser.TO)
                self.state = 6039
                self.name()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 6041
                self.match(PostgreSQLParser.ALTER)
                self.state = 6042
                self.match(PostgreSQLParser.PUBLICATION)
                self.state = 6043
                self.name()
                self.state = 6044
                self.match(PostgreSQLParser.RENAME)
                self.state = 6045
                self.match(PostgreSQLParser.TO)
                self.state = 6046
                self.name()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 6048
                self.match(PostgreSQLParser.ALTER)
                self.state = 6049
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 6050
                self.function_with_argtypes()
                self.state = 6051
                self.match(PostgreSQLParser.RENAME)
                self.state = 6052
                self.match(PostgreSQLParser.TO)
                self.state = 6053
                self.name()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 6055
                self.match(PostgreSQLParser.ALTER)
                self.state = 6056
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6057
                self.name()
                self.state = 6058
                self.match(PostgreSQLParser.RENAME)
                self.state = 6059
                self.match(PostgreSQLParser.TO)
                self.state = 6060
                self.name()
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 6062
                self.match(PostgreSQLParser.ALTER)
                self.state = 6063
                self.match(PostgreSQLParser.SERVER)
                self.state = 6064
                self.name()
                self.state = 6065
                self.match(PostgreSQLParser.RENAME)
                self.state = 6066
                self.match(PostgreSQLParser.TO)
                self.state = 6067
                self.name()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 6069
                self.match(PostgreSQLParser.ALTER)
                self.state = 6070
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 6071
                self.name()
                self.state = 6072
                self.match(PostgreSQLParser.RENAME)
                self.state = 6073
                self.match(PostgreSQLParser.TO)
                self.state = 6074
                self.name()
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 6076
                self.match(PostgreSQLParser.ALTER)
                self.state = 6077
                self.match(PostgreSQLParser.TABLE)
                self.state = 6078
                self.relation_expr()
                self.state = 6079
                self.match(PostgreSQLParser.RENAME)
                self.state = 6080
                self.match(PostgreSQLParser.TO)
                self.state = 6081
                self.name()
                pass

            elif la_ == 22:
                self.enterOuterAlt(localctx, 22)
                self.state = 6083
                self.match(PostgreSQLParser.ALTER)
                self.state = 6084
                self.match(PostgreSQLParser.TABLE)
                self.state = 6085
                self.match(PostgreSQLParser.IF_P)
                self.state = 6086
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6087
                self.relation_expr()
                self.state = 6088
                self.match(PostgreSQLParser.RENAME)
                self.state = 6089
                self.match(PostgreSQLParser.TO)
                self.state = 6090
                self.name()
                pass

            elif la_ == 23:
                self.enterOuterAlt(localctx, 23)
                self.state = 6092
                self.match(PostgreSQLParser.ALTER)
                self.state = 6093
                self.match(PostgreSQLParser.SEQUENCE)
                self.state = 6094
                self.qualified_name()
                self.state = 6095
                self.match(PostgreSQLParser.RENAME)
                self.state = 6096
                self.match(PostgreSQLParser.TO)
                self.state = 6097
                self.name()
                pass

            elif la_ == 24:
                self.enterOuterAlt(localctx, 24)
                self.state = 6099
                self.match(PostgreSQLParser.ALTER)
                self.state = 6100
                self.match(PostgreSQLParser.SEQUENCE)
                self.state = 6101
                self.match(PostgreSQLParser.IF_P)
                self.state = 6102
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6103
                self.qualified_name()
                self.state = 6104
                self.match(PostgreSQLParser.RENAME)
                self.state = 6105
                self.match(PostgreSQLParser.TO)
                self.state = 6106
                self.name()
                pass

            elif la_ == 25:
                self.enterOuterAlt(localctx, 25)
                self.state = 6108
                self.match(PostgreSQLParser.ALTER)
                self.state = 6109
                self.match(PostgreSQLParser.VIEW)
                self.state = 6110
                self.qualified_name()
                self.state = 6111
                self.match(PostgreSQLParser.RENAME)
                self.state = 6112
                self.match(PostgreSQLParser.TO)
                self.state = 6113
                self.name()
                pass

            elif la_ == 26:
                self.enterOuterAlt(localctx, 26)
                self.state = 6115
                self.match(PostgreSQLParser.ALTER)
                self.state = 6116
                self.match(PostgreSQLParser.VIEW)
                self.state = 6117
                self.match(PostgreSQLParser.IF_P)
                self.state = 6118
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6119
                self.qualified_name()
                self.state = 6120
                self.match(PostgreSQLParser.RENAME)
                self.state = 6121
                self.match(PostgreSQLParser.TO)
                self.state = 6122
                self.name()
                pass

            elif la_ == 27:
                self.enterOuterAlt(localctx, 27)
                self.state = 6124
                self.match(PostgreSQLParser.ALTER)
                self.state = 6125
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 6126
                self.match(PostgreSQLParser.VIEW)
                self.state = 6127
                self.qualified_name()
                self.state = 6128
                self.match(PostgreSQLParser.RENAME)
                self.state = 6129
                self.match(PostgreSQLParser.TO)
                self.state = 6130
                self.name()
                pass

            elif la_ == 28:
                self.enterOuterAlt(localctx, 28)
                self.state = 6132
                self.match(PostgreSQLParser.ALTER)
                self.state = 6133
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 6134
                self.match(PostgreSQLParser.VIEW)
                self.state = 6135
                self.match(PostgreSQLParser.IF_P)
                self.state = 6136
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6137
                self.qualified_name()
                self.state = 6138
                self.match(PostgreSQLParser.RENAME)
                self.state = 6139
                self.match(PostgreSQLParser.TO)
                self.state = 6140
                self.name()
                pass

            elif la_ == 29:
                self.enterOuterAlt(localctx, 29)
                self.state = 6142
                self.match(PostgreSQLParser.ALTER)
                self.state = 6143
                self.match(PostgreSQLParser.INDEX)
                self.state = 6144
                self.qualified_name()
                self.state = 6145
                self.match(PostgreSQLParser.RENAME)
                self.state = 6146
                self.match(PostgreSQLParser.TO)
                self.state = 6147
                self.name()
                pass

            elif la_ == 30:
                self.enterOuterAlt(localctx, 30)
                self.state = 6149
                self.match(PostgreSQLParser.ALTER)
                self.state = 6150
                self.match(PostgreSQLParser.INDEX)
                self.state = 6151
                self.match(PostgreSQLParser.IF_P)
                self.state = 6152
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6153
                self.qualified_name()
                self.state = 6154
                self.match(PostgreSQLParser.RENAME)
                self.state = 6155
                self.match(PostgreSQLParser.TO)
                self.state = 6156
                self.name()
                pass

            elif la_ == 31:
                self.enterOuterAlt(localctx, 31)
                self.state = 6158
                self.match(PostgreSQLParser.ALTER)
                self.state = 6159
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 6160
                self.match(PostgreSQLParser.TABLE)
                self.state = 6161
                self.relation_expr()
                self.state = 6162
                self.match(PostgreSQLParser.RENAME)
                self.state = 6163
                self.match(PostgreSQLParser.TO)
                self.state = 6164
                self.name()
                pass

            elif la_ == 32:
                self.enterOuterAlt(localctx, 32)
                self.state = 6166
                self.match(PostgreSQLParser.ALTER)
                self.state = 6167
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 6168
                self.match(PostgreSQLParser.TABLE)
                self.state = 6169
                self.match(PostgreSQLParser.IF_P)
                self.state = 6170
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6171
                self.relation_expr()
                self.state = 6172
                self.match(PostgreSQLParser.RENAME)
                self.state = 6173
                self.match(PostgreSQLParser.TO)
                self.state = 6174
                self.name()
                pass

            elif la_ == 33:
                self.enterOuterAlt(localctx, 33)
                self.state = 6176
                self.match(PostgreSQLParser.ALTER)
                self.state = 6177
                self.match(PostgreSQLParser.TABLE)
                self.state = 6178
                self.relation_expr()
                self.state = 6179
                self.match(PostgreSQLParser.RENAME)
                self.state = 6180
                self.opt_column()
                self.state = 6181
                self.name()
                self.state = 6182
                self.match(PostgreSQLParser.TO)
                self.state = 6183
                self.name()
                pass

            elif la_ == 34:
                self.enterOuterAlt(localctx, 34)
                self.state = 6185
                self.match(PostgreSQLParser.ALTER)
                self.state = 6186
                self.match(PostgreSQLParser.TABLE)
                self.state = 6187
                self.match(PostgreSQLParser.IF_P)
                self.state = 6188
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6189
                self.relation_expr()
                self.state = 6190
                self.match(PostgreSQLParser.RENAME)
                self.state = 6191
                self.opt_column()
                self.state = 6192
                self.name()
                self.state = 6193
                self.match(PostgreSQLParser.TO)
                self.state = 6194
                self.name()
                pass

            elif la_ == 35:
                self.enterOuterAlt(localctx, 35)
                self.state = 6196
                self.match(PostgreSQLParser.ALTER)
                self.state = 6197
                self.match(PostgreSQLParser.VIEW)
                self.state = 6198
                self.qualified_name()
                self.state = 6199
                self.match(PostgreSQLParser.RENAME)
                self.state = 6200
                self.opt_column()
                self.state = 6201
                self.name()
                self.state = 6202
                self.match(PostgreSQLParser.TO)
                self.state = 6203
                self.name()
                pass

            elif la_ == 36:
                self.enterOuterAlt(localctx, 36)
                self.state = 6205
                self.match(PostgreSQLParser.ALTER)
                self.state = 6206
                self.match(PostgreSQLParser.VIEW)
                self.state = 6207
                self.match(PostgreSQLParser.IF_P)
                self.state = 6208
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6209
                self.qualified_name()
                self.state = 6210
                self.match(PostgreSQLParser.RENAME)
                self.state = 6211
                self.opt_column()
                self.state = 6212
                self.name()
                self.state = 6213
                self.match(PostgreSQLParser.TO)
                self.state = 6214
                self.name()
                pass

            elif la_ == 37:
                self.enterOuterAlt(localctx, 37)
                self.state = 6216
                self.match(PostgreSQLParser.ALTER)
                self.state = 6217
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 6218
                self.match(PostgreSQLParser.VIEW)
                self.state = 6219
                self.qualified_name()
                self.state = 6220
                self.match(PostgreSQLParser.RENAME)
                self.state = 6221
                self.opt_column()
                self.state = 6222
                self.name()
                self.state = 6223
                self.match(PostgreSQLParser.TO)
                self.state = 6224
                self.name()
                pass

            elif la_ == 38:
                self.enterOuterAlt(localctx, 38)
                self.state = 6226
                self.match(PostgreSQLParser.ALTER)
                self.state = 6227
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 6228
                self.match(PostgreSQLParser.VIEW)
                self.state = 6229
                self.match(PostgreSQLParser.IF_P)
                self.state = 6230
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6231
                self.qualified_name()
                self.state = 6232
                self.match(PostgreSQLParser.RENAME)
                self.state = 6233
                self.opt_column()
                self.state = 6234
                self.name()
                self.state = 6235
                self.match(PostgreSQLParser.TO)
                self.state = 6236
                self.name()
                pass

            elif la_ == 39:
                self.enterOuterAlt(localctx, 39)
                self.state = 6238
                self.match(PostgreSQLParser.ALTER)
                self.state = 6239
                self.match(PostgreSQLParser.TABLE)
                self.state = 6240
                self.relation_expr()
                self.state = 6241
                self.match(PostgreSQLParser.RENAME)
                self.state = 6242
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 6243
                self.name()
                self.state = 6244
                self.match(PostgreSQLParser.TO)
                self.state = 6245
                self.name()
                pass

            elif la_ == 40:
                self.enterOuterAlt(localctx, 40)
                self.state = 6247
                self.match(PostgreSQLParser.ALTER)
                self.state = 6248
                self.match(PostgreSQLParser.TABLE)
                self.state = 6249
                self.match(PostgreSQLParser.IF_P)
                self.state = 6250
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6251
                self.relation_expr()
                self.state = 6252
                self.match(PostgreSQLParser.RENAME)
                self.state = 6253
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 6254
                self.name()
                self.state = 6255
                self.match(PostgreSQLParser.TO)
                self.state = 6256
                self.name()
                pass

            elif la_ == 41:
                self.enterOuterAlt(localctx, 41)
                self.state = 6258
                self.match(PostgreSQLParser.ALTER)
                self.state = 6259
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 6260
                self.match(PostgreSQLParser.TABLE)
                self.state = 6261
                self.relation_expr()
                self.state = 6262
                self.match(PostgreSQLParser.RENAME)
                self.state = 6263
                self.opt_column()
                self.state = 6264
                self.name()
                self.state = 6265
                self.match(PostgreSQLParser.TO)
                self.state = 6266
                self.name()
                pass

            elif la_ == 42:
                self.enterOuterAlt(localctx, 42)
                self.state = 6268
                self.match(PostgreSQLParser.ALTER)
                self.state = 6269
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 6270
                self.match(PostgreSQLParser.TABLE)
                self.state = 6271
                self.match(PostgreSQLParser.IF_P)
                self.state = 6272
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6273
                self.relation_expr()
                self.state = 6274
                self.match(PostgreSQLParser.RENAME)
                self.state = 6275
                self.opt_column()
                self.state = 6276
                self.name()
                self.state = 6277
                self.match(PostgreSQLParser.TO)
                self.state = 6278
                self.name()
                pass

            elif la_ == 43:
                self.enterOuterAlt(localctx, 43)
                self.state = 6280
                self.match(PostgreSQLParser.ALTER)
                self.state = 6281
                self.match(PostgreSQLParser.RULE)
                self.state = 6282
                self.name()
                self.state = 6283
                self.match(PostgreSQLParser.ON)
                self.state = 6284
                self.qualified_name()
                self.state = 6285
                self.match(PostgreSQLParser.RENAME)
                self.state = 6286
                self.match(PostgreSQLParser.TO)
                self.state = 6287
                self.name()
                pass

            elif la_ == 44:
                self.enterOuterAlt(localctx, 44)
                self.state = 6289
                self.match(PostgreSQLParser.ALTER)
                self.state = 6290
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 6291
                self.name()
                self.state = 6292
                self.match(PostgreSQLParser.ON)
                self.state = 6293
                self.qualified_name()
                self.state = 6294
                self.match(PostgreSQLParser.RENAME)
                self.state = 6295
                self.match(PostgreSQLParser.TO)
                self.state = 6296
                self.name()
                pass

            elif la_ == 45:
                self.enterOuterAlt(localctx, 45)
                self.state = 6298
                self.match(PostgreSQLParser.ALTER)
                self.state = 6299
                self.match(PostgreSQLParser.EVENT)
                self.state = 6300
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 6301
                self.name()
                self.state = 6302
                self.match(PostgreSQLParser.RENAME)
                self.state = 6303
                self.match(PostgreSQLParser.TO)
                self.state = 6304
                self.name()
                pass

            elif la_ == 46:
                self.enterOuterAlt(localctx, 46)
                self.state = 6306
                self.match(PostgreSQLParser.ALTER)
                self.state = 6307
                self.match(PostgreSQLParser.ROLE)
                self.state = 6308
                self.roleid()
                self.state = 6309
                self.match(PostgreSQLParser.RENAME)
                self.state = 6310
                self.match(PostgreSQLParser.TO)
                self.state = 6311
                self.roleid()
                pass

            elif la_ == 47:
                self.enterOuterAlt(localctx, 47)
                self.state = 6313
                self.match(PostgreSQLParser.ALTER)
                self.state = 6314
                self.match(PostgreSQLParser.USER)
                self.state = 6315
                self.roleid()
                self.state = 6316
                self.match(PostgreSQLParser.RENAME)
                self.state = 6317
                self.match(PostgreSQLParser.TO)
                self.state = 6318
                self.roleid()
                pass

            elif la_ == 48:
                self.enterOuterAlt(localctx, 48)
                self.state = 6320
                self.match(PostgreSQLParser.ALTER)
                self.state = 6321
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 6322
                self.name()
                self.state = 6323
                self.match(PostgreSQLParser.RENAME)
                self.state = 6324
                self.match(PostgreSQLParser.TO)
                self.state = 6325
                self.name()
                pass

            elif la_ == 49:
                self.enterOuterAlt(localctx, 49)
                self.state = 6327
                self.match(PostgreSQLParser.ALTER)
                self.state = 6328
                self.match(PostgreSQLParser.STATISTICS)
                self.state = 6329
                self.any_name()
                self.state = 6330
                self.match(PostgreSQLParser.RENAME)
                self.state = 6331
                self.match(PostgreSQLParser.TO)
                self.state = 6332
                self.name()
                pass

            elif la_ == 50:
                self.enterOuterAlt(localctx, 50)
                self.state = 6334
                self.match(PostgreSQLParser.ALTER)
                self.state = 6335
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6336
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6337
                self.match(PostgreSQLParser.PARSER)
                self.state = 6338
                self.any_name()
                self.state = 6339
                self.match(PostgreSQLParser.RENAME)
                self.state = 6340
                self.match(PostgreSQLParser.TO)
                self.state = 6341
                self.name()
                pass

            elif la_ == 51:
                self.enterOuterAlt(localctx, 51)
                self.state = 6343
                self.match(PostgreSQLParser.ALTER)
                self.state = 6344
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6345
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6346
                self.match(PostgreSQLParser.DICTIONARY)
                self.state = 6347
                self.any_name()
                self.state = 6348
                self.match(PostgreSQLParser.RENAME)
                self.state = 6349
                self.match(PostgreSQLParser.TO)
                self.state = 6350
                self.name()
                pass

            elif la_ == 52:
                self.enterOuterAlt(localctx, 52)
                self.state = 6352
                self.match(PostgreSQLParser.ALTER)
                self.state = 6353
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6354
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6355
                self.match(PostgreSQLParser.TEMPLATE)
                self.state = 6356
                self.any_name()
                self.state = 6357
                self.match(PostgreSQLParser.RENAME)
                self.state = 6358
                self.match(PostgreSQLParser.TO)
                self.state = 6359
                self.name()
                pass

            elif la_ == 53:
                self.enterOuterAlt(localctx, 53)
                self.state = 6361
                self.match(PostgreSQLParser.ALTER)
                self.state = 6362
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6363
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6364
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 6365
                self.any_name()
                self.state = 6366
                self.match(PostgreSQLParser.RENAME)
                self.state = 6367
                self.match(PostgreSQLParser.TO)
                self.state = 6368
                self.name()
                pass

            elif la_ == 54:
                self.enterOuterAlt(localctx, 54)
                self.state = 6370
                self.match(PostgreSQLParser.ALTER)
                self.state = 6371
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 6372
                self.any_name()
                self.state = 6373
                self.match(PostgreSQLParser.RENAME)
                self.state = 6374
                self.match(PostgreSQLParser.TO)
                self.state = 6375
                self.name()
                pass

            elif la_ == 55:
                self.enterOuterAlt(localctx, 55)
                self.state = 6377
                self.match(PostgreSQLParser.ALTER)
                self.state = 6378
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 6379
                self.any_name()
                self.state = 6380
                self.match(PostgreSQLParser.RENAME)
                self.state = 6381
                self.match(PostgreSQLParser.ATTRIBUTE)
                self.state = 6382
                self.name()
                self.state = 6383
                self.match(PostgreSQLParser.TO)
                self.state = 6384
                self.name()
                self.state = 6385
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_columnContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COLUMN(self):
            return self.getToken(PostgreSQLParser.COLUMN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_column

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_column" ):
                listener.enterOpt_column(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_column" ):
                listener.exitOpt_column(self)




    def opt_column(self):

        localctx = PostgreSQLParser.Opt_columnContext(self, self._ctx, self.state)
        self.enterRule(localctx, 724, self.RULE_opt_column)
        try:
            self.state = 6391
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,311,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6389
                self.match(PostgreSQLParser.COLUMN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_set_dataContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_set_data

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_set_data" ):
                listener.enterOpt_set_data(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_set_data" ):
                listener.exitOpt_set_data(self)




    def opt_set_data(self):

        localctx = PostgreSQLParser.Opt_set_dataContext(self, self._ctx, self.state)
        self.enterRule(localctx, 726, self.RULE_opt_set_data)
        try:
            self.state = 6396
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [326]:
                self.enterOuterAlt(localctx, 1)
                self.state = 6393
                self.match(PostgreSQLParser.SET)
                self.state = 6394
                self.match(PostgreSQLParser.DATA_P)
                pass
            elif token in [353]:
                self.enterOuterAlt(localctx, 2)

                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 AlterobjectdependsstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def opt_no(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_noContext,0)


        def DEPENDS(self):
            return self.getToken(PostgreSQLParser.DEPENDS, 0)

        def ON(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.ON)
            else:
                return self.getToken(PostgreSQLParser.ON, i)

        def EXTENSION(self):
            return self.getToken(PostgreSQLParser.EXTENSION, 0)

        def name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.NameContext,i)


        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def MATERIALIZED(self):
            return self.getToken(PostgreSQLParser.MATERIALIZED, 0)

        def VIEW(self):
            return self.getToken(PostgreSQLParser.VIEW, 0)

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterobjectdependsstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterobjectdependsstmt" ):
                listener.enterAlterobjectdependsstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterobjectdependsstmt" ):
                listener.exitAlterobjectdependsstmt(self)




    def alterobjectdependsstmt(self):

        localctx = PostgreSQLParser.AlterobjectdependsstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 728, self.RULE_alterobjectdependsstmt)
        try:
            self.state = 6455
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,313,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6398
                self.match(PostgreSQLParser.ALTER)
                self.state = 6399
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 6400
                self.function_with_argtypes()
                self.state = 6401
                self.opt_no()
                self.state = 6402
                self.match(PostgreSQLParser.DEPENDS)
                self.state = 6403
                self.match(PostgreSQLParser.ON)
                self.state = 6404
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 6405
                self.name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 6407
                self.match(PostgreSQLParser.ALTER)
                self.state = 6408
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 6409
                self.function_with_argtypes()
                self.state = 6410
                self.opt_no()
                self.state = 6411
                self.match(PostgreSQLParser.DEPENDS)
                self.state = 6412
                self.match(PostgreSQLParser.ON)
                self.state = 6413
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 6414
                self.name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 6416
                self.match(PostgreSQLParser.ALTER)
                self.state = 6417
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 6418
                self.function_with_argtypes()
                self.state = 6419
                self.opt_no()
                self.state = 6420
                self.match(PostgreSQLParser.DEPENDS)
                self.state = 6421
                self.match(PostgreSQLParser.ON)
                self.state = 6422
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 6423
                self.name()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 6425
                self.match(PostgreSQLParser.ALTER)
                self.state = 6426
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 6427
                self.name()
                self.state = 6428
                self.match(PostgreSQLParser.ON)
                self.state = 6429
                self.qualified_name()
                self.state = 6430
                self.opt_no()
                self.state = 6431
                self.match(PostgreSQLParser.DEPENDS)
                self.state = 6432
                self.match(PostgreSQLParser.ON)
                self.state = 6433
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 6434
                self.name()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 6436
                self.match(PostgreSQLParser.ALTER)
                self.state = 6437
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 6438
                self.match(PostgreSQLParser.VIEW)
                self.state = 6439
                self.qualified_name()
                self.state = 6440
                self.opt_no()
                self.state = 6441
                self.match(PostgreSQLParser.DEPENDS)
                self.state = 6442
                self.match(PostgreSQLParser.ON)
                self.state = 6443
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 6444
                self.name()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 6446
                self.match(PostgreSQLParser.ALTER)
                self.state = 6447
                self.match(PostgreSQLParser.INDEX)
                self.state = 6448
                self.qualified_name()
                self.state = 6449
                self.opt_no()
                self.state = 6450
                self.match(PostgreSQLParser.DEPENDS)
                self.state = 6451
                self.match(PostgreSQLParser.ON)
                self.state = 6452
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 6453
                self.name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_noContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_no

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_no" ):
                listener.enterOpt_no(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_no" ):
                listener.exitOpt_no(self)




    def opt_no(self):

        localctx = PostgreSQLParser.Opt_noContext(self, self._ctx, self.state)
        self.enterRule(localctx, 730, self.RULE_opt_no)
        try:
            self.state = 6459
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [262]:
                self.enterOuterAlt(localctx, 1)
                self.state = 6457
                self.match(PostgreSQLParser.NO)
                pass
            elif token in [462]:
                self.enterOuterAlt(localctx, 2)

                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 AlterobjectschemastmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def aggregate_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggregate_with_argtypesContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.NameContext,i)


        def COLLATION(self):
            return self.getToken(PostgreSQLParser.COLLATION, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def CONVERSION_P(self):
            return self.getToken(PostgreSQLParser.CONVERSION_P, 0)

        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def EXTENSION(self):
            return self.getToken(PostgreSQLParser.EXTENSION, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def operator_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_with_argtypesContext,0)


        def CLASS(self):
            return self.getToken(PostgreSQLParser.CLASS, 0)

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def relation_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_exprContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def STATISTICS(self):
            return self.getToken(PostgreSQLParser.STATISTICS, 0)

        def TEXT_P(self):
            return self.getToken(PostgreSQLParser.TEXT_P, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def PARSER(self):
            return self.getToken(PostgreSQLParser.PARSER, 0)

        def DICTIONARY(self):
            return self.getToken(PostgreSQLParser.DICTIONARY, 0)

        def TEMPLATE(self):
            return self.getToken(PostgreSQLParser.TEMPLATE, 0)

        def CONFIGURATION(self):
            return self.getToken(PostgreSQLParser.CONFIGURATION, 0)

        def SEQUENCE(self):
            return self.getToken(PostgreSQLParser.SEQUENCE, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def VIEW(self):
            return self.getToken(PostgreSQLParser.VIEW, 0)

        def MATERIALIZED(self):
            return self.getToken(PostgreSQLParser.MATERIALIZED, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterobjectschemastmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterobjectschemastmt" ):
                listener.enterAlterobjectschemastmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterobjectschemastmt" ):
                listener.exitAlterobjectschemastmt(self)




    def alterobjectschemastmt(self):

        localctx = PostgreSQLParser.AlterobjectschemastmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 732, self.RULE_alterobjectschemastmt)
        try:
            self.state = 6678
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,315,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6461
                self.match(PostgreSQLParser.ALTER)
                self.state = 6462
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 6463
                self.aggregate_with_argtypes()
                self.state = 6464
                self.match(PostgreSQLParser.SET)
                self.state = 6465
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6466
                self.name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 6468
                self.match(PostgreSQLParser.ALTER)
                self.state = 6469
                self.match(PostgreSQLParser.COLLATION)
                self.state = 6470
                self.any_name()
                self.state = 6471
                self.match(PostgreSQLParser.SET)
                self.state = 6472
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6473
                self.name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 6475
                self.match(PostgreSQLParser.ALTER)
                self.state = 6476
                self.match(PostgreSQLParser.CONVERSION_P)
                self.state = 6477
                self.any_name()
                self.state = 6478
                self.match(PostgreSQLParser.SET)
                self.state = 6479
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6480
                self.name()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 6482
                self.match(PostgreSQLParser.ALTER)
                self.state = 6483
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 6484
                self.any_name()
                self.state = 6485
                self.match(PostgreSQLParser.SET)
                self.state = 6486
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6487
                self.name()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 6489
                self.match(PostgreSQLParser.ALTER)
                self.state = 6490
                self.match(PostgreSQLParser.EXTENSION)
                self.state = 6491
                self.name()
                self.state = 6492
                self.match(PostgreSQLParser.SET)
                self.state = 6493
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6494
                self.name()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 6496
                self.match(PostgreSQLParser.ALTER)
                self.state = 6497
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 6498
                self.function_with_argtypes()
                self.state = 6499
                self.match(PostgreSQLParser.SET)
                self.state = 6500
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6501
                self.name()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 6503
                self.match(PostgreSQLParser.ALTER)
                self.state = 6504
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 6505
                self.operator_with_argtypes()
                self.state = 6506
                self.match(PostgreSQLParser.SET)
                self.state = 6507
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6508
                self.name()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 6510
                self.match(PostgreSQLParser.ALTER)
                self.state = 6511
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 6512
                self.match(PostgreSQLParser.CLASS)
                self.state = 6513
                self.any_name()
                self.state = 6514
                self.match(PostgreSQLParser.USING)
                self.state = 6515
                self.name()
                self.state = 6516
                self.match(PostgreSQLParser.SET)
                self.state = 6517
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6518
                self.name()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 6520
                self.match(PostgreSQLParser.ALTER)
                self.state = 6521
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 6522
                self.match(PostgreSQLParser.FAMILY)
                self.state = 6523
                self.any_name()
                self.state = 6524
                self.match(PostgreSQLParser.USING)
                self.state = 6525
                self.name()
                self.state = 6526
                self.match(PostgreSQLParser.SET)
                self.state = 6527
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6528
                self.name()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 6530
                self.match(PostgreSQLParser.ALTER)
                self.state = 6531
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 6532
                self.function_with_argtypes()
                self.state = 6533
                self.match(PostgreSQLParser.SET)
                self.state = 6534
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6535
                self.name()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 6537
                self.match(PostgreSQLParser.ALTER)
                self.state = 6538
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 6539
                self.function_with_argtypes()
                self.state = 6540
                self.match(PostgreSQLParser.SET)
                self.state = 6541
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6542
                self.name()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 6544
                self.match(PostgreSQLParser.ALTER)
                self.state = 6545
                self.match(PostgreSQLParser.TABLE)
                self.state = 6546
                self.relation_expr()
                self.state = 6547
                self.match(PostgreSQLParser.SET)
                self.state = 6548
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6549
                self.name()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 6551
                self.match(PostgreSQLParser.ALTER)
                self.state = 6552
                self.match(PostgreSQLParser.TABLE)
                self.state = 6553
                self.match(PostgreSQLParser.IF_P)
                self.state = 6554
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6555
                self.relation_expr()
                self.state = 6556
                self.match(PostgreSQLParser.SET)
                self.state = 6557
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6558
                self.name()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 6560
                self.match(PostgreSQLParser.ALTER)
                self.state = 6561
                self.match(PostgreSQLParser.STATISTICS)
                self.state = 6562
                self.any_name()
                self.state = 6563
                self.match(PostgreSQLParser.SET)
                self.state = 6564
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6565
                self.name()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 6567
                self.match(PostgreSQLParser.ALTER)
                self.state = 6568
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6569
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6570
                self.match(PostgreSQLParser.PARSER)
                self.state = 6571
                self.any_name()
                self.state = 6572
                self.match(PostgreSQLParser.SET)
                self.state = 6573
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6574
                self.name()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 6576
                self.match(PostgreSQLParser.ALTER)
                self.state = 6577
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6578
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6579
                self.match(PostgreSQLParser.DICTIONARY)
                self.state = 6580
                self.any_name()
                self.state = 6581
                self.match(PostgreSQLParser.SET)
                self.state = 6582
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6583
                self.name()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 6585
                self.match(PostgreSQLParser.ALTER)
                self.state = 6586
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6587
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6588
                self.match(PostgreSQLParser.TEMPLATE)
                self.state = 6589
                self.any_name()
                self.state = 6590
                self.match(PostgreSQLParser.SET)
                self.state = 6591
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6592
                self.name()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 6594
                self.match(PostgreSQLParser.ALTER)
                self.state = 6595
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6596
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6597
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 6598
                self.any_name()
                self.state = 6599
                self.match(PostgreSQLParser.SET)
                self.state = 6600
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6601
                self.name()
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 6603
                self.match(PostgreSQLParser.ALTER)
                self.state = 6604
                self.match(PostgreSQLParser.SEQUENCE)
                self.state = 6605
                self.qualified_name()
                self.state = 6606
                self.match(PostgreSQLParser.SET)
                self.state = 6607
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6608
                self.name()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 6610
                self.match(PostgreSQLParser.ALTER)
                self.state = 6611
                self.match(PostgreSQLParser.SEQUENCE)
                self.state = 6612
                self.match(PostgreSQLParser.IF_P)
                self.state = 6613
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6614
                self.qualified_name()
                self.state = 6615
                self.match(PostgreSQLParser.SET)
                self.state = 6616
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6617
                self.name()
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 6619
                self.match(PostgreSQLParser.ALTER)
                self.state = 6620
                self.match(PostgreSQLParser.VIEW)
                self.state = 6621
                self.qualified_name()
                self.state = 6622
                self.match(PostgreSQLParser.SET)
                self.state = 6623
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6624
                self.name()
                pass

            elif la_ == 22:
                self.enterOuterAlt(localctx, 22)
                self.state = 6626
                self.match(PostgreSQLParser.ALTER)
                self.state = 6627
                self.match(PostgreSQLParser.VIEW)
                self.state = 6628
                self.match(PostgreSQLParser.IF_P)
                self.state = 6629
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6630
                self.qualified_name()
                self.state = 6631
                self.match(PostgreSQLParser.SET)
                self.state = 6632
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6633
                self.name()
                pass

            elif la_ == 23:
                self.enterOuterAlt(localctx, 23)
                self.state = 6635
                self.match(PostgreSQLParser.ALTER)
                self.state = 6636
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 6637
                self.match(PostgreSQLParser.VIEW)
                self.state = 6638
                self.qualified_name()
                self.state = 6639
                self.match(PostgreSQLParser.SET)
                self.state = 6640
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6641
                self.name()
                pass

            elif la_ == 24:
                self.enterOuterAlt(localctx, 24)
                self.state = 6643
                self.match(PostgreSQLParser.ALTER)
                self.state = 6644
                self.match(PostgreSQLParser.MATERIALIZED)
                self.state = 6645
                self.match(PostgreSQLParser.VIEW)
                self.state = 6646
                self.match(PostgreSQLParser.IF_P)
                self.state = 6647
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6648
                self.qualified_name()
                self.state = 6649
                self.match(PostgreSQLParser.SET)
                self.state = 6650
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6651
                self.name()
                pass

            elif la_ == 25:
                self.enterOuterAlt(localctx, 25)
                self.state = 6653
                self.match(PostgreSQLParser.ALTER)
                self.state = 6654
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 6655
                self.match(PostgreSQLParser.TABLE)
                self.state = 6656
                self.relation_expr()
                self.state = 6657
                self.match(PostgreSQLParser.SET)
                self.state = 6658
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6659
                self.name()
                pass

            elif la_ == 26:
                self.enterOuterAlt(localctx, 26)
                self.state = 6661
                self.match(PostgreSQLParser.ALTER)
                self.state = 6662
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 6663
                self.match(PostgreSQLParser.TABLE)
                self.state = 6664
                self.match(PostgreSQLParser.IF_P)
                self.state = 6665
                self.match(PostgreSQLParser.EXISTS)
                self.state = 6666
                self.relation_expr()
                self.state = 6667
                self.match(PostgreSQLParser.SET)
                self.state = 6668
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6669
                self.name()
                pass

            elif la_ == 27:
                self.enterOuterAlt(localctx, 27)
                self.state = 6671
                self.match(PostgreSQLParser.ALTER)
                self.state = 6672
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 6673
                self.any_name()
                self.state = 6674
                self.match(PostgreSQLParser.SET)
                self.state = 6675
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6676
                self.name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlteroperatorstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def operator_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_with_argtypesContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def operator_def_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_def_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alteroperatorstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlteroperatorstmt" ):
                listener.enterAlteroperatorstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlteroperatorstmt" ):
                listener.exitAlteroperatorstmt(self)




    def alteroperatorstmt(self):

        localctx = PostgreSQLParser.AlteroperatorstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 734, self.RULE_alteroperatorstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 6680
            self.match(PostgreSQLParser.ALTER)
            self.state = 6681
            self.match(PostgreSQLParser.OPERATOR)
            self.state = 6682
            self.operator_with_argtypes()
            self.state = 6683
            self.match(PostgreSQLParser.SET)
            self.state = 6684
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 6685
            self.operator_def_list()
            self.state = 6686
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Operator_def_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def operator_def_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Operator_def_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Operator_def_elemContext,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_operator_def_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOperator_def_list" ):
                listener.enterOperator_def_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOperator_def_list" ):
                listener.exitOperator_def_list(self)




    def operator_def_list(self):

        localctx = PostgreSQLParser.Operator_def_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 736, self.RULE_operator_def_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 6688
            self.operator_def_elem()
            self.state = 6693
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 6689
                self.match(PostgreSQLParser.COMMA)
                self.state = 6690
                self.operator_def_elem()
                self.state = 6695
                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 Operator_def_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def NONE(self):
            return self.getToken(PostgreSQLParser.NONE, 0)

        def operator_def_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_def_argContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_operator_def_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOperator_def_elem" ):
                listener.enterOperator_def_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOperator_def_elem" ):
                listener.exitOperator_def_elem(self)




    def operator_def_elem(self):

        localctx = PostgreSQLParser.Operator_def_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 738, self.RULE_operator_def_elem)
        try:
            self.state = 6704
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,317,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6696
                self.collabel()
                self.state = 6697
                self.match(PostgreSQLParser.EQUAL)
                self.state = 6698
                self.match(PostgreSQLParser.NONE)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 6700
                self.collabel()
                self.state = 6701
                self.match(PostgreSQLParser.EQUAL)
                self.state = 6702
                self.operator_def_arg()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Operator_def_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_typeContext,0)


        def reserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reserved_keywordContext,0)


        def qual_all_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qual_all_opContext,0)


        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_operator_def_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOperator_def_arg" ):
                listener.enterOperator_def_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOperator_def_arg" ):
                listener.exitOperator_def_arg(self)




    def operator_def_arg(self):

        localctx = PostgreSQLParser.Operator_def_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 740, self.RULE_operator_def_arg)
        try:
            self.state = 6711
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,318,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6706
                self.func_type()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 6707
                self.reserved_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 6708
                self.qual_all_op()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 6709
                self.numericonly()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 6710
                self.sconst()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AltertypestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def operator_def_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_def_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altertypestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAltertypestmt" ):
                listener.enterAltertypestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAltertypestmt" ):
                listener.exitAltertypestmt(self)




    def altertypestmt(self):

        localctx = PostgreSQLParser.AltertypestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 742, self.RULE_altertypestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 6713
            self.match(PostgreSQLParser.ALTER)
            self.state = 6714
            self.match(PostgreSQLParser.TYPE_P)
            self.state = 6715
            self.any_name()
            self.state = 6716
            self.match(PostgreSQLParser.SET)
            self.state = 6717
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 6718
            self.operator_def_list()
            self.state = 6719
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterownerstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def aggregate_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Aggregate_with_argtypesContext,0)


        def OWNER(self):
            return self.getToken(PostgreSQLParser.OWNER, 0)

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def COLLATION(self):
            return self.getToken(PostgreSQLParser.COLLATION, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def CONVERSION_P(self):
            return self.getToken(PostgreSQLParser.CONVERSION_P, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def function_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Function_with_argtypesContext,0)


        def opt_procedural(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_proceduralContext,0)


        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def LARGE_P(self):
            return self.getToken(PostgreSQLParser.LARGE_P, 0)

        def OBJECT_P(self):
            return self.getToken(PostgreSQLParser.OBJECT_P, 0)

        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def operator_with_argtypes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Operator_with_argtypesContext,0)


        def CLASS(self):
            return self.getToken(PostgreSQLParser.CLASS, 0)

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def STATISTICS(self):
            return self.getToken(PostgreSQLParser.STATISTICS, 0)

        def TEXT_P(self):
            return self.getToken(PostgreSQLParser.TEXT_P, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def DICTIONARY(self):
            return self.getToken(PostgreSQLParser.DICTIONARY, 0)

        def CONFIGURATION(self):
            return self.getToken(PostgreSQLParser.CONFIGURATION, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def WRAPPER(self):
            return self.getToken(PostgreSQLParser.WRAPPER, 0)

        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def EVENT(self):
            return self.getToken(PostgreSQLParser.EVENT, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def PUBLICATION(self):
            return self.getToken(PostgreSQLParser.PUBLICATION, 0)

        def SUBSCRIPTION(self):
            return self.getToken(PostgreSQLParser.SUBSCRIPTION, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterownerstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterownerstmt" ):
                listener.enterAlterownerstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterownerstmt" ):
                listener.exitAlterownerstmt(self)




    def alterownerstmt(self):

        localctx = PostgreSQLParser.AlterownerstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 744, self.RULE_alterownerstmt)
        try:
            self.state = 6904
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,319,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6721
                self.match(PostgreSQLParser.ALTER)
                self.state = 6722
                self.match(PostgreSQLParser.AGGREGATE)
                self.state = 6723
                self.aggregate_with_argtypes()
                self.state = 6724
                self.match(PostgreSQLParser.OWNER)
                self.state = 6725
                self.match(PostgreSQLParser.TO)
                self.state = 6726
                self.rolespec()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 6728
                self.match(PostgreSQLParser.ALTER)
                self.state = 6729
                self.match(PostgreSQLParser.COLLATION)
                self.state = 6730
                self.any_name()
                self.state = 6731
                self.match(PostgreSQLParser.OWNER)
                self.state = 6732
                self.match(PostgreSQLParser.TO)
                self.state = 6733
                self.rolespec()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 6735
                self.match(PostgreSQLParser.ALTER)
                self.state = 6736
                self.match(PostgreSQLParser.CONVERSION_P)
                self.state = 6737
                self.any_name()
                self.state = 6738
                self.match(PostgreSQLParser.OWNER)
                self.state = 6739
                self.match(PostgreSQLParser.TO)
                self.state = 6740
                self.rolespec()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 6742
                self.match(PostgreSQLParser.ALTER)
                self.state = 6743
                self.match(PostgreSQLParser.DATABASE)
                self.state = 6744
                self.name()
                self.state = 6745
                self.match(PostgreSQLParser.OWNER)
                self.state = 6746
                self.match(PostgreSQLParser.TO)
                self.state = 6747
                self.rolespec()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 6749
                self.match(PostgreSQLParser.ALTER)
                self.state = 6750
                self.match(PostgreSQLParser.DOMAIN_P)
                self.state = 6751
                self.any_name()
                self.state = 6752
                self.match(PostgreSQLParser.OWNER)
                self.state = 6753
                self.match(PostgreSQLParser.TO)
                self.state = 6754
                self.rolespec()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 6756
                self.match(PostgreSQLParser.ALTER)
                self.state = 6757
                self.match(PostgreSQLParser.FUNCTION)
                self.state = 6758
                self.function_with_argtypes()
                self.state = 6759
                self.match(PostgreSQLParser.OWNER)
                self.state = 6760
                self.match(PostgreSQLParser.TO)
                self.state = 6761
                self.rolespec()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 6763
                self.match(PostgreSQLParser.ALTER)
                self.state = 6764
                self.opt_procedural()
                self.state = 6765
                self.match(PostgreSQLParser.LANGUAGE)
                self.state = 6766
                self.name()
                self.state = 6767
                self.match(PostgreSQLParser.OWNER)
                self.state = 6768
                self.match(PostgreSQLParser.TO)
                self.state = 6769
                self.rolespec()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 6771
                self.match(PostgreSQLParser.ALTER)
                self.state = 6772
                self.match(PostgreSQLParser.LARGE_P)
                self.state = 6773
                self.match(PostgreSQLParser.OBJECT_P)
                self.state = 6774
                self.numericonly()
                self.state = 6775
                self.match(PostgreSQLParser.OWNER)
                self.state = 6776
                self.match(PostgreSQLParser.TO)
                self.state = 6777
                self.rolespec()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 6779
                self.match(PostgreSQLParser.ALTER)
                self.state = 6780
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 6781
                self.operator_with_argtypes()
                self.state = 6782
                self.match(PostgreSQLParser.OWNER)
                self.state = 6783
                self.match(PostgreSQLParser.TO)
                self.state = 6784
                self.rolespec()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 6786
                self.match(PostgreSQLParser.ALTER)
                self.state = 6787
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 6788
                self.match(PostgreSQLParser.CLASS)
                self.state = 6789
                self.any_name()
                self.state = 6790
                self.match(PostgreSQLParser.USING)
                self.state = 6791
                self.name()
                self.state = 6792
                self.match(PostgreSQLParser.OWNER)
                self.state = 6793
                self.match(PostgreSQLParser.TO)
                self.state = 6794
                self.rolespec()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 6796
                self.match(PostgreSQLParser.ALTER)
                self.state = 6797
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 6798
                self.match(PostgreSQLParser.FAMILY)
                self.state = 6799
                self.any_name()
                self.state = 6800
                self.match(PostgreSQLParser.USING)
                self.state = 6801
                self.name()
                self.state = 6802
                self.match(PostgreSQLParser.OWNER)
                self.state = 6803
                self.match(PostgreSQLParser.TO)
                self.state = 6804
                self.rolespec()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 6806
                self.match(PostgreSQLParser.ALTER)
                self.state = 6807
                self.match(PostgreSQLParser.PROCEDURE)
                self.state = 6808
                self.function_with_argtypes()
                self.state = 6809
                self.match(PostgreSQLParser.OWNER)
                self.state = 6810
                self.match(PostgreSQLParser.TO)
                self.state = 6811
                self.rolespec()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 6813
                self.match(PostgreSQLParser.ALTER)
                self.state = 6814
                self.match(PostgreSQLParser.ROUTINE)
                self.state = 6815
                self.function_with_argtypes()
                self.state = 6816
                self.match(PostgreSQLParser.OWNER)
                self.state = 6817
                self.match(PostgreSQLParser.TO)
                self.state = 6818
                self.rolespec()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 6820
                self.match(PostgreSQLParser.ALTER)
                self.state = 6821
                self.match(PostgreSQLParser.SCHEMA)
                self.state = 6822
                self.name()
                self.state = 6823
                self.match(PostgreSQLParser.OWNER)
                self.state = 6824
                self.match(PostgreSQLParser.TO)
                self.state = 6825
                self.rolespec()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 6827
                self.match(PostgreSQLParser.ALTER)
                self.state = 6828
                self.match(PostgreSQLParser.TYPE_P)
                self.state = 6829
                self.any_name()
                self.state = 6830
                self.match(PostgreSQLParser.OWNER)
                self.state = 6831
                self.match(PostgreSQLParser.TO)
                self.state = 6832
                self.rolespec()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 6834
                self.match(PostgreSQLParser.ALTER)
                self.state = 6835
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 6836
                self.name()
                self.state = 6837
                self.match(PostgreSQLParser.OWNER)
                self.state = 6838
                self.match(PostgreSQLParser.TO)
                self.state = 6839
                self.rolespec()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 6841
                self.match(PostgreSQLParser.ALTER)
                self.state = 6842
                self.match(PostgreSQLParser.STATISTICS)
                self.state = 6843
                self.any_name()
                self.state = 6844
                self.match(PostgreSQLParser.OWNER)
                self.state = 6845
                self.match(PostgreSQLParser.TO)
                self.state = 6846
                self.rolespec()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 6848
                self.match(PostgreSQLParser.ALTER)
                self.state = 6849
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6850
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6851
                self.match(PostgreSQLParser.DICTIONARY)
                self.state = 6852
                self.any_name()
                self.state = 6853
                self.match(PostgreSQLParser.OWNER)
                self.state = 6854
                self.match(PostgreSQLParser.TO)
                self.state = 6855
                self.rolespec()
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 6857
                self.match(PostgreSQLParser.ALTER)
                self.state = 6858
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 6859
                self.match(PostgreSQLParser.SEARCH)
                self.state = 6860
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 6861
                self.any_name()
                self.state = 6862
                self.match(PostgreSQLParser.OWNER)
                self.state = 6863
                self.match(PostgreSQLParser.TO)
                self.state = 6864
                self.rolespec()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 6866
                self.match(PostgreSQLParser.ALTER)
                self.state = 6867
                self.match(PostgreSQLParser.FOREIGN)
                self.state = 6868
                self.match(PostgreSQLParser.DATA_P)
                self.state = 6869
                self.match(PostgreSQLParser.WRAPPER)
                self.state = 6870
                self.name()
                self.state = 6871
                self.match(PostgreSQLParser.OWNER)
                self.state = 6872
                self.match(PostgreSQLParser.TO)
                self.state = 6873
                self.rolespec()
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 6875
                self.match(PostgreSQLParser.ALTER)
                self.state = 6876
                self.match(PostgreSQLParser.SERVER)
                self.state = 6877
                self.name()
                self.state = 6878
                self.match(PostgreSQLParser.OWNER)
                self.state = 6879
                self.match(PostgreSQLParser.TO)
                self.state = 6880
                self.rolespec()
                pass

            elif la_ == 22:
                self.enterOuterAlt(localctx, 22)
                self.state = 6882
                self.match(PostgreSQLParser.ALTER)
                self.state = 6883
                self.match(PostgreSQLParser.EVENT)
                self.state = 6884
                self.match(PostgreSQLParser.TRIGGER)
                self.state = 6885
                self.name()
                self.state = 6886
                self.match(PostgreSQLParser.OWNER)
                self.state = 6887
                self.match(PostgreSQLParser.TO)
                self.state = 6888
                self.rolespec()
                pass

            elif la_ == 23:
                self.enterOuterAlt(localctx, 23)
                self.state = 6890
                self.match(PostgreSQLParser.ALTER)
                self.state = 6891
                self.match(PostgreSQLParser.PUBLICATION)
                self.state = 6892
                self.name()
                self.state = 6893
                self.match(PostgreSQLParser.OWNER)
                self.state = 6894
                self.match(PostgreSQLParser.TO)
                self.state = 6895
                self.rolespec()
                pass

            elif la_ == 24:
                self.enterOuterAlt(localctx, 24)
                self.state = 6897
                self.match(PostgreSQLParser.ALTER)
                self.state = 6898
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 6899
                self.name()
                self.state = 6900
                self.match(PostgreSQLParser.OWNER)
                self.state = 6901
                self.match(PostgreSQLParser.TO)
                self.state = 6902
                self.rolespec()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatepublicationstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def PUBLICATION(self):
            return self.getToken(PostgreSQLParser.PUBLICATION, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_publication_for_tables(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_publication_for_tablesContext,0)


        def opt_definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_definitionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createpublicationstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatepublicationstmt" ):
                listener.enterCreatepublicationstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatepublicationstmt" ):
                listener.exitCreatepublicationstmt(self)




    def createpublicationstmt(self):

        localctx = PostgreSQLParser.CreatepublicationstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 746, self.RULE_createpublicationstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 6906
            self.match(PostgreSQLParser.CREATE)
            self.state = 6907
            self.match(PostgreSQLParser.PUBLICATION)
            self.state = 6908
            self.name()
            self.state = 6909
            self.opt_publication_for_tables()
            self.state = 6910
            self.opt_definition()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_publication_for_tablesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def publication_for_tables(self):
            return self.getTypedRuleContext(PostgreSQLParser.Publication_for_tablesContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_publication_for_tables

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_publication_for_tables" ):
                listener.enterOpt_publication_for_tables(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_publication_for_tables" ):
                listener.exitOpt_publication_for_tables(self)




    def opt_publication_for_tables(self):

        localctx = PostgreSQLParser.Opt_publication_for_tablesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 748, self.RULE_opt_publication_for_tables)
        try:
            self.state = 6914
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62]:
                self.enterOuterAlt(localctx, 1)
                self.state = 6912
                self.publication_for_tables()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Publication_for_tablesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def relation_expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_expr_listContext,0)


        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def TABLES(self):
            return self.getToken(PostgreSQLParser.TABLES, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_publication_for_tables

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPublication_for_tables" ):
                listener.enterPublication_for_tables(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPublication_for_tables" ):
                listener.exitPublication_for_tables(self)




    def publication_for_tables(self):

        localctx = PostgreSQLParser.Publication_for_tablesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 750, self.RULE_publication_for_tables)
        try:
            self.state = 6922
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,321,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6916
                self.match(PostgreSQLParser.FOR)
                self.state = 6917
                self.match(PostgreSQLParser.TABLE)
                self.state = 6918
                self.relation_expr_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 6919
                self.match(PostgreSQLParser.FOR)
                self.state = 6920
                self.match(PostgreSQLParser.ALL)
                self.state = 6921
                self.match(PostgreSQLParser.TABLES)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterpublicationstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def PUBLICATION(self):
            return self.getToken(PostgreSQLParser.PUBLICATION, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.DefinitionContext,0)


        def ADD_P(self):
            return self.getToken(PostgreSQLParser.ADD_P, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def relation_expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_expr_listContext,0)


        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterpublicationstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterpublicationstmt" ):
                listener.enterAlterpublicationstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterpublicationstmt" ):
                listener.exitAlterpublicationstmt(self)




    def alterpublicationstmt(self):

        localctx = PostgreSQLParser.AlterpublicationstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 752, self.RULE_alterpublicationstmt)
        try:
            self.state = 6951
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,322,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6924
                self.match(PostgreSQLParser.ALTER)
                self.state = 6925
                self.match(PostgreSQLParser.PUBLICATION)
                self.state = 6926
                self.name()
                self.state = 6927
                self.match(PostgreSQLParser.SET)
                self.state = 6928
                self.definition()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 6930
                self.match(PostgreSQLParser.ALTER)
                self.state = 6931
                self.match(PostgreSQLParser.PUBLICATION)
                self.state = 6932
                self.name()
                self.state = 6933
                self.match(PostgreSQLParser.ADD_P)
                self.state = 6934
                self.match(PostgreSQLParser.TABLE)
                self.state = 6935
                self.relation_expr_list()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 6937
                self.match(PostgreSQLParser.ALTER)
                self.state = 6938
                self.match(PostgreSQLParser.PUBLICATION)
                self.state = 6939
                self.name()
                self.state = 6940
                self.match(PostgreSQLParser.SET)
                self.state = 6941
                self.match(PostgreSQLParser.TABLE)
                self.state = 6942
                self.relation_expr_list()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 6944
                self.match(PostgreSQLParser.ALTER)
                self.state = 6945
                self.match(PostgreSQLParser.PUBLICATION)
                self.state = 6946
                self.name()
                self.state = 6947
                self.match(PostgreSQLParser.DROP)
                self.state = 6948
                self.match(PostgreSQLParser.TABLE)
                self.state = 6949
                self.relation_expr_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 CreatesubscriptionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def SUBSCRIPTION(self):
            return self.getToken(PostgreSQLParser.SUBSCRIPTION, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def CONNECTION(self):
            return self.getToken(PostgreSQLParser.CONNECTION, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def PUBLICATION(self):
            return self.getToken(PostgreSQLParser.PUBLICATION, 0)

        def publication_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Publication_name_listContext,0)


        def opt_definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_definitionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createsubscriptionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatesubscriptionstmt" ):
                listener.enterCreatesubscriptionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatesubscriptionstmt" ):
                listener.exitCreatesubscriptionstmt(self)




    def createsubscriptionstmt(self):

        localctx = PostgreSQLParser.CreatesubscriptionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 754, self.RULE_createsubscriptionstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 6953
            self.match(PostgreSQLParser.CREATE)
            self.state = 6954
            self.match(PostgreSQLParser.SUBSCRIPTION)
            self.state = 6955
            self.name()
            self.state = 6956
            self.match(PostgreSQLParser.CONNECTION)
            self.state = 6957
            self.sconst()
            self.state = 6958
            self.match(PostgreSQLParser.PUBLICATION)
            self.state = 6959
            self.publication_name_list()
            self.state = 6960
            self.opt_definition()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Publication_name_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def publication_name_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Publication_name_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Publication_name_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_publication_name_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPublication_name_list" ):
                listener.enterPublication_name_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPublication_name_list" ):
                listener.exitPublication_name_list(self)




    def publication_name_list(self):

        localctx = PostgreSQLParser.Publication_name_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 756, self.RULE_publication_name_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 6962
            self.publication_name_item()
            self.state = 6967
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 6963
                self.match(PostgreSQLParser.COMMA)
                self.state = 6964
                self.publication_name_item()
                self.state = 6969
                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 Publication_name_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_publication_name_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPublication_name_item" ):
                listener.enterPublication_name_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPublication_name_item" ):
                listener.exitPublication_name_item(self)




    def publication_name_item(self):

        localctx = PostgreSQLParser.Publication_name_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 758, self.RULE_publication_name_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 6970
            self.collabel()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AltersubscriptionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def SUBSCRIPTION(self):
            return self.getToken(PostgreSQLParser.SUBSCRIPTION, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.DefinitionContext,0)


        def CONNECTION(self):
            return self.getToken(PostgreSQLParser.CONNECTION, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def REFRESH(self):
            return self.getToken(PostgreSQLParser.REFRESH, 0)

        def PUBLICATION(self):
            return self.getToken(PostgreSQLParser.PUBLICATION, 0)

        def opt_definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_definitionContext,0)


        def publication_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Publication_name_listContext,0)


        def ENABLE_P(self):
            return self.getToken(PostgreSQLParser.ENABLE_P, 0)

        def DISABLE_P(self):
            return self.getToken(PostgreSQLParser.DISABLE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altersubscriptionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAltersubscriptionstmt" ):
                listener.enterAltersubscriptionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAltersubscriptionstmt" ):
                listener.exitAltersubscriptionstmt(self)




    def altersubscriptionstmt(self):

        localctx = PostgreSQLParser.AltersubscriptionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 760, self.RULE_altersubscriptionstmt)
        try:
            self.state = 7009
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,324,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 6972
                self.match(PostgreSQLParser.ALTER)
                self.state = 6973
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 6974
                self.name()
                self.state = 6975
                self.match(PostgreSQLParser.SET)
                self.state = 6976
                self.definition()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 6978
                self.match(PostgreSQLParser.ALTER)
                self.state = 6979
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 6980
                self.name()
                self.state = 6981
                self.match(PostgreSQLParser.CONNECTION)
                self.state = 6982
                self.sconst()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 6984
                self.match(PostgreSQLParser.ALTER)
                self.state = 6985
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 6986
                self.name()
                self.state = 6987
                self.match(PostgreSQLParser.REFRESH)
                self.state = 6988
                self.match(PostgreSQLParser.PUBLICATION)
                self.state = 6989
                self.opt_definition()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 6991
                self.match(PostgreSQLParser.ALTER)
                self.state = 6992
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 6993
                self.name()
                self.state = 6994
                self.match(PostgreSQLParser.SET)
                self.state = 6995
                self.match(PostgreSQLParser.PUBLICATION)
                self.state = 6996
                self.publication_name_list()
                self.state = 6997
                self.opt_definition()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 6999
                self.match(PostgreSQLParser.ALTER)
                self.state = 7000
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 7001
                self.name()
                self.state = 7002
                self.match(PostgreSQLParser.ENABLE_P)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 7004
                self.match(PostgreSQLParser.ALTER)
                self.state = 7005
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 7006
                self.name()
                self.state = 7007
                self.match(PostgreSQLParser.DISABLE_P)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DropsubscriptionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def SUBSCRIPTION(self):
            return self.getToken(PostgreSQLParser.SUBSCRIPTION, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dropsubscriptionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDropsubscriptionstmt" ):
                listener.enterDropsubscriptionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDropsubscriptionstmt" ):
                listener.exitDropsubscriptionstmt(self)




    def dropsubscriptionstmt(self):

        localctx = PostgreSQLParser.DropsubscriptionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 762, self.RULE_dropsubscriptionstmt)
        try:
            self.state = 7023
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,325,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7011
                self.match(PostgreSQLParser.DROP)
                self.state = 7012
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 7013
                self.name()
                self.state = 7014
                self.opt_drop_behavior()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7016
                self.match(PostgreSQLParser.DROP)
                self.state = 7017
                self.match(PostgreSQLParser.SUBSCRIPTION)
                self.state = 7018
                self.match(PostgreSQLParser.IF_P)
                self.state = 7019
                self.match(PostgreSQLParser.EXISTS)
                self.state = 7020
                self.name()
                self.state = 7021
                self.opt_drop_behavior()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RulestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opt_or_replace(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_or_replaceContext,0)


        def RULE(self):
            return self.getToken(PostgreSQLParser.RULE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def event(self):
            return self.getTypedRuleContext(PostgreSQLParser.EventContext,0)


        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def where_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_clauseContext,0)


        def DO(self):
            return self.getToken(PostgreSQLParser.DO, 0)

        def opt_instead(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_insteadContext,0)


        def ruleactionlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.RuleactionlistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rulestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRulestmt" ):
                listener.enterRulestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRulestmt" ):
                listener.exitRulestmt(self)




    def rulestmt(self):

        localctx = PostgreSQLParser.RulestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 764, self.RULE_rulestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7025
            self.match(PostgreSQLParser.CREATE)
            self.state = 7026
            self.opt_or_replace()
            self.state = 7027
            self.match(PostgreSQLParser.RULE)
            self.state = 7028
            self.name()
            self.state = 7029
            self.match(PostgreSQLParser.AS)
            self.state = 7030
            self.match(PostgreSQLParser.ON)
            self.state = 7031
            self.event()
            self.state = 7032
            self.match(PostgreSQLParser.TO)
            self.state = 7033
            self.qualified_name()
            self.state = 7034
            self.where_clause()
            self.state = 7035
            self.match(PostgreSQLParser.DO)
            self.state = 7036
            self.opt_instead()
            self.state = 7037
            self.ruleactionlist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RuleactionlistContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NOTHING(self):
            return self.getToken(PostgreSQLParser.NOTHING, 0)

        def ruleactionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RuleactionstmtContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def ruleactionmulti(self):
            return self.getTypedRuleContext(PostgreSQLParser.RuleactionmultiContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_ruleactionlist

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRuleactionlist" ):
                listener.enterRuleactionlist(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRuleactionlist" ):
                listener.exitRuleactionlist(self)




    def ruleactionlist(self):

        localctx = PostgreSQLParser.RuleactionlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 766, self.RULE_ruleactionlist)
        try:
            self.state = 7045
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,326,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7039
                self.match(PostgreSQLParser.NOTHING)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7040
                self.ruleactionstmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7041
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7042
                self.ruleactionmulti()
                self.state = 7043
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RuleactionmultiContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ruleactionstmtOrEmpty(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.RuleactionstmtOrEmptyContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.RuleactionstmtOrEmptyContext,i)


        def SEMI(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.SEMI)
            else:
                return self.getToken(PostgreSQLParser.SEMI, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_ruleactionmulti

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRuleactionmulti" ):
                listener.enterRuleactionmulti(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRuleactionmulti" ):
                listener.exitRuleactionmulti(self)




    def ruleactionmulti(self):

        localctx = PostgreSQLParser.RuleactionmultiContext(self, self._ctx, self.state)
        self.enterRule(localctx, 768, self.RULE_ruleactionmulti)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7047
            self.ruleactionstmtOrEmpty()
            self.state = 7052
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==7:
                self.state = 7048
                self.match(PostgreSQLParser.SEMI)
                self.state = 7049
                self.ruleactionstmtOrEmpty()
                self.state = 7054
                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 RuleactionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def insertstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.InsertstmtContext,0)


        def updatestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.UpdatestmtContext,0)


        def deletestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DeletestmtContext,0)


        def notifystmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.NotifystmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_ruleactionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRuleactionstmt" ):
                listener.enterRuleactionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRuleactionstmt" ):
                listener.exitRuleactionstmt(self)




    def ruleactionstmt(self):

        localctx = PostgreSQLParser.RuleactionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 770, self.RULE_ruleactionstmt)
        try:
            self.state = 7060
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,328,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7055
                self.selectstmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7056
                self.insertstmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7057
                self.updatestmt()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7058
                self.deletestmt()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 7059
                self.notifystmt()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RuleactionstmtOrEmptyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ruleactionstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RuleactionstmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_ruleactionstmtOrEmpty

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRuleactionstmtOrEmpty" ):
                listener.enterRuleactionstmtOrEmpty(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRuleactionstmtOrEmpty" ):
                listener.exitRuleactionstmtOrEmpty(self)




    def ruleactionstmtOrEmpty(self):

        localctx = PostgreSQLParser.RuleactionstmtOrEmptyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 772, self.RULE_ruleactionstmtOrEmpty)
        try:
            self.state = 7064
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 88, 92, 105, 182, 232, 264, 362, 415]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7062
                self.ruleactionstmt()
                pass
            elif token in [3, 7]:
                self.enterOuterAlt(localctx, 2)

                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 EventContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SELECT(self):
            return self.getToken(PostgreSQLParser.SELECT, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def DELETE_P(self):
            return self.getToken(PostgreSQLParser.DELETE_P, 0)

        def INSERT(self):
            return self.getToken(PostgreSQLParser.INSERT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_event

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEvent" ):
                listener.enterEvent(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEvent" ):
                listener.exitEvent(self)




    def event(self):

        localctx = PostgreSQLParser.EventContext(self, self._ctx, self.state)
        self.enterRule(localctx, 774, self.RULE_event)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7066
            _la = self._input.LA(1)
            if not(_la==88 or _la==182 or _la==232 or _la==362):
                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 Opt_insteadContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INSTEAD(self):
            return self.getToken(PostgreSQLParser.INSTEAD, 0)

        def ALSO(self):
            return self.getToken(PostgreSQLParser.ALSO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_instead

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_instead" ):
                listener.enterOpt_instead(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_instead" ):
                listener.exitOpt_instead(self)




    def opt_instead(self):

        localctx = PostgreSQLParser.Opt_insteadContext(self, self._ctx, self.state)
        self.enterRule(localctx, 776, self.RULE_opt_instead)
        try:
            self.state = 7071
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [233]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7068
                self.match(PostgreSQLParser.INSTEAD)
                pass
            elif token in [137]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7069
                self.match(PostgreSQLParser.ALSO)
                pass
            elif token in [2, 88, 92, 105, 182, 232, 263, 264, 362, 415]:
                self.enterOuterAlt(localctx, 3)

                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 NotifystmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NOTIFY(self):
            return self.getToken(PostgreSQLParser.NOTIFY, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def notify_payload(self):
            return self.getTypedRuleContext(PostgreSQLParser.Notify_payloadContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_notifystmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNotifystmt" ):
                listener.enterNotifystmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNotifystmt" ):
                listener.exitNotifystmt(self)




    def notifystmt(self):

        localctx = PostgreSQLParser.NotifystmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 778, self.RULE_notifystmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7073
            self.match(PostgreSQLParser.NOTIFY)
            self.state = 7074
            self.colid()
            self.state = 7075
            self.notify_payload()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Notify_payloadContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_notify_payload

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNotify_payload" ):
                listener.enterNotify_payload(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNotify_payload" ):
                listener.exitNotify_payload(self)




    def notify_payload(self):

        localctx = PostgreSQLParser.Notify_payloadContext(self, self._ctx, self.state)
        self.enterRule(localctx, 780, self.RULE_notify_payload)
        try:
            self.state = 7080
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [6]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7077
                self.match(PostgreSQLParser.COMMA)
                self.state = 7078
                self.sconst()
                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 ListenstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LISTEN(self):
            return self.getToken(PostgreSQLParser.LISTEN, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_listenstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterListenstmt" ):
                listener.enterListenstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitListenstmt" ):
                listener.exitListenstmt(self)




    def listenstmt(self):

        localctx = PostgreSQLParser.ListenstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 782, self.RULE_listenstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7082
            self.match(PostgreSQLParser.LISTEN)
            self.state = 7083
            self.colid()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UnlistenstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def UNLISTEN(self):
            return self.getToken(PostgreSQLParser.UNLISTEN, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def STAR(self):
            return self.getToken(PostgreSQLParser.STAR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_unlistenstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterUnlistenstmt" ):
                listener.enterUnlistenstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitUnlistenstmt" ):
                listener.exitUnlistenstmt(self)




    def unlistenstmt(self):

        localctx = PostgreSQLParser.UnlistenstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 784, self.RULE_unlistenstmt)
        try:
            self.state = 7089
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,332,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7085
                self.match(PostgreSQLParser.UNLISTEN)
                self.state = 7086
                self.colid()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7087
                self.match(PostgreSQLParser.UNLISTEN)
                self.state = 7088
                self.match(PostgreSQLParser.STAR)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TransactionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ABORT_P(self):
            return self.getToken(PostgreSQLParser.ABORT_P, 0)

        def opt_transaction(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_transactionContext,0)


        def opt_transaction_chain(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_transaction_chainContext,0)


        def BEGIN_P(self):
            return self.getToken(PostgreSQLParser.BEGIN_P, 0)

        def transaction_mode_list_or_empty(self):
            return self.getTypedRuleContext(PostgreSQLParser.Transaction_mode_list_or_emptyContext,0)


        def START(self):
            return self.getToken(PostgreSQLParser.START, 0)

        def TRANSACTION(self):
            return self.getToken(PostgreSQLParser.TRANSACTION, 0)

        def COMMIT(self):
            return self.getToken(PostgreSQLParser.COMMIT, 0)

        def END_P(self):
            return self.getToken(PostgreSQLParser.END_P, 0)

        def ROLLBACK(self):
            return self.getToken(PostgreSQLParser.ROLLBACK, 0)

        def SAVEPOINT(self):
            return self.getToken(PostgreSQLParser.SAVEPOINT, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def RELEASE(self):
            return self.getToken(PostgreSQLParser.RELEASE, 0)

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def PREPARE(self):
            return self.getToken(PostgreSQLParser.PREPARE, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def PREPARED(self):
            return self.getToken(PostgreSQLParser.PREPARED, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_transactionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransactionstmt" ):
                listener.enterTransactionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransactionstmt" ):
                listener.exitTransactionstmt(self)




    def transactionstmt(self):

        localctx = PostgreSQLParser.TransactionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 786, self.RULE_transactionstmt)
        try:
            self.state = 7141
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,333,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7091
                self.match(PostgreSQLParser.ABORT_P)
                self.state = 7092
                self.opt_transaction()
                self.state = 7093
                self.opt_transaction_chain()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7095
                self.match(PostgreSQLParser.BEGIN_P)
                self.state = 7096
                self.opt_transaction()
                self.state = 7097
                self.transaction_mode_list_or_empty()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7099
                self.match(PostgreSQLParser.START)
                self.state = 7100
                self.match(PostgreSQLParser.TRANSACTION)
                self.state = 7101
                self.transaction_mode_list_or_empty()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7102
                self.match(PostgreSQLParser.COMMIT)
                self.state = 7103
                self.opt_transaction()
                self.state = 7104
                self.opt_transaction_chain()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 7106
                self.match(PostgreSQLParser.END_P)
                self.state = 7107
                self.opt_transaction()
                self.state = 7108
                self.opt_transaction_chain()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 7110
                self.match(PostgreSQLParser.ROLLBACK)
                self.state = 7111
                self.opt_transaction()
                self.state = 7112
                self.opt_transaction_chain()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 7114
                self.match(PostgreSQLParser.SAVEPOINT)
                self.state = 7115
                self.colid()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 7116
                self.match(PostgreSQLParser.RELEASE)
                self.state = 7117
                self.match(PostgreSQLParser.SAVEPOINT)
                self.state = 7118
                self.colid()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 7119
                self.match(PostgreSQLParser.RELEASE)
                self.state = 7120
                self.colid()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 7121
                self.match(PostgreSQLParser.ROLLBACK)
                self.state = 7122
                self.opt_transaction()
                self.state = 7123
                self.match(PostgreSQLParser.TO)
                self.state = 7124
                self.match(PostgreSQLParser.SAVEPOINT)
                self.state = 7125
                self.colid()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 7127
                self.match(PostgreSQLParser.ROLLBACK)
                self.state = 7128
                self.opt_transaction()
                self.state = 7129
                self.match(PostgreSQLParser.TO)
                self.state = 7130
                self.colid()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 7132
                self.match(PostgreSQLParser.PREPARE)
                self.state = 7133
                self.match(PostgreSQLParser.TRANSACTION)
                self.state = 7134
                self.sconst()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 7135
                self.match(PostgreSQLParser.COMMIT)
                self.state = 7136
                self.match(PostgreSQLParser.PREPARED)
                self.state = 7137
                self.sconst()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 7138
                self.match(PostgreSQLParser.ROLLBACK)
                self.state = 7139
                self.match(PostgreSQLParser.PREPARED)
                self.state = 7140
                self.sconst()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_transactionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORK(self):
            return self.getToken(PostgreSQLParser.WORK, 0)

        def TRANSACTION(self):
            return self.getToken(PostgreSQLParser.TRANSACTION, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_transaction

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_transaction" ):
                listener.enterOpt_transaction(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_transaction" ):
                listener.exitOpt_transaction(self)




    def opt_transaction(self):

        localctx = PostgreSQLParser.Opt_transactionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 788, self.RULE_opt_transaction)
        try:
            self.state = 7146
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [373]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7143
                self.match(PostgreSQLParser.WORK)
                pass
            elif token in [349]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7144
                self.match(PostgreSQLParser.TRANSACTION)
                pass
            elif token in [-1, 2, 7, 31, 32, 33, 46, 54, 57, 61, 65, 71, 77, 88, 92, 94, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 235, 243, 244, 247, 253, 258, 264, 283, 293, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 3)

                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 Transaction_mode_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ISOLATION(self):
            return self.getToken(PostgreSQLParser.ISOLATION, 0)

        def LEVEL(self):
            return self.getToken(PostgreSQLParser.LEVEL, 0)

        def iso_level(self):
            return self.getTypedRuleContext(PostgreSQLParser.Iso_levelContext,0)


        def READ(self):
            return self.getToken(PostgreSQLParser.READ, 0)

        def ONLY(self):
            return self.getToken(PostgreSQLParser.ONLY, 0)

        def WRITE(self):
            return self.getToken(PostgreSQLParser.WRITE, 0)

        def DEFERRABLE(self):
            return self.getToken(PostgreSQLParser.DEFERRABLE, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_transaction_mode_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransaction_mode_item" ):
                listener.enterTransaction_mode_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransaction_mode_item" ):
                listener.exitTransaction_mode_item(self)




    def transaction_mode_item(self):

        localctx = PostgreSQLParser.Transaction_mode_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 790, self.RULE_transaction_mode_item)
        try:
            self.state = 7158
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,335,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7148
                self.match(PostgreSQLParser.ISOLATION)
                self.state = 7149
                self.match(PostgreSQLParser.LEVEL)
                self.state = 7150
                self.iso_level()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7151
                self.match(PostgreSQLParser.READ)
                self.state = 7152
                self.match(PostgreSQLParser.ONLY)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7153
                self.match(PostgreSQLParser.READ)
                self.state = 7154
                self.match(PostgreSQLParser.WRITE)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7155
                self.match(PostgreSQLParser.DEFERRABLE)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 7156
                self.match(PostgreSQLParser.NOT)
                self.state = 7157
                self.match(PostgreSQLParser.DEFERRABLE)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Transaction_mode_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def transaction_mode_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Transaction_mode_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Transaction_mode_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_transaction_mode_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransaction_mode_list" ):
                listener.enterTransaction_mode_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransaction_mode_list" ):
                listener.exitTransaction_mode_list(self)




    def transaction_mode_list(self):

        localctx = PostgreSQLParser.Transaction_mode_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 792, self.RULE_transaction_mode_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7160
            self.transaction_mode_item()
            self.state = 7167
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6 or _la==54 or _la==77 or _la==235 or _la==293:
                self.state = 7162
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==6:
                    self.state = 7161
                    self.match(PostgreSQLParser.COMMA)


                self.state = 7164
                self.transaction_mode_item()
                self.state = 7169
                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 Transaction_mode_list_or_emptyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def transaction_mode_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Transaction_mode_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_transaction_mode_list_or_empty

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransaction_mode_list_or_empty" ):
                listener.enterTransaction_mode_list_or_empty(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransaction_mode_list_or_empty" ):
                listener.exitTransaction_mode_list_or_empty(self)




    def transaction_mode_list_or_empty(self):

        localctx = PostgreSQLParser.Transaction_mode_list_or_emptyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 794, self.RULE_transaction_mode_list_or_empty)
        try:
            self.state = 7172
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [54, 77, 235, 293]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7170
                self.transaction_mode_list()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_transaction_chainContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AND(self):
            return self.getToken(PostgreSQLParser.AND, 0)

        def CHAIN(self):
            return self.getToken(PostgreSQLParser.CHAIN, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_transaction_chain

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_transaction_chain" ):
                listener.enterOpt_transaction_chain(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_transaction_chain" ):
                listener.exitOpt_transaction_chain(self)




    def opt_transaction_chain(self):

        localctx = PostgreSQLParser.Opt_transaction_chainContext(self, self._ctx, self.state)
        self.enterRule(localctx, 796, self.RULE_opt_transaction_chain)
        self._la = 0 # Token type
        try:
            self.state = 7180
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7174
                self.match(PostgreSQLParser.AND)
                self.state = 7176
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==262:
                    self.state = 7175
                    self.match(PostgreSQLParser.NO)


                self.state = 7178
                self.match(PostgreSQLParser.CHAIN)
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 ViewstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opttemp(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttempContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def opt_check_option(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_check_optionContext,0)


        def VIEW(self):
            return self.getToken(PostgreSQLParser.VIEW, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def opt_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_column_listContext,0)


        def opt_reloptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_reloptionsContext,0)


        def RECURSIVE(self):
            return self.getToken(PostgreSQLParser.RECURSIVE, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def columnlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnlistContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def OR(self):
            return self.getToken(PostgreSQLParser.OR, 0)

        def REPLACE(self):
            return self.getToken(PostgreSQLParser.REPLACE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_viewstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterViewstmt" ):
                listener.enterViewstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitViewstmt" ):
                listener.exitViewstmt(self)




    def viewstmt(self):

        localctx = PostgreSQLParser.ViewstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 798, self.RULE_viewstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7182
            self.match(PostgreSQLParser.CREATE)
            self.state = 7185
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==82:
                self.state = 7183
                self.match(PostgreSQLParser.OR)
                self.state = 7184
                self.match(PostgreSQLParser.REPLACE)


            self.state = 7187
            self.opttemp()
            self.state = 7201
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [369]:
                self.state = 7188
                self.match(PostgreSQLParser.VIEW)
                self.state = 7189
                self.qualified_name()
                self.state = 7190
                self.opt_column_list()
                self.state = 7191
                self.opt_reloptions()
                pass
            elif token in [296]:
                self.state = 7193
                self.match(PostgreSQLParser.RECURSIVE)
                self.state = 7194
                self.match(PostgreSQLParser.VIEW)
                self.state = 7195
                self.qualified_name()
                self.state = 7196
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7197
                self.columnlist()
                self.state = 7198
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 7199
                self.opt_reloptions()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 7203
            self.match(PostgreSQLParser.AS)
            self.state = 7204
            self.selectstmt()
            self.state = 7205
            self.opt_check_option()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_check_optionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def CHECK(self):
            return self.getToken(PostgreSQLParser.CHECK, 0)

        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def CASCADED(self):
            return self.getToken(PostgreSQLParser.CASCADED, 0)

        def LOCAL(self):
            return self.getToken(PostgreSQLParser.LOCAL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_check_option

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_check_option" ):
                listener.enterOpt_check_option(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_check_option" ):
                listener.exitOpt_check_option(self)




    def opt_check_option(self):

        localctx = PostgreSQLParser.Opt_check_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 800, self.RULE_opt_check_option)
        self._la = 0 # Token type
        try:
            self.state = 7214
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,344,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7207
                self.match(PostgreSQLParser.WITH)
                self.state = 7209
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==151 or _la==245:
                    self.state = 7208
                    _la = self._input.LA(1)
                    if not(_la==151 or _la==245):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 7211
                self.match(PostgreSQLParser.CHECK)
                self.state = 7212
                self.match(PostgreSQLParser.OPTION)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LoadstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LOAD(self):
            return self.getToken(PostgreSQLParser.LOAD, 0)

        def file_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.File_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_loadstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLoadstmt" ):
                listener.enterLoadstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLoadstmt" ):
                listener.exitLoadstmt(self)




    def loadstmt(self):

        localctx = PostgreSQLParser.LoadstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 802, self.RULE_loadstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7216
            self.match(PostgreSQLParser.LOAD)
            self.state = 7217
            self.file_name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatedbstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def createdb_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Createdb_opt_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createdbstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatedbstmt" ):
                listener.enterCreatedbstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatedbstmt" ):
                listener.exitCreatedbstmt(self)




    def createdbstmt(self):

        localctx = PostgreSQLParser.CreatedbstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 804, self.RULE_createdbstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7219
            self.match(PostgreSQLParser.CREATE)
            self.state = 7220
            self.match(PostgreSQLParser.DATABASE)
            self.state = 7221
            self.name()
            self.state = 7222
            self.opt_with()
            self.state = 7223
            self.createdb_opt_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Createdb_opt_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def createdb_opt_items(self):
            return self.getTypedRuleContext(PostgreSQLParser.Createdb_opt_itemsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createdb_opt_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatedb_opt_list" ):
                listener.enterCreatedb_opt_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatedb_opt_list" ):
                listener.exitCreatedb_opt_list(self)




    def createdb_opt_list(self):

        localctx = PostgreSQLParser.Createdb_opt_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 806, self.RULE_createdb_opt_list)
        try:
            self.state = 7227
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,345,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7225
                self.createdb_opt_items()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Createdb_opt_itemsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def createdb_opt_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Createdb_opt_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Createdb_opt_itemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createdb_opt_items

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatedb_opt_items" ):
                listener.enterCreatedb_opt_items(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatedb_opt_items" ):
                listener.exitCreatedb_opt_items(self)




    def createdb_opt_items(self):

        localctx = PostgreSQLParser.Createdb_opt_itemsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 808, self.RULE_createdb_opt_items)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7230 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 7229
                    self.createdb_opt_item()

                else:
                    raise NoViableAltException(self)
                self.state = 7232 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,346,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 Createdb_opt_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def createdb_opt_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Createdb_opt_nameContext,0)


        def opt_equal(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_equalContext,0)


        def signediconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SignediconstContext,0)


        def opt_boolean_or_string(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_boolean_or_stringContext,0)


        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createdb_opt_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatedb_opt_item" ):
                listener.enterCreatedb_opt_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatedb_opt_item" ):
                listener.exitCreatedb_opt_item(self)




    def createdb_opt_item(self):

        localctx = PostgreSQLParser.Createdb_opt_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 810, self.RULE_createdb_opt_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7234
            self.createdb_opt_name()
            self.state = 7235
            self.opt_equal()
            self.state = 7239
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,347,self._ctx)
            if la_ == 1:
                self.state = 7236
                self.signediconst()
                pass

            elif la_ == 2:
                self.state = 7237
                self.opt_boolean_or_string()
                pass

            elif la_ == 3:
                self.state = 7238
                self.match(PostgreSQLParser.DEFAULT)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Createdb_opt_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def CONNECTION(self):
            return self.getToken(PostgreSQLParser.CONNECTION, 0)

        def LIMIT(self):
            return self.getToken(PostgreSQLParser.LIMIT, 0)

        def ENCODING(self):
            return self.getToken(PostgreSQLParser.ENCODING, 0)

        def LOCATION(self):
            return self.getToken(PostgreSQLParser.LOCATION, 0)

        def OWNER(self):
            return self.getToken(PostgreSQLParser.OWNER, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def TEMPLATE(self):
            return self.getToken(PostgreSQLParser.TEMPLATE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createdb_opt_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatedb_opt_name" ):
                listener.enterCreatedb_opt_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatedb_opt_name" ):
                listener.exitCreatedb_opt_name(self)




    def createdb_opt_name(self):

        localctx = PostgreSQLParser.Createdb_opt_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 812, self.RULE_createdb_opt_name)
        try:
            self.state = 7249
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 123, 130, 144, 153, 157, 161, 167, 172, 207, 210, 232, 240, 258, 261, 262, 272, 286, 300, 306, 312, 316, 317, 326, 353, 433, 434, 477, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7241
                self.identifier()
                pass
            elif token in [164]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7242
                self.match(PostgreSQLParser.CONNECTION)
                self.state = 7243
                self.match(PostgreSQLParser.LIMIT)
                pass
            elif token in [194]:
                self.enterOuterAlt(localctx, 3)
                self.state = 7244
                self.match(PostgreSQLParser.ENCODING)
                pass
            elif token in [246]:
                self.enterOuterAlt(localctx, 4)
                self.state = 7245
                self.match(PostgreSQLParser.LOCATION)
                pass
            elif token in [275]:
                self.enterOuterAlt(localctx, 5)
                self.state = 7246
                self.match(PostgreSQLParser.OWNER)
                pass
            elif token in [344]:
                self.enterOuterAlt(localctx, 6)
                self.state = 7247
                self.match(PostgreSQLParser.TABLESPACE)
                pass
            elif token in [346]:
                self.enterOuterAlt(localctx, 7)
                self.state = 7248
                self.match(PostgreSQLParser.TEMPLATE)
                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 Opt_equalContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_equal

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_equal" ):
                listener.enterOpt_equal(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_equal" ):
                listener.exitOpt_equal(self)




    def opt_equal(self):

        localctx = PostgreSQLParser.Opt_equalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 814, self.RULE_opt_equal)
        try:
            self.state = 7253
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [10]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7251
                self.match(PostgreSQLParser.EQUAL)
                pass
            elif token in [12, 13, 33, 35, 43, 44, 45, 53, 57, 60, 61, 80, 92, 96, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 658, 661, 662, 671]:
                self.enterOuterAlt(localctx, 2)

                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 AlterdatabasestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.NameContext,i)


        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def createdb_opt_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Createdb_opt_listContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterdatabasestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterdatabasestmt" ):
                listener.enterAlterdatabasestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterdatabasestmt" ):
                listener.exitAlterdatabasestmt(self)




    def alterdatabasestmt(self):

        localctx = PostgreSQLParser.AlterdatabasestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 816, self.RULE_alterdatabasestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7255
            self.match(PostgreSQLParser.ALTER)
            self.state = 7256
            self.match(PostgreSQLParser.DATABASE)
            self.state = 7257
            self.name()
            self.state = 7264
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,350,self._ctx)
            if la_ == 1:
                self.state = 7258
                self.match(PostgreSQLParser.WITH)
                self.state = 7259
                self.createdb_opt_list()
                pass

            elif la_ == 2:
                self.state = 7260
                self.createdb_opt_list()
                pass

            elif la_ == 3:
                self.state = 7261
                self.match(PostgreSQLParser.SET)
                self.state = 7262
                self.match(PostgreSQLParser.TABLESPACE)
                self.state = 7263
                self.name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterdatabasesetstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def setresetclause(self):
            return self.getTypedRuleContext(PostgreSQLParser.SetresetclauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterdatabasesetstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterdatabasesetstmt" ):
                listener.enterAlterdatabasesetstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterdatabasesetstmt" ):
                listener.exitAlterdatabasesetstmt(self)




    def alterdatabasesetstmt(self):

        localctx = PostgreSQLParser.AlterdatabasesetstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 818, self.RULE_alterdatabasesetstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7266
            self.match(PostgreSQLParser.ALTER)
            self.state = 7267
            self.match(PostgreSQLParser.DATABASE)
            self.state = 7268
            self.name()
            self.state = 7269
            self.setresetclause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DropdbstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def opt_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_withContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def drop_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Drop_option_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_dropdbstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDropdbstmt" ):
                listener.enterDropdbstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDropdbstmt" ):
                listener.exitDropdbstmt(self)




    def dropdbstmt(self):

        localctx = PostgreSQLParser.DropdbstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 820, self.RULE_dropdbstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7271
            self.match(PostgreSQLParser.DROP)
            self.state = 7272
            self.match(PostgreSQLParser.DATABASE)
            self.state = 7275
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,351,self._ctx)
            if la_ == 1:
                self.state = 7273
                self.match(PostgreSQLParser.IF_P)
                self.state = 7274
                self.match(PostgreSQLParser.EXISTS)


            self.state = 7277
            self.name()
            self.state = 7283
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,352,self._ctx)
            if la_ == 1:
                self.state = 7278
                self.opt_with()
                self.state = 7279
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7280
                self.drop_option_list()
                self.state = 7281
                self.match(PostgreSQLParser.CLOSE_PAREN)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Drop_option_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def drop_option(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Drop_optionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Drop_optionContext,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_drop_option_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDrop_option_list" ):
                listener.enterDrop_option_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDrop_option_list" ):
                listener.exitDrop_option_list(self)




    def drop_option_list(self):

        localctx = PostgreSQLParser.Drop_option_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 822, self.RULE_drop_option_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7285
            self.drop_option()
            self.state = 7290
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 7286
                self.match(PostgreSQLParser.COMMA)
                self.state = 7287
                self.drop_option()
                self.state = 7292
                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 Drop_optionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FORCE(self):
            return self.getToken(PostgreSQLParser.FORCE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_drop_option

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDrop_option" ):
                listener.enterDrop_option(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDrop_option" ):
                listener.exitDrop_option(self)




    def drop_option(self):

        localctx = PostgreSQLParser.Drop_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 824, self.RULE_drop_option)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7293
            self.match(PostgreSQLParser.FORCE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AltercollationstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def COLLATION(self):
            return self.getToken(PostgreSQLParser.COLLATION, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def REFRESH(self):
            return self.getToken(PostgreSQLParser.REFRESH, 0)

        def VERSION_P(self):
            return self.getToken(PostgreSQLParser.VERSION_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altercollationstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAltercollationstmt" ):
                listener.enterAltercollationstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAltercollationstmt" ):
                listener.exitAltercollationstmt(self)




    def altercollationstmt(self):

        localctx = PostgreSQLParser.AltercollationstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 826, self.RULE_altercollationstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7295
            self.match(PostgreSQLParser.ALTER)
            self.state = 7296
            self.match(PostgreSQLParser.COLLATION)
            self.state = 7297
            self.any_name()
            self.state = 7298
            self.match(PostgreSQLParser.REFRESH)
            self.state = 7299
            self.match(PostgreSQLParser.VERSION_P)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AltersystemstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def SYSTEM_P(self):
            return self.getToken(PostgreSQLParser.SYSTEM_P, 0)

        def generic_set(self):
            return self.getTypedRuleContext(PostgreSQLParser.Generic_setContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def RESET(self):
            return self.getToken(PostgreSQLParser.RESET, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altersystemstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAltersystemstmt" ):
                listener.enterAltersystemstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAltersystemstmt" ):
                listener.exitAltersystemstmt(self)




    def altersystemstmt(self):

        localctx = PostgreSQLParser.AltersystemstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 828, self.RULE_altersystemstmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7301
            self.match(PostgreSQLParser.ALTER)
            self.state = 7302
            self.match(PostgreSQLParser.SYSTEM_P)
            self.state = 7303
            _la = self._input.LA(1)
            if not(_la==306 or _la==326):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 7304
            self.generic_set()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreatedomainstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def opt_as(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_asContext,0)


        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def colquallist(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColquallistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createdomainstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreatedomainstmt" ):
                listener.enterCreatedomainstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreatedomainstmt" ):
                listener.exitCreatedomainstmt(self)




    def createdomainstmt(self):

        localctx = PostgreSQLParser.CreatedomainstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 830, self.RULE_createdomainstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7306
            self.match(PostgreSQLParser.CREATE)
            self.state = 7307
            self.match(PostgreSQLParser.DOMAIN_P)
            self.state = 7308
            self.any_name()
            self.state = 7309
            self.opt_as()
            self.state = 7310
            self.typename()
            self.state = 7311
            self.colquallist()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterdomainstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def alter_column_default(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alter_column_defaultContext,0)


        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def ADD_P(self):
            return self.getToken(PostgreSQLParser.ADD_P, 0)

        def tableconstraint(self):
            return self.getTypedRuleContext(PostgreSQLParser.TableconstraintContext,0)


        def CONSTRAINT(self):
            return self.getToken(PostgreSQLParser.CONSTRAINT, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_drop_behavior(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_drop_behaviorContext,0)


        def VALIDATE(self):
            return self.getToken(PostgreSQLParser.VALIDATE, 0)

        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alterdomainstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterdomainstmt" ):
                listener.enterAlterdomainstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterdomainstmt" ):
                listener.exitAlterdomainstmt(self)




    def alterdomainstmt(self):

        localctx = PostgreSQLParser.AlterdomainstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 832, self.RULE_alterdomainstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7313
            self.match(PostgreSQLParser.ALTER)
            self.state = 7314
            self.match(PostgreSQLParser.DOMAIN_P)
            self.state = 7315
            self.any_name()
            self.state = 7337
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,355,self._ctx)
            if la_ == 1:
                self.state = 7316
                self.alter_column_default()
                pass

            elif la_ == 2:
                self.state = 7317
                self.match(PostgreSQLParser.DROP)
                self.state = 7318
                self.match(PostgreSQLParser.NOT)
                self.state = 7319
                self.match(PostgreSQLParser.NULL_P)
                pass

            elif la_ == 3:
                self.state = 7320
                self.match(PostgreSQLParser.SET)
                self.state = 7321
                self.match(PostgreSQLParser.NOT)
                self.state = 7322
                self.match(PostgreSQLParser.NULL_P)
                pass

            elif la_ == 4:
                self.state = 7323
                self.match(PostgreSQLParser.ADD_P)
                self.state = 7324
                self.tableconstraint()
                pass

            elif la_ == 5:
                self.state = 7325
                self.match(PostgreSQLParser.DROP)
                self.state = 7326
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 7329
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,354,self._ctx)
                if la_ == 1:
                    self.state = 7327
                    self.match(PostgreSQLParser.IF_P)
                    self.state = 7328
                    self.match(PostgreSQLParser.EXISTS)


                self.state = 7331
                self.name()
                self.state = 7332
                self.opt_drop_behavior()
                pass

            elif la_ == 6:
                self.state = 7334
                self.match(PostgreSQLParser.VALIDATE)
                self.state = 7335
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 7336
                self.name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_asContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_as

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_as" ):
                listener.enterOpt_as(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_as" ):
                listener.exitOpt_as(self)




    def opt_as(self):

        localctx = PostgreSQLParser.Opt_asContext(self, self._ctx, self.state)
        self.enterRule(localctx, 834, self.RULE_opt_as)
        try:
            self.state = 7341
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [36]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7339
                self.match(PostgreSQLParser.AS)
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 661, 662, 671]:
                self.enterOuterAlt(localctx, 2)

                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 AltertsdictionarystmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def TEXT_P(self):
            return self.getToken(PostgreSQLParser.TEXT_P, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def DICTIONARY(self):
            return self.getToken(PostgreSQLParser.DICTIONARY, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def definition(self):
            return self.getTypedRuleContext(PostgreSQLParser.DefinitionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altertsdictionarystmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAltertsdictionarystmt" ):
                listener.enterAltertsdictionarystmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAltertsdictionarystmt" ):
                listener.exitAltertsdictionarystmt(self)




    def altertsdictionarystmt(self):

        localctx = PostgreSQLParser.AltertsdictionarystmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 836, self.RULE_altertsdictionarystmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7343
            self.match(PostgreSQLParser.ALTER)
            self.state = 7344
            self.match(PostgreSQLParser.TEXT_P)
            self.state = 7345
            self.match(PostgreSQLParser.SEARCH)
            self.state = 7346
            self.match(PostgreSQLParser.DICTIONARY)
            self.state = 7347
            self.any_name()
            self.state = 7348
            self.definition()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AltertsconfigurationstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALTER(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.ALTER)
            else:
                return self.getToken(PostgreSQLParser.ALTER, i)

        def TEXT_P(self):
            return self.getToken(PostgreSQLParser.TEXT_P, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def CONFIGURATION(self):
            return self.getToken(PostgreSQLParser.CONFIGURATION, 0)

        def any_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Any_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,i)


        def ADD_P(self):
            return self.getToken(PostgreSQLParser.ADD_P, 0)

        def MAPPING(self):
            return self.getToken(PostgreSQLParser.MAPPING, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Name_listContext,0)


        def any_with(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_withContext,0)


        def any_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_name_listContext,0)


        def REPLACE(self):
            return self.getToken(PostgreSQLParser.REPLACE, 0)

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_altertsconfigurationstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAltertsconfigurationstmt" ):
                listener.enterAltertsconfigurationstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAltertsconfigurationstmt" ):
                listener.exitAltertsconfigurationstmt(self)




    def altertsconfigurationstmt(self):

        localctx = PostgreSQLParser.AltertsconfigurationstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 838, self.RULE_altertsconfigurationstmt)
        try:
            self.state = 7422
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,357,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7350
                self.match(PostgreSQLParser.ALTER)
                self.state = 7351
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 7352
                self.match(PostgreSQLParser.SEARCH)
                self.state = 7353
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 7354
                self.any_name()
                self.state = 7355
                self.match(PostgreSQLParser.ADD_P)
                self.state = 7356
                self.match(PostgreSQLParser.MAPPING)
                self.state = 7357
                self.match(PostgreSQLParser.FOR)
                self.state = 7358
                self.name_list()
                self.state = 7359
                self.any_with()
                self.state = 7360
                self.any_name_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7362
                self.match(PostgreSQLParser.ALTER)
                self.state = 7363
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 7364
                self.match(PostgreSQLParser.SEARCH)
                self.state = 7365
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 7366
                self.any_name()
                self.state = 7367
                self.match(PostgreSQLParser.ALTER)
                self.state = 7368
                self.match(PostgreSQLParser.MAPPING)
                self.state = 7369
                self.match(PostgreSQLParser.FOR)
                self.state = 7370
                self.name_list()
                self.state = 7371
                self.any_with()
                self.state = 7372
                self.any_name_list()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7374
                self.match(PostgreSQLParser.ALTER)
                self.state = 7375
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 7376
                self.match(PostgreSQLParser.SEARCH)
                self.state = 7377
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 7378
                self.any_name()
                self.state = 7379
                self.match(PostgreSQLParser.ALTER)
                self.state = 7380
                self.match(PostgreSQLParser.MAPPING)
                self.state = 7381
                self.match(PostgreSQLParser.REPLACE)
                self.state = 7382
                self.any_name()
                self.state = 7383
                self.any_with()
                self.state = 7384
                self.any_name()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7386
                self.match(PostgreSQLParser.ALTER)
                self.state = 7387
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 7388
                self.match(PostgreSQLParser.SEARCH)
                self.state = 7389
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 7390
                self.any_name()
                self.state = 7391
                self.match(PostgreSQLParser.ALTER)
                self.state = 7392
                self.match(PostgreSQLParser.MAPPING)
                self.state = 7393
                self.match(PostgreSQLParser.FOR)
                self.state = 7394
                self.name_list()
                self.state = 7395
                self.match(PostgreSQLParser.REPLACE)
                self.state = 7396
                self.any_name()
                self.state = 7397
                self.any_with()
                self.state = 7398
                self.any_name()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 7400
                self.match(PostgreSQLParser.ALTER)
                self.state = 7401
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 7402
                self.match(PostgreSQLParser.SEARCH)
                self.state = 7403
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 7404
                self.any_name()
                self.state = 7405
                self.match(PostgreSQLParser.DROP)
                self.state = 7406
                self.match(PostgreSQLParser.MAPPING)
                self.state = 7407
                self.match(PostgreSQLParser.FOR)
                self.state = 7408
                self.name_list()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 7410
                self.match(PostgreSQLParser.ALTER)
                self.state = 7411
                self.match(PostgreSQLParser.TEXT_P)
                self.state = 7412
                self.match(PostgreSQLParser.SEARCH)
                self.state = 7413
                self.match(PostgreSQLParser.CONFIGURATION)
                self.state = 7414
                self.any_name()
                self.state = 7415
                self.match(PostgreSQLParser.DROP)
                self.state = 7416
                self.match(PostgreSQLParser.MAPPING)
                self.state = 7417
                self.match(PostgreSQLParser.IF_P)
                self.state = 7418
                self.match(PostgreSQLParser.EXISTS)
                self.state = 7419
                self.match(PostgreSQLParser.FOR)
                self.state = 7420
                self.name_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 Any_withContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_any_with

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAny_with" ):
                listener.enterAny_with(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAny_with" ):
                listener.exitAny_with(self)




    def any_with(self):

        localctx = PostgreSQLParser.Any_withContext(self, self._ctx, self.state)
        self.enterRule(localctx, 840, self.RULE_any_with)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7424
            self.match(PostgreSQLParser.WITH)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CreateconversionstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opt_default(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_defaultContext,0)


        def CONVERSION_P(self):
            return self.getToken(PostgreSQLParser.CONVERSION_P, 0)

        def any_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Any_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,i)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def sconst(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SconstContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SconstContext,i)


        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_createconversionstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCreateconversionstmt" ):
                listener.enterCreateconversionstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCreateconversionstmt" ):
                listener.exitCreateconversionstmt(self)




    def createconversionstmt(self):

        localctx = PostgreSQLParser.CreateconversionstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 842, self.RULE_createconversionstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7426
            self.match(PostgreSQLParser.CREATE)
            self.state = 7427
            self.opt_default()
            self.state = 7428
            self.match(PostgreSQLParser.CONVERSION_P)
            self.state = 7429
            self.any_name()
            self.state = 7430
            self.match(PostgreSQLParser.FOR)
            self.state = 7431
            self.sconst()
            self.state = 7432
            self.match(PostgreSQLParser.TO)
            self.state = 7433
            self.sconst()
            self.state = 7434
            self.match(PostgreSQLParser.FROM)
            self.state = 7435
            self.any_name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ClusterstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CLUSTER(self):
            return self.getToken(PostgreSQLParser.CLUSTER, 0)

        def opt_verbose(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_verboseContext,0)


        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def cluster_index_specification(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cluster_index_specificationContext,0)


        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_clusterstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClusterstmt" ):
                listener.enterClusterstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitClusterstmt" ):
                listener.exitClusterstmt(self)




    def clusterstmt(self):

        localctx = PostgreSQLParser.ClusterstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 844, self.RULE_clusterstmt)
        try:
            self.state = 7450
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,358,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7437
                self.match(PostgreSQLParser.CLUSTER)
                self.state = 7438
                self.opt_verbose()
                self.state = 7439
                self.qualified_name()
                self.state = 7440
                self.cluster_index_specification()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7442
                self.match(PostgreSQLParser.CLUSTER)
                self.state = 7443
                self.opt_verbose()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7444
                self.match(PostgreSQLParser.CLUSTER)
                self.state = 7445
                self.opt_verbose()
                self.state = 7446
                self.name()
                self.state = 7447
                self.match(PostgreSQLParser.ON)
                self.state = 7448
                self.qualified_name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Cluster_index_specificationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_cluster_index_specification

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCluster_index_specification" ):
                listener.enterCluster_index_specification(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCluster_index_specification" ):
                listener.exitCluster_index_specification(self)




    def cluster_index_specification(self):

        localctx = PostgreSQLParser.Cluster_index_specificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 846, self.RULE_cluster_index_specification)
        try:
            self.state = 7455
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7452
                self.match(PostgreSQLParser.USING)
                self.state = 7453
                self.name()
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 VacuumstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VACUUM(self):
            return self.getToken(PostgreSQLParser.VACUUM, 0)

        def opt_full(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_fullContext,0)


        def opt_freeze(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_freezeContext,0)


        def opt_verbose(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_verboseContext,0)


        def opt_analyze(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_analyzeContext,0)


        def opt_vacuum_relation_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_vacuum_relation_listContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def vac_analyze_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Vac_analyze_option_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_vacuumstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterVacuumstmt" ):
                listener.enterVacuumstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitVacuumstmt" ):
                listener.exitVacuumstmt(self)




    def vacuumstmt(self):

        localctx = PostgreSQLParser.VacuumstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 848, self.RULE_vacuumstmt)
        try:
            self.state = 7470
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,360,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7457
                self.match(PostgreSQLParser.VACUUM)
                self.state = 7458
                self.opt_full()
                self.state = 7459
                self.opt_freeze()
                self.state = 7460
                self.opt_verbose()
                self.state = 7461
                self.opt_analyze()
                self.state = 7462
                self.opt_vacuum_relation_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7464
                self.match(PostgreSQLParser.VACUUM)
                self.state = 7465
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7466
                self.vac_analyze_option_list()
                self.state = 7467
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 7468
                self.opt_vacuum_relation_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 AnalyzestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def analyze_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Analyze_keywordContext,0)


        def opt_verbose(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_verboseContext,0)


        def opt_vacuum_relation_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_vacuum_relation_listContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def vac_analyze_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Vac_analyze_option_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_analyzestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAnalyzestmt" ):
                listener.enterAnalyzestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAnalyzestmt" ):
                listener.exitAnalyzestmt(self)




    def analyzestmt(self):

        localctx = PostgreSQLParser.AnalyzestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 850, self.RULE_analyzestmt)
        try:
            self.state = 7482
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,361,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7472
                self.analyze_keyword()
                self.state = 7473
                self.opt_verbose()
                self.state = 7474
                self.opt_vacuum_relation_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7476
                self.analyze_keyword()
                self.state = 7477
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7478
                self.vac_analyze_option_list()
                self.state = 7479
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 7480
                self.opt_vacuum_relation_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 Vac_analyze_option_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def vac_analyze_option_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Vac_analyze_option_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Vac_analyze_option_elemContext,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_vac_analyze_option_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterVac_analyze_option_list" ):
                listener.enterVac_analyze_option_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitVac_analyze_option_list" ):
                listener.exitVac_analyze_option_list(self)




    def vac_analyze_option_list(self):

        localctx = PostgreSQLParser.Vac_analyze_option_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 852, self.RULE_vac_analyze_option_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7484
            self.vac_analyze_option_elem()
            self.state = 7489
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 7485
                self.match(PostgreSQLParser.COMMA)
                self.state = 7486
                self.vac_analyze_option_elem()
                self.state = 7491
                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 Analyze_keywordContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ANALYZE(self):
            return self.getToken(PostgreSQLParser.ANALYZE, 0)

        def ANALYSE(self):
            return self.getToken(PostgreSQLParser.ANALYSE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_analyze_keyword

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAnalyze_keyword" ):
                listener.enterAnalyze_keyword(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAnalyze_keyword" ):
                listener.exitAnalyze_keyword(self)




    def analyze_keyword(self):

        localctx = PostgreSQLParser.Analyze_keywordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 854, self.RULE_analyze_keyword)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7492
            _la = self._input.LA(1)
            if not(_la==31 or _la==32):
                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 Vac_analyze_option_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def vac_analyze_option_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Vac_analyze_option_nameContext,0)


        def vac_analyze_option_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Vac_analyze_option_argContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_vac_analyze_option_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterVac_analyze_option_elem" ):
                listener.enterVac_analyze_option_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitVac_analyze_option_elem" ):
                listener.exitVac_analyze_option_elem(self)




    def vac_analyze_option_elem(self):

        localctx = PostgreSQLParser.Vac_analyze_option_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 856, self.RULE_vac_analyze_option_elem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7494
            self.vac_analyze_option_name()
            self.state = 7495
            self.vac_analyze_option_arg()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Vac_analyze_option_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def nonreservedword(self):
            return self.getTypedRuleContext(PostgreSQLParser.NonreservedwordContext,0)


        def analyze_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Analyze_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_vac_analyze_option_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterVac_analyze_option_name" ):
                listener.enterVac_analyze_option_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitVac_analyze_option_name" ):
                listener.exitVac_analyze_option_name(self)




    def vac_analyze_option_name(self):

        localctx = PostgreSQLParser.Vac_analyze_option_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 858, self.RULE_vac_analyze_option_name)
        try:
            self.state = 7499
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7497
                self.nonreservedword()
                pass
            elif token in [31, 32]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7498
                self.analyze_keyword()
                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 Vac_analyze_option_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_boolean_or_string(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_boolean_or_stringContext,0)


        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_vac_analyze_option_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterVac_analyze_option_arg" ):
                listener.enterVac_analyze_option_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitVac_analyze_option_arg" ):
                listener.exitVac_analyze_option_arg(self)




    def vac_analyze_option_arg(self):

        localctx = PostgreSQLParser.Vac_analyze_option_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 860, self.RULE_vac_analyze_option_arg)
        try:
            self.state = 7504
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 60, 61, 80, 92, 96, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7501
                self.opt_boolean_or_string()
                pass
            elif token in [12, 13, 658, 660]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7502
                self.numericonly()
                pass
            elif token in [3, 6]:
                self.enterOuterAlt(localctx, 3)

                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 Opt_analyzeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def analyze_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Analyze_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_analyze

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_analyze" ):
                listener.enterOpt_analyze(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_analyze" ):
                listener.exitOpt_analyze(self)




    def opt_analyze(self):

        localctx = PostgreSQLParser.Opt_analyzeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 862, self.RULE_opt_analyze)
        try:
            self.state = 7508
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,365,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7506
                self.analyze_keyword()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_verboseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VERBOSE(self):
            return self.getToken(PostgreSQLParser.VERBOSE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_verbose

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_verbose" ):
                listener.enterOpt_verbose(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_verbose" ):
                listener.exitOpt_verbose(self)




    def opt_verbose(self):

        localctx = PostgreSQLParser.Opt_verboseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 864, self.RULE_opt_verbose)
        try:
            self.state = 7512
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [128]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7510
                self.match(PostgreSQLParser.VERBOSE)
                pass
            elif token in [-1, 2, 7, 31, 32, 33, 35, 43, 44, 45, 46, 53, 57, 61, 65, 71, 88, 92, 105, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_fullContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FULL(self):
            return self.getToken(PostgreSQLParser.FULL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_full

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_full" ):
                listener.enterOpt_full(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_full" ):
                listener.exitOpt_full(self)




    def opt_full(self):

        localctx = PostgreSQLParser.Opt_fullContext(self, self._ctx, self.state)
        self.enterRule(localctx, 866, self.RULE_opt_full)
        try:
            self.state = 7516
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [113]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7514
                self.match(PostgreSQLParser.FULL)
                pass
            elif token in [-1, 2, 7, 31, 32, 33, 35, 43, 44, 45, 46, 53, 57, 61, 65, 71, 88, 92, 105, 112, 116, 119, 123, 124, 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_freezeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FREEZE(self):
            return self.getToken(PostgreSQLParser.FREEZE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_freeze

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_freeze" ):
                listener.enterOpt_freeze(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_freeze" ):
                listener.exitOpt_freeze(self)




    def opt_freeze(self):

        localctx = PostgreSQLParser.Opt_freezeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 868, self.RULE_opt_freeze)
        try:
            self.state = 7520
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [112]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7518
                self.match(PostgreSQLParser.FREEZE)
                pass
            elif token in [-1, 2, 7, 31, 32, 33, 35, 43, 44, 45, 46, 53, 57, 61, 65, 71, 88, 92, 105, 116, 119, 123, 124, 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_name_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Name_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_name_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_name_list" ):
                listener.enterOpt_name_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_name_list" ):
                listener.exitOpt_name_list(self)




    def opt_name_list(self):

        localctx = PostgreSQLParser.Opt_name_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 870, self.RULE_opt_name_list)
        try:
            self.state = 7527
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,369,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7522
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7523
                self.name_list()
                self.state = 7524
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Vacuum_relationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def opt_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_name_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_vacuum_relation

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterVacuum_relation" ):
                listener.enterVacuum_relation(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitVacuum_relation" ):
                listener.exitVacuum_relation(self)




    def vacuum_relation(self):

        localctx = PostgreSQLParser.Vacuum_relationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 872, self.RULE_vacuum_relation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7529
            self.qualified_name()
            self.state = 7530
            self.opt_name_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Vacuum_relation_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def vacuum_relation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Vacuum_relationContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Vacuum_relationContext,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_vacuum_relation_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterVacuum_relation_list" ):
                listener.enterVacuum_relation_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitVacuum_relation_list" ):
                listener.exitVacuum_relation_list(self)




    def vacuum_relation_list(self):

        localctx = PostgreSQLParser.Vacuum_relation_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 874, self.RULE_vacuum_relation_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7532
            self.vacuum_relation()
            self.state = 7537
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 7533
                self.match(PostgreSQLParser.COMMA)
                self.state = 7534
                self.vacuum_relation()
                self.state = 7539
                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 Opt_vacuum_relation_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def vacuum_relation_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Vacuum_relation_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_vacuum_relation_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_vacuum_relation_list" ):
                listener.enterOpt_vacuum_relation_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_vacuum_relation_list" ):
                listener.exitOpt_vacuum_relation_list(self)




    def opt_vacuum_relation_list(self):

        localctx = PostgreSQLParser.Opt_vacuum_relation_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 876, self.RULE_opt_vacuum_relation_list)
        try:
            self.state = 7542
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,371,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7540
                self.vacuum_relation_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExplainstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EXPLAIN(self):
            return self.getToken(PostgreSQLParser.EXPLAIN, 0)

        def explainablestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ExplainablestmtContext,0)


        def analyze_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Analyze_keywordContext,0)


        def opt_verbose(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_verboseContext,0)


        def VERBOSE(self):
            return self.getToken(PostgreSQLParser.VERBOSE, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def explain_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Explain_option_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_explainstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExplainstmt" ):
                listener.enterExplainstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExplainstmt" ):
                listener.exitExplainstmt(self)




    def explainstmt(self):

        localctx = PostgreSQLParser.ExplainstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 878, self.RULE_explainstmt)
        try:
            self.state = 7560
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,372,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7544
                self.match(PostgreSQLParser.EXPLAIN)
                self.state = 7545
                self.explainablestmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7546
                self.match(PostgreSQLParser.EXPLAIN)
                self.state = 7547
                self.analyze_keyword()
                self.state = 7548
                self.opt_verbose()
                self.state = 7549
                self.explainablestmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7551
                self.match(PostgreSQLParser.EXPLAIN)
                self.state = 7552
                self.match(PostgreSQLParser.VERBOSE)
                self.state = 7553
                self.explainablestmt()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7554
                self.match(PostgreSQLParser.EXPLAIN)
                self.state = 7555
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7556
                self.explain_option_list()
                self.state = 7557
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 7558
                self.explainablestmt()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExplainablestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def insertstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.InsertstmtContext,0)


        def updatestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.UpdatestmtContext,0)


        def deletestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DeletestmtContext,0)


        def declarecursorstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DeclarecursorstmtContext,0)


        def createasstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreateasstmtContext,0)


        def creatematviewstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.CreatematviewstmtContext,0)


        def refreshmatviewstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.RefreshmatviewstmtContext,0)


        def executestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ExecutestmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_explainablestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExplainablestmt" ):
                listener.enterExplainablestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExplainablestmt" ):
                listener.exitExplainablestmt(self)




    def explainablestmt(self):

        localctx = PostgreSQLParser.ExplainablestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 880, self.RULE_explainablestmt)
        try:
            self.state = 7571
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,373,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7562
                self.selectstmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7563
                self.insertstmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7564
                self.updatestmt()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7565
                self.deletestmt()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 7566
                self.declarecursorstmt()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 7567
                self.createasstmt()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 7568
                self.creatematviewstmt()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 7569
                self.refreshmatviewstmt()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 7570
                self.executestmt()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Explain_option_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def explain_option_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Explain_option_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Explain_option_elemContext,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_explain_option_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExplain_option_list" ):
                listener.enterExplain_option_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExplain_option_list" ):
                listener.exitExplain_option_list(self)




    def explain_option_list(self):

        localctx = PostgreSQLParser.Explain_option_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 882, self.RULE_explain_option_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7573
            self.explain_option_elem()
            self.state = 7578
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 7574
                self.match(PostgreSQLParser.COMMA)
                self.state = 7575
                self.explain_option_elem()
                self.state = 7580
                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 Explain_option_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def explain_option_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Explain_option_nameContext,0)


        def explain_option_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Explain_option_argContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_explain_option_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExplain_option_elem" ):
                listener.enterExplain_option_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExplain_option_elem" ):
                listener.exitExplain_option_elem(self)




    def explain_option_elem(self):

        localctx = PostgreSQLParser.Explain_option_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 884, self.RULE_explain_option_elem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7581
            self.explain_option_name()
            self.state = 7582
            self.explain_option_arg()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Explain_option_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def nonreservedword(self):
            return self.getTypedRuleContext(PostgreSQLParser.NonreservedwordContext,0)


        def analyze_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Analyze_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_explain_option_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExplain_option_name" ):
                listener.enterExplain_option_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExplain_option_name" ):
                listener.exitExplain_option_name(self)




    def explain_option_name(self):

        localctx = PostgreSQLParser.Explain_option_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 886, self.RULE_explain_option_name)
        try:
            self.state = 7586
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7584
                self.nonreservedword()
                pass
            elif token in [31, 32]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7585
                self.analyze_keyword()
                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 Explain_option_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_boolean_or_string(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_boolean_or_stringContext,0)


        def numericonly(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericonlyContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_explain_option_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExplain_option_arg" ):
                listener.enterExplain_option_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExplain_option_arg" ):
                listener.exitExplain_option_arg(self)




    def explain_option_arg(self):

        localctx = PostgreSQLParser.Explain_option_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 888, self.RULE_explain_option_arg)
        try:
            self.state = 7591
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 60, 61, 80, 92, 96, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7588
                self.opt_boolean_or_string()
                pass
            elif token in [12, 13, 658, 660]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7589
                self.numericonly()
                pass
            elif token in [3, 6]:
                self.enterOuterAlt(localctx, 3)

                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 PreparestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PREPARE(self):
            return self.getToken(PostgreSQLParser.PREPARE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def prep_type_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Prep_type_clauseContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def preparablestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.PreparablestmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_preparestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPreparestmt" ):
                listener.enterPreparestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPreparestmt" ):
                listener.exitPreparestmt(self)




    def preparestmt(self):

        localctx = PostgreSQLParser.PreparestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 890, self.RULE_preparestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7593
            self.match(PostgreSQLParser.PREPARE)
            self.state = 7594
            self.name()
            self.state = 7595
            self.prep_type_clause()
            self.state = 7596
            self.match(PostgreSQLParser.AS)
            self.state = 7597
            self.preparablestmt()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Prep_type_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def type_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_prep_type_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPrep_type_clause" ):
                listener.enterPrep_type_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPrep_type_clause" ):
                listener.exitPrep_type_clause(self)




    def prep_type_clause(self):

        localctx = PostgreSQLParser.Prep_type_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 892, self.RULE_prep_type_clause)
        try:
            self.state = 7604
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7599
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7600
                self.type_list()
                self.state = 7601
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [36]:
                self.enterOuterAlt(localctx, 2)

                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 PreparablestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def insertstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.InsertstmtContext,0)


        def updatestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.UpdatestmtContext,0)


        def deletestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.DeletestmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_preparablestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPreparablestmt" ):
                listener.enterPreparablestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPreparablestmt" ):
                listener.exitPreparablestmt(self)




    def preparablestmt(self):

        localctx = PostgreSQLParser.PreparablestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 894, self.RULE_preparablestmt)
        try:
            self.state = 7610
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,378,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7606
                self.selectstmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7607
                self.insertstmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7608
                self.updatestmt()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7609
                self.deletestmt()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExecutestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EXECUTE(self):
            return self.getToken(PostgreSQLParser.EXECUTE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def execute_param_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Execute_param_clauseContext,0)


        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def opttemp(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttempContext,0)


        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def create_as_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Create_as_targetContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def opt_with_data(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_with_dataContext,0)


        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_executestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExecutestmt" ):
                listener.enterExecutestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExecutestmt" ):
                listener.exitExecutestmt(self)




    def executestmt(self):

        localctx = PostgreSQLParser.ExecutestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 896, self.RULE_executestmt)
        try:
            self.state = 7639
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,379,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7612
                self.match(PostgreSQLParser.EXECUTE)
                self.state = 7613
                self.name()
                self.state = 7614
                self.execute_param_clause()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7616
                self.match(PostgreSQLParser.CREATE)
                self.state = 7617
                self.opttemp()
                self.state = 7618
                self.match(PostgreSQLParser.TABLE)
                self.state = 7619
                self.create_as_target()
                self.state = 7620
                self.match(PostgreSQLParser.AS)
                self.state = 7621
                self.match(PostgreSQLParser.EXECUTE)
                self.state = 7622
                self.name()
                self.state = 7623
                self.execute_param_clause()
                self.state = 7624
                self.opt_with_data()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7626
                self.match(PostgreSQLParser.CREATE)
                self.state = 7627
                self.opttemp()
                self.state = 7628
                self.match(PostgreSQLParser.TABLE)
                self.state = 7629
                self.match(PostgreSQLParser.IF_P)
                self.state = 7630
                self.match(PostgreSQLParser.NOT)
                self.state = 7631
                self.match(PostgreSQLParser.EXISTS)
                self.state = 7632
                self.create_as_target()
                self.state = 7633
                self.match(PostgreSQLParser.AS)
                self.state = 7634
                self.match(PostgreSQLParser.EXECUTE)
                self.state = 7635
                self.name()
                self.state = 7636
                self.execute_param_clause()
                self.state = 7637
                self.opt_with_data()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Execute_param_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_execute_param_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExecute_param_clause" ):
                listener.enterExecute_param_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExecute_param_clause" ):
                listener.exitExecute_param_clause(self)




    def execute_param_clause(self):

        localctx = PostgreSQLParser.Execute_param_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 898, self.RULE_execute_param_clause)
        try:
            self.state = 7646
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,380,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7641
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7642
                self.expr_list()
                self.state = 7643
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DeallocatestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DEALLOCATE(self):
            return self.getToken(PostgreSQLParser.DEALLOCATE, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def PREPARE(self):
            return self.getToken(PostgreSQLParser.PREPARE, 0)

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_deallocatestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDeallocatestmt" ):
                listener.enterDeallocatestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDeallocatestmt" ):
                listener.exitDeallocatestmt(self)




    def deallocatestmt(self):

        localctx = PostgreSQLParser.DeallocatestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 900, self.RULE_deallocatestmt)
        try:
            self.state = 7658
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,381,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7648
                self.match(PostgreSQLParser.DEALLOCATE)
                self.state = 7649
                self.name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7650
                self.match(PostgreSQLParser.DEALLOCATE)
                self.state = 7651
                self.match(PostgreSQLParser.PREPARE)
                self.state = 7652
                self.name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7653
                self.match(PostgreSQLParser.DEALLOCATE)
                self.state = 7654
                self.match(PostgreSQLParser.ALL)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7655
                self.match(PostgreSQLParser.DEALLOCATE)
                self.state = 7656
                self.match(PostgreSQLParser.PREPARE)
                self.state = 7657
                self.match(PostgreSQLParser.ALL)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InsertstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_with_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_with_clauseContext,0)


        def INSERT(self):
            return self.getToken(PostgreSQLParser.INSERT, 0)

        def INTO(self):
            return self.getToken(PostgreSQLParser.INTO, 0)

        def insert_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Insert_targetContext,0)


        def insert_rest(self):
            return self.getTypedRuleContext(PostgreSQLParser.Insert_restContext,0)


        def opt_on_conflict(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_on_conflictContext,0)


        def returning_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Returning_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_insertstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInsertstmt" ):
                listener.enterInsertstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInsertstmt" ):
                listener.exitInsertstmt(self)




    def insertstmt(self):

        localctx = PostgreSQLParser.InsertstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 902, self.RULE_insertstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7660
            self.opt_with_clause()
            self.state = 7661
            self.match(PostgreSQLParser.INSERT)
            self.state = 7662
            self.match(PostgreSQLParser.INTO)
            self.state = 7663
            self.insert_target()
            self.state = 7664
            self.insert_rest()
            self.state = 7665
            self.opt_on_conflict()
            self.state = 7666
            self.returning_clause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Insert_targetContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_insert_target

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInsert_target" ):
                listener.enterInsert_target(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInsert_target" ):
                listener.exitInsert_target(self)




    def insert_target(self):

        localctx = PostgreSQLParser.Insert_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 904, self.RULE_insert_target)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7668
            self.qualified_name()
            self.state = 7671
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==36:
                self.state = 7669
                self.match(PostgreSQLParser.AS)
                self.state = 7670
                self.colid()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Insert_restContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def OVERRIDING(self):
            return self.getToken(PostgreSQLParser.OVERRIDING, 0)

        def override_kind(self):
            return self.getTypedRuleContext(PostgreSQLParser.Override_kindContext,0)


        def VALUE_P(self):
            return self.getToken(PostgreSQLParser.VALUE_P, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def insert_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Insert_column_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def VALUES(self):
            return self.getToken(PostgreSQLParser.VALUES, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_insert_rest

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInsert_rest" ):
                listener.enterInsert_rest(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInsert_rest" ):
                listener.exitInsert_rest(self)




    def insert_rest(self):

        localctx = PostgreSQLParser.Insert_restContext(self, self._ctx, self.state)
        self.enterRule(localctx, 906, self.RULE_insert_rest)
        self._la = 0 # Token type
        try:
            self.state = 7692
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,384,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7673
                self.selectstmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7674
                self.match(PostgreSQLParser.OVERRIDING)
                self.state = 7675
                self.override_kind()
                self.state = 7676
                self.match(PostgreSQLParser.VALUE_P)
                self.state = 7677
                self.selectstmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 7679
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7680
                self.insert_column_list()
                self.state = 7681
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 7686
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==463:
                    self.state = 7682
                    self.match(PostgreSQLParser.OVERRIDING)
                    self.state = 7683
                    self.override_kind()
                    self.state = 7684
                    self.match(PostgreSQLParser.VALUE_P)


                self.state = 7688
                self.selectstmt()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 7690
                self.match(PostgreSQLParser.DEFAULT)
                self.state = 7691
                self.match(PostgreSQLParser.VALUES)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Override_kindContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def SYSTEM_P(self):
            return self.getToken(PostgreSQLParser.SYSTEM_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_override_kind

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOverride_kind" ):
                listener.enterOverride_kind(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOverride_kind" ):
                listener.exitOverride_kind(self)




    def override_kind(self):

        localctx = PostgreSQLParser.Override_kindContext(self, self._ctx, self.state)
        self.enterRule(localctx, 908, self.RULE_override_kind)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7694
            _la = self._input.LA(1)
            if not(_la==99 or _la==342):
                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 Insert_column_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def insert_column_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Insert_column_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Insert_column_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_insert_column_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInsert_column_list" ):
                listener.enterInsert_column_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInsert_column_list" ):
                listener.exitInsert_column_list(self)




    def insert_column_list(self):

        localctx = PostgreSQLParser.Insert_column_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 910, self.RULE_insert_column_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7696
            self.insert_column_item()
            self.state = 7701
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 7697
                self.match(PostgreSQLParser.COMMA)
                self.state = 7698
                self.insert_column_item()
                self.state = 7703
                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 Insert_column_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def opt_indirection(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_indirectionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_insert_column_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInsert_column_item" ):
                listener.enterInsert_column_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInsert_column_item" ):
                listener.exitInsert_column_item(self)




    def insert_column_item(self):

        localctx = PostgreSQLParser.Insert_column_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 912, self.RULE_insert_column_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7704
            self.colid()
            self.state = 7705
            self.opt_indirection()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_on_conflictContext(ParserRuleContext):
        __slots__ = 'parser'

        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 CONFLICT(self):
            return self.getToken(PostgreSQLParser.CONFLICT, 0)

        def opt_conf_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_conf_exprContext,0)


        def DO(self):
            return self.getToken(PostgreSQLParser.DO, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def set_clause_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_clause_listContext,0)


        def where_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_clauseContext,0)


        def NOTHING(self):
            return self.getToken(PostgreSQLParser.NOTHING, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_on_conflict

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_on_conflict" ):
                listener.enterOpt_on_conflict(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_on_conflict" ):
                listener.exitOpt_on_conflict(self)




    def opt_on_conflict(self):

        localctx = PostgreSQLParser.Opt_on_conflictContext(self, self._ctx, self.state)
        self.enterRule(localctx, 914, self.RULE_opt_on_conflict)
        try:
            self.state = 7720
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [80]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7707
                self.match(PostgreSQLParser.ON)
                self.state = 7708
                self.match(PostgreSQLParser.CONFLICT)
                self.state = 7709
                self.opt_conf_expr()
                self.state = 7710
                self.match(PostgreSQLParser.DO)
                self.state = 7717
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [362]:
                    self.state = 7711
                    self.match(PostgreSQLParser.UPDATE)
                    self.state = 7712
                    self.match(PostgreSQLParser.SET)
                    self.state = 7713
                    self.set_clause_list()
                    self.state = 7714
                    self.where_clause()
                    pass
                elif token in [263]:
                    self.state = 7716
                    self.match(PostgreSQLParser.NOTHING)
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 65, 71, 87, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_conf_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def index_params(self):
            return self.getTypedRuleContext(PostgreSQLParser.Index_paramsContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def where_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_clauseContext,0)


        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def CONSTRAINT(self):
            return self.getToken(PostgreSQLParser.CONSTRAINT, 0)

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_conf_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_conf_expr" ):
                listener.enterOpt_conf_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_conf_expr" ):
                listener.exitOpt_conf_expr(self)




    def opt_conf_expr(self):

        localctx = PostgreSQLParser.Opt_conf_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 916, self.RULE_opt_conf_expr)
        try:
            self.state = 7731
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7722
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7723
                self.index_params()
                self.state = 7724
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 7725
                self.where_clause()
                pass
            elif token in [80]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7727
                self.match(PostgreSQLParser.ON)
                self.state = 7728
                self.match(PostgreSQLParser.CONSTRAINT)
                self.state = 7729
                self.name()
                pass
            elif token in [57]:
                self.enterOuterAlt(localctx, 3)

                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 Returning_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def RETURNING(self):
            return self.getToken(PostgreSQLParser.RETURNING, 0)

        def target_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Target_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_returning_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReturning_clause" ):
                listener.enterReturning_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReturning_clause" ):
                listener.exitReturning_clause(self)




    def returning_clause(self):

        localctx = PostgreSQLParser.Returning_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 918, self.RULE_returning_clause)
        try:
            self.state = 7736
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [87]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7733
                self.match(PostgreSQLParser.RETURNING)
                self.state = 7734
                self.target_list()
                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 MergestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def MERGE(self):
            return self.getToken(PostgreSQLParser.MERGE, 0)

        def qualified_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Qualified_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,i)


        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)


        def merge_insert_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Merge_insert_clauseContext,0)


        def merge_update_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Merge_update_clauseContext,0)


        def INTO(self):
            return self.getToken(PostgreSQLParser.INTO, 0)

        def alias_clause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Alias_clauseContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Alias_clauseContext,i)


        def merge_delete_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Merge_delete_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_mergestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMergestmt" ):
                listener.enterMergestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMergestmt" ):
                listener.exitMergestmt(self)




    def mergestmt(self):

        localctx = PostgreSQLParser.MergestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 920, self.RULE_mergestmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7738
            self.match(PostgreSQLParser.MERGE)
            self.state = 7740
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==71:
                self.state = 7739
                self.match(PostgreSQLParser.INTO)


            self.state = 7742
            self.qualified_name()
            self.state = 7744
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2459027080864595968) != 0) or ((((_la - 92)) & ~0x3f) == 0 and ((1 << (_la - 92)) & -113665638399) != 0) or ((((_la - 156)) & ~0x3f) == 0 and ((1 << (_la - 156)) & -1) != 0) or ((((_la - 220)) & ~0x3f) == 0 and ((1 << (_la - 220)) & -9663676417) != 0) or ((((_la - 284)) & ~0x3f) == 0 and ((1 << (_la - 284)) & -1) != 0) or ((((_la - 348)) & ~0x3f) == 0 and ((1 << (_la - 348)) & -1) != 0) or ((((_la - 412)) & ~0x3f) == 0 and ((1 << (_la - 412)) & -1152925902653358081) != 0) or ((((_la - 476)) & ~0x3f) == 0 and ((1 << (_la - 476)) & -8796764110849) != 0) or ((((_la - 540)) & ~0x3f) == 0 and ((1 << (_la - 540)) & -1) != 0) or ((((_la - 604)) & ~0x3f) == 0 and ((1 << (_la - 604)) & 432345718846390271) != 0):
                self.state = 7743
                self.alias_clause()


            self.state = 7746
            self.match(PostgreSQLParser.USING)
            self.state = 7749
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2]:
                self.state = 7747
                self.select_with_parens()
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.state = 7748
                self.qualified_name()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 7752
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2459027080864595968) != 0) or ((((_la - 92)) & ~0x3f) == 0 and ((1 << (_la - 92)) & -113665638399) != 0) or ((((_la - 156)) & ~0x3f) == 0 and ((1 << (_la - 156)) & -1) != 0) or ((((_la - 220)) & ~0x3f) == 0 and ((1 << (_la - 220)) & -9663676417) != 0) or ((((_la - 284)) & ~0x3f) == 0 and ((1 << (_la - 284)) & -1) != 0) or ((((_la - 348)) & ~0x3f) == 0 and ((1 << (_la - 348)) & -1) != 0) or ((((_la - 412)) & ~0x3f) == 0 and ((1 << (_la - 412)) & -1152925902653358081) != 0) or ((((_la - 476)) & ~0x3f) == 0 and ((1 << (_la - 476)) & -8796764110849) != 0) or ((((_la - 540)) & ~0x3f) == 0 and ((1 << (_la - 540)) & -1) != 0) or ((((_la - 604)) & ~0x3f) == 0 and ((1 << (_la - 604)) & 432345718846390271) != 0):
                self.state = 7751
                self.alias_clause()


            self.state = 7754
            self.match(PostgreSQLParser.ON)
            self.state = 7755
            self.a_expr()
            self.state = 7764
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,396,self._ctx)
            if la_ == 1:
                self.state = 7756
                self.merge_insert_clause()
                self.state = 7758
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,394,self._ctx)
                if la_ == 1:
                    self.state = 7757
                    self.merge_update_clause()


                pass

            elif la_ == 2:
                self.state = 7760
                self.merge_update_clause()
                self.state = 7762
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,395,self._ctx)
                if la_ == 1:
                    self.state = 7761
                    self.merge_insert_clause()


                pass


            self.state = 7767
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==102:
                self.state = 7766
                self.merge_delete_clause()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Merge_insert_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def MATCHED(self):
            return self.getToken(PostgreSQLParser.MATCHED, 0)

        def INSERT(self):
            return self.getToken(PostgreSQLParser.INSERT, 0)

        def values_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Values_clauseContext,0)


        def AND(self):
            return self.getToken(PostgreSQLParser.AND, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def THEN(self):
            return self.getToken(PostgreSQLParser.THEN, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def insert_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Insert_column_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_merge_insert_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMerge_insert_clause" ):
                listener.enterMerge_insert_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMerge_insert_clause" ):
                listener.exitMerge_insert_clause(self)




    def merge_insert_clause(self):

        localctx = PostgreSQLParser.Merge_insert_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 922, self.RULE_merge_insert_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7769
            self.match(PostgreSQLParser.WHEN)
            self.state = 7770
            self.match(PostgreSQLParser.NOT)
            self.state = 7771
            self.match(PostgreSQLParser.MATCHED)
            self.state = 7774
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==33:
                self.state = 7772
                self.match(PostgreSQLParser.AND)
                self.state = 7773
                self.a_expr()


            self.state = 7777
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==93:
                self.state = 7776
                self.match(PostgreSQLParser.THEN)


            self.state = 7779
            self.match(PostgreSQLParser.INSERT)
            self.state = 7784
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 7780
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7781
                self.insert_column_list()
                self.state = 7782
                self.match(PostgreSQLParser.CLOSE_PAREN)


            self.state = 7786
            self.values_clause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Merge_update_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def MATCHED(self):
            return self.getToken(PostgreSQLParser.MATCHED, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def set_clause_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_clause_listContext,0)


        def AND(self):
            return self.getToken(PostgreSQLParser.AND, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def THEN(self):
            return self.getToken(PostgreSQLParser.THEN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_merge_update_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMerge_update_clause" ):
                listener.enterMerge_update_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMerge_update_clause" ):
                listener.exitMerge_update_clause(self)




    def merge_update_clause(self):

        localctx = PostgreSQLParser.Merge_update_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 924, self.RULE_merge_update_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7788
            self.match(PostgreSQLParser.WHEN)
            self.state = 7789
            self.match(PostgreSQLParser.MATCHED)
            self.state = 7792
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==33:
                self.state = 7790
                self.match(PostgreSQLParser.AND)
                self.state = 7791
                self.a_expr()


            self.state = 7795
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==93:
                self.state = 7794
                self.match(PostgreSQLParser.THEN)


            self.state = 7797
            self.match(PostgreSQLParser.UPDATE)
            self.state = 7798
            self.match(PostgreSQLParser.SET)
            self.state = 7799
            self.set_clause_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Merge_delete_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def MATCHED(self):
            return self.getToken(PostgreSQLParser.MATCHED, 0)

        def DELETE_P(self):
            return self.getToken(PostgreSQLParser.DELETE_P, 0)

        def THEN(self):
            return self.getToken(PostgreSQLParser.THEN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_merge_delete_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMerge_delete_clause" ):
                listener.enterMerge_delete_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMerge_delete_clause" ):
                listener.exitMerge_delete_clause(self)




    def merge_delete_clause(self):

        localctx = PostgreSQLParser.Merge_delete_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 926, self.RULE_merge_delete_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7801
            self.match(PostgreSQLParser.WHEN)
            self.state = 7802
            self.match(PostgreSQLParser.MATCHED)
            self.state = 7804
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==93:
                self.state = 7803
                self.match(PostgreSQLParser.THEN)


            self.state = 7806
            self.match(PostgreSQLParser.DELETE_P)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DeletestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_with_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_with_clauseContext,0)


        def DELETE_P(self):
            return self.getToken(PostgreSQLParser.DELETE_P, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def relation_expr_opt_alias(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_expr_opt_aliasContext,0)


        def using_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Using_clauseContext,0)


        def where_or_current_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_or_current_clauseContext,0)


        def returning_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Returning_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_deletestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDeletestmt" ):
                listener.enterDeletestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDeletestmt" ):
                listener.exitDeletestmt(self)




    def deletestmt(self):

        localctx = PostgreSQLParser.DeletestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 928, self.RULE_deletestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7808
            self.opt_with_clause()
            self.state = 7809
            self.match(PostgreSQLParser.DELETE_P)
            self.state = 7810
            self.match(PostgreSQLParser.FROM)
            self.state = 7811
            self.relation_expr_opt_alias()
            self.state = 7812
            self.using_clause()
            self.state = 7813
            self.where_or_current_clause()
            self.state = 7814
            self.returning_clause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Using_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def from_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.From_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_using_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterUsing_clause" ):
                listener.enterUsing_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitUsing_clause" ):
                listener.exitUsing_clause(self)




    def using_clause(self):

        localctx = PostgreSQLParser.Using_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 930, self.RULE_using_clause)
        try:
            self.state = 7819
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7816
                self.match(PostgreSQLParser.USING)
                self.state = 7817
                self.from_list()
                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 65, 71, 87, 88, 92, 103, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 LockstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LOCK_P(self):
            return self.getToken(PostgreSQLParser.LOCK_P, 0)

        def opt_table(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_tableContext,0)


        def relation_expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_expr_listContext,0)


        def opt_lock(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_lockContext,0)


        def opt_nowait(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_nowaitContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_lockstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLockstmt" ):
                listener.enterLockstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLockstmt" ):
                listener.exitLockstmt(self)




    def lockstmt(self):

        localctx = PostgreSQLParser.LockstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 932, self.RULE_lockstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7821
            self.match(PostgreSQLParser.LOCK_P)
            self.state = 7822
            self.opt_table()
            self.state = 7823
            self.relation_expr_list()
            self.state = 7824
            self.opt_lock()
            self.state = 7825
            self.opt_nowait()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_lockContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def lock_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Lock_typeContext,0)


        def MODE(self):
            return self.getToken(PostgreSQLParser.MODE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_lock

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_lock" ):
                listener.enterOpt_lock(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_lock" ):
                listener.exitOpt_lock(self)




    def opt_lock(self):

        localctx = PostgreSQLParser.Opt_lockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 934, self.RULE_opt_lock)
        try:
            self.state = 7832
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [68]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7827
                self.match(PostgreSQLParser.IN_P)
                self.state = 7828
                self.lock_type()
                self.state = 7829
                self.match(PostgreSQLParser.MODE)
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 265, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Lock_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ACCESS(self):
            return self.getToken(PostgreSQLParser.ACCESS, 0)

        def SHARE(self):
            return self.getToken(PostgreSQLParser.SHARE, 0)

        def EXCLUSIVE(self):
            return self.getToken(PostgreSQLParser.EXCLUSIVE, 0)

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_lock_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLock_type" ):
                listener.enterLock_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLock_type" ):
                listener.exitLock_type(self)




    def lock_type(self):

        localctx = PostgreSQLParser.Lock_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 936, self.RULE_lock_type)
        self._la = 0 # Token type
        try:
            self.state = 7846
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [131]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7834
                self.match(PostgreSQLParser.ACCESS)
                self.state = 7835
                _la = self._input.LA(1)
                if not(_la==201 or _la==327):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [407]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7836
                self.match(PostgreSQLParser.ROW)
                self.state = 7837
                _la = self._input.LA(1)
                if not(_la==201 or _la==327):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [327]:
                self.enterOuterAlt(localctx, 3)
                self.state = 7838
                self.match(PostgreSQLParser.SHARE)
                self.state = 7843
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [362]:
                    self.state = 7839
                    self.match(PostgreSQLParser.UPDATE)
                    self.state = 7840
                    self.match(PostgreSQLParser.EXCLUSIVE)
                    pass
                elif token in [407]:
                    self.state = 7841
                    self.match(PostgreSQLParser.ROW)
                    self.state = 7842
                    self.match(PostgreSQLParser.EXCLUSIVE)
                    pass
                elif token in [256]:
                    pass
                else:
                    pass
                pass
            elif token in [201]:
                self.enterOuterAlt(localctx, 4)
                self.state = 7845
                self.match(PostgreSQLParser.EXCLUSIVE)
                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 Opt_nowaitContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NOWAIT(self):
            return self.getToken(PostgreSQLParser.NOWAIT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_nowait

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_nowait" ):
                listener.enterOpt_nowait(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_nowait" ):
                listener.exitOpt_nowait(self)




    def opt_nowait(self):

        localctx = PostgreSQLParser.Opt_nowaitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 938, self.RULE_opt_nowait)
        try:
            self.state = 7850
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [265]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7848
                self.match(PostgreSQLParser.NOWAIT)
                pass
            elif token in [-1, 2, 7, 31, 32, 46, 57, 61, 65, 71, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_nowait_or_skipContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NOWAIT(self):
            return self.getToken(PostgreSQLParser.NOWAIT, 0)

        def SKIP_P(self):
            return self.getToken(PostgreSQLParser.SKIP_P, 0)

        def LOCKED(self):
            return self.getToken(PostgreSQLParser.LOCKED, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_nowait_or_skip

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_nowait_or_skip" ):
                listener.enterOpt_nowait_or_skip(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_nowait_or_skip" ):
                listener.exitOpt_nowait_or_skip(self)




    def opt_nowait_or_skip(self):

        localctx = PostgreSQLParser.Opt_nowait_or_skipContext(self, self._ctx, self.state)
        self.enterRule(localctx, 940, self.RULE_opt_nowait_or_skip)
        try:
            self.state = 7856
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [265]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7852
                self.match(PostgreSQLParser.NOWAIT)
                pass
            elif token in [465]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7853
                self.match(PostgreSQLParser.SKIP_P)
                self.state = 7854
                self.match(PostgreSQLParser.LOCKED)
                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 62, 65, 71, 74, 79, 80, 87, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 3)

                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 UpdatestmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_with_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_with_clauseContext,0)


        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def relation_expr_opt_alias(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_expr_opt_aliasContext,0)


        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def set_clause_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_clause_listContext,0)


        def from_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.From_clauseContext,0)


        def where_or_current_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_or_current_clauseContext,0)


        def returning_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Returning_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_updatestmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterUpdatestmt" ):
                listener.enterUpdatestmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitUpdatestmt" ):
                listener.exitUpdatestmt(self)




    def updatestmt(self):

        localctx = PostgreSQLParser.UpdatestmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 942, self.RULE_updatestmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7858
            self.opt_with_clause()
            self.state = 7859
            self.match(PostgreSQLParser.UPDATE)
            self.state = 7860
            self.relation_expr_opt_alias()
            self.state = 7861
            self.match(PostgreSQLParser.SET)
            self.state = 7862
            self.set_clause_list()
            self.state = 7863
            self.from_clause()
            self.state = 7864
            self.where_or_current_clause()
            self.state = 7865
            self.returning_clause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Set_clause_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def set_clause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Set_clauseContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Set_clauseContext,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_set_clause_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSet_clause_list" ):
                listener.enterSet_clause_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSet_clause_list" ):
                listener.exitSet_clause_list(self)




    def set_clause_list(self):

        localctx = PostgreSQLParser.Set_clause_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 944, self.RULE_set_clause_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7867
            self.set_clause()
            self.state = 7872
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 7868
                self.match(PostgreSQLParser.COMMA)
                self.state = 7869
                self.set_clause()
                self.state = 7874
                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 Set_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def set_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_targetContext,0)


        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def set_target_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Set_target_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_set_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSet_clause" ):
                listener.enterSet_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSet_clause" ):
                listener.exitSet_clause(self)




    def set_clause(self):

        localctx = PostgreSQLParser.Set_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 946, self.RULE_set_clause)
        try:
            self.state = 7885
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7875
                self.set_target()
                self.state = 7876
                self.match(PostgreSQLParser.EQUAL)
                self.state = 7877
                self.a_expr()
                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7879
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7880
                self.set_target_list()
                self.state = 7881
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 7882
                self.match(PostgreSQLParser.EQUAL)
                self.state = 7883
                self.a_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


    class Set_targetContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def opt_indirection(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_indirectionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_set_target

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSet_target" ):
                listener.enterSet_target(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSet_target" ):
                listener.exitSet_target(self)




    def set_target(self):

        localctx = PostgreSQLParser.Set_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 948, self.RULE_set_target)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7887
            self.colid()
            self.state = 7888
            self.opt_indirection()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Set_target_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def set_target(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Set_targetContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Set_targetContext,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_set_target_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSet_target_list" ):
                listener.enterSet_target_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSet_target_list" ):
                listener.exitSet_target_list(self)




    def set_target_list(self):

        localctx = PostgreSQLParser.Set_target_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 950, self.RULE_set_target_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7890
            self.set_target()
            self.state = 7895
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 7891
                self.match(PostgreSQLParser.COMMA)
                self.state = 7892
                self.set_target()
                self.state = 7897
                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 DeclarecursorstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DECLARE(self):
            return self.getToken(PostgreSQLParser.DECLARE, 0)

        def cursor_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_nameContext,0)


        def cursor_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_optionsContext,0)


        def CURSOR(self):
            return self.getToken(PostgreSQLParser.CURSOR, 0)

        def opt_hold(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_holdContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_declarecursorstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDeclarecursorstmt" ):
                listener.enterDeclarecursorstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDeclarecursorstmt" ):
                listener.exitDeclarecursorstmt(self)




    def declarecursorstmt(self):

        localctx = PostgreSQLParser.DeclarecursorstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 952, self.RULE_declarecursorstmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7898
            self.match(PostgreSQLParser.DECLARE)
            self.state = 7899
            self.cursor_name()
            self.state = 7900
            self.cursor_options()
            self.state = 7901
            self.match(PostgreSQLParser.CURSOR)
            self.state = 7902
            self.opt_hold()
            self.state = 7903
            self.match(PostgreSQLParser.FOR)
            self.state = 7904
            self.selectstmt()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Cursor_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_cursor_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCursor_name" ):
                listener.enterCursor_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCursor_name" ):
                listener.exitCursor_name(self)




    def cursor_name(self):

        localctx = PostgreSQLParser.Cursor_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 954, self.RULE_cursor_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7906
            self.name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Cursor_optionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NO(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.NO)
            else:
                return self.getToken(PostgreSQLParser.NO, i)

        def SCROLL(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.SCROLL)
            else:
                return self.getToken(PostgreSQLParser.SCROLL, i)

        def BINARY(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.BINARY)
            else:
                return self.getToken(PostgreSQLParser.BINARY, i)

        def INSENSITIVE(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.INSENSITIVE)
            else:
                return self.getToken(PostgreSQLParser.INSENSITIVE, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_cursor_options

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCursor_options" ):
                listener.enterCursor_options(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCursor_options" ):
                listener.exitCursor_options(self)




    def cursor_options(self):

        localctx = PostgreSQLParser.Cursor_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 956, self.RULE_cursor_options)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7915
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==107 or _la==231 or _la==262 or _la==317:
                self.state = 7913
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [262]:
                    self.state = 7908
                    self.match(PostgreSQLParser.NO)
                    self.state = 7909
                    self.match(PostgreSQLParser.SCROLL)
                    pass
                elif token in [317]:
                    self.state = 7910
                    self.match(PostgreSQLParser.SCROLL)
                    pass
                elif token in [107]:
                    self.state = 7911
                    self.match(PostgreSQLParser.BINARY)
                    pass
                elif token in [231]:
                    self.state = 7912
                    self.match(PostgreSQLParser.INSENSITIVE)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 7917
                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 Opt_holdContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def HOLD(self):
            return self.getToken(PostgreSQLParser.HOLD, 0)

        def WITHOUT(self):
            return self.getToken(PostgreSQLParser.WITHOUT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_hold

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_hold" ):
                listener.enterOpt_hold(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_hold" ):
                listener.exitOpt_hold(self)




    def opt_hold(self):

        localctx = PostgreSQLParser.Opt_holdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 958, self.RULE_opt_hold)
        try:
            self.state = 7923
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [105]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7919
                self.match(PostgreSQLParser.WITH)
                self.state = 7920
                self.match(PostgreSQLParser.HOLD)
                pass
            elif token in [372]:
                self.enterOuterAlt(localctx, 3)
                self.state = 7921
                self.match(PostgreSQLParser.WITHOUT)
                self.state = 7922
                self.match(PostgreSQLParser.HOLD)
                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 SelectstmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def select_no_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_no_parensContext,0)


        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_selectstmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSelectstmt" ):
                listener.enterSelectstmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSelectstmt" ):
                listener.exitSelectstmt(self)




    def selectstmt(self):

        localctx = PostgreSQLParser.SelectstmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 960, self.RULE_selectstmt)
        try:
            self.state = 7927
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,416,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7925
                self.select_no_parens()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7926
                self.select_with_parens()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Select_with_parensContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def select_no_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_no_parensContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_with_parens

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSelect_with_parens" ):
                listener.enterSelect_with_parens(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSelect_with_parens" ):
                listener.exitSelect_with_parens(self)




    def select_with_parens(self):

        localctx = PostgreSQLParser.Select_with_parensContext(self, self._ctx, self.state)
        self.enterRule(localctx, 962, self.RULE_select_with_parens)
        try:
            self.state = 7937
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,417,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 7929
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7930
                self.select_no_parens()
                self.state = 7931
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 7933
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 7934
                self.select_with_parens()
                self.state = 7935
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Select_no_parensContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def select_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_clauseContext,0)


        def opt_sort_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_sort_clauseContext,0)


        def for_locking_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.For_locking_clauseContext,0)


        def opt_select_limit(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_select_limitContext,0)


        def select_limit(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_limitContext,0)


        def opt_for_locking_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_for_locking_clauseContext,0)


        def with_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.With_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_no_parens

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSelect_no_parens" ):
                listener.enterSelect_no_parens(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSelect_no_parens" ):
                listener.exitSelect_no_parens(self)




    def select_no_parens(self):

        localctx = PostgreSQLParser.Select_no_parensContext(self, self._ctx, self.state)
        self.enterRule(localctx, 964, self.RULE_select_no_parens)
        try:
            self.state = 7960
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 88, 92, 415]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7939
                self.select_clause()
                self.state = 7940
                self.opt_sort_clause()
                self.state = 7947
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,418,self._ctx)
                if la_ == 1:
                    self.state = 7941
                    self.for_locking_clause()
                    self.state = 7942
                    self.opt_select_limit()

                elif la_ == 2:
                    self.state = 7944
                    self.select_limit()
                    self.state = 7945
                    self.opt_for_locking_clause()


                pass
            elif token in [105]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7949
                self.with_clause()
                self.state = 7950
                self.select_clause()
                self.state = 7951
                self.opt_sort_clause()
                self.state = 7958
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,419,self._ctx)
                if la_ == 1:
                    self.state = 7952
                    self.for_locking_clause()
                    self.state = 7953
                    self.opt_select_limit()

                elif la_ == 2:
                    self.state = 7955
                    self.select_limit()
                    self.state = 7956
                    self.opt_for_locking_clause()


                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_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def simple_select_intersect(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Simple_select_intersectContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Simple_select_intersectContext,i)


        def all_or_distinct(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.All_or_distinctContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.All_or_distinctContext,i)


        def UNION(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.UNION)
            else:
                return self.getToken(PostgreSQLParser.UNION, i)

        def EXCEPT(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.EXCEPT)
            else:
                return self.getToken(PostgreSQLParser.EXCEPT, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSelect_clause" ):
                listener.enterSelect_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSelect_clause" ):
                listener.exitSelect_clause(self)




    def select_clause(self):

        localctx = PostgreSQLParser.Select_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 966, self.RULE_select_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7962
            self.simple_select_intersect()
            self.state = 7969
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==59 or _la==97:
                self.state = 7963
                _la = self._input.LA(1)
                if not(_la==59 or _la==97):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 7964
                self.all_or_distinct()
                self.state = 7965
                self.simple_select_intersect()
                self.state = 7971
                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_select_intersectContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def simple_select_pramary(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Simple_select_pramaryContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Simple_select_pramaryContext,i)


        def INTERSECT(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.INTERSECT)
            else:
                return self.getToken(PostgreSQLParser.INTERSECT, i)

        def all_or_distinct(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.All_or_distinctContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.All_or_distinctContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_simple_select_intersect

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSimple_select_intersect" ):
                listener.enterSimple_select_intersect(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSimple_select_intersect" ):
                listener.exitSimple_select_intersect(self)




    def simple_select_intersect(self):

        localctx = PostgreSQLParser.Simple_select_intersectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 968, self.RULE_simple_select_intersect)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 7972
            self.simple_select_pramary()
            self.state = 7979
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==70:
                self.state = 7973
                self.match(PostgreSQLParser.INTERSECT)
                self.state = 7974
                self.all_or_distinct()
                self.state = 7975
                self.simple_select_pramary()
                self.state = 7981
                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_select_pramaryContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SELECT(self):
            return self.getToken(PostgreSQLParser.SELECT, 0)

        def into_clause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Into_clauseContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Into_clauseContext,i)


        def from_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.From_clauseContext,0)


        def where_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_clauseContext,0)


        def group_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Group_clauseContext,0)


        def having_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Having_clauseContext,0)


        def window_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Window_clauseContext,0)


        def opt_all_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_all_clauseContext,0)


        def opt_target_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_target_listContext,0)


        def distinct_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Distinct_clauseContext,0)


        def target_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Target_listContext,0)


        def values_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Values_clauseContext,0)


        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def relation_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_exprContext,0)


        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_simple_select_pramary

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSimple_select_pramary" ):
                listener.enterSimple_select_pramary(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSimple_select_pramary" ):
                listener.exitSimple_select_pramary(self)




    def simple_select_pramary(self):

        localctx = PostgreSQLParser.Simple_select_pramaryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 970, self.RULE_simple_select_pramary)
        try:
            self.state = 8003
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [88]:
                self.enterOuterAlt(localctx, 1)
                self.state = 7982
                self.match(PostgreSQLParser.SELECT)
                self.state = 7990
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [-1, 2, 3, 7, 9, 12, 13, 28, 29, 30, 31, 32, 33, 35, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 57, 59, 60, 61, 62, 64, 65, 66, 67, 70, 71, 74, 75, 76, 77, 78, 79, 80, 83, 87, 88, 89, 92, 96, 97, 98, 99, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 668, 671]:
                    self.state = 7983
                    self.opt_all_clause()
                    self.state = 7984
                    self.into_clause()
                    self.state = 7985
                    self.opt_target_list()
                    pass
                elif token in [56]:
                    self.state = 7987
                    self.distinct_clause()
                    self.state = 7988
                    self.target_list()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 7992
                self.into_clause()
                self.state = 7993
                self.from_clause()
                self.state = 7994
                self.where_clause()
                self.state = 7995
                self.group_clause()
                self.state = 7996
                self.having_clause()
                self.state = 7997
                self.window_clause()
                pass
            elif token in [415]:
                self.enterOuterAlt(localctx, 2)
                self.state = 7999
                self.values_clause()
                pass
            elif token in [92]:
                self.enterOuterAlt(localctx, 3)
                self.state = 8000
                self.match(PostgreSQLParser.TABLE)
                self.state = 8001
                self.relation_expr()
                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 4)
                self.state = 8002
                self.select_with_parens()
                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 With_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def cte_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cte_listContext,0)


        def RECURSIVE(self):
            return self.getToken(PostgreSQLParser.RECURSIVE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_with_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWith_clause" ):
                listener.enterWith_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWith_clause" ):
                listener.exitWith_clause(self)




    def with_clause(self):

        localctx = PostgreSQLParser.With_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 972, self.RULE_with_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8005
            self.match(PostgreSQLParser.WITH)
            self.state = 8007
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,425,self._ctx)
            if la_ == 1:
                self.state = 8006
                self.match(PostgreSQLParser.RECURSIVE)


            self.state = 8009
            self.cte_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Cte_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def common_table_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Common_table_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Common_table_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 getRuleIndex(self):
            return PostgreSQLParser.RULE_cte_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCte_list" ):
                listener.enterCte_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCte_list" ):
                listener.exitCte_list(self)




    def cte_list(self):

        localctx = PostgreSQLParser.Cte_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 974, self.RULE_cte_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8011
            self.common_table_expr()
            self.state = 8016
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 8012
                self.match(PostgreSQLParser.COMMA)
                self.state = 8013
                self.common_table_expr()
                self.state = 8018
                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 Common_table_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def name(self):
            return self.getTypedRuleContext(PostgreSQLParser.NameContext,0)


        def opt_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_name_listContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def opt_materialized(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_materializedContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def preparablestmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.PreparablestmtContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_common_table_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCommon_table_expr" ):
                listener.enterCommon_table_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCommon_table_expr" ):
                listener.exitCommon_table_expr(self)




    def common_table_expr(self):

        localctx = PostgreSQLParser.Common_table_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 976, self.RULE_common_table_expr)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8019
            self.name()
            self.state = 8020
            self.opt_name_list()
            self.state = 8021
            self.match(PostgreSQLParser.AS)
            self.state = 8022
            self.opt_materialized()
            self.state = 8023
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8024
            self.preparablestmt()
            self.state = 8025
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_materializedContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def MATERIALIZED(self):
            return self.getToken(PostgreSQLParser.MATERIALIZED, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_materialized

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_materialized" ):
                listener.enterOpt_materialized(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_materialized" ):
                listener.exitOpt_materialized(self)




    def opt_materialized(self):

        localctx = PostgreSQLParser.Opt_materializedContext(self, self._ctx, self.state)
        self.enterRule(localctx, 978, self.RULE_opt_materialized)
        try:
            self.state = 8031
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [251]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8027
                self.match(PostgreSQLParser.MATERIALIZED)
                pass
            elif token in [77]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8028
                self.match(PostgreSQLParser.NOT)
                self.state = 8029
                self.match(PostgreSQLParser.MATERIALIZED)
                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 3)

                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 Opt_with_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def with_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.With_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_with_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_with_clause" ):
                listener.enterOpt_with_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_with_clause" ):
                listener.exitOpt_with_clause(self)




    def opt_with_clause(self):

        localctx = PostgreSQLParser.Opt_with_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 980, self.RULE_opt_with_clause)
        try:
            self.state = 8035
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [105]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8033
                self.with_clause()
                pass
            elif token in [182, 232, 362]:
                self.enterOuterAlt(localctx, 2)

                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 Into_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INTO(self):
            return self.getToken(PostgreSQLParser.INTO, 0)

        def opt_strict(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_strictContext,0)


        def opttempTableName(self):
            return self.getTypedRuleContext(PostgreSQLParser.OpttempTableNameContext,0)


        def into_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Into_targetContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_into_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInto_clause" ):
                listener.enterInto_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInto_clause" ):
                listener.exitInto_clause(self)




    def into_clause(self):

        localctx = PostgreSQLParser.Into_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 982, self.RULE_into_clause)
        try:
            self.state = 8045
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,430,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8037
                self.match(PostgreSQLParser.INTO)
                self.state = 8042
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,429,self._ctx)
                if la_ == 1:
                    self.state = 8038
                    self.opt_strict()
                    self.state = 8039
                    self.opttempTableName()
                    pass

                elif la_ == 2:
                    self.state = 8041
                    self.into_target()
                    pass


                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_strictContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def STRICT_P(self):
            return self.getToken(PostgreSQLParser.STRICT_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_strict

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_strict" ):
                listener.enterOpt_strict(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_strict" ):
                listener.exitOpt_strict(self)




    def opt_strict(self):

        localctx = PostgreSQLParser.Opt_strictContext(self, self._ctx, self.state)
        self.enterRule(localctx, 984, self.RULE_opt_strict)
        try:
            self.state = 8049
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,431,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8048
                self.match(PostgreSQLParser.STRICT_P)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OpttempTableNameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_table(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_tableContext,0)


        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def TEMPORARY(self):
            return self.getToken(PostgreSQLParser.TEMPORARY, 0)

        def TEMP(self):
            return self.getToken(PostgreSQLParser.TEMP, 0)

        def LOCAL(self):
            return self.getToken(PostgreSQLParser.LOCAL, 0)

        def GLOBAL(self):
            return self.getToken(PostgreSQLParser.GLOBAL, 0)

        def UNLOGGED(self):
            return self.getToken(PostgreSQLParser.UNLOGGED, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opttempTableName

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpttempTableName" ):
                listener.enterOpttempTableName(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpttempTableName" ):
                listener.exitOpttempTableName(self)




    def opttempTableName(self):

        localctx = PostgreSQLParser.OpttempTableNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 986, self.RULE_opttempTableName)
        self._la = 0 # Token type
        try:
            self.state = 8065
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,433,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8052
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==213 or _la==245:
                    self.state = 8051
                    _la = self._input.LA(1)
                    if not(_la==213 or _la==245):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 8054
                _la = self._input.LA(1)
                if not(_la==345 or _la==347):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 8055
                self.opt_table()
                self.state = 8056
                self.qualified_name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8058
                self.match(PostgreSQLParser.UNLOGGED)
                self.state = 8059
                self.opt_table()
                self.state = 8060
                self.qualified_name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 8062
                self.match(PostgreSQLParser.TABLE)
                self.state = 8063
                self.qualified_name()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 8064
                self.qualified_name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_tableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_table

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_table" ):
                listener.enterOpt_table(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_table" ):
                listener.exitOpt_table(self)




    def opt_table(self):

        localctx = PostgreSQLParser.Opt_tableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 988, self.RULE_opt_table)
        try:
            self.state = 8069
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,434,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8067
                self.match(PostgreSQLParser.TABLE)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class All_or_distinctContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def DISTINCT(self):
            return self.getToken(PostgreSQLParser.DISTINCT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_all_or_distinct

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAll_or_distinct" ):
                listener.enterAll_or_distinct(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAll_or_distinct" ):
                listener.exitAll_or_distinct(self)




    def all_or_distinct(self):

        localctx = PostgreSQLParser.All_or_distinctContext(self, self._ctx, self.state)
        self.enterRule(localctx, 990, self.RULE_all_or_distinct)
        try:
            self.state = 8074
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [30]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8071
                self.match(PostgreSQLParser.ALL)
                pass
            elif token in [56]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8072
                self.match(PostgreSQLParser.DISTINCT)
                pass
            elif token in [2, 88, 92, 415]:
                self.enterOuterAlt(localctx, 3)

                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 Distinct_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DISTINCT(self):
            return self.getToken(PostgreSQLParser.DISTINCT, 0)

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_distinct_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDistinct_clause" ):
                listener.enterDistinct_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDistinct_clause" ):
                listener.exitDistinct_clause(self)




    def distinct_clause(self):

        localctx = PostgreSQLParser.Distinct_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 992, self.RULE_distinct_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8076
            self.match(PostgreSQLParser.DISTINCT)
            self.state = 8082
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==80:
                self.state = 8077
                self.match(PostgreSQLParser.ON)
                self.state = 8078
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8079
                self.expr_list()
                self.state = 8080
                self.match(PostgreSQLParser.CLOSE_PAREN)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_all_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_all_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_all_clause" ):
                listener.enterOpt_all_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_all_clause" ):
                listener.exitOpt_all_clause(self)




    def opt_all_clause(self):

        localctx = PostgreSQLParser.Opt_all_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 994, self.RULE_opt_all_clause)
        try:
            self.state = 8086
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [30]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8084
                self.match(PostgreSQLParser.ALL)
                pass
            elif token in [-1, 2, 3, 7, 9, 12, 13, 28, 29, 31, 32, 33, 35, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 57, 59, 60, 61, 62, 64, 65, 66, 67, 70, 71, 74, 75, 76, 77, 78, 79, 80, 83, 87, 88, 89, 92, 96, 97, 98, 99, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 668, 671]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_sort_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sort_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sort_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_sort_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_sort_clause" ):
                listener.enterOpt_sort_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_sort_clause" ):
                listener.exitOpt_sort_clause(self)




    def opt_sort_clause(self):

        localctx = PostgreSQLParser.Opt_sort_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 996, self.RULE_opt_sort_clause)
        try:
            self.state = 8090
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [83]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8088
                self.sort_clause()
                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 62, 65, 71, 74, 79, 80, 87, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 292, 294, 298, 299, 301, 306, 310, 312, 313, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 481, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Sort_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ORDER(self):
            return self.getToken(PostgreSQLParser.ORDER, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def sortby_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sortby_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sort_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSort_clause" ):
                listener.enterSort_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSort_clause" ):
                listener.exitSort_clause(self)




    def sort_clause(self):

        localctx = PostgreSQLParser.Sort_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 998, self.RULE_sort_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8092
            self.match(PostgreSQLParser.ORDER)
            self.state = 8093
            self.match(PostgreSQLParser.BY)
            self.state = 8094
            self.sortby_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Sortby_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sortby(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.SortbyContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.SortbyContext,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_sortby_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSortby_list" ):
                listener.enterSortby_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSortby_list" ):
                listener.exitSortby_list(self)




    def sortby_list(self):

        localctx = PostgreSQLParser.Sortby_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1000, self.RULE_sortby_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8096
            self.sortby()
            self.state = 8101
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 8097
                self.match(PostgreSQLParser.COMMA)
                self.state = 8098
                self.sortby()
                self.state = 8103
                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 SortbyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def opt_nulls_order(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_nulls_orderContext,0)


        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def qual_all_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qual_all_opContext,0)


        def opt_asc_desc(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_asc_descContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sortby

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSortby" ):
                listener.enterSortby(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSortby" ):
                listener.exitSortby(self)




    def sortby(self):

        localctx = PostgreSQLParser.SortbyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1002, self.RULE_sortby)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8104
            self.a_expr()
            self.state = 8108
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.state = 8105
                self.match(PostgreSQLParser.USING)
                self.state = 8106
                self.qual_all_op()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 37, 46, 55, 57, 61, 62, 65, 71, 74, 79, 80, 87, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 266, 283, 292, 294, 298, 299, 301, 306, 310, 312, 313, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 481, 519, 668]:
                self.state = 8107
                self.opt_asc_desc()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 8110
            self.opt_nulls_order()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Select_limitContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def limit_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Limit_clauseContext,0)


        def offset_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Offset_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_limit

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSelect_limit" ):
                listener.enterSelect_limit(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSelect_limit" ):
                listener.exitSelect_limit(self)




    def select_limit(self):

        localctx = PostgreSQLParser.Select_limitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1004, self.RULE_select_limit)
        self._la = 0 # Token type
        try:
            self.state = 8120
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [61, 74]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8112
                self.limit_clause()
                self.state = 8114
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==79:
                    self.state = 8113
                    self.offset_clause()


                pass
            elif token in [79]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8116
                self.offset_clause()
                self.state = 8118
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,442,self._ctx)
                if la_ == 1:
                    self.state = 8117
                    self.limit_clause()


                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 Opt_select_limitContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def select_limit(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_limitContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_select_limit

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_select_limit" ):
                listener.enterOpt_select_limit(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_select_limit" ):
                listener.exitOpt_select_limit(self)




    def opt_select_limit(self):

        localctx = PostgreSQLParser.Opt_select_limitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1006, self.RULE_opt_select_limit)
        try:
            self.state = 8124
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,444,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8122
                self.select_limit()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        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):
        __slots__ = 'parser'

        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 select_limit_value(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_limit_valueContext,0)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def select_offset_value(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_offset_valueContext,0)


        def FETCH(self):
            return self.getToken(PostgreSQLParser.FETCH, 0)

        def first_or_next(self):
            return self.getTypedRuleContext(PostgreSQLParser.First_or_nextContext,0)


        def select_fetch_first_value(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_fetch_first_valueContext,0)


        def row_or_rows(self):
            return self.getTypedRuleContext(PostgreSQLParser.Row_or_rowsContext,0)


        def ONLY(self):
            return self.getToken(PostgreSQLParser.ONLY, 0)

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def TIES(self):
            return self.getToken(PostgreSQLParser.TIES, 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, 1008, self.RULE_limit_clause)
        self._la = 0 # Token type
        try:
            self.state = 8149
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [74]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8126
                self.match(PostgreSQLParser.LIMIT)
                self.state = 8127
                self.select_limit_value()
                self.state = 8130
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==6:
                    self.state = 8128
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 8129
                    self.select_offset_value()


                pass
            elif token in [61]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8132
                self.match(PostgreSQLParser.FETCH)
                self.state = 8133
                self.first_or_next()
                self.state = 8147
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,448,self._ctx)
                if la_ == 1:
                    self.state = 8134
                    self.select_fetch_first_value()
                    self.state = 8135
                    self.row_or_rows()
                    self.state = 8139
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [81]:
                        self.state = 8136
                        self.match(PostgreSQLParser.ONLY)
                        pass
                    elif token in [105]:
                        self.state = 8137
                        self.match(PostgreSQLParser.WITH)
                        self.state = 8138
                        self.match(PostgreSQLParser.TIES)
                        pass
                    else:
                        raise NoViableAltException(self)

                    pass

                elif la_ == 2:
                    self.state = 8141
                    self.row_or_rows()
                    self.state = 8145
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [81]:
                        self.state = 8142
                        self.match(PostgreSQLParser.ONLY)
                        pass
                    elif token in [105]:
                        self.state = 8143
                        self.match(PostgreSQLParser.WITH)
                        self.state = 8144
                        self.match(PostgreSQLParser.TIES)
                        pass
                    else:
                        raise NoViableAltException(self)

                    pass


                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 Offset_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OFFSET(self):
            return self.getToken(PostgreSQLParser.OFFSET, 0)

        def select_offset_value(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_offset_valueContext,0)


        def select_fetch_first_value(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_fetch_first_valueContext,0)


        def row_or_rows(self):
            return self.getTypedRuleContext(PostgreSQLParser.Row_or_rowsContext,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, 1010, self.RULE_offset_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8151
            self.match(PostgreSQLParser.OFFSET)
            self.state = 8156
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,450,self._ctx)
            if la_ == 1:
                self.state = 8152
                self.select_offset_value()
                pass

            elif la_ == 2:
                self.state = 8153
                self.select_fetch_first_value()
                self.state = 8154
                self.row_or_rows()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Select_limit_valueContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_limit_value

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSelect_limit_value" ):
                listener.enterSelect_limit_value(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSelect_limit_value" ):
                listener.exitSelect_limit_value(self)




    def select_limit_value(self):

        localctx = PostgreSQLParser.Select_limit_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1012, self.RULE_select_limit_value)
        try:
            self.state = 8160
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 12, 13, 28, 29, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 77, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8158
                self.a_expr()
                pass
            elif token in [30]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8159
                self.match(PostgreSQLParser.ALL)
                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_offset_valueContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_offset_value

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSelect_offset_value" ):
                listener.enterSelect_offset_value(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSelect_offset_value" ):
                listener.exitSelect_offset_value(self)




    def select_offset_value(self):

        localctx = PostgreSQLParser.Select_offset_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1014, self.RULE_select_offset_value)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8162
            self.a_expr()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Select_fetch_first_valueContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def c_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.C_exprContext,0)


        def PLUS(self):
            return self.getToken(PostgreSQLParser.PLUS, 0)

        def i_or_f_const(self):
            return self.getTypedRuleContext(PostgreSQLParser.I_or_f_constContext,0)


        def MINUS(self):
            return self.getToken(PostgreSQLParser.MINUS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_select_fetch_first_value

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSelect_fetch_first_value" ):
                listener.enterSelect_fetch_first_value(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSelect_fetch_first_value" ):
                listener.exitSelect_fetch_first_value(self)




    def select_fetch_first_value(self):

        localctx = PostgreSQLParser.Select_fetch_first_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1016, self.RULE_select_fetch_first_value)
        try:
            self.state = 8169
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 28, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8164
                self.c_expr()
                pass
            elif token in [12]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8165
                self.match(PostgreSQLParser.PLUS)
                self.state = 8166
                self.i_or_f_const()
                pass
            elif token in [13]:
                self.enterOuterAlt(localctx, 3)
                self.state = 8167
                self.match(PostgreSQLParser.MINUS)
                self.state = 8168
                self.i_or_f_const()
                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 I_or_f_constContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def fconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.FconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_i_or_f_const

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterI_or_f_const" ):
                listener.enterI_or_f_const(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitI_or_f_const" ):
                listener.exitI_or_f_const(self)




    def i_or_f_const(self):

        localctx = PostgreSQLParser.I_or_f_constContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1018, self.RULE_i_or_f_const)
        try:
            self.state = 8173
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [658]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8171
                self.iconst()
                pass
            elif token in [660]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8172
                self.fconst()
                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 Row_or_rowsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def ROWS(self):
            return self.getToken(PostgreSQLParser.ROWS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_row_or_rows

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRow_or_rows" ):
                listener.enterRow_or_rows(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRow_or_rows" ):
                listener.exitRow_or_rows(self)




    def row_or_rows(self):

        localctx = PostgreSQLParser.Row_or_rowsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1020, self.RULE_row_or_rows)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8175
            _la = self._input.LA(1)
            if not(_la==313 or _la==407):
                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 First_or_nextContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FIRST_P(self):
            return self.getToken(PostgreSQLParser.FIRST_P, 0)

        def NEXT(self):
            return self.getToken(PostgreSQLParser.NEXT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_first_or_next

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFirst_or_next" ):
                listener.enterFirst_or_next(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFirst_or_next" ):
                listener.exitFirst_or_next(self)




    def first_or_next(self):

        localctx = PostgreSQLParser.First_or_nextContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1022, self.RULE_first_or_next)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8177
            _la = self._input.LA(1)
            if not(_la==207 or _la==261):
                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_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def GROUP_P(self):
            return self.getToken(PostgreSQLParser.GROUP_P, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def group_by_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Group_by_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_group_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGroup_clause" ):
                listener.enterGroup_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGroup_clause" ):
                listener.exitGroup_clause(self)




    def group_clause(self):

        localctx = PostgreSQLParser.Group_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1024, self.RULE_group_clause)
        try:
            self.state = 8183
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [66]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8179
                self.match(PostgreSQLParser.GROUP_P)
                self.state = 8180
                self.match(PostgreSQLParser.BY)
                self.state = 8181
                self.group_by_list()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 57, 59, 61, 62, 65, 67, 70, 71, 74, 79, 80, 83, 87, 88, 92, 93, 97, 100, 102, 104, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Group_by_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def group_by_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Group_by_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Group_by_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_group_by_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGroup_by_list" ):
                listener.enterGroup_by_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGroup_by_list" ):
                listener.exitGroup_by_list(self)




    def group_by_list(self):

        localctx = PostgreSQLParser.Group_by_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1026, self.RULE_group_by_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8185
            self.group_by_item()
            self.state = 8190
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,455,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8186
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 8187
                    self.group_by_item() 
                self.state = 8192
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,455,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 Group_by_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def empty_grouping_set(self):
            return self.getTypedRuleContext(PostgreSQLParser.Empty_grouping_setContext,0)


        def cube_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cube_clauseContext,0)


        def rollup_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Rollup_clauseContext,0)


        def grouping_sets_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Grouping_sets_clauseContext,0)


        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_group_by_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGroup_by_item" ):
                listener.enterGroup_by_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGroup_by_item" ):
                listener.exitGroup_by_item(self)




    def group_by_item(self):

        localctx = PostgreSQLParser.Group_by_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1028, self.RULE_group_by_item)
        try:
            self.state = 8198
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,456,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8193
                self.empty_grouping_set()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8194
                self.cube_clause()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 8195
                self.rollup_clause()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 8196
                self.grouping_sets_clause()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 8197
                self.a_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 Empty_grouping_setContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_empty_grouping_set

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEmpty_grouping_set" ):
                listener.enterEmpty_grouping_set(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEmpty_grouping_set" ):
                listener.exitEmpty_grouping_set(self)




    def empty_grouping_set(self):

        localctx = PostgreSQLParser.Empty_grouping_setContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1030, self.RULE_empty_grouping_set)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8200
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8201
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Rollup_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ROLLUP(self):
            return self.getToken(PostgreSQLParser.ROLLUP, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rollup_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRollup_clause" ):
                listener.enterRollup_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRollup_clause" ):
                listener.exitRollup_clause(self)




    def rollup_clause(self):

        localctx = PostgreSQLParser.Rollup_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1032, self.RULE_rollup_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8203
            self.match(PostgreSQLParser.ROLLUP)
            self.state = 8204
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8205
            self.expr_list()
            self.state = 8206
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Cube_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CUBE(self):
            return self.getToken(PostgreSQLParser.CUBE, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_cube_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCube_clause" ):
                listener.enterCube_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCube_clause" ):
                listener.exitCube_clause(self)




    def cube_clause(self):

        localctx = PostgreSQLParser.Cube_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1034, self.RULE_cube_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8208
            self.match(PostgreSQLParser.CUBE)
            self.state = 8209
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8210
            self.expr_list()
            self.state = 8211
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Grouping_sets_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def GROUPING(self):
            return self.getToken(PostgreSQLParser.GROUPING, 0)

        def SETS(self):
            return self.getToken(PostgreSQLParser.SETS, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def group_by_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Group_by_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_grouping_sets_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGrouping_sets_clause" ):
                listener.enterGrouping_sets_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGrouping_sets_clause" ):
                listener.exitGrouping_sets_clause(self)




    def grouping_sets_clause(self):

        localctx = PostgreSQLParser.Grouping_sets_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1036, self.RULE_grouping_sets_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8213
            self.match(PostgreSQLParser.GROUPING)
            self.state = 8214
            self.match(PostgreSQLParser.SETS)
            self.state = 8215
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8216
            self.group_by_list()
            self.state = 8217
            self.match(PostgreSQLParser.CLOSE_PAREN)
        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):
        __slots__ = 'parser'

        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 a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,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, 1038, self.RULE_having_clause)
        try:
            self.state = 8222
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [67]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8219
                self.match(PostgreSQLParser.HAVING)
                self.state = 8220
                self.a_expr()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 57, 59, 61, 62, 65, 70, 71, 74, 79, 80, 83, 87, 88, 92, 93, 97, 100, 102, 104, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 For_locking_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def for_locking_items(self):
            return self.getTypedRuleContext(PostgreSQLParser.For_locking_itemsContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def READ(self):
            return self.getToken(PostgreSQLParser.READ, 0)

        def ONLY(self):
            return self.getToken(PostgreSQLParser.ONLY, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_for_locking_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_locking_clause" ):
                listener.enterFor_locking_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_locking_clause" ):
                listener.exitFor_locking_clause(self)




    def for_locking_clause(self):

        localctx = PostgreSQLParser.For_locking_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1040, self.RULE_for_locking_clause)
        try:
            self.state = 8228
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,458,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8224
                self.for_locking_items()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8225
                self.match(PostgreSQLParser.FOR)
                self.state = 8226
                self.match(PostgreSQLParser.READ)
                self.state = 8227
                self.match(PostgreSQLParser.ONLY)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_for_locking_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def for_locking_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.For_locking_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_for_locking_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_for_locking_clause" ):
                listener.enterOpt_for_locking_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_for_locking_clause" ):
                listener.exitOpt_for_locking_clause(self)




    def opt_for_locking_clause(self):

        localctx = PostgreSQLParser.Opt_for_locking_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1042, self.RULE_opt_for_locking_clause)
        try:
            self.state = 8232
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8230
                self.for_locking_clause()
                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 65, 71, 80, 87, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 For_locking_itemsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def for_locking_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.For_locking_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.For_locking_itemContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_for_locking_items

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_locking_items" ):
                listener.enterFor_locking_items(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_locking_items" ):
                listener.exitFor_locking_items(self)




    def for_locking_items(self):

        localctx = PostgreSQLParser.For_locking_itemsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1044, self.RULE_for_locking_items)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8235 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 8234
                self.for_locking_item()
                self.state = 8237 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==62):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class For_locking_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def for_locking_strength(self):
            return self.getTypedRuleContext(PostgreSQLParser.For_locking_strengthContext,0)


        def locked_rels_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Locked_rels_listContext,0)


        def opt_nowait_or_skip(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_nowait_or_skipContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_for_locking_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_locking_item" ):
                listener.enterFor_locking_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_locking_item" ):
                listener.exitFor_locking_item(self)




    def for_locking_item(self):

        localctx = PostgreSQLParser.For_locking_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1046, self.RULE_for_locking_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8239
            self.for_locking_strength()
            self.state = 8240
            self.locked_rels_list()
            self.state = 8241
            self.opt_nowait_or_skip()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class For_locking_strengthContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def SHARE(self):
            return self.getToken(PostgreSQLParser.SHARE, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def KEY(self):
            return self.getToken(PostgreSQLParser.KEY, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_for_locking_strength

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_locking_strength" ):
                listener.enterFor_locking_strength(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_locking_strength" ):
                listener.exitFor_locking_strength(self)




    def for_locking_strength(self):

        localctx = PostgreSQLParser.For_locking_strengthContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1048, self.RULE_for_locking_strength)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8243
            self.match(PostgreSQLParser.FOR)
            self.state = 8253
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [262, 362]:
                self.state = 8246
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==262:
                    self.state = 8244
                    self.match(PostgreSQLParser.NO)
                    self.state = 8245
                    self.match(PostgreSQLParser.KEY)


                self.state = 8248
                self.match(PostgreSQLParser.UPDATE)
                pass
            elif token in [236, 327]:
                self.state = 8250
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==236:
                    self.state = 8249
                    self.match(PostgreSQLParser.KEY)


                self.state = 8252
                self.match(PostgreSQLParser.SHARE)
                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 Locked_rels_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OF(self):
            return self.getToken(PostgreSQLParser.OF, 0)

        def qualified_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_name_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_locked_rels_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLocked_rels_list" ):
                listener.enterLocked_rels_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLocked_rels_list" ):
                listener.exitLocked_rels_list(self)




    def locked_rels_list(self):

        localctx = PostgreSQLParser.Locked_rels_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1050, self.RULE_locked_rels_list)
        try:
            self.state = 8258
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [268]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8255
                self.match(PostgreSQLParser.OF)
                self.state = 8256
                self.qualified_name_list()
                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 62, 65, 71, 74, 79, 80, 87, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 265, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 465, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Values_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        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 OPEN_PAREN(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.OPEN_PAREN)
            else:
                return self.getToken(PostgreSQLParser.OPEN_PAREN, i)

        def expr_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Expr_listContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,i)


        def CLOSE_PAREN(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.CLOSE_PAREN)
            else:
                return self.getToken(PostgreSQLParser.CLOSE_PAREN, 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_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterValues_clause" ):
                listener.enterValues_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitValues_clause" ):
                listener.exitValues_clause(self)




    def values_clause(self):

        localctx = PostgreSQLParser.Values_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1052, self.RULE_values_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8260
            self.match(PostgreSQLParser.VALUES)
            self.state = 8261
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8262
            self.expr_list()
            self.state = 8263
            self.match(PostgreSQLParser.CLOSE_PAREN)
            self.state = 8271
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 8264
                self.match(PostgreSQLParser.COMMA)
                self.state = 8265
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8266
                self.expr_list()
                self.state = 8267
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 8273
                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 From_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def from_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.From_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_from_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFrom_clause" ):
                listener.enterFrom_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFrom_clause" ):
                listener.exitFrom_clause(self)




    def from_clause(self):

        localctx = PostgreSQLParser.From_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1054, self.RULE_from_clause)
        try:
            self.state = 8277
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [64]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8274
                self.match(PostgreSQLParser.FROM)
                self.state = 8275
                self.from_list()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 57, 59, 61, 62, 65, 66, 67, 70, 71, 74, 79, 80, 83, 87, 88, 92, 93, 97, 100, 102, 103, 104, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 From_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def non_ansi_join(self):
            return self.getTypedRuleContext(PostgreSQLParser.Non_ansi_joinContext,0)


        def table_ref(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_refContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_refContext,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_from_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFrom_list" ):
                listener.enterFrom_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFrom_list" ):
                listener.exitFrom_list(self)




    def from_list(self):

        localctx = PostgreSQLParser.From_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1056, self.RULE_from_list)
        try:
            self.state = 8288
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,468,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8279
                self.non_ansi_join()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8280
                self.table_ref()
                self.state = 8285
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,467,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 8281
                        self.match(PostgreSQLParser.COMMA)
                        self.state = 8282
                        self.table_ref() 
                    self.state = 8287
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,467,self._ctx)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Non_ansi_joinContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def table_ref(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_refContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_refContext,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_non_ansi_join

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNon_ansi_join" ):
                listener.enterNon_ansi_join(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNon_ansi_join" ):
                listener.exitNon_ansi_join(self)




    def non_ansi_join(self):

        localctx = PostgreSQLParser.Non_ansi_joinContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1058, self.RULE_non_ansi_join)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8290
            self.table_ref()
            self.state = 8293 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 8291
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 8292
                    self.table_ref()

                else:
                    raise NoViableAltException(self)
                self.state = 8295 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,469,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_refContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def relation_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_exprContext,0)


        def opt_alias_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_alias_clauseContext,0)


        def func_table(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_tableContext,0)


        def func_alias_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_alias_clauseContext,0)


        def xmltable(self):
            return self.getTypedRuleContext(PostgreSQLParser.XmltableContext,0)


        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)


        def LATERAL_P(self):
            return self.getToken(PostgreSQLParser.LATERAL_P, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def table_ref(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Table_refContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Table_refContext,i)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def CROSS(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.CROSS)
            else:
                return self.getToken(PostgreSQLParser.CROSS, i)

        def JOIN(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.JOIN)
            else:
                return self.getToken(PostgreSQLParser.JOIN, i)

        def NATURAL(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.NATURAL)
            else:
                return self.getToken(PostgreSQLParser.NATURAL, i)

        def join_qual(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Join_qualContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Join_qualContext,i)


        def tablesample_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Tablesample_clauseContext,0)


        def join_type(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Join_typeContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Join_typeContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_ref

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTable_ref" ):
                listener.enterTable_ref(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTable_ref" ):
                listener.exitTable_ref(self)




    def table_ref(self):

        localctx = PostgreSQLParser.Table_refContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1060, self.RULE_table_ref)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8346
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,475,self._ctx)
            if la_ == 1:
                self.state = 8297
                self.relation_expr()
                self.state = 8298
                self.opt_alias_clause()
                self.state = 8300
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==472:
                    self.state = 8299
                    self.tablesample_clause()


                pass

            elif la_ == 2:
                self.state = 8302
                self.func_table()
                self.state = 8303
                self.func_alias_clause()
                pass

            elif la_ == 3:
                self.state = 8305
                self.xmltable()
                self.state = 8306
                self.opt_alias_clause()
                pass

            elif la_ == 4:
                self.state = 8308
                self.select_with_parens()
                self.state = 8309
                self.opt_alias_clause()
                pass

            elif la_ == 5:
                self.state = 8311
                self.match(PostgreSQLParser.LATERAL_P)
                self.state = 8321
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,471,self._ctx)
                if la_ == 1:
                    self.state = 8312
                    self.xmltable()
                    self.state = 8313
                    self.opt_alias_clause()
                    pass

                elif la_ == 2:
                    self.state = 8315
                    self.func_table()
                    self.state = 8316
                    self.func_alias_clause()
                    pass

                elif la_ == 3:
                    self.state = 8318
                    self.select_with_parens()
                    self.state = 8319
                    self.opt_alias_clause()
                    pass


                pass

            elif la_ == 6:
                self.state = 8323
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8324
                self.table_ref()
                self.state = 8341
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [110]:
                    self.state = 8325
                    self.match(PostgreSQLParser.CROSS)
                    self.state = 8326
                    self.match(PostgreSQLParser.JOIN)
                    self.state = 8327
                    self.table_ref()
                    pass
                elif token in [121]:
                    self.state = 8328
                    self.match(PostgreSQLParser.NATURAL)
                    self.state = 8330
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if ((((_la - 113)) & ~0x3f) == 0 and ((1 << (_la - 113)) & 8261) != 0):
                        self.state = 8329
                        self.join_type()


                    self.state = 8332
                    self.match(PostgreSQLParser.JOIN)
                    self.state = 8333
                    self.table_ref()
                    pass
                elif token in [113, 115, 118, 119, 126]:
                    self.state = 8335
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if ((((_la - 113)) & ~0x3f) == 0 and ((1 << (_la - 113)) & 8261) != 0):
                        self.state = 8334
                        self.join_type()


                    self.state = 8337
                    self.match(PostgreSQLParser.JOIN)
                    self.state = 8338
                    self.table_ref()
                    self.state = 8339
                    self.join_qual()
                    pass
                elif token in [3]:
                    pass
                else:
                    pass
                self.state = 8343
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 8344
                self.opt_alias_clause()
                pass


            self.state = 8366
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,479,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8364
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [110]:
                        self.state = 8348
                        self.match(PostgreSQLParser.CROSS)
                        self.state = 8349
                        self.match(PostgreSQLParser.JOIN)
                        self.state = 8350
                        self.table_ref()
                        pass
                    elif token in [121]:
                        self.state = 8351
                        self.match(PostgreSQLParser.NATURAL)
                        self.state = 8353
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if ((((_la - 113)) & ~0x3f) == 0 and ((1 << (_la - 113)) & 8261) != 0):
                            self.state = 8352
                            self.join_type()


                        self.state = 8355
                        self.match(PostgreSQLParser.JOIN)
                        self.state = 8356
                        self.table_ref()
                        pass
                    elif token in [113, 115, 118, 119, 126]:
                        self.state = 8358
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if ((((_la - 113)) & ~0x3f) == 0 and ((1 << (_la - 113)) & 8261) != 0):
                            self.state = 8357
                            self.join_type()


                        self.state = 8360
                        self.match(PostgreSQLParser.JOIN)
                        self.state = 8361
                        self.table_ref()
                        self.state = 8362
                        self.join_qual()
                        pass
                    else:
                        raise NoViableAltException(self)
             
                self.state = 8368
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,479,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 Alias_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Name_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_alias_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlias_clause" ):
                listener.enterAlias_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlias_clause" ):
                listener.exitAlias_clause(self)




    def alias_clause(self):

        localctx = PostgreSQLParser.Alias_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1062, self.RULE_alias_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8370
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==36:
                self.state = 8369
                self.match(PostgreSQLParser.AS)


            self.state = 8372
            self.colid()
            self.state = 8377
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,481,self._ctx)
            if la_ == 1:
                self.state = 8373
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8374
                self.name_list()
                self.state = 8375
                self.match(PostgreSQLParser.CLOSE_PAREN)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_alias_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def table_alias_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_alias_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_alias_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_alias_clause" ):
                listener.enterOpt_alias_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_alias_clause" ):
                listener.exitOpt_alias_clause(self)




    def opt_alias_clause(self):

        localctx = PostgreSQLParser.Opt_alias_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1064, self.RULE_opt_alias_clause)
        try:
            self.state = 8381
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,482,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8379
                self.table_alias_clause()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                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_alias_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def table_alias(self):
            return self.getTypedRuleContext(PostgreSQLParser.Table_aliasContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Name_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_alias_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTable_alias_clause" ):
                listener.enterTable_alias_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTable_alias_clause" ):
                listener.exitTable_alias_clause(self)




    def table_alias_clause(self):

        localctx = PostgreSQLParser.Table_alias_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1066, self.RULE_table_alias_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8384
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==36:
                self.state = 8383
                self.match(PostgreSQLParser.AS)


            self.state = 8386
            self.table_alias()
            self.state = 8391
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,484,self._ctx)
            if la_ == 1:
                self.state = 8387
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8388
                self.name_list()
                self.state = 8389
                self.match(PostgreSQLParser.CLOSE_PAREN)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_alias_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def alias_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Alias_clauseContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def tablefuncelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.TablefuncelementlistContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_alias_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_alias_clause" ):
                listener.enterFunc_alias_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_alias_clause" ):
                listener.exitFunc_alias_clause(self)




    def func_alias_clause(self):

        localctx = PostgreSQLParser.Func_alias_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1068, self.RULE_func_alias_clause)
        self._la = 0 # Token type
        try:
            self.state = 8406
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,487,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8393
                self.alias_clause()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8399
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [36]:
                    self.state = 8394
                    self.match(PostgreSQLParser.AS)
                    self.state = 8396
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2459027012145119232) != 0) or ((((_la - 92)) & ~0x3f) == 0 and ((1 << (_la - 92)) & -113665638399) != 0) or ((((_la - 156)) & ~0x3f) == 0 and ((1 << (_la - 156)) & -1) != 0) or ((((_la - 220)) & ~0x3f) == 0 and ((1 << (_la - 220)) & -9663676417) != 0) or ((((_la - 284)) & ~0x3f) == 0 and ((1 << (_la - 284)) & -1) != 0) or ((((_la - 348)) & ~0x3f) == 0 and ((1 << (_la - 348)) & -1) != 0) or ((((_la - 412)) & ~0x3f) == 0 and ((1 << (_la - 412)) & -1152925902653358081) != 0) or ((((_la - 476)) & ~0x3f) == 0 and ((1 << (_la - 476)) & -8796764110849) != 0) or ((((_la - 540)) & ~0x3f) == 0 and ((1 << (_la - 540)) & -1) != 0) or ((((_la - 604)) & ~0x3f) == 0 and ((1 << (_la - 604)) & 432345718846390271) != 0):
                        self.state = 8395
                        self.colid()


                    pass
                elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                    self.state = 8398
                    self.colid()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 8401
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8402
                self.tablefuncelementlist()
                self.state = 8403
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Join_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FULL(self):
            return self.getToken(PostgreSQLParser.FULL, 0)

        def LEFT(self):
            return self.getToken(PostgreSQLParser.LEFT, 0)

        def RIGHT(self):
            return self.getToken(PostgreSQLParser.RIGHT, 0)

        def INNER_P(self):
            return self.getToken(PostgreSQLParser.INNER_P, 0)

        def OUTER_P(self):
            return self.getToken(PostgreSQLParser.OUTER_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_join_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterJoin_type" ):
                listener.enterJoin_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitJoin_type" ):
                listener.exitJoin_type(self)




    def join_type(self):

        localctx = PostgreSQLParser.Join_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1070, self.RULE_join_type)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8408
            _la = self._input.LA(1)
            if not(((((_la - 113)) & ~0x3f) == 0 and ((1 << (_la - 113)) & 8261) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 8410
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==123:
                self.state = 8409
                self.match(PostgreSQLParser.OUTER_P)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Join_qualContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Name_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_join_qual

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterJoin_qual" ):
                listener.enterJoin_qual(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitJoin_qual" ):
                listener.exitJoin_qual(self)




    def join_qual(self):

        localctx = PostgreSQLParser.Join_qualContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1072, self.RULE_join_qual)
        try:
            self.state = 8419
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [100]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8412
                self.match(PostgreSQLParser.USING)
                self.state = 8413
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8414
                self.name_list()
                self.state = 8415
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [80]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8417
                self.match(PostgreSQLParser.ON)
                self.state = 8418
                self.a_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


    class Relation_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def STAR(self):
            return self.getToken(PostgreSQLParser.STAR, 0)

        def ONLY(self):
            return self.getToken(PostgreSQLParser.ONLY, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_relation_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRelation_expr" ):
                listener.enterRelation_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRelation_expr" ):
                listener.exitRelation_expr(self)




    def relation_expr(self):

        localctx = PostgreSQLParser.Relation_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1074, self.RULE_relation_expr)
        self._la = 0 # Token type
        try:
            self.state = 8433
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8421
                self.qualified_name()
                self.state = 8423
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==9:
                    self.state = 8422
                    self.match(PostgreSQLParser.STAR)


                pass
            elif token in [81]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8425
                self.match(PostgreSQLParser.ONLY)
                self.state = 8431
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                    self.state = 8426
                    self.qualified_name()
                    pass
                elif token in [2]:
                    self.state = 8427
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 8428
                    self.qualified_name()
                    self.state = 8429
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    pass
                else:
                    raise NoViableAltException(self)

                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 Relation_expr_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def relation_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Relation_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Relation_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 getRuleIndex(self):
            return PostgreSQLParser.RULE_relation_expr_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRelation_expr_list" ):
                listener.enterRelation_expr_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRelation_expr_list" ):
                listener.exitRelation_expr_list(self)




    def relation_expr_list(self):

        localctx = PostgreSQLParser.Relation_expr_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1076, self.RULE_relation_expr_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8435
            self.relation_expr()
            self.state = 8440
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 8436
                self.match(PostgreSQLParser.COMMA)
                self.state = 8437
                self.relation_expr()
                self.state = 8442
                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 Relation_expr_opt_aliasContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def relation_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Relation_exprContext,0)


        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_relation_expr_opt_alias

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRelation_expr_opt_alias" ):
                listener.enterRelation_expr_opt_alias(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRelation_expr_opt_alias" ):
                listener.exitRelation_expr_opt_alias(self)




    def relation_expr_opt_alias(self):

        localctx = PostgreSQLParser.Relation_expr_opt_aliasContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1078, self.RULE_relation_expr_opt_alias)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8443
            self.relation_expr()
            self.state = 8448
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,495,self._ctx)
            if la_ == 1:
                self.state = 8445
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==36:
                    self.state = 8444
                    self.match(PostgreSQLParser.AS)


                self.state = 8447
                self.colid()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Tablesample_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TABLESAMPLE(self):
            return self.getToken(PostgreSQLParser.TABLESAMPLE, 0)

        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def opt_repeatable_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_repeatable_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_tablesample_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTablesample_clause" ):
                listener.enterTablesample_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTablesample_clause" ):
                listener.exitTablesample_clause(self)




    def tablesample_clause(self):

        localctx = PostgreSQLParser.Tablesample_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1080, self.RULE_tablesample_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8450
            self.match(PostgreSQLParser.TABLESAMPLE)
            self.state = 8451
            self.func_name()
            self.state = 8452
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8453
            self.expr_list()
            self.state = 8454
            self.match(PostgreSQLParser.CLOSE_PAREN)
            self.state = 8455
            self.opt_repeatable_clause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_repeatable_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def REPEATABLE(self):
            return self.getToken(PostgreSQLParser.REPEATABLE, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_repeatable_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_repeatable_clause" ):
                listener.enterOpt_repeatable_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_repeatable_clause" ):
                listener.exitOpt_repeatable_clause(self)




    def opt_repeatable_clause(self):

        localctx = PostgreSQLParser.Opt_repeatable_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1082, self.RULE_opt_repeatable_clause)
        try:
            self.state = 8463
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [303]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8457
                self.match(PostgreSQLParser.REPEATABLE)
                self.state = 8458
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8459
                self.a_expr()
                self.state = 8460
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 57, 59, 61, 62, 65, 66, 67, 70, 71, 74, 79, 80, 83, 87, 88, 92, 93, 97, 100, 102, 103, 104, 105, 110, 113, 115, 118, 119, 121, 126, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Func_tableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_expr_windowless(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_expr_windowlessContext,0)


        def opt_ordinality(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_ordinalityContext,0)


        def ROWS(self):
            return self.getToken(PostgreSQLParser.ROWS, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def rowsfrom_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Rowsfrom_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_table

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_table" ):
                listener.enterFunc_table(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_table" ):
                listener.exitFunc_table(self)




    def func_table(self):

        localctx = PostgreSQLParser.Func_tableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1084, self.RULE_func_table)
        try:
            self.state = 8475
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,497,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8465
                self.func_expr_windowless()
                self.state = 8466
                self.opt_ordinality()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8468
                self.match(PostgreSQLParser.ROWS)
                self.state = 8469
                self.match(PostgreSQLParser.FROM)
                self.state = 8470
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8471
                self.rowsfrom_list()
                self.state = 8472
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 8473
                self.opt_ordinality()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Rowsfrom_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_expr_windowless(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_expr_windowlessContext,0)


        def opt_col_def_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_col_def_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rowsfrom_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRowsfrom_item" ):
                listener.enterRowsfrom_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRowsfrom_item" ):
                listener.exitRowsfrom_item(self)




    def rowsfrom_item(self):

        localctx = PostgreSQLParser.Rowsfrom_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1086, self.RULE_rowsfrom_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8477
            self.func_expr_windowless()
            self.state = 8478
            self.opt_col_def_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Rowsfrom_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def rowsfrom_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Rowsfrom_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Rowsfrom_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_rowsfrom_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRowsfrom_list" ):
                listener.enterRowsfrom_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRowsfrom_list" ):
                listener.exitRowsfrom_list(self)




    def rowsfrom_list(self):

        localctx = PostgreSQLParser.Rowsfrom_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1088, self.RULE_rowsfrom_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8480
            self.rowsfrom_item()
            self.state = 8485
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 8481
                self.match(PostgreSQLParser.COMMA)
                self.state = 8482
                self.rowsfrom_item()
                self.state = 8487
                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 Opt_col_def_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def tablefuncelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.TablefuncelementlistContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_col_def_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_col_def_list" ):
                listener.enterOpt_col_def_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_col_def_list" ):
                listener.exitOpt_col_def_list(self)




    def opt_col_def_list(self):

        localctx = PostgreSQLParser.Opt_col_def_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1090, self.RULE_opt_col_def_list)
        try:
            self.state = 8494
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [36]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8488
                self.match(PostgreSQLParser.AS)
                self.state = 8489
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8490
                self.tablefuncelementlist()
                self.state = 8491
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [3, 6]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_ordinalityContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def ORDINALITY(self):
            return self.getToken(PostgreSQLParser.ORDINALITY, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_ordinality

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_ordinality" ):
                listener.enterOpt_ordinality(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_ordinality" ):
                listener.exitOpt_ordinality(self)




    def opt_ordinality(self):

        localctx = PostgreSQLParser.Opt_ordinalityContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1092, self.RULE_opt_ordinality)
        try:
            self.state = 8499
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,500,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8496
                self.match(PostgreSQLParser.WITH)
                self.state = 8497
                self.match(PostgreSQLParser.ORDINALITY)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        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):
        __slots__ = 'parser'

        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 a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,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, 1094, self.RULE_where_clause)
        try:
            self.state = 8504
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [103]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8501
                self.match(PostgreSQLParser.WHERE)
                self.state = 8502
                self.a_expr()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 57, 59, 61, 62, 65, 66, 67, 70, 71, 74, 79, 80, 83, 87, 88, 92, 93, 97, 100, 102, 104, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Where_or_current_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        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 CURRENT_P(self):
            return self.getToken(PostgreSQLParser.CURRENT_P, 0)

        def OF(self):
            return self.getToken(PostgreSQLParser.OF, 0)

        def cursor_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_nameContext,0)


        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_where_or_current_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWhere_or_current_clause" ):
                listener.enterWhere_or_current_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWhere_or_current_clause" ):
                listener.exitWhere_or_current_clause(self)




    def where_or_current_clause(self):

        localctx = PostgreSQLParser.Where_or_current_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1096, self.RULE_where_or_current_clause)
        try:
            self.state = 8514
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [103]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8506
                self.match(PostgreSQLParser.WHERE)
                self.state = 8511
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,502,self._ctx)
                if la_ == 1:
                    self.state = 8507
                    self.match(PostgreSQLParser.CURRENT_P)
                    self.state = 8508
                    self.match(PostgreSQLParser.OF)
                    self.state = 8509
                    self.cursor_name()
                    pass

                elif la_ == 2:
                    self.state = 8510
                    self.a_expr()
                    pass


                pass
            elif token in [-1, 2, 3, 7, 31, 32, 46, 57, 61, 65, 71, 87, 88, 92, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 OpttablefuncelementlistContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def tablefuncelementlist(self):
            return self.getTypedRuleContext(PostgreSQLParser.TablefuncelementlistContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opttablefuncelementlist

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpttablefuncelementlist" ):
                listener.enterOpttablefuncelementlist(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpttablefuncelementlist" ):
                listener.exitOpttablefuncelementlist(self)




    def opttablefuncelementlist(self):

        localctx = PostgreSQLParser.OpttablefuncelementlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1098, self.RULE_opttablefuncelementlist)
        try:
            self.state = 8518
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8516
                self.tablefuncelementlist()
                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 2)

                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 TablefuncelementlistContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def tablefuncelement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TablefuncelementContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TablefuncelementContext,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_tablefuncelementlist

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTablefuncelementlist" ):
                listener.enterTablefuncelementlist(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTablefuncelementlist" ):
                listener.exitTablefuncelementlist(self)




    def tablefuncelementlist(self):

        localctx = PostgreSQLParser.TablefuncelementlistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1100, self.RULE_tablefuncelementlist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8520
            self.tablefuncelement()
            self.state = 8525
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 8521
                self.match(PostgreSQLParser.COMMA)
                self.state = 8522
                self.tablefuncelement()
                self.state = 8527
                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 TablefuncelementContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def opt_collate_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_collate_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_tablefuncelement

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTablefuncelement" ):
                listener.enterTablefuncelement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTablefuncelement" ):
                listener.exitTablefuncelement(self)




    def tablefuncelement(self):

        localctx = PostgreSQLParser.TablefuncelementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1102, self.RULE_tablefuncelement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8528
            self.colid()
            self.state = 8529
            self.typename()
            self.state = 8530
            self.opt_collate_clause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class XmltableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def XMLTABLE(self):
            return self.getToken(PostgreSQLParser.XMLTABLE, 0)

        def OPEN_PAREN(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.OPEN_PAREN)
            else:
                return self.getToken(PostgreSQLParser.OPEN_PAREN, i)

        def CLOSE_PAREN(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.CLOSE_PAREN)
            else:
                return self.getToken(PostgreSQLParser.CLOSE_PAREN, i)

        def c_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.C_exprContext,0)


        def xmlexists_argument(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xmlexists_argumentContext,0)


        def COLUMNS(self):
            return self.getToken(PostgreSQLParser.COLUMNS, 0)

        def xmltable_column_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xmltable_column_listContext,0)


        def XMLNAMESPACES(self):
            return self.getToken(PostgreSQLParser.XMLNAMESPACES, 0)

        def xml_namespace_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xml_namespace_listContext,0)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xmltable

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXmltable" ):
                listener.enterXmltable(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXmltable" ):
                listener.exitXmltable(self)




    def xmltable(self):

        localctx = PostgreSQLParser.XmltableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1104, self.RULE_xmltable)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8532
            self.match(PostgreSQLParser.XMLTABLE)
            self.state = 8533
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8549
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,506,self._ctx)
            if la_ == 1:
                self.state = 8534
                self.c_expr()
                self.state = 8535
                self.xmlexists_argument()
                self.state = 8536
                self.match(PostgreSQLParser.COLUMNS)
                self.state = 8537
                self.xmltable_column_list()
                pass

            elif la_ == 2:
                self.state = 8539
                self.match(PostgreSQLParser.XMLNAMESPACES)
                self.state = 8540
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8541
                self.xml_namespace_list()
                self.state = 8542
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 8543
                self.match(PostgreSQLParser.COMMA)
                self.state = 8544
                self.c_expr()
                self.state = 8545
                self.xmlexists_argument()
                self.state = 8546
                self.match(PostgreSQLParser.COLUMNS)
                self.state = 8547
                self.xmltable_column_list()
                pass


            self.state = 8551
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Xmltable_column_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def xmltable_column_el(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Xmltable_column_elContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Xmltable_column_elContext,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_xmltable_column_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXmltable_column_list" ):
                listener.enterXmltable_column_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXmltable_column_list" ):
                listener.exitXmltable_column_list(self)




    def xmltable_column_list(self):

        localctx = PostgreSQLParser.Xmltable_column_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1106, self.RULE_xmltable_column_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8553
            self.xmltable_column_el()
            self.state = 8558
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 8554
                self.match(PostgreSQLParser.COMMA)
                self.state = 8555
                self.xmltable_column_el()
                self.state = 8560
                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 Xmltable_column_elContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def ORDINALITY(self):
            return self.getToken(PostgreSQLParser.ORDINALITY, 0)

        def xmltable_column_option_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xmltable_column_option_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xmltable_column_el

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXmltable_column_el" ):
                listener.enterXmltable_column_el(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXmltable_column_el" ):
                listener.exitXmltable_column_el(self)




    def xmltable_column_el(self):

        localctx = PostgreSQLParser.Xmltable_column_elContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1108, self.RULE_xmltable_column_el)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8561
            self.colid()
            self.state = 8568
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.state = 8562
                self.typename()
                self.state = 8564
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 33)) & ~0x3f) == 0 and ((1 << (_la - 33)) & 576513529147825157) != 0) or ((((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & 74346914954363009) != 0) or ((((_la - 207)) & ~0x3f) == 0 and ((1 << (_la - 207)) & 56295003965620233) != 0) or ((((_la - 272)) & ~0x3f) == 0 and ((1 << (_la - 272)) & 18068292027564033) != 0) or _la==353 or ((((_la - 433)) & ~0x3f) == 0 and ((1 << (_la - 433)) & -144097595889811453) != 0) or ((((_la - 497)) & ~0x3f) == 0 and ((1 << (_la - 497)) & 12516927) != 0) or ((((_la - 636)) & ~0x3f) == 0 and ((1 << (_la - 636)) & 100663331) != 0):
                    self.state = 8563
                    self.xmltable_column_option_list()


                pass
            elif token in [62]:
                self.state = 8566
                self.match(PostgreSQLParser.FOR)
                self.state = 8567
                self.match(PostgreSQLParser.ORDINALITY)
                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 Xmltable_column_option_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def xmltable_column_option_el(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Xmltable_column_option_elContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Xmltable_column_option_elContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xmltable_column_option_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXmltable_column_option_list" ):
                listener.enterXmltable_column_option_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXmltable_column_option_list" ):
                listener.exitXmltable_column_option_list(self)




    def xmltable_column_option_list(self):

        localctx = PostgreSQLParser.Xmltable_column_option_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1110, self.RULE_xmltable_column_option_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8571 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 8570
                self.xmltable_column_option_el()
                self.state = 8573 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (((((_la - 33)) & ~0x3f) == 0 and ((1 << (_la - 33)) & 576513529147825157) != 0) or ((((_la - 116)) & ~0x3f) == 0 and ((1 << (_la - 116)) & 74346914954363009) != 0) or ((((_la - 207)) & ~0x3f) == 0 and ((1 << (_la - 207)) & 56295003965620233) != 0) or ((((_la - 272)) & ~0x3f) == 0 and ((1 << (_la - 272)) & 18068292027564033) != 0) or _la==353 or ((((_la - 433)) & ~0x3f) == 0 and ((1 << (_la - 433)) & -144097595889811453) != 0) or ((((_la - 497)) & ~0x3f) == 0 and ((1 << (_la - 497)) & 12516927) != 0) or ((((_la - 636)) & ~0x3f) == 0 and ((1 << (_la - 636)) & 100663331) != 0)):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Xmltable_column_option_elContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xmltable_column_option_el

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXmltable_column_option_el" ):
                listener.enterXmltable_column_option_el(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXmltable_column_option_el" ):
                listener.exitXmltable_column_option_el(self)




    def xmltable_column_option_el(self):

        localctx = PostgreSQLParser.Xmltable_column_option_elContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1112, self.RULE_xmltable_column_option_el)
        try:
            self.state = 8583
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,511,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8575
                self.match(PostgreSQLParser.DEFAULT)
                self.state = 8576
                self.a_expr()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8577
                self.identifier()
                self.state = 8578
                self.a_expr()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 8580
                self.match(PostgreSQLParser.NOT)
                self.state = 8581
                self.match(PostgreSQLParser.NULL_P)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 8582
                self.match(PostgreSQLParser.NULL_P)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Xml_namespace_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def xml_namespace_el(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Xml_namespace_elContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Xml_namespace_elContext,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_xml_namespace_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXml_namespace_list" ):
                listener.enterXml_namespace_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXml_namespace_list" ):
                listener.exitXml_namespace_list(self)




    def xml_namespace_list(self):

        localctx = PostgreSQLParser.Xml_namespace_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1114, self.RULE_xml_namespace_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8585
            self.xml_namespace_el()
            self.state = 8590
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 8586
                self.match(PostgreSQLParser.COMMA)
                self.state = 8587
                self.xml_namespace_el()
                self.state = 8592
                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 Xml_namespace_elContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def b_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.B_exprContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xml_namespace_el

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXml_namespace_el" ):
                listener.enterXml_namespace_el(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXml_namespace_el" ):
                listener.exitXml_namespace_el(self)




    def xml_namespace_el(self):

        localctx = PostgreSQLParser.Xml_namespace_elContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1116, self.RULE_xml_namespace_el)
        try:
            self.state = 8599
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,513,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8593
                self.b_expr(0)
                self.state = 8594
                self.match(PostgreSQLParser.AS)
                self.state = 8595
                self.collabel()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8597
                self.match(PostgreSQLParser.DEFAULT)
                self.state = 8598
                self.b_expr(0)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TypenameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def simpletypename(self):
            return self.getTypedRuleContext(PostgreSQLParser.SimpletypenameContext,0)


        def opt_array_bounds(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_array_boundsContext,0)


        def ARRAY(self):
            return self.getToken(PostgreSQLParser.ARRAY, 0)

        def SETOF(self):
            return self.getToken(PostgreSQLParser.SETOF, 0)

        def OPEN_BRACKET(self):
            return self.getToken(PostgreSQLParser.OPEN_BRACKET, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def CLOSE_BRACKET(self):
            return self.getToken(PostgreSQLParser.CLOSE_BRACKET, 0)

        def qualified_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qualified_nameContext,0)


        def PERCENT(self):
            return self.getToken(PostgreSQLParser.PERCENT, 0)

        def ROWTYPE(self):
            return self.getToken(PostgreSQLParser.ROWTYPE, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_typename

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTypename" ):
                listener.enterTypename(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTypename" ):
                listener.exitTypename(self)




    def typename(self):

        localctx = PostgreSQLParser.TypenameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1118, self.RULE_typename)
        self._la = 0 # Token type
        try:
            self.state = 8619
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,517,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8602
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==408:
                    self.state = 8601
                    self.match(PostgreSQLParser.SETOF)


                self.state = 8604
                self.simpletypename()
                self.state = 8613
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,516,self._ctx)
                if la_ == 1:
                    self.state = 8605
                    self.opt_array_bounds()
                    pass

                elif la_ == 2:
                    self.state = 8606
                    self.match(PostgreSQLParser.ARRAY)
                    self.state = 8611
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,515,self._ctx)
                    if la_ == 1:
                        self.state = 8607
                        self.match(PostgreSQLParser.OPEN_BRACKET)
                        self.state = 8608
                        self.iconst()
                        self.state = 8609
                        self.match(PostgreSQLParser.CLOSE_BRACKET)


                    pass


                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8615
                self.qualified_name()
                self.state = 8616
                self.match(PostgreSQLParser.PERCENT)
                self.state = 8617
                _la = self._input.LA(1)
                if not(_la==353 or _la==477):
                    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 Opt_array_boundsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_BRACKET(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.OPEN_BRACKET)
            else:
                return self.getToken(PostgreSQLParser.OPEN_BRACKET, i)

        def CLOSE_BRACKET(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.CLOSE_BRACKET)
            else:
                return self.getToken(PostgreSQLParser.CLOSE_BRACKET, i)

        def iconst(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.IconstContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.IconstContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_array_bounds

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_array_bounds" ):
                listener.enterOpt_array_bounds(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_array_bounds" ):
                listener.exitOpt_array_bounds(self)




    def opt_array_bounds(self):

        localctx = PostgreSQLParser.Opt_array_boundsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1120, self.RULE_opt_array_bounds)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8628
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,519,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8621
                    self.match(PostgreSQLParser.OPEN_BRACKET)
                    self.state = 8623
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==658:
                        self.state = 8622
                        self.iconst()


                    self.state = 8625
                    self.match(PostgreSQLParser.CLOSE_BRACKET) 
                self.state = 8630
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,519,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 SimpletypenameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def generictype(self):
            return self.getTypedRuleContext(PostgreSQLParser.GenerictypeContext,0)


        def numeric(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericContext,0)


        def bit(self):
            return self.getTypedRuleContext(PostgreSQLParser.BitContext,0)


        def character(self):
            return self.getTypedRuleContext(PostgreSQLParser.CharacterContext,0)


        def constdatetime(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstdatetimeContext,0)


        def constinterval(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstintervalContext,0)


        def opt_interval(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_intervalContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_simpletypename

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSimpletypename" ):
                listener.enterSimpletypename(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSimpletypename" ):
                listener.exitSimpletypename(self)




    def simpletypename(self):

        localctx = PostgreSQLParser.SimpletypenameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1122, self.RULE_simpletypename)
        try:
            self.state = 8644
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,521,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8631
                self.generictype()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8632
                self.numeric()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 8633
                self.bit()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 8634
                self.character()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 8635
                self.constdatetime()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 8636
                self.constinterval()
                self.state = 8642
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,520,self._ctx)
                if la_ == 1:
                    self.state = 8637
                    self.opt_interval()
                    pass

                elif la_ == 2:
                    self.state = 8638
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 8639
                    self.iconst()
                    self.state = 8640
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    pass


                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConsttypenameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def numeric(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericContext,0)


        def constbit(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstbitContext,0)


        def constcharacter(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstcharacterContext,0)


        def constdatetime(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstdatetimeContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_consttypename

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterConsttypename" ):
                listener.enterConsttypename(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitConsttypename" ):
                listener.exitConsttypename(self)




    def consttypename(self):

        localctx = PostgreSQLParser.ConsttypenameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1124, self.RULE_consttypename)
        try:
            self.state = 8650
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [190, 381, 383, 387, 388, 391, 394, 395, 402, 406, 409]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8646
                self.numeric()
                pass
            elif token in [382]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8647
                self.constbit()
                pass
            elif token in [384, 385, 398, 399, 416]:
                self.enterOuterAlt(localctx, 3)
                self.state = 8648
                self.constcharacter()
                pass
            elif token in [411, 412]:
                self.enterOuterAlt(localctx, 4)
                self.state = 8649
                self.constdatetime()
                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 GenerictypeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_type_modifiers(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_type_modifiersContext,0)


        def builtin_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Builtin_function_nameContext,0)


        def type_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_function_nameContext,0)


        def LEFT(self):
            return self.getToken(PostgreSQLParser.LEFT, 0)

        def RIGHT(self):
            return self.getToken(PostgreSQLParser.RIGHT, 0)

        def attrs(self):
            return self.getTypedRuleContext(PostgreSQLParser.AttrsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_generictype

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGenerictype" ):
                listener.enterGenerictype(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGenerictype" ):
                listener.exitGenerictype(self)




    def generictype(self):

        localctx = PostgreSQLParser.GenerictypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1126, self.RULE_generictype)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8656
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [304, 418, 419, 420, 421, 422, 423, 424, 504, 513, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635]:
                self.state = 8652
                self.builtin_function_name()
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 471, 472, 473, 475, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520, 636, 637, 641, 661, 662]:
                self.state = 8653
                self.type_function_name()
                pass
            elif token in [119]:
                self.state = 8654
                self.match(PostgreSQLParser.LEFT)
                pass
            elif token in [126]:
                self.state = 8655
                self.match(PostgreSQLParser.RIGHT)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 8659
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,524,self._ctx)
            if la_ == 1:
                self.state = 8658
                self.attrs()


            self.state = 8661
            self.opt_type_modifiers()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_type_modifiersContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_type_modifiers

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_type_modifiers" ):
                listener.enterOpt_type_modifiers(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_type_modifiers" ):
                listener.exitOpt_type_modifiers(self)




    def opt_type_modifiers(self):

        localctx = PostgreSQLParser.Opt_type_modifiersContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1128, self.RULE_opt_type_modifiers)
        try:
            self.state = 8668
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,525,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8663
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8664
                self.expr_list()
                self.state = 8665
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NumericContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INT_P(self):
            return self.getToken(PostgreSQLParser.INT_P, 0)

        def INTEGER(self):
            return self.getToken(PostgreSQLParser.INTEGER, 0)

        def SMALLINT(self):
            return self.getToken(PostgreSQLParser.SMALLINT, 0)

        def BIGINT(self):
            return self.getToken(PostgreSQLParser.BIGINT, 0)

        def REAL(self):
            return self.getToken(PostgreSQLParser.REAL, 0)

        def FLOAT_P(self):
            return self.getToken(PostgreSQLParser.FLOAT_P, 0)

        def opt_float(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_floatContext,0)


        def DOUBLE_P(self):
            return self.getToken(PostgreSQLParser.DOUBLE_P, 0)

        def PRECISION(self):
            return self.getToken(PostgreSQLParser.PRECISION, 0)

        def DECIMAL_P(self):
            return self.getToken(PostgreSQLParser.DECIMAL_P, 0)

        def opt_type_modifiers(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_type_modifiersContext,0)


        def DEC(self):
            return self.getToken(PostgreSQLParser.DEC, 0)

        def NUMERIC(self):
            return self.getToken(PostgreSQLParser.NUMERIC, 0)

        def BOOLEAN_P(self):
            return self.getToken(PostgreSQLParser.BOOLEAN_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_numeric

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumeric" ):
                listener.enterNumeric(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumeric" ):
                listener.exitNumeric(self)




    def numeric(self):

        localctx = PostgreSQLParser.NumericContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1130, self.RULE_numeric)
        try:
            self.state = 8686
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [394]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8670
                self.match(PostgreSQLParser.INT_P)
                pass
            elif token in [395]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8671
                self.match(PostgreSQLParser.INTEGER)
                pass
            elif token in [409]:
                self.enterOuterAlt(localctx, 3)
                self.state = 8672
                self.match(PostgreSQLParser.SMALLINT)
                pass
            elif token in [381]:
                self.enterOuterAlt(localctx, 4)
                self.state = 8673
                self.match(PostgreSQLParser.BIGINT)
                pass
            elif token in [406]:
                self.enterOuterAlt(localctx, 5)
                self.state = 8674
                self.match(PostgreSQLParser.REAL)
                pass
            elif token in [391]:
                self.enterOuterAlt(localctx, 6)
                self.state = 8675
                self.match(PostgreSQLParser.FLOAT_P)
                self.state = 8676
                self.opt_float()
                pass
            elif token in [190]:
                self.enterOuterAlt(localctx, 7)
                self.state = 8677
                self.match(PostgreSQLParser.DOUBLE_P)
                self.state = 8678
                self.match(PostgreSQLParser.PRECISION)
                pass
            elif token in [388]:
                self.enterOuterAlt(localctx, 8)
                self.state = 8679
                self.match(PostgreSQLParser.DECIMAL_P)
                self.state = 8680
                self.opt_type_modifiers()
                pass
            elif token in [387]:
                self.enterOuterAlt(localctx, 9)
                self.state = 8681
                self.match(PostgreSQLParser.DEC)
                self.state = 8682
                self.opt_type_modifiers()
                pass
            elif token in [402]:
                self.enterOuterAlt(localctx, 10)
                self.state = 8683
                self.match(PostgreSQLParser.NUMERIC)
                self.state = 8684
                self.opt_type_modifiers()
                pass
            elif token in [383]:
                self.enterOuterAlt(localctx, 11)
                self.state = 8685
                self.match(PostgreSQLParser.BOOLEAN_P)
                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 Opt_floatContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_float

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_float" ):
                listener.enterOpt_float(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_float" ):
                listener.exitOpt_float(self)




    def opt_float(self):

        localctx = PostgreSQLParser.Opt_floatContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1132, self.RULE_opt_float)
        try:
            self.state = 8693
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,527,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8688
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8689
                self.iconst()
                self.state = 8690
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BitContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def bitwithlength(self):
            return self.getTypedRuleContext(PostgreSQLParser.BitwithlengthContext,0)


        def bitwithoutlength(self):
            return self.getTypedRuleContext(PostgreSQLParser.BitwithoutlengthContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bit

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBit" ):
                listener.enterBit(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBit" ):
                listener.exitBit(self)




    def bit(self):

        localctx = PostgreSQLParser.BitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1134, self.RULE_bit)
        try:
            self.state = 8697
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,528,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8695
                self.bitwithlength()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8696
                self.bitwithoutlength()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstbitContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def bitwithlength(self):
            return self.getTypedRuleContext(PostgreSQLParser.BitwithlengthContext,0)


        def bitwithoutlength(self):
            return self.getTypedRuleContext(PostgreSQLParser.BitwithoutlengthContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constbit

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterConstbit" ):
                listener.enterConstbit(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitConstbit" ):
                listener.exitConstbit(self)




    def constbit(self):

        localctx = PostgreSQLParser.ConstbitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1136, self.RULE_constbit)
        try:
            self.state = 8701
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,529,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8699
                self.bitwithlength()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8700
                self.bitwithoutlength()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BitwithlengthContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BIT(self):
            return self.getToken(PostgreSQLParser.BIT, 0)

        def opt_varying(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_varyingContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bitwithlength

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBitwithlength" ):
                listener.enterBitwithlength(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBitwithlength" ):
                listener.exitBitwithlength(self)




    def bitwithlength(self):

        localctx = PostgreSQLParser.BitwithlengthContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1138, self.RULE_bitwithlength)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8703
            self.match(PostgreSQLParser.BIT)
            self.state = 8704
            self.opt_varying()
            self.state = 8705
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 8706
            self.expr_list()
            self.state = 8707
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BitwithoutlengthContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BIT(self):
            return self.getToken(PostgreSQLParser.BIT, 0)

        def opt_varying(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_varyingContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bitwithoutlength

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBitwithoutlength" ):
                listener.enterBitwithoutlength(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBitwithoutlength" ):
                listener.exitBitwithoutlength(self)




    def bitwithoutlength(self):

        localctx = PostgreSQLParser.BitwithoutlengthContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1140, self.RULE_bitwithoutlength)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8709
            self.match(PostgreSQLParser.BIT)
            self.state = 8710
            self.opt_varying()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CharacterContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def character_c(self):
            return self.getTypedRuleContext(PostgreSQLParser.Character_cContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_character

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCharacter" ):
                listener.enterCharacter(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCharacter" ):
                listener.exitCharacter(self)




    def character(self):

        localctx = PostgreSQLParser.CharacterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1142, self.RULE_character)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8712
            self.character_c()
            self.state = 8717
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,530,self._ctx)
            if la_ == 1:
                self.state = 8713
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8714
                self.iconst()
                self.state = 8715
                self.match(PostgreSQLParser.CLOSE_PAREN)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstcharacterContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def character_c(self):
            return self.getTypedRuleContext(PostgreSQLParser.Character_cContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constcharacter

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterConstcharacter" ):
                listener.enterConstcharacter(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitConstcharacter" ):
                listener.exitConstcharacter(self)




    def constcharacter(self):

        localctx = PostgreSQLParser.ConstcharacterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1144, self.RULE_constcharacter)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8719
            self.character_c()
            self.state = 8724
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 8720
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8721
                self.iconst()
                self.state = 8722
                self.match(PostgreSQLParser.CLOSE_PAREN)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Character_cContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_varying(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_varyingContext,0)


        def CHARACTER(self):
            return self.getToken(PostgreSQLParser.CHARACTER, 0)

        def CHAR_P(self):
            return self.getToken(PostgreSQLParser.CHAR_P, 0)

        def NCHAR(self):
            return self.getToken(PostgreSQLParser.NCHAR, 0)

        def VARCHAR(self):
            return self.getToken(PostgreSQLParser.VARCHAR, 0)

        def NATIONAL(self):
            return self.getToken(PostgreSQLParser.NATIONAL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_character_c

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCharacter_c" ):
                listener.enterCharacter_c(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCharacter_c" ):
                listener.exitCharacter_c(self)




    def character_c(self):

        localctx = PostgreSQLParser.Character_cContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1146, self.RULE_character_c)
        self._la = 0 # Token type
        try:
            self.state = 8732
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [384, 385, 399]:
                self.enterOuterAlt(localctx, 1)
                self.state = 8726
                _la = self._input.LA(1)
                if not(((((_la - 384)) & ~0x3f) == 0 and ((1 << (_la - 384)) & 32771) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 8727
                self.opt_varying()
                pass
            elif token in [416]:
                self.enterOuterAlt(localctx, 2)
                self.state = 8728
                self.match(PostgreSQLParser.VARCHAR)
                pass
            elif token in [398]:
                self.enterOuterAlt(localctx, 3)
                self.state = 8729
                self.match(PostgreSQLParser.NATIONAL)
                self.state = 8730
                _la = self._input.LA(1)
                if not(_la==384 or _la==385):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 8731
                self.opt_varying()
                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 Opt_varyingContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VARYING(self):
            return self.getToken(PostgreSQLParser.VARYING, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_varying

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_varying" ):
                listener.enterOpt_varying(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_varying" ):
                listener.exitOpt_varying(self)




    def opt_varying(self):

        localctx = PostgreSQLParser.Opt_varyingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1148, self.RULE_opt_varying)
        try:
            self.state = 8736
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,533,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8734
                self.match(PostgreSQLParser.VARYING)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstdatetimeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_timezone(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_timezoneContext,0)


        def TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.TIMESTAMP, 0)

        def TIME(self):
            return self.getToken(PostgreSQLParser.TIME, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constdatetime

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterConstdatetime" ):
                listener.enterConstdatetime(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitConstdatetime" ):
                listener.exitConstdatetime(self)




    def constdatetime(self):

        localctx = PostgreSQLParser.ConstdatetimeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1150, self.RULE_constdatetime)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8738
            _la = self._input.LA(1)
            if not(_la==411 or _la==412):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 8743
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,534,self._ctx)
            if la_ == 1:
                self.state = 8739
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8740
                self.iconst()
                self.state = 8741
                self.match(PostgreSQLParser.CLOSE_PAREN)


            self.state = 8745
            self.opt_timezone()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstintervalContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INTERVAL(self):
            return self.getToken(PostgreSQLParser.INTERVAL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_constinterval

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterConstinterval" ):
                listener.enterConstinterval(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitConstinterval" ):
                listener.exitConstinterval(self)




    def constinterval(self):

        localctx = PostgreSQLParser.ConstintervalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1152, self.RULE_constinterval)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8747
            self.match(PostgreSQLParser.INTERVAL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_timezoneContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def TIME(self):
            return self.getToken(PostgreSQLParser.TIME, 0)

        def ZONE(self):
            return self.getToken(PostgreSQLParser.ZONE, 0)

        def WITHOUT(self):
            return self.getToken(PostgreSQLParser.WITHOUT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_timezone

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_timezone" ):
                listener.enterOpt_timezone(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_timezone" ):
                listener.exitOpt_timezone(self)




    def opt_timezone(self):

        localctx = PostgreSQLParser.Opt_timezoneContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1154, self.RULE_opt_timezone)
        try:
            self.state = 8756
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,535,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8749
                self.match(PostgreSQLParser.WITH)
                self.state = 8750
                self.match(PostgreSQLParser.TIME)
                self.state = 8751
                self.match(PostgreSQLParser.ZONE)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8752
                self.match(PostgreSQLParser.WITHOUT)
                self.state = 8753
                self.match(PostgreSQLParser.TIME)
                self.state = 8754
                self.match(PostgreSQLParser.ZONE)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_intervalContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def YEAR_P(self):
            return self.getToken(PostgreSQLParser.YEAR_P, 0)

        def MONTH_P(self):
            return self.getToken(PostgreSQLParser.MONTH_P, 0)

        def DAY_P(self):
            return self.getToken(PostgreSQLParser.DAY_P, 0)

        def HOUR_P(self):
            return self.getToken(PostgreSQLParser.HOUR_P, 0)

        def MINUTE_P(self):
            return self.getToken(PostgreSQLParser.MINUTE_P, 0)

        def interval_second(self):
            return self.getTypedRuleContext(PostgreSQLParser.Interval_secondContext,0)


        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_interval

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_interval" ):
                listener.enterOpt_interval(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_interval" ):
                listener.exitOpt_interval(self)




    def opt_interval(self):

        localctx = PostgreSQLParser.Opt_intervalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1156, self.RULE_opt_interval)
        try:
            self.state = 8784
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,538,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8758
                self.match(PostgreSQLParser.YEAR_P)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 8759
                self.match(PostgreSQLParser.MONTH_P)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 8760
                self.match(PostgreSQLParser.DAY_P)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 8761
                self.match(PostgreSQLParser.HOUR_P)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 8762
                self.match(PostgreSQLParser.MINUTE_P)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 8763
                self.interval_second()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 8764
                self.match(PostgreSQLParser.YEAR_P)
                self.state = 8765
                self.match(PostgreSQLParser.TO)
                self.state = 8766
                self.match(PostgreSQLParser.MONTH_P)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 8767
                self.match(PostgreSQLParser.DAY_P)
                self.state = 8768
                self.match(PostgreSQLParser.TO)
                self.state = 8772
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [218]:
                    self.state = 8769
                    self.match(PostgreSQLParser.HOUR_P)
                    pass
                elif token in [254]:
                    self.state = 8770
                    self.match(PostgreSQLParser.MINUTE_P)
                    pass
                elif token in [319]:
                    self.state = 8771
                    self.interval_second()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 8774
                self.match(PostgreSQLParser.HOUR_P)
                self.state = 8775
                self.match(PostgreSQLParser.TO)
                self.state = 8778
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [254]:
                    self.state = 8776
                    self.match(PostgreSQLParser.MINUTE_P)
                    pass
                elif token in [319]:
                    self.state = 8777
                    self.interval_second()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 8780
                self.match(PostgreSQLParser.MINUTE_P)
                self.state = 8781
                self.match(PostgreSQLParser.TO)
                self.state = 8782
                self.interval_second()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Interval_secondContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SECOND_P(self):
            return self.getToken(PostgreSQLParser.SECOND_P, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_interval_second

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInterval_second" ):
                listener.enterInterval_second(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInterval_second" ):
                listener.exitInterval_second(self)




    def interval_second(self):

        localctx = PostgreSQLParser.Interval_secondContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1158, self.RULE_interval_second)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8786
            self.match(PostgreSQLParser.SECOND_P)
            self.state = 8791
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,539,self._ctx)
            if la_ == 1:
                self.state = 8787
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 8788
                self.iconst()
                self.state = 8789
                self.match(PostgreSQLParser.CLOSE_PAREN)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_escapeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ESCAPE(self):
            return self.getToken(PostgreSQLParser.ESCAPE, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_escape

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_escape" ):
                listener.enterOpt_escape(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_escape" ):
                listener.exitOpt_escape(self)




    def opt_escape(self):

        localctx = PostgreSQLParser.Opt_escapeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1160, self.RULE_opt_escape)
        try:
            self.state = 8796
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,540,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 8793
                self.match(PostgreSQLParser.ESCAPE)
                self.state = 8794
                self.a_expr()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_qual(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_qualContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr" ):
                listener.enterA_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr" ):
                listener.exitA_expr(self)




    def a_expr(self):

        localctx = PostgreSQLParser.A_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1162, self.RULE_a_expr)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8798
            self.a_expr_qual()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_qualContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_lessless(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_lesslessContext,0)


        def qual_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qual_opContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_qual

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_qual" ):
                listener.enterA_expr_qual(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_qual" ):
                listener.exitA_expr_qual(self)




    def a_expr_qual(self):

        localctx = PostgreSQLParser.A_expr_qualContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1164, self.RULE_a_expr_qual)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8800
            self.a_expr_lessless()
            self.state = 8802
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,541,self._ctx)
            if la_ == 1:
                self.state = 8801
                self.qual_op()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_lesslessContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_or(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_orContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_orContext,i)


        def LESS_LESS(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.LESS_LESS)
            else:
                return self.getToken(PostgreSQLParser.LESS_LESS, i)

        def GREATER_GREATER(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.GREATER_GREATER)
            else:
                return self.getToken(PostgreSQLParser.GREATER_GREATER, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_lessless

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_lessless" ):
                listener.enterA_expr_lessless(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_lessless" ):
                listener.exitA_expr_lessless(self)




    def a_expr_lessless(self):

        localctx = PostgreSQLParser.A_expr_lesslessContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1166, self.RULE_a_expr_lessless)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8804
            self.a_expr_or()
            self.state = 8809
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,542,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8805
                    _la = self._input.LA(1)
                    if not(_la==18 or _la==19):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 8806
                    self.a_expr_or() 
                self.state = 8811
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,542,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 A_expr_orContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_and(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_andContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_andContext,i)


        def OR(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.OR)
            else:
                return self.getToken(PostgreSQLParser.OR, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_or

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_or" ):
                listener.enterA_expr_or(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_or" ):
                listener.exitA_expr_or(self)




    def a_expr_or(self):

        localctx = PostgreSQLParser.A_expr_orContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1168, self.RULE_a_expr_or)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8812
            self.a_expr_and()
            self.state = 8817
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,543,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8813
                    self.match(PostgreSQLParser.OR)
                    self.state = 8814
                    self.a_expr_and() 
                self.state = 8819
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,543,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 A_expr_andContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_between(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_betweenContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_betweenContext,i)


        def AND(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.AND)
            else:
                return self.getToken(PostgreSQLParser.AND, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_and

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_and" ):
                listener.enterA_expr_and(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_and" ):
                listener.exitA_expr_and(self)




    def a_expr_and(self):

        localctx = PostgreSQLParser.A_expr_andContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1170, self.RULE_a_expr_and)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8820
            self.a_expr_between()
            self.state = 8825
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,544,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8821
                    self.match(PostgreSQLParser.AND)
                    self.state = 8822
                    self.a_expr_between() 
                self.state = 8827
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,544,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 A_expr_betweenContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_in(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_inContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_inContext,i)


        def BETWEEN(self):
            return self.getToken(PostgreSQLParser.BETWEEN, 0)

        def AND(self):
            return self.getToken(PostgreSQLParser.AND, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def SYMMETRIC(self):
            return self.getToken(PostgreSQLParser.SYMMETRIC, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_between

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_between" ):
                listener.enterA_expr_between(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_between" ):
                listener.exitA_expr_between(self)




    def a_expr_between(self):

        localctx = PostgreSQLParser.A_expr_betweenContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1172, self.RULE_a_expr_between)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8828
            self.a_expr_in()
            self.state = 8840
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,547,self._ctx)
            if la_ == 1:
                self.state = 8830
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==77:
                    self.state = 8829
                    self.match(PostgreSQLParser.NOT)


                self.state = 8832
                self.match(PostgreSQLParser.BETWEEN)
                self.state = 8834
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==91:
                    self.state = 8833
                    self.match(PostgreSQLParser.SYMMETRIC)


                self.state = 8836
                self.a_expr_in()
                self.state = 8837
                self.match(PostgreSQLParser.AND)
                self.state = 8838
                self.a_expr_in()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_inContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_unary_not(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_unary_notContext,0)


        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def in_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.In_exprContext,0)


        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_in

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_in" ):
                listener.enterA_expr_in(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_in" ):
                listener.exitA_expr_in(self)




    def a_expr_in(self):

        localctx = PostgreSQLParser.A_expr_inContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1174, self.RULE_a_expr_in)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8842
            self.a_expr_unary_not()
            self.state = 8848
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,549,self._ctx)
            if la_ == 1:
                self.state = 8844
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==77:
                    self.state = 8843
                    self.match(PostgreSQLParser.NOT)


                self.state = 8846
                self.match(PostgreSQLParser.IN_P)
                self.state = 8847
                self.in_expr()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_unary_notContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_isnull(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_isnullContext,0)


        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_unary_not

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_unary_not" ):
                listener.enterA_expr_unary_not(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_unary_not" ):
                listener.exitA_expr_unary_not(self)




    def a_expr_unary_not(self):

        localctx = PostgreSQLParser.A_expr_unary_notContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1176, self.RULE_a_expr_unary_not)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8851
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==77:
                self.state = 8850
                self.match(PostgreSQLParser.NOT)


            self.state = 8853
            self.a_expr_isnull()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_isnullContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_is_not(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_is_notContext,0)


        def ISNULL(self):
            return self.getToken(PostgreSQLParser.ISNULL, 0)

        def NOTNULL(self):
            return self.getToken(PostgreSQLParser.NOTNULL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_isnull

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_isnull" ):
                listener.enterA_expr_isnull(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_isnull" ):
                listener.exitA_expr_isnull(self)




    def a_expr_isnull(self):

        localctx = PostgreSQLParser.A_expr_isnullContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1178, self.RULE_a_expr_isnull)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8855
            self.a_expr_is_not()
            self.state = 8857
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,551,self._ctx)
            if la_ == 1:
                self.state = 8856
                _la = self._input.LA(1)
                if not(_la==117 or _la==122):
                    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 A_expr_is_notContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_compare(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_compareContext,0)


        def IS(self):
            return self.getToken(PostgreSQLParser.IS, 0)

        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def TRUE_P(self):
            return self.getToken(PostgreSQLParser.TRUE_P, 0)

        def FALSE_P(self):
            return self.getToken(PostgreSQLParser.FALSE_P, 0)

        def UNKNOWN(self):
            return self.getToken(PostgreSQLParser.UNKNOWN, 0)

        def DISTINCT(self):
            return self.getToken(PostgreSQLParser.DISTINCT, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def OF(self):
            return self.getToken(PostgreSQLParser.OF, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def type_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def DOCUMENT_P(self):
            return self.getToken(PostgreSQLParser.DOCUMENT_P, 0)

        def NORMALIZED(self):
            return self.getToken(PostgreSQLParser.NORMALIZED, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def unicode_normal_form(self):
            return self.getTypedRuleContext(PostgreSQLParser.Unicode_normal_formContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_is_not

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_is_not" ):
                listener.enterA_expr_is_not(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_is_not" ):
                listener.exitA_expr_is_not(self)




    def a_expr_is_not(self):

        localctx = PostgreSQLParser.A_expr_is_notContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1180, self.RULE_a_expr_is_not)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8859
            self.a_expr_compare()
            self.state = 8883
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,555,self._ctx)
            if la_ == 1:
                self.state = 8860
                self.match(PostgreSQLParser.IS)
                self.state = 8862
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==77:
                    self.state = 8861
                    self.match(PostgreSQLParser.NOT)


                self.state = 8881
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [78]:
                    self.state = 8864
                    self.match(PostgreSQLParser.NULL_P)
                    pass
                elif token in [96]:
                    self.state = 8865
                    self.match(PostgreSQLParser.TRUE_P)
                    pass
                elif token in [60]:
                    self.state = 8866
                    self.match(PostgreSQLParser.FALSE_P)
                    pass
                elif token in [358]:
                    self.state = 8867
                    self.match(PostgreSQLParser.UNKNOWN)
                    pass
                elif token in [56]:
                    self.state = 8868
                    self.match(PostgreSQLParser.DISTINCT)
                    self.state = 8869
                    self.match(PostgreSQLParser.FROM)
                    self.state = 8870
                    self.a_expr()
                    pass
                elif token in [268]:
                    self.state = 8871
                    self.match(PostgreSQLParser.OF)
                    self.state = 8872
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 8873
                    self.type_list()
                    self.state = 8874
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    pass
                elif token in [188]:
                    self.state = 8876
                    self.match(PostgreSQLParser.DOCUMENT_P)
                    pass
                elif token in [478, 483, 484, 485, 486]:
                    self.state = 8878
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if ((((_la - 483)) & ~0x3f) == 0 and ((1 << (_la - 483)) & 15) != 0):
                        self.state = 8877
                        self.unicode_normal_form()


                    self.state = 8880
                    self.match(PostgreSQLParser.NORMALIZED)
                    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 A_expr_compareContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_like(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_likeContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_likeContext,i)


        def subquery_Op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Subquery_OpContext,0)


        def sub_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sub_typeContext,0)


        def LT(self):
            return self.getToken(PostgreSQLParser.LT, 0)

        def GT(self):
            return self.getToken(PostgreSQLParser.GT, 0)

        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def LESS_EQUALS(self):
            return self.getToken(PostgreSQLParser.LESS_EQUALS, 0)

        def GREATER_EQUALS(self):
            return self.getToken(PostgreSQLParser.GREATER_EQUALS, 0)

        def NOT_EQUALS(self):
            return self.getToken(PostgreSQLParser.NOT_EQUALS, 0)

        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_compare

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_compare" ):
                listener.enterA_expr_compare(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_compare" ):
                listener.exitA_expr_compare(self)




    def a_expr_compare(self):

        localctx = PostgreSQLParser.A_expr_compareContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1182, self.RULE_a_expr_compare)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8885
            self.a_expr_like()
            self.state = 8897
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,557,self._ctx)
            if la_ == 1:
                self.state = 8886
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 44237824) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 8887
                self.a_expr_like()

            elif la_ == 2:
                self.state = 8888
                self.subquery_Op()
                self.state = 8889
                self.sub_type()
                self.state = 8895
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,556,self._ctx)
                if la_ == 1:
                    self.state = 8890
                    self.select_with_parens()
                    pass

                elif la_ == 2:
                    self.state = 8891
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 8892
                    self.a_expr()
                    self.state = 8893
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    pass




        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_likeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_qual_op(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_qual_opContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_qual_opContext,i)


        def opt_escape(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_escapeContext,0)


        def LIKE(self):
            return self.getToken(PostgreSQLParser.LIKE, 0)

        def ILIKE(self):
            return self.getToken(PostgreSQLParser.ILIKE, 0)

        def SIMILAR(self):
            return self.getToken(PostgreSQLParser.SIMILAR, 0)

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_like

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_like" ):
                listener.enterA_expr_like(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_like" ):
                listener.exitA_expr_like(self)




    def a_expr_like(self):

        localctx = PostgreSQLParser.A_expr_likeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1184, self.RULE_a_expr_like)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8899
            self.a_expr_qual_op()
            self.state = 8912
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,560,self._ctx)
            if la_ == 1:
                self.state = 8901
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==77:
                    self.state = 8900
                    self.match(PostgreSQLParser.NOT)


                self.state = 8907
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [120]:
                    self.state = 8903
                    self.match(PostgreSQLParser.LIKE)
                    pass
                elif token in [114]:
                    self.state = 8904
                    self.match(PostgreSQLParser.ILIKE)
                    pass
                elif token in [127]:
                    self.state = 8905
                    self.match(PostgreSQLParser.SIMILAR)
                    self.state = 8906
                    self.match(PostgreSQLParser.TO)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 8909
                self.a_expr_qual_op()
                self.state = 8910
                self.opt_escape()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_qual_opContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_unary_qualop(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_unary_qualopContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_unary_qualopContext,i)


        def qual_op(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Qual_opContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Qual_opContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_qual_op

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_qual_op" ):
                listener.enterA_expr_qual_op(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_qual_op" ):
                listener.exitA_expr_qual_op(self)




    def a_expr_qual_op(self):

        localctx = PostgreSQLParser.A_expr_qual_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1186, self.RULE_a_expr_qual_op)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8914
            self.a_expr_unary_qualop()
            self.state = 8920
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,561,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8915
                    self.qual_op()
                    self.state = 8916
                    self.a_expr_unary_qualop() 
                self.state = 8922
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,561,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 A_expr_unary_qualopContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_add(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_addContext,0)


        def qual_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qual_opContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_unary_qualop

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_unary_qualop" ):
                listener.enterA_expr_unary_qualop(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_unary_qualop" ):
                listener.exitA_expr_unary_qualop(self)




    def a_expr_unary_qualop(self):

        localctx = PostgreSQLParser.A_expr_unary_qualopContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1188, self.RULE_a_expr_unary_qualop)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8924
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,562,self._ctx)
            if la_ == 1:
                self.state = 8923
                self.qual_op()


            self.state = 8926
            self.a_expr_add()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_addContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_mul(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_mulContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_mulContext,i)


        def MINUS(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.MINUS)
            else:
                return self.getToken(PostgreSQLParser.MINUS, 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_a_expr_add

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_add" ):
                listener.enterA_expr_add(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_add" ):
                listener.exitA_expr_add(self)




    def a_expr_add(self):

        localctx = PostgreSQLParser.A_expr_addContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1190, self.RULE_a_expr_add)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8928
            self.a_expr_mul()
            self.state = 8933
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,563,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8929
                    _la = self._input.LA(1)
                    if not(_la==12 or _la==13):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 8930
                    self.a_expr_mul() 
                self.state = 8935
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,563,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 A_expr_mulContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_caret(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_expr_caretContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_expr_caretContext,i)


        def STAR(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.STAR)
            else:
                return self.getToken(PostgreSQLParser.STAR, i)

        def SLASH(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.SLASH)
            else:
                return self.getToken(PostgreSQLParser.SLASH, i)

        def PERCENT(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.PERCENT)
            else:
                return self.getToken(PostgreSQLParser.PERCENT, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_mul

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_mul" ):
                listener.enterA_expr_mul(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_mul" ):
                listener.exitA_expr_mul(self)




    def a_expr_mul(self):

        localctx = PostgreSQLParser.A_expr_mulContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1192, self.RULE_a_expr_mul)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8936
            self.a_expr_caret()
            self.state = 8941
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,564,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 8937
                    _la = self._input.LA(1)
                    if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 134234624) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 8938
                    self.a_expr_caret() 
                self.state = 8943
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,564,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 A_expr_caretContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_unary_sign(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_unary_signContext,0)


        def CARET(self):
            return self.getToken(PostgreSQLParser.CARET, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_caret

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_caret" ):
                listener.enterA_expr_caret(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_caret" ):
                listener.exitA_expr_caret(self)




    def a_expr_caret(self):

        localctx = PostgreSQLParser.A_expr_caretContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1194, self.RULE_a_expr_caret)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8944
            self.a_expr_unary_sign()
            self.state = 8947
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,565,self._ctx)
            if la_ == 1:
                self.state = 8945
                self.match(PostgreSQLParser.CARET)
                self.state = 8946
                self.a_expr()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_unary_signContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_at_time_zone(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_at_time_zoneContext,0)


        def MINUS(self):
            return self.getToken(PostgreSQLParser.MINUS, 0)

        def PLUS(self):
            return self.getToken(PostgreSQLParser.PLUS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_unary_sign

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_unary_sign" ):
                listener.enterA_expr_unary_sign(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_unary_sign" ):
                listener.exitA_expr_unary_sign(self)




    def a_expr_unary_sign(self):

        localctx = PostgreSQLParser.A_expr_unary_signContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1196, self.RULE_a_expr_unary_sign)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8950
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==12 or _la==13:
                self.state = 8949
                _la = self._input.LA(1)
                if not(_la==12 or _la==13):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 8952
            self.a_expr_at_time_zone()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_at_time_zoneContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_collate(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_collateContext,0)


        def AT(self):
            return self.getToken(PostgreSQLParser.AT, 0)

        def TIME(self):
            return self.getToken(PostgreSQLParser.TIME, 0)

        def ZONE(self):
            return self.getToken(PostgreSQLParser.ZONE, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_at_time_zone

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_at_time_zone" ):
                listener.enterA_expr_at_time_zone(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_at_time_zone" ):
                listener.exitA_expr_at_time_zone(self)




    def a_expr_at_time_zone(self):

        localctx = PostgreSQLParser.A_expr_at_time_zoneContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1198, self.RULE_a_expr_at_time_zone)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8954
            self.a_expr_collate()
            self.state = 8959
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,567,self._ctx)
            if la_ == 1:
                self.state = 8955
                self.match(PostgreSQLParser.AT)
                self.state = 8956
                self.match(PostgreSQLParser.TIME)
                self.state = 8957
                self.match(PostgreSQLParser.ZONE)
                self.state = 8958
                self.a_expr()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_collateContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr_typecast(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_expr_typecastContext,0)


        def COLLATE(self):
            return self.getToken(PostgreSQLParser.COLLATE, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_collate

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_collate" ):
                listener.enterA_expr_collate(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_collate" ):
                listener.exitA_expr_collate(self)




    def a_expr_collate(self):

        localctx = PostgreSQLParser.A_expr_collateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1200, self.RULE_a_expr_collate)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8961
            self.a_expr_typecast()
            self.state = 8964
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,568,self._ctx)
            if la_ == 1:
                self.state = 8962
                self.match(PostgreSQLParser.COLLATE)
                self.state = 8963
                self.any_name()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class A_expr_typecastContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def c_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.C_exprContext,0)


        def TYPECAST(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.TYPECAST)
            else:
                return self.getToken(PostgreSQLParser.TYPECAST, i)

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_a_expr_typecast

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterA_expr_typecast" ):
                listener.enterA_expr_typecast(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitA_expr_typecast" ):
                listener.exitA_expr_typecast(self)




    def a_expr_typecast(self):

        localctx = PostgreSQLParser.A_expr_typecastContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1202, self.RULE_a_expr_typecast)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8966
            self.c_expr()
            self.state = 8971
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 8967
                self.match(PostgreSQLParser.TYPECAST)
                self.state = 8968
                self.typename()
                self.state = 8973
                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 B_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def c_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.C_exprContext,0)


        def b_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.B_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.B_exprContext,i)


        def PLUS(self):
            return self.getToken(PostgreSQLParser.PLUS, 0)

        def MINUS(self):
            return self.getToken(PostgreSQLParser.MINUS, 0)

        def qual_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.Qual_opContext,0)


        def CARET(self):
            return self.getToken(PostgreSQLParser.CARET, 0)

        def STAR(self):
            return self.getToken(PostgreSQLParser.STAR, 0)

        def SLASH(self):
            return self.getToken(PostgreSQLParser.SLASH, 0)

        def PERCENT(self):
            return self.getToken(PostgreSQLParser.PERCENT, 0)

        def LT(self):
            return self.getToken(PostgreSQLParser.LT, 0)

        def GT(self):
            return self.getToken(PostgreSQLParser.GT, 0)

        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def LESS_EQUALS(self):
            return self.getToken(PostgreSQLParser.LESS_EQUALS, 0)

        def GREATER_EQUALS(self):
            return self.getToken(PostgreSQLParser.GREATER_EQUALS, 0)

        def NOT_EQUALS(self):
            return self.getToken(PostgreSQLParser.NOT_EQUALS, 0)

        def TYPECAST(self):
            return self.getToken(PostgreSQLParser.TYPECAST, 0)

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def IS(self):
            return self.getToken(PostgreSQLParser.IS, 0)

        def DISTINCT(self):
            return self.getToken(PostgreSQLParser.DISTINCT, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def OF(self):
            return self.getToken(PostgreSQLParser.OF, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def type_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def DOCUMENT_P(self):
            return self.getToken(PostgreSQLParser.DOCUMENT_P, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_b_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterB_expr" ):
                listener.enterB_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitB_expr" ):
                listener.exitB_expr(self)



    def b_expr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = PostgreSQLParser.B_exprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 1204
        self.enterRecursionRule(localctx, 1204, self.RULE_b_expr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 8981
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,570,self._ctx)
            if la_ == 1:
                self.state = 8975
                self.c_expr()
                pass

            elif la_ == 2:
                self.state = 8976
                _la = self._input.LA(1)
                if not(_la==12 or _la==13):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 8977
                self.b_expr(9)
                pass

            elif la_ == 3:
                self.state = 8978
                self.qual_op()
                self.state = 8979
                self.b_expr(3)
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 9022
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,574,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 9020
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,573,self._ctx)
                    if la_ == 1:
                        localctx = PostgreSQLParser.B_exprContext(self, _parentctx, _parentState)
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_b_expr)
                        self.state = 8983
                        if not self.precpred(self._ctx, 8):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
                        self.state = 8984
                        self.match(PostgreSQLParser.CARET)
                        self.state = 8985
                        self.b_expr(9)
                        pass

                    elif la_ == 2:
                        localctx = PostgreSQLParser.B_exprContext(self, _parentctx, _parentState)
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_b_expr)
                        self.state = 8986
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 8987
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 134234624) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 8988
                        self.b_expr(8)
                        pass

                    elif la_ == 3:
                        localctx = PostgreSQLParser.B_exprContext(self, _parentctx, _parentState)
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_b_expr)
                        self.state = 8989
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 8990
                        _la = self._input.LA(1)
                        if not(_la==12 or _la==13):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 8991
                        self.b_expr(7)
                        pass

                    elif la_ == 4:
                        localctx = PostgreSQLParser.B_exprContext(self, _parentctx, _parentState)
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_b_expr)
                        self.state = 8992
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 8993
                        self.qual_op()
                        self.state = 8994
                        self.b_expr(6)
                        pass

                    elif la_ == 5:
                        localctx = PostgreSQLParser.B_exprContext(self, _parentctx, _parentState)
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_b_expr)
                        self.state = 8996
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 8997
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 44237824) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 8998
                        self.b_expr(5)
                        pass

                    elif la_ == 6:
                        localctx = PostgreSQLParser.B_exprContext(self, _parentctx, _parentState)
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_b_expr)
                        self.state = 8999
                        if not self.precpred(self._ctx, 10):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
                        self.state = 9000
                        self.match(PostgreSQLParser.TYPECAST)
                        self.state = 9001
                        self.typename()
                        pass

                    elif la_ == 7:
                        localctx = PostgreSQLParser.B_exprContext(self, _parentctx, _parentState)
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_b_expr)
                        self.state = 9002
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 9003
                        self.qual_op()
                        pass

                    elif la_ == 8:
                        localctx = PostgreSQLParser.B_exprContext(self, _parentctx, _parentState)
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_b_expr)
                        self.state = 9004
                        if not self.precpred(self._ctx, 1):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                        self.state = 9005
                        self.match(PostgreSQLParser.IS)
                        self.state = 9007
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==77:
                            self.state = 9006
                            self.match(PostgreSQLParser.NOT)


                        self.state = 9018
                        self._errHandler.sync(self)
                        token = self._input.LA(1)
                        if token in [56]:
                            self.state = 9009
                            self.match(PostgreSQLParser.DISTINCT)
                            self.state = 9010
                            self.match(PostgreSQLParser.FROM)
                            self.state = 9011
                            self.b_expr(0)
                            pass
                        elif token in [268]:
                            self.state = 9012
                            self.match(PostgreSQLParser.OF)
                            self.state = 9013
                            self.match(PostgreSQLParser.OPEN_PAREN)
                            self.state = 9014
                            self.type_list()
                            self.state = 9015
                            self.match(PostgreSQLParser.CLOSE_PAREN)
                            pass
                        elif token in [188]:
                            self.state = 9017
                            self.match(PostgreSQLParser.DOCUMENT_P)
                            pass
                        else:
                            raise NoViableAltException(self)

                        pass

             
                self.state = 9024
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,574,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.unrollRecursionContexts(_parentctx)
        return localctx


    class C_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_c_expr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class C_expr_existsContext(C_exprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a PostgreSQLParser.C_exprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)
        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterC_expr_exists" ):
                listener.enterC_expr_exists(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitC_expr_exists" ):
                listener.exitC_expr_exists(self)


    class C_expr_caseContext(C_exprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a PostgreSQLParser.C_exprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def case_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Case_exprContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterC_expr_case" ):
                listener.enterC_expr_case(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitC_expr_case" ):
                listener.exitC_expr_case(self)


    class C_expr_exprContext(C_exprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a PostgreSQLParser.C_exprContext
            super().__init__(parser)
            self.a_expr_in_parens = None # A_exprContext
            self.copyFrom(ctx)

        def ARRAY(self):
            return self.getToken(PostgreSQLParser.ARRAY, 0)
        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)

        def array_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Array_exprContext,0)

        def PARAM(self):
            return self.getToken(PostgreSQLParser.PARAM, 0)
        def opt_indirection(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_indirectionContext,0)

        def GROUPING(self):
            return self.getToken(PostgreSQLParser.GROUPING, 0)
        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)
        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)
        def UNIQUE(self):
            return self.getToken(PostgreSQLParser.UNIQUE, 0)
        def columnref(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColumnrefContext,0)

        def aexprconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.AexprconstContext,0)

        def plsqlvariablename(self):
            return self.getTypedRuleContext(PostgreSQLParser.PlsqlvariablenameContext,0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)

        def func_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_exprContext,0)

        def indirection(self):
            return self.getTypedRuleContext(PostgreSQLParser.IndirectionContext,0)

        def explicit_row(self):
            return self.getTypedRuleContext(PostgreSQLParser.Explicit_rowContext,0)

        def implicit_row(self):
            return self.getTypedRuleContext(PostgreSQLParser.Implicit_rowContext,0)

        def row(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.RowContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.RowContext,i)

        def OVERLAPS(self):
            return self.getToken(PostgreSQLParser.OVERLAPS, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterC_expr_expr" ):
                listener.enterC_expr_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitC_expr_expr" ):
                listener.exitC_expr_expr(self)



    def c_expr(self):

        localctx = PostgreSQLParser.C_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1206, self.RULE_c_expr)
        try:
            self.state = 9061
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,577,self._ctx)
            if la_ == 1:
                localctx = PostgreSQLParser.C_expr_existsContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 9025
                self.match(PostgreSQLParser.EXISTS)
                self.state = 9026
                self.select_with_parens()
                pass

            elif la_ == 2:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 9027
                self.match(PostgreSQLParser.ARRAY)
                self.state = 9030
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [2]:
                    self.state = 9028
                    self.select_with_parens()
                    pass
                elif token in [4]:
                    self.state = 9029
                    self.array_expr()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 3:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 9032
                self.match(PostgreSQLParser.PARAM)
                self.state = 9033
                self.opt_indirection()
                pass

            elif la_ == 4:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 9034
                self.match(PostgreSQLParser.GROUPING)
                self.state = 9035
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9036
                self.expr_list()
                self.state = 9037
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 5:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 9039
                self.match(PostgreSQLParser.UNIQUE)
                self.state = 9040
                self.select_with_parens()
                pass

            elif la_ == 6:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 9041
                self.columnref()
                pass

            elif la_ == 7:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 9042
                self.aexprconst()
                pass

            elif la_ == 8:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 9043
                self.plsqlvariablename()
                pass

            elif la_ == 9:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 9)
                self.state = 9044
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9045
                localctx.a_expr_in_parens = self.a_expr()
                self.state = 9046
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 9047
                self.opt_indirection()
                pass

            elif la_ == 10:
                localctx = PostgreSQLParser.C_expr_caseContext(self, localctx)
                self.enterOuterAlt(localctx, 10)
                self.state = 9049
                self.case_expr()
                pass

            elif la_ == 11:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 11)
                self.state = 9050
                self.func_expr()
                pass

            elif la_ == 12:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 12)
                self.state = 9051
                self.select_with_parens()
                self.state = 9053
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,576,self._ctx)
                if la_ == 1:
                    self.state = 9052
                    self.indirection()


                pass

            elif la_ == 13:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 13)
                self.state = 9055
                self.explicit_row()
                pass

            elif la_ == 14:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 14)
                self.state = 9056
                self.implicit_row()
                pass

            elif la_ == 15:
                localctx = PostgreSQLParser.C_expr_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 15)
                self.state = 9057
                self.row()
                self.state = 9058
                self.match(PostgreSQLParser.OVERLAPS)
                self.state = 9059
                self.row()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PlsqlvariablenameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PLSQLVARIABLENAME(self):
            return self.getToken(PostgreSQLParser.PLSQLVARIABLENAME, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_plsqlvariablename

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPlsqlvariablename" ):
                listener.enterPlsqlvariablename(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPlsqlvariablename" ):
                listener.exitPlsqlvariablename(self)




    def plsqlvariablename(self):

        localctx = PostgreSQLParser.PlsqlvariablenameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1208, self.RULE_plsqlvariablename)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9063
            self.match(PostgreSQLParser.PLSQLVARIABLENAME)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_applicationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def func_arg_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_arg_listContext,0)


        def opt_sort_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_sort_clauseContext,0)


        def VARIADIC(self):
            return self.getToken(PostgreSQLParser.VARIADIC, 0)

        def func_arg_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_arg_exprContext,0)


        def STAR(self):
            return self.getToken(PostgreSQLParser.STAR, 0)

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def DISTINCT(self):
            return self.getToken(PostgreSQLParser.DISTINCT, 0)

        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_application

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_application" ):
                listener.enterFunc_application(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_application" ):
                listener.exitFunc_application(self)




    def func_application(self):

        localctx = PostgreSQLParser.Func_applicationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1210, self.RULE_func_application)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9065
            self.func_name()
            self.state = 9066
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 9085
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 12, 13, 28, 29, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 77, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                self.state = 9067
                self.func_arg_list()
                self.state = 9071
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==6:
                    self.state = 9068
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 9069
                    self.match(PostgreSQLParser.VARIADIC)
                    self.state = 9070
                    self.func_arg_expr()


                self.state = 9073
                self.opt_sort_clause()
                pass
            elif token in [101]:
                self.state = 9075
                self.match(PostgreSQLParser.VARIADIC)
                self.state = 9076
                self.func_arg_expr()
                self.state = 9077
                self.opt_sort_clause()
                pass
            elif token in [30, 56]:
                self.state = 9079
                _la = self._input.LA(1)
                if not(_la==30 or _la==56):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 9080
                self.func_arg_list()
                self.state = 9081
                self.opt_sort_clause()
                pass
            elif token in [9]:
                self.state = 9083
                self.match(PostgreSQLParser.STAR)
                pass
            elif token in [3]:
                pass
            else:
                raise NoViableAltException(self)

            self.state = 9087
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_application(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_applicationContext,0)


        def within_group_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Within_group_clauseContext,0)


        def filter_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Filter_clauseContext,0)


        def over_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Over_clauseContext,0)


        def func_expr_common_subexpr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_expr_common_subexprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_expr" ):
                listener.enterFunc_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_expr" ):
                listener.exitFunc_expr(self)




    def func_expr(self):

        localctx = PostgreSQLParser.Func_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1212, self.RULE_func_expr)
        try:
            self.state = 9095
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,580,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9089
                self.func_application()
                self.state = 9090
                self.within_group_clause()
                self.state = 9091
                self.filter_clause()
                self.state = 9092
                self.over_clause()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9094
                self.func_expr_common_subexpr()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_expr_windowlessContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_application(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_applicationContext,0)


        def func_expr_common_subexpr(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_expr_common_subexprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_expr_windowless

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_expr_windowless" ):
                listener.enterFunc_expr_windowless(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_expr_windowless" ):
                listener.exitFunc_expr_windowless(self)




    def func_expr_windowless(self):

        localctx = PostgreSQLParser.Func_expr_windowlessContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1214, self.RULE_func_expr_windowless)
        try:
            self.state = 9099
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,581,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9097
                self.func_application()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9098
                self.func_expr_common_subexpr()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_expr_common_subexprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COLLATION(self):
            return self.getToken(PostgreSQLParser.COLLATION, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,i)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def CURRENT_DATE(self):
            return self.getToken(PostgreSQLParser.CURRENT_DATE, 0)

        def CURRENT_TIME(self):
            return self.getToken(PostgreSQLParser.CURRENT_TIME, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def CURRENT_TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.CURRENT_TIMESTAMP, 0)

        def LOCALTIME(self):
            return self.getToken(PostgreSQLParser.LOCALTIME, 0)

        def LOCALTIMESTAMP(self):
            return self.getToken(PostgreSQLParser.LOCALTIMESTAMP, 0)

        def CURRENT_ROLE(self):
            return self.getToken(PostgreSQLParser.CURRENT_ROLE, 0)

        def CURRENT_USER(self):
            return self.getToken(PostgreSQLParser.CURRENT_USER, 0)

        def SESSION_USER(self):
            return self.getToken(PostgreSQLParser.SESSION_USER, 0)

        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def CURRENT_CATALOG(self):
            return self.getToken(PostgreSQLParser.CURRENT_CATALOG, 0)

        def CURRENT_SCHEMA(self):
            return self.getToken(PostgreSQLParser.CURRENT_SCHEMA, 0)

        def CAST(self):
            return self.getToken(PostgreSQLParser.CAST, 0)

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def EXTRACT(self):
            return self.getToken(PostgreSQLParser.EXTRACT, 0)

        def extract_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Extract_listContext,0)


        def NORMALIZE(self):
            return self.getToken(PostgreSQLParser.NORMALIZE, 0)

        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def unicode_normal_form(self):
            return self.getTypedRuleContext(PostgreSQLParser.Unicode_normal_formContext,0)


        def OVERLAY(self):
            return self.getToken(PostgreSQLParser.OVERLAY, 0)

        def overlay_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Overlay_listContext,0)


        def POSITION(self):
            return self.getToken(PostgreSQLParser.POSITION, 0)

        def position_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Position_listContext,0)


        def SUBSTRING(self):
            return self.getToken(PostgreSQLParser.SUBSTRING, 0)

        def substr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Substr_listContext,0)


        def TREAT(self):
            return self.getToken(PostgreSQLParser.TREAT, 0)

        def TRIM(self):
            return self.getToken(PostgreSQLParser.TRIM, 0)

        def trim_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Trim_listContext,0)


        def BOTH(self):
            return self.getToken(PostgreSQLParser.BOTH, 0)

        def LEADING(self):
            return self.getToken(PostgreSQLParser.LEADING, 0)

        def TRAILING(self):
            return self.getToken(PostgreSQLParser.TRAILING, 0)

        def NULLIF(self):
            return self.getToken(PostgreSQLParser.NULLIF, 0)

        def COALESCE(self):
            return self.getToken(PostgreSQLParser.COALESCE, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def GREATEST(self):
            return self.getToken(PostgreSQLParser.GREATEST, 0)

        def LEAST(self):
            return self.getToken(PostgreSQLParser.LEAST, 0)

        def XMLCONCAT(self):
            return self.getToken(PostgreSQLParser.XMLCONCAT, 0)

        def XMLELEMENT(self):
            return self.getToken(PostgreSQLParser.XMLELEMENT, 0)

        def NAME_P(self):
            return self.getToken(PostgreSQLParser.NAME_P, 0)

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def xml_attributes(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xml_attributesContext,0)


        def XMLEXISTS(self):
            return self.getToken(PostgreSQLParser.XMLEXISTS, 0)

        def c_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.C_exprContext,0)


        def xmlexists_argument(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xmlexists_argumentContext,0)


        def XMLFOREST(self):
            return self.getToken(PostgreSQLParser.XMLFOREST, 0)

        def xml_attribute_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xml_attribute_listContext,0)


        def XMLPARSE(self):
            return self.getToken(PostgreSQLParser.XMLPARSE, 0)

        def document_or_content(self):
            return self.getTypedRuleContext(PostgreSQLParser.Document_or_contentContext,0)


        def xml_whitespace_option(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xml_whitespace_optionContext,0)


        def XMLPI(self):
            return self.getToken(PostgreSQLParser.XMLPI, 0)

        def XMLROOT(self):
            return self.getToken(PostgreSQLParser.XMLROOT, 0)

        def XML_P(self):
            return self.getToken(PostgreSQLParser.XML_P, 0)

        def xml_root_version(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xml_root_versionContext,0)


        def opt_xml_root_standalone(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_xml_root_standaloneContext,0)


        def XMLSERIALIZE(self):
            return self.getToken(PostgreSQLParser.XMLSERIALIZE, 0)

        def simpletypename(self):
            return self.getTypedRuleContext(PostgreSQLParser.SimpletypenameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_expr_common_subexpr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_expr_common_subexpr" ):
                listener.enterFunc_expr_common_subexpr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_expr_common_subexpr" ):
                listener.exitFunc_expr_common_subexpr(self)




    def func_expr_common_subexpr(self):

        localctx = PostgreSQLParser.Func_expr_common_subexprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1216, self.RULE_func_expr_common_subexpr)
        self._la = 0 # Token type
        try:
            self.state = 9278
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [108]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9101
                self.match(PostgreSQLParser.COLLATION)
                self.state = 9102
                self.match(PostgreSQLParser.FOR)
                self.state = 9103
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9104
                self.a_expr()
                self.state = 9105
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [48]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9107
                self.match(PostgreSQLParser.CURRENT_DATE)
                pass
            elif token in [50]:
                self.enterOuterAlt(localctx, 3)
                self.state = 9108
                self.match(PostgreSQLParser.CURRENT_TIME)
                self.state = 9113
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,582,self._ctx)
                if la_ == 1:
                    self.state = 9109
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 9110
                    self.iconst()
                    self.state = 9111
                    self.match(PostgreSQLParser.CLOSE_PAREN)


                pass
            elif token in [51]:
                self.enterOuterAlt(localctx, 4)
                self.state = 9115
                self.match(PostgreSQLParser.CURRENT_TIMESTAMP)
                self.state = 9120
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,583,self._ctx)
                if la_ == 1:
                    self.state = 9116
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 9117
                    self.iconst()
                    self.state = 9118
                    self.match(PostgreSQLParser.CLOSE_PAREN)


                pass
            elif token in [75]:
                self.enterOuterAlt(localctx, 5)
                self.state = 9122
                self.match(PostgreSQLParser.LOCALTIME)
                self.state = 9127
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,584,self._ctx)
                if la_ == 1:
                    self.state = 9123
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 9124
                    self.iconst()
                    self.state = 9125
                    self.match(PostgreSQLParser.CLOSE_PAREN)


                pass
            elif token in [76]:
                self.enterOuterAlt(localctx, 6)
                self.state = 9129
                self.match(PostgreSQLParser.LOCALTIMESTAMP)
                self.state = 9134
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,585,self._ctx)
                if la_ == 1:
                    self.state = 9130
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 9131
                    self.iconst()
                    self.state = 9132
                    self.match(PostgreSQLParser.CLOSE_PAREN)


                pass
            elif token in [49]:
                self.enterOuterAlt(localctx, 7)
                self.state = 9136
                self.match(PostgreSQLParser.CURRENT_ROLE)
                pass
            elif token in [52]:
                self.enterOuterAlt(localctx, 8)
                self.state = 9137
                self.match(PostgreSQLParser.CURRENT_USER)
                pass
            elif token in [89]:
                self.enterOuterAlt(localctx, 9)
                self.state = 9138
                self.match(PostgreSQLParser.SESSION_USER)
                pass
            elif token in [99]:
                self.enterOuterAlt(localctx, 10)
                self.state = 9139
                self.match(PostgreSQLParser.USER)
                pass
            elif token in [47]:
                self.enterOuterAlt(localctx, 11)
                self.state = 9140
                self.match(PostgreSQLParser.CURRENT_CATALOG)
                pass
            elif token in [111]:
                self.enterOuterAlt(localctx, 12)
                self.state = 9141
                self.match(PostgreSQLParser.CURRENT_SCHEMA)
                pass
            elif token in [41]:
                self.enterOuterAlt(localctx, 13)
                self.state = 9142
                self.match(PostgreSQLParser.CAST)
                self.state = 9143
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9144
                self.a_expr()
                self.state = 9145
                self.match(PostgreSQLParser.AS)
                self.state = 9146
                self.typename()
                self.state = 9147
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [390]:
                self.enterOuterAlt(localctx, 14)
                self.state = 9149
                self.match(PostgreSQLParser.EXTRACT)
                self.state = 9150
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9151
                self.extract_list()
                self.state = 9152
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [489]:
                self.enterOuterAlt(localctx, 15)
                self.state = 9154
                self.match(PostgreSQLParser.NORMALIZE)
                self.state = 9155
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9156
                self.a_expr()
                self.state = 9159
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==6:
                    self.state = 9157
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 9158
                    self.unicode_normal_form()


                self.state = 9161
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [403]:
                self.enterOuterAlt(localctx, 16)
                self.state = 9163
                self.match(PostgreSQLParser.OVERLAY)
                self.state = 9164
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9165
                self.overlay_list()
                self.state = 9166
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [404]:
                self.enterOuterAlt(localctx, 17)
                self.state = 9168
                self.match(PostgreSQLParser.POSITION)
                self.state = 9169
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9170
                self.position_list()
                self.state = 9171
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [410]:
                self.enterOuterAlt(localctx, 18)
                self.state = 9173
                self.match(PostgreSQLParser.SUBSTRING)
                self.state = 9174
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9175
                self.substr_list()
                self.state = 9176
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [413]:
                self.enterOuterAlt(localctx, 19)
                self.state = 9178
                self.match(PostgreSQLParser.TREAT)
                self.state = 9179
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9180
                self.a_expr()
                self.state = 9181
                self.match(PostgreSQLParser.AS)
                self.state = 9182
                self.typename()
                self.state = 9183
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [414]:
                self.enterOuterAlt(localctx, 20)
                self.state = 9185
                self.match(PostgreSQLParser.TRIM)
                self.state = 9186
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9188
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 39)) & ~0x3f) == 0 and ((1 << (_la - 39)) & 72057611217797121) != 0):
                    self.state = 9187
                    _la = self._input.LA(1)
                    if not(((((_la - 39)) & ~0x3f) == 0 and ((1 << (_la - 39)) & 72057611217797121) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 9190
                self.trim_list()
                self.state = 9191
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [401]:
                self.enterOuterAlt(localctx, 21)
                self.state = 9193
                self.match(PostgreSQLParser.NULLIF)
                self.state = 9194
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9195
                self.a_expr()
                self.state = 9196
                self.match(PostgreSQLParser.COMMA)
                self.state = 9197
                self.a_expr()
                self.state = 9198
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [386]:
                self.enterOuterAlt(localctx, 22)
                self.state = 9200
                self.match(PostgreSQLParser.COALESCE)
                self.state = 9201
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9202
                self.expr_list()
                self.state = 9203
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [392]:
                self.enterOuterAlt(localctx, 23)
                self.state = 9205
                self.match(PostgreSQLParser.GREATEST)
                self.state = 9206
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9207
                self.expr_list()
                self.state = 9208
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [397]:
                self.enterOuterAlt(localctx, 24)
                self.state = 9210
                self.match(PostgreSQLParser.LEAST)
                self.state = 9211
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9212
                self.expr_list()
                self.state = 9213
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [425]:
                self.enterOuterAlt(localctx, 25)
                self.state = 9215
                self.match(PostgreSQLParser.XMLCONCAT)
                self.state = 9216
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9217
                self.expr_list()
                self.state = 9218
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [426]:
                self.enterOuterAlt(localctx, 26)
                self.state = 9220
                self.match(PostgreSQLParser.XMLELEMENT)
                self.state = 9221
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9222
                self.match(PostgreSQLParser.NAME_P)
                self.state = 9223
                self.collabel()
                self.state = 9229
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==6:
                    self.state = 9224
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 9227
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,588,self._ctx)
                    if la_ == 1:
                        self.state = 9225
                        self.xml_attributes()
                        pass

                    elif la_ == 2:
                        self.state = 9226
                        self.expr_list()
                        pass




                self.state = 9231
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [427]:
                self.enterOuterAlt(localctx, 27)
                self.state = 9233
                self.match(PostgreSQLParser.XMLEXISTS)
                self.state = 9234
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9235
                self.c_expr()
                self.state = 9236
                self.xmlexists_argument()
                self.state = 9237
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [428]:
                self.enterOuterAlt(localctx, 28)
                self.state = 9239
                self.match(PostgreSQLParser.XMLFOREST)
                self.state = 9240
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9241
                self.xml_attribute_list()
                self.state = 9242
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [429]:
                self.enterOuterAlt(localctx, 29)
                self.state = 9244
                self.match(PostgreSQLParser.XMLPARSE)
                self.state = 9245
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9246
                self.document_or_content()
                self.state = 9247
                self.a_expr()
                self.state = 9248
                self.xml_whitespace_option()
                self.state = 9249
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [430]:
                self.enterOuterAlt(localctx, 30)
                self.state = 9251
                self.match(PostgreSQLParser.XMLPI)
                self.state = 9252
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9253
                self.match(PostgreSQLParser.NAME_P)
                self.state = 9254
                self.collabel()
                self.state = 9257
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==6:
                    self.state = 9255
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 9256
                    self.a_expr()


                self.state = 9259
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [431]:
                self.enterOuterAlt(localctx, 31)
                self.state = 9261
                self.match(PostgreSQLParser.XMLROOT)
                self.state = 9262
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9263
                self.match(PostgreSQLParser.XML_P)
                self.state = 9264
                self.a_expr()
                self.state = 9265
                self.match(PostgreSQLParser.COMMA)
                self.state = 9266
                self.xml_root_version()
                self.state = 9267
                self.opt_xml_root_standalone()
                self.state = 9268
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [432]:
                self.enterOuterAlt(localctx, 32)
                self.state = 9270
                self.match(PostgreSQLParser.XMLSERIALIZE)
                self.state = 9271
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9272
                self.document_or_content()
                self.state = 9273
                self.a_expr()
                self.state = 9274
                self.match(PostgreSQLParser.AS)
                self.state = 9275
                self.simpletypename()
                self.state = 9276
                self.match(PostgreSQLParser.CLOSE_PAREN)
                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 Xml_root_versionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def VERSION_P(self):
            return self.getToken(PostgreSQLParser.VERSION_P, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def VALUE_P(self):
            return self.getToken(PostgreSQLParser.VALUE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xml_root_version

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXml_root_version" ):
                listener.enterXml_root_version(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXml_root_version" ):
                listener.exitXml_root_version(self)




    def xml_root_version(self):

        localctx = PostgreSQLParser.Xml_root_versionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1218, self.RULE_xml_root_version)
        try:
            self.state = 9285
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,592,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9280
                self.match(PostgreSQLParser.VERSION_P)
                self.state = 9281
                self.a_expr()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9282
                self.match(PostgreSQLParser.VERSION_P)
                self.state = 9283
                self.match(PostgreSQLParser.NO)
                self.state = 9284
                self.match(PostgreSQLParser.VALUE_P)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_xml_root_standaloneContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def STANDALONE_P(self):
            return self.getToken(PostgreSQLParser.STANDALONE_P, 0)

        def YES_P(self):
            return self.getToken(PostgreSQLParser.YES_P, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def VALUE_P(self):
            return self.getToken(PostgreSQLParser.VALUE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_xml_root_standalone

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_xml_root_standalone" ):
                listener.enterOpt_xml_root_standalone(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_xml_root_standalone" ):
                listener.exitOpt_xml_root_standalone(self)




    def opt_xml_root_standalone(self):

        localctx = PostgreSQLParser.Opt_xml_root_standaloneContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1220, self.RULE_opt_xml_root_standalone)
        try:
            self.state = 9298
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,593,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9287
                self.match(PostgreSQLParser.COMMA)
                self.state = 9288
                self.match(PostgreSQLParser.STANDALONE_P)
                self.state = 9289
                self.match(PostgreSQLParser.YES_P)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9290
                self.match(PostgreSQLParser.COMMA)
                self.state = 9291
                self.match(PostgreSQLParser.STANDALONE_P)
                self.state = 9292
                self.match(PostgreSQLParser.NO)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9293
                self.match(PostgreSQLParser.COMMA)
                self.state = 9294
                self.match(PostgreSQLParser.STANDALONE_P)
                self.state = 9295
                self.match(PostgreSQLParser.NO)
                self.state = 9296
                self.match(PostgreSQLParser.VALUE_P)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Xml_attributesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def XMLATTRIBUTES(self):
            return self.getToken(PostgreSQLParser.XMLATTRIBUTES, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def xml_attribute_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Xml_attribute_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xml_attributes

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXml_attributes" ):
                listener.enterXml_attributes(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXml_attributes" ):
                listener.exitXml_attributes(self)




    def xml_attributes(self):

        localctx = PostgreSQLParser.Xml_attributesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1222, self.RULE_xml_attributes)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9300
            self.match(PostgreSQLParser.XMLATTRIBUTES)
            self.state = 9301
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 9302
            self.xml_attribute_list()
            self.state = 9303
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Xml_attribute_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def xml_attribute_el(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Xml_attribute_elContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Xml_attribute_elContext,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_xml_attribute_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXml_attribute_list" ):
                listener.enterXml_attribute_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXml_attribute_list" ):
                listener.exitXml_attribute_list(self)




    def xml_attribute_list(self):

        localctx = PostgreSQLParser.Xml_attribute_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1224, self.RULE_xml_attribute_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9305
            self.xml_attribute_el()
            self.state = 9310
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 9306
                self.match(PostgreSQLParser.COMMA)
                self.state = 9307
                self.xml_attribute_el()
                self.state = 9312
                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 Xml_attribute_elContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xml_attribute_el

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXml_attribute_el" ):
                listener.enterXml_attribute_el(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXml_attribute_el" ):
                listener.exitXml_attribute_el(self)




    def xml_attribute_el(self):

        localctx = PostgreSQLParser.Xml_attribute_elContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1226, self.RULE_xml_attribute_el)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9313
            self.a_expr()
            self.state = 9316
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==36:
                self.state = 9314
                self.match(PostgreSQLParser.AS)
                self.state = 9315
                self.collabel()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Document_or_contentContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DOCUMENT_P(self):
            return self.getToken(PostgreSQLParser.DOCUMENT_P, 0)

        def CONTENT_P(self):
            return self.getToken(PostgreSQLParser.CONTENT_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_document_or_content

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDocument_or_content" ):
                listener.enterDocument_or_content(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDocument_or_content" ):
                listener.exitDocument_or_content(self)




    def document_or_content(self):

        localctx = PostgreSQLParser.Document_or_contentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1228, self.RULE_document_or_content)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9318
            _la = self._input.LA(1)
            if not(_la==166 or _la==188):
                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 Xml_whitespace_optionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PRESERVE(self):
            return self.getToken(PostgreSQLParser.PRESERVE, 0)

        def WHITESPACE_P(self):
            return self.getToken(PostgreSQLParser.WHITESPACE_P, 0)

        def STRIP_P(self):
            return self.getToken(PostgreSQLParser.STRIP_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xml_whitespace_option

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXml_whitespace_option" ):
                listener.enterXml_whitespace_option(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXml_whitespace_option" ):
                listener.exitXml_whitespace_option(self)




    def xml_whitespace_option(self):

        localctx = PostgreSQLParser.Xml_whitespace_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1230, self.RULE_xml_whitespace_option)
        try:
            self.state = 9325
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [285]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9320
                self.match(PostgreSQLParser.PRESERVE)
                self.state = 9321
                self.match(PostgreSQLParser.WHITESPACE_P)
                pass
            elif token in [340]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9322
                self.match(PostgreSQLParser.STRIP_P)
                self.state = 9323
                self.match(PostgreSQLParser.WHITESPACE_P)
                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 3)

                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 Xmlexists_argumentContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PASSING(self):
            return self.getToken(PostgreSQLParser.PASSING, 0)

        def c_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.C_exprContext,0)


        def xml_passing_mech(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Xml_passing_mechContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Xml_passing_mechContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xmlexists_argument

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXmlexists_argument" ):
                listener.enterXmlexists_argument(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXmlexists_argument" ):
                listener.exitXmlexists_argument(self)




    def xmlexists_argument(self):

        localctx = PostgreSQLParser.Xmlexists_argumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1232, self.RULE_xmlexists_argument)
        try:
            self.state = 9342
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,597,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9327
                self.match(PostgreSQLParser.PASSING)
                self.state = 9328
                self.c_expr()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9329
                self.match(PostgreSQLParser.PASSING)
                self.state = 9330
                self.c_expr()
                self.state = 9331
                self.xml_passing_mech()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9333
                self.match(PostgreSQLParser.PASSING)
                self.state = 9334
                self.xml_passing_mech()
                self.state = 9335
                self.c_expr()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9337
                self.match(PostgreSQLParser.PASSING)
                self.state = 9338
                self.xml_passing_mech()
                self.state = 9339
                self.c_expr()
                self.state = 9340
                self.xml_passing_mech()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Xml_passing_mechContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def REF(self):
            return self.getToken(PostgreSQLParser.REF, 0)

        def VALUE_P(self):
            return self.getToken(PostgreSQLParser.VALUE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xml_passing_mech

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXml_passing_mech" ):
                listener.enterXml_passing_mech(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXml_passing_mech" ):
                listener.exitXml_passing_mech(self)




    def xml_passing_mech(self):

        localctx = PostgreSQLParser.Xml_passing_mechContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1234, self.RULE_xml_passing_mech)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9344
            self.match(PostgreSQLParser.BY)
            self.state = 9345
            _la = self._input.LA(1)
            if not(_la==297 or _la==450):
                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 Within_group_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WITHIN(self):
            return self.getToken(PostgreSQLParser.WITHIN, 0)

        def GROUP_P(self):
            return self.getToken(PostgreSQLParser.GROUP_P, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def sort_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sort_clauseContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_within_group_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWithin_group_clause" ):
                listener.enterWithin_group_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWithin_group_clause" ):
                listener.exitWithin_group_clause(self)




    def within_group_clause(self):

        localctx = PostgreSQLParser.Within_group_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1236, self.RULE_within_group_clause)
        try:
            self.state = 9354
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,598,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9347
                self.match(PostgreSQLParser.WITHIN)
                self.state = 9348
                self.match(PostgreSQLParser.GROUP_P)
                self.state = 9349
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9350
                self.sort_clause()
                self.state = 9351
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Filter_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FILTER(self):
            return self.getToken(PostgreSQLParser.FILTER, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def WHERE(self):
            return self.getToken(PostgreSQLParser.WHERE, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_filter_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFilter_clause" ):
                listener.enterFilter_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFilter_clause" ):
                listener.exitFilter_clause(self)




    def filter_clause(self):

        localctx = PostgreSQLParser.Filter_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1238, self.RULE_filter_clause)
        try:
            self.state = 9363
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,599,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9356
                self.match(PostgreSQLParser.FILTER)
                self.state = 9357
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9358
                self.match(PostgreSQLParser.WHERE)
                self.state = 9359
                self.a_expr()
                self.state = 9360
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Window_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WINDOW(self):
            return self.getToken(PostgreSQLParser.WINDOW, 0)

        def window_definition_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Window_definition_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_window_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWindow_clause" ):
                listener.enterWindow_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWindow_clause" ):
                listener.exitWindow_clause(self)




    def window_clause(self):

        localctx = PostgreSQLParser.Window_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1240, self.RULE_window_clause)
        try:
            self.state = 9368
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [104]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9365
                self.match(PostgreSQLParser.WINDOW)
                self.state = 9366
                self.window_definition_list()
                pass
            elif token in [-1, 2, 3, 6, 7, 31, 32, 46, 57, 59, 61, 62, 65, 70, 71, 74, 79, 80, 83, 87, 88, 92, 93, 97, 100, 102, 105, 129, 138, 146, 155, 157, 158, 159, 161, 169, 177, 178, 182, 187, 191, 202, 203, 232, 243, 244, 247, 253, 258, 264, 283, 294, 298, 299, 301, 306, 310, 312, 315, 320, 326, 328, 333, 351, 359, 362, 363, 415, 433, 444, 454, 519, 668]:
                self.enterOuterAlt(localctx, 2)

                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 Window_definition_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def window_definition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Window_definitionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Window_definitionContext,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_window_definition_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWindow_definition_list" ):
                listener.enterWindow_definition_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWindow_definition_list" ):
                listener.exitWindow_definition_list(self)




    def window_definition_list(self):

        localctx = PostgreSQLParser.Window_definition_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1242, self.RULE_window_definition_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9370
            self.window_definition()
            self.state = 9375
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,601,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 9371
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 9372
                    self.window_definition() 
                self.state = 9377
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,601,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 Window_definitionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def window_specification(self):
            return self.getTypedRuleContext(PostgreSQLParser.Window_specificationContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_window_definition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWindow_definition" ):
                listener.enterWindow_definition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWindow_definition" ):
                listener.exitWindow_definition(self)




    def window_definition(self):

        localctx = PostgreSQLParser.Window_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1244, self.RULE_window_definition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9378
            self.colid()
            self.state = 9379
            self.match(PostgreSQLParser.AS)
            self.state = 9380
            self.window_specification()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Over_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OVER(self):
            return self.getToken(PostgreSQLParser.OVER, 0)

        def window_specification(self):
            return self.getTypedRuleContext(PostgreSQLParser.Window_specificationContext,0)


        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_over_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOver_clause" ):
                listener.enterOver_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOver_clause" ):
                listener.exitOver_clause(self)




    def over_clause(self):

        localctx = PostgreSQLParser.Over_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1246, self.RULE_over_clause)
        try:
            self.state = 9388
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,603,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9382
                self.match(PostgreSQLParser.OVER)
                self.state = 9385
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [2]:
                    self.state = 9383
                    self.window_specification()
                    pass
                elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                    self.state = 9384
                    self.colid()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Window_specificationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def opt_existing_window_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_existing_window_nameContext,0)


        def opt_partition_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_partition_clauseContext,0)


        def opt_sort_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_sort_clauseContext,0)


        def opt_frame_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_frame_clauseContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_window_specification

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWindow_specification" ):
                listener.enterWindow_specification(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWindow_specification" ):
                listener.exitWindow_specification(self)




    def window_specification(self):

        localctx = PostgreSQLParser.Window_specificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1248, self.RULE_window_specification)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9390
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 9391
            self.opt_existing_window_name()
            self.state = 9392
            self.opt_partition_clause()
            self.state = 9393
            self.opt_sort_clause()
            self.state = 9394
            self.opt_frame_clause()
            self.state = 9395
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_existing_window_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_existing_window_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_existing_window_name" ):
                listener.enterOpt_existing_window_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_existing_window_name" ):
                listener.exitOpt_existing_window_name(self)




    def opt_existing_window_name(self):

        localctx = PostgreSQLParser.Opt_existing_window_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1250, self.RULE_opt_existing_window_name)
        try:
            self.state = 9399
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,604,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9397
                self.colid()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_partition_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PARTITION(self):
            return self.getToken(PostgreSQLParser.PARTITION, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_partition_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_partition_clause" ):
                listener.enterOpt_partition_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_partition_clause" ):
                listener.exitOpt_partition_clause(self)




    def opt_partition_clause(self):

        localctx = PostgreSQLParser.Opt_partition_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1252, self.RULE_opt_partition_clause)
        try:
            self.state = 9405
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [278]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9401
                self.match(PostgreSQLParser.PARTITION)
                self.state = 9402
                self.match(PostgreSQLParser.BY)
                self.state = 9403
                self.expr_list()
                pass
            elif token in [3, 83, 292, 313, 481]:
                self.enterOuterAlt(localctx, 2)

                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 Opt_frame_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def RANGE(self):
            return self.getToken(PostgreSQLParser.RANGE, 0)

        def frame_extent(self):
            return self.getTypedRuleContext(PostgreSQLParser.Frame_extentContext,0)


        def opt_window_exclusion_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_window_exclusion_clauseContext,0)


        def ROWS(self):
            return self.getToken(PostgreSQLParser.ROWS, 0)

        def GROUPS(self):
            return self.getToken(PostgreSQLParser.GROUPS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_frame_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_frame_clause" ):
                listener.enterOpt_frame_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_frame_clause" ):
                listener.exitOpt_frame_clause(self)




    def opt_frame_clause(self):

        localctx = PostgreSQLParser.Opt_frame_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1254, self.RULE_opt_frame_clause)
        try:
            self.state = 9420
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [292]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9407
                self.match(PostgreSQLParser.RANGE)
                self.state = 9408
                self.frame_extent()
                self.state = 9409
                self.opt_window_exclusion_clause()
                pass
            elif token in [313]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9411
                self.match(PostgreSQLParser.ROWS)
                self.state = 9412
                self.frame_extent()
                self.state = 9413
                self.opt_window_exclusion_clause()
                pass
            elif token in [481]:
                self.enterOuterAlt(localctx, 3)
                self.state = 9415
                self.match(PostgreSQLParser.GROUPS)
                self.state = 9416
                self.frame_extent()
                self.state = 9417
                self.opt_window_exclusion_clause()
                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 4)

                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 Frame_extentContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def frame_bound(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Frame_boundContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Frame_boundContext,i)


        def BETWEEN(self):
            return self.getToken(PostgreSQLParser.BETWEEN, 0)

        def AND(self):
            return self.getToken(PostgreSQLParser.AND, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_frame_extent

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFrame_extent" ):
                listener.enterFrame_extent(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFrame_extent" ):
                listener.exitFrame_extent(self)




    def frame_extent(self):

        localctx = PostgreSQLParser.Frame_extentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1256, self.RULE_frame_extent)
        try:
            self.state = 9428
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,607,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9422
                self.frame_bound()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9423
                self.match(PostgreSQLParser.BETWEEN)
                self.state = 9424
                self.frame_bound()
                self.state = 9425
                self.match(PostgreSQLParser.AND)
                self.state = 9426
                self.frame_bound()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Frame_boundContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def UNBOUNDED(self):
            return self.getToken(PostgreSQLParser.UNBOUNDED, 0)

        def PRECEDING(self):
            return self.getToken(PostgreSQLParser.PRECEDING, 0)

        def FOLLOWING(self):
            return self.getToken(PostgreSQLParser.FOLLOWING, 0)

        def CURRENT_P(self):
            return self.getToken(PostgreSQLParser.CURRENT_P, 0)

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_frame_bound

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFrame_bound" ):
                listener.enterFrame_bound(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFrame_bound" ):
                listener.exitFrame_bound(self)




    def frame_bound(self):

        localctx = PostgreSQLParser.Frame_boundContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1258, self.RULE_frame_bound)
        self._la = 0 # Token type
        try:
            self.state = 9437
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,608,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9430
                self.match(PostgreSQLParser.UNBOUNDED)
                self.state = 9431
                _la = self._input.LA(1)
                if not(_la==208 or _la==282):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9432
                self.match(PostgreSQLParser.CURRENT_P)
                self.state = 9433
                self.match(PostgreSQLParser.ROW)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9434
                self.a_expr()
                self.state = 9435
                _la = self._input.LA(1)
                if not(_la==208 or _la==282):
                    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 Opt_window_exclusion_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EXCLUDE(self):
            return self.getToken(PostgreSQLParser.EXCLUDE, 0)

        def CURRENT_P(self):
            return self.getToken(PostgreSQLParser.CURRENT_P, 0)

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def GROUP_P(self):
            return self.getToken(PostgreSQLParser.GROUP_P, 0)

        def TIES(self):
            return self.getToken(PostgreSQLParser.TIES, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def OTHERS(self):
            return self.getToken(PostgreSQLParser.OTHERS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_window_exclusion_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_window_exclusion_clause" ):
                listener.enterOpt_window_exclusion_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_window_exclusion_clause" ):
                listener.exitOpt_window_exclusion_clause(self)




    def opt_window_exclusion_clause(self):

        localctx = PostgreSQLParser.Opt_window_exclusion_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1260, self.RULE_opt_window_exclusion_clause)
        try:
            self.state = 9449
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [199]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9439
                self.match(PostgreSQLParser.EXCLUDE)
                self.state = 9446
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [434]:
                    self.state = 9440
                    self.match(PostgreSQLParser.CURRENT_P)
                    self.state = 9441
                    self.match(PostgreSQLParser.ROW)
                    pass
                elif token in [66]:
                    self.state = 9442
                    self.match(PostgreSQLParser.GROUP_P)
                    pass
                elif token in [467]:
                    self.state = 9443
                    self.match(PostgreSQLParser.TIES)
                    pass
                elif token in [262]:
                    self.state = 9444
                    self.match(PostgreSQLParser.NO)
                    self.state = 9445
                    self.match(PostgreSQLParser.OTHERS)
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 2)

                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 RowContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_row

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRow" ):
                listener.enterRow(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRow" ):
                listener.exitRow(self)




    def row(self):

        localctx = PostgreSQLParser.RowContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1262, self.RULE_row)
        self._la = 0 # Token type
        try:
            self.state = 9463
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [407]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9451
                self.match(PostgreSQLParser.ROW)
                self.state = 9452
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9454
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & 3620818277858553860) != 0) or ((((_la - 75)) & ~0x3f) == 0 and ((1 << (_la - 75)) & -2120073201) != 0) or ((((_la - 139)) & ~0x3f) == 0 and ((1 << (_la - 139)) & -1) != 0) or ((((_la - 203)) & ~0x3f) == 0 and ((1 << (_la - 203)) & -1266637395197953) != 0) or ((((_la - 267)) & ~0x3f) == 0 and ((1 << (_la - 267)) & -1) != 0) or ((((_la - 331)) & ~0x3f) == 0 and ((1 << (_la - 331)) & -1) != 0) or ((((_la - 395)) & ~0x3f) == 0 and ((1 << (_la - 395)) & -576460752303423489) != 0) or ((((_la - 459)) & ~0x3f) == 0 and ((1 << (_la - 459)) & -1153009465537069057) != 0) or ((((_la - 523)) & ~0x3f) == 0 and ((1 << (_la - 523)) & -1) != 0) or ((((_la - 587)) & ~0x3f) == 0 and ((1 << (_la - 587)) & -3150267939345661953) != 0) or ((((_la - 654)) & ~0x3f) == 0 and ((1 << (_la - 654)) & 131537) != 0):
                    self.state = 9453
                    self.expr_list()


                self.state = 9456
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9457
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9458
                self.expr_list()
                self.state = 9459
                self.match(PostgreSQLParser.COMMA)
                self.state = 9460
                self.a_expr()
                self.state = 9461
                self.match(PostgreSQLParser.CLOSE_PAREN)
                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 Explicit_rowContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_explicit_row

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExplicit_row" ):
                listener.enterExplicit_row(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExplicit_row" ):
                listener.exitExplicit_row(self)




    def explicit_row(self):

        localctx = PostgreSQLParser.Explicit_rowContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1264, self.RULE_explicit_row)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9465
            self.match(PostgreSQLParser.ROW)
            self.state = 9466
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 9468
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 3620818277858553860) != 0) or ((((_la - 75)) & ~0x3f) == 0 and ((1 << (_la - 75)) & -2120073201) != 0) or ((((_la - 139)) & ~0x3f) == 0 and ((1 << (_la - 139)) & -1) != 0) or ((((_la - 203)) & ~0x3f) == 0 and ((1 << (_la - 203)) & -1266637395197953) != 0) or ((((_la - 267)) & ~0x3f) == 0 and ((1 << (_la - 267)) & -1) != 0) or ((((_la - 331)) & ~0x3f) == 0 and ((1 << (_la - 331)) & -1) != 0) or ((((_la - 395)) & ~0x3f) == 0 and ((1 << (_la - 395)) & -576460752303423489) != 0) or ((((_la - 459)) & ~0x3f) == 0 and ((1 << (_la - 459)) & -1153009465537069057) != 0) or ((((_la - 523)) & ~0x3f) == 0 and ((1 << (_la - 523)) & -1) != 0) or ((((_la - 587)) & ~0x3f) == 0 and ((1 << (_la - 587)) & -3150267939345661953) != 0) or ((((_la - 654)) & ~0x3f) == 0 and ((1 << (_la - 654)) & 131537) != 0):
                self.state = 9467
                self.expr_list()


            self.state = 9470
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Implicit_rowContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_implicit_row

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterImplicit_row" ):
                listener.enterImplicit_row(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitImplicit_row" ):
                listener.exitImplicit_row(self)




    def implicit_row(self):

        localctx = PostgreSQLParser.Implicit_rowContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1266, self.RULE_implicit_row)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9472
            self.match(PostgreSQLParser.OPEN_PAREN)
            self.state = 9473
            self.expr_list()
            self.state = 9474
            self.match(PostgreSQLParser.COMMA)
            self.state = 9475
            self.a_expr()
            self.state = 9476
            self.match(PostgreSQLParser.CLOSE_PAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Sub_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ANY(self):
            return self.getToken(PostgreSQLParser.ANY, 0)

        def SOME(self):
            return self.getToken(PostgreSQLParser.SOME, 0)

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sub_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSub_type" ):
                listener.enterSub_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSub_type" ):
                listener.exitSub_type(self)




    def sub_type(self):

        localctx = PostgreSQLParser.Sub_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1268, self.RULE_sub_type)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9478
            _la = self._input.LA(1)
            if not(((((_la - 30)) & ~0x3f) == 0 and ((1 << (_la - 30)) & 1152921504606846993) != 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 All_opContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Operator(self):
            return self.getToken(PostgreSQLParser.Operator, 0)

        def mathop(self):
            return self.getTypedRuleContext(PostgreSQLParser.MathopContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_all_op

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAll_op" ):
                listener.enterAll_op(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAll_op" ):
                listener.exitAll_op(self)




    def all_op(self):

        localctx = PostgreSQLParser.All_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1270, self.RULE_all_op)
        try:
            self.state = 9482
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [29]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9480
                self.match(PostgreSQLParser.Operator)
                pass
            elif token in [9, 10, 12, 13, 14, 15, 16, 17, 21, 23, 25, 27]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9481
                self.mathop()
                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 MathopContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PLUS(self):
            return self.getToken(PostgreSQLParser.PLUS, 0)

        def MINUS(self):
            return self.getToken(PostgreSQLParser.MINUS, 0)

        def STAR(self):
            return self.getToken(PostgreSQLParser.STAR, 0)

        def SLASH(self):
            return self.getToken(PostgreSQLParser.SLASH, 0)

        def PERCENT(self):
            return self.getToken(PostgreSQLParser.PERCENT, 0)

        def CARET(self):
            return self.getToken(PostgreSQLParser.CARET, 0)

        def LT(self):
            return self.getToken(PostgreSQLParser.LT, 0)

        def GT(self):
            return self.getToken(PostgreSQLParser.GT, 0)

        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def LESS_EQUALS(self):
            return self.getToken(PostgreSQLParser.LESS_EQUALS, 0)

        def GREATER_EQUALS(self):
            return self.getToken(PostgreSQLParser.GREATER_EQUALS, 0)

        def NOT_EQUALS(self):
            return self.getToken(PostgreSQLParser.NOT_EQUALS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_mathop

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMathop" ):
                listener.enterMathop(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMathop" ):
                listener.exitMathop(self)




    def mathop(self):

        localctx = PostgreSQLParser.MathopContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1272, self.RULE_mathop)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9484
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 178517504) != 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 Qual_opContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Operator(self):
            return self.getToken(PostgreSQLParser.Operator, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def any_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_operatorContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_qual_op

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterQual_op" ):
                listener.enterQual_op(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitQual_op" ):
                listener.exitQual_op(self)




    def qual_op(self):

        localctx = PostgreSQLParser.Qual_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1274, self.RULE_qual_op)
        try:
            self.state = 9492
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [29]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9486
                self.match(PostgreSQLParser.Operator)
                pass
            elif token in [271]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9487
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 9488
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9489
                self.any_operator()
                self.state = 9490
                self.match(PostgreSQLParser.CLOSE_PAREN)
                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 Qual_all_opContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def all_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.All_opContext,0)


        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def any_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_operatorContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_qual_all_op

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterQual_all_op" ):
                listener.enterQual_all_op(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitQual_all_op" ):
                listener.exitQual_all_op(self)




    def qual_all_op(self):

        localctx = PostgreSQLParser.Qual_all_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1276, self.RULE_qual_all_op)
        try:
            self.state = 9500
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [9, 10, 12, 13, 14, 15, 16, 17, 21, 23, 25, 27, 29]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9494
                self.all_op()
                pass
            elif token in [271]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9495
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 9496
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9497
                self.any_operator()
                self.state = 9498
                self.match(PostgreSQLParser.CLOSE_PAREN)
                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 Subquery_OpContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def all_op(self):
            return self.getTypedRuleContext(PostgreSQLParser.All_opContext,0)


        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def any_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_operatorContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def LIKE(self):
            return self.getToken(PostgreSQLParser.LIKE, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def ILIKE(self):
            return self.getToken(PostgreSQLParser.ILIKE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_subquery_Op

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSubquery_Op" ):
                listener.enterSubquery_Op(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSubquery_Op" ):
                listener.exitSubquery_Op(self)




    def subquery_Op(self):

        localctx = PostgreSQLParser.Subquery_OpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1278, self.RULE_subquery_Op)
        try:
            self.state = 9514
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,617,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9502
                self.all_op()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9503
                self.match(PostgreSQLParser.OPERATOR)
                self.state = 9504
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9505
                self.any_operator()
                self.state = 9506
                self.match(PostgreSQLParser.CLOSE_PAREN)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9508
                self.match(PostgreSQLParser.LIKE)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9509
                self.match(PostgreSQLParser.NOT)
                self.state = 9510
                self.match(PostgreSQLParser.LIKE)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 9511
                self.match(PostgreSQLParser.ILIKE)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 9512
                self.match(PostgreSQLParser.NOT)
                self.state = 9513
                self.match(PostgreSQLParser.ILIKE)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Expr_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_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 getRuleIndex(self):
            return PostgreSQLParser.RULE_expr_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpr_list" ):
                listener.enterExpr_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpr_list" ):
                listener.exitExpr_list(self)




    def expr_list(self):

        localctx = PostgreSQLParser.Expr_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1280, self.RULE_expr_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9516
            self.a_expr()
            self.state = 9521
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,618,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 9517
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 9518
                    self.a_expr() 
                self.state = 9523
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,618,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 Func_arg_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def func_arg_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Func_arg_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Func_arg_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 getRuleIndex(self):
            return PostgreSQLParser.RULE_func_arg_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_arg_list" ):
                listener.enterFunc_arg_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_arg_list" ):
                listener.exitFunc_arg_list(self)




    def func_arg_list(self):

        localctx = PostgreSQLParser.Func_arg_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1282, self.RULE_func_arg_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9524
            self.func_arg_expr()
            self.state = 9529
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,619,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 9525
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 9526
                    self.func_arg_expr() 
                self.state = 9531
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,619,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 Func_arg_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def param_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Param_nameContext,0)


        def COLON_EQUALS(self):
            return self.getToken(PostgreSQLParser.COLON_EQUALS, 0)

        def EQUALS_GREATER(self):
            return self.getToken(PostgreSQLParser.EQUALS_GREATER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_arg_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_arg_expr" ):
                listener.enterFunc_arg_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_arg_expr" ):
                listener.exitFunc_arg_expr(self)




    def func_arg_expr(self):

        localctx = PostgreSQLParser.Func_arg_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1284, self.RULE_func_arg_expr)
        self._la = 0 # Token type
        try:
            self.state = 9537
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,620,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9532
                self.a_expr()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9533
                self.param_name()
                self.state = 9534
                _la = self._input.LA(1)
                if not(_la==20 or _la==22):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 9535
                self.a_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 Type_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def typename(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.TypenameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,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_type_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterType_list" ):
                listener.enterType_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitType_list" ):
                listener.exitType_list(self)




    def type_list(self):

        localctx = PostgreSQLParser.Type_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1286, self.RULE_type_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9539
            self.typename()
            self.state = 9544
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 9540
                self.match(PostgreSQLParser.COMMA)
                self.state = 9541
                self.typename()
                self.state = 9546
                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 Array_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_BRACKET(self):
            return self.getToken(PostgreSQLParser.OPEN_BRACKET, 0)

        def CLOSE_BRACKET(self):
            return self.getToken(PostgreSQLParser.CLOSE_BRACKET, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def array_expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Array_expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_array_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterArray_expr" ):
                listener.enterArray_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitArray_expr" ):
                listener.exitArray_expr(self)




    def array_expr(self):

        localctx = PostgreSQLParser.Array_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1288, self.RULE_array_expr)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9547
            self.match(PostgreSQLParser.OPEN_BRACKET)
            self.state = 9550
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 12, 13, 28, 29, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 77, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                self.state = 9548
                self.expr_list()
                pass
            elif token in [4]:
                self.state = 9549
                self.array_expr_list()
                pass
            elif token in [5]:
                pass
            else:
                pass
            self.state = 9552
            self.match(PostgreSQLParser.CLOSE_BRACKET)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Array_expr_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def array_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Array_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Array_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 getRuleIndex(self):
            return PostgreSQLParser.RULE_array_expr_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterArray_expr_list" ):
                listener.enterArray_expr_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitArray_expr_list" ):
                listener.exitArray_expr_list(self)




    def array_expr_list(self):

        localctx = PostgreSQLParser.Array_expr_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1290, self.RULE_array_expr_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9554
            self.array_expr()
            self.state = 9559
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 9555
                self.match(PostgreSQLParser.COMMA)
                self.state = 9556
                self.array_expr()
                self.state = 9561
                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 Extract_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def extract_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Extract_argContext,0)


        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_extract_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExtract_list" ):
                listener.enterExtract_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExtract_list" ):
                listener.exitExtract_list(self)




    def extract_list(self):

        localctx = PostgreSQLParser.Extract_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1292, self.RULE_extract_list)
        try:
            self.state = 9567
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 123, 130, 144, 153, 157, 161, 167, 172, 176, 207, 210, 218, 232, 240, 254, 257, 258, 261, 262, 272, 286, 300, 306, 312, 316, 317, 319, 326, 353, 377, 433, 434, 477, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520, 636, 637, 641, 645, 647, 649, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9562
                self.extract_arg()
                self.state = 9563
                self.match(PostgreSQLParser.FROM)
                self.state = 9564
                self.a_expr()
                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 2)

                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 Extract_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def YEAR_P(self):
            return self.getToken(PostgreSQLParser.YEAR_P, 0)

        def MONTH_P(self):
            return self.getToken(PostgreSQLParser.MONTH_P, 0)

        def DAY_P(self):
            return self.getToken(PostgreSQLParser.DAY_P, 0)

        def HOUR_P(self):
            return self.getToken(PostgreSQLParser.HOUR_P, 0)

        def MINUTE_P(self):
            return self.getToken(PostgreSQLParser.MINUTE_P, 0)

        def SECOND_P(self):
            return self.getToken(PostgreSQLParser.SECOND_P, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_extract_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExtract_arg" ):
                listener.enterExtract_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExtract_arg" ):
                listener.exitExtract_arg(self)




    def extract_arg(self):

        localctx = PostgreSQLParser.Extract_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1294, self.RULE_extract_arg)
        try:
            self.state = 9577
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 123, 130, 144, 153, 157, 161, 167, 172, 207, 210, 232, 240, 258, 261, 262, 272, 286, 300, 306, 312, 316, 317, 326, 353, 433, 434, 477, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9569
                self.identifier()
                pass
            elif token in [377]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9570
                self.match(PostgreSQLParser.YEAR_P)
                pass
            elif token in [257]:
                self.enterOuterAlt(localctx, 3)
                self.state = 9571
                self.match(PostgreSQLParser.MONTH_P)
                pass
            elif token in [176]:
                self.enterOuterAlt(localctx, 4)
                self.state = 9572
                self.match(PostgreSQLParser.DAY_P)
                pass
            elif token in [218]:
                self.enterOuterAlt(localctx, 5)
                self.state = 9573
                self.match(PostgreSQLParser.HOUR_P)
                pass
            elif token in [254]:
                self.enterOuterAlt(localctx, 6)
                self.state = 9574
                self.match(PostgreSQLParser.MINUTE_P)
                pass
            elif token in [319]:
                self.enterOuterAlt(localctx, 7)
                self.state = 9575
                self.match(PostgreSQLParser.SECOND_P)
                pass
            elif token in [645, 647, 649, 671]:
                self.enterOuterAlt(localctx, 8)
                self.state = 9576
                self.sconst()
                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 Unicode_normal_formContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NFC(self):
            return self.getToken(PostgreSQLParser.NFC, 0)

        def NFD(self):
            return self.getToken(PostgreSQLParser.NFD, 0)

        def NFKC(self):
            return self.getToken(PostgreSQLParser.NFKC, 0)

        def NFKD(self):
            return self.getToken(PostgreSQLParser.NFKD, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_unicode_normal_form

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterUnicode_normal_form" ):
                listener.enterUnicode_normal_form(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitUnicode_normal_form" ):
                listener.exitUnicode_normal_form(self)




    def unicode_normal_form(self):

        localctx = PostgreSQLParser.Unicode_normal_formContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1296, self.RULE_unicode_normal_form)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9579
            _la = self._input.LA(1)
            if not(((((_la - 483)) & ~0x3f) == 0 and ((1 << (_la - 483)) & 15) != 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 Overlay_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,i)


        def PLACING(self):
            return self.getToken(PostgreSQLParser.PLACING, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_overlay_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOverlay_list" ):
                listener.enterOverlay_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOverlay_list" ):
                listener.exitOverlay_list(self)




    def overlay_list(self):

        localctx = PostgreSQLParser.Overlay_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1298, self.RULE_overlay_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9581
            self.a_expr()
            self.state = 9582
            self.match(PostgreSQLParser.PLACING)
            self.state = 9583
            self.a_expr()
            self.state = 9584
            self.match(PostgreSQLParser.FROM)
            self.state = 9585
            self.a_expr()
            self.state = 9588
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==62:
                self.state = 9586
                self.match(PostgreSQLParser.FOR)
                self.state = 9587
                self.a_expr()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Position_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def b_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.B_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.B_exprContext,i)


        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_position_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPosition_list" ):
                listener.enterPosition_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPosition_list" ):
                listener.exitPosition_list(self)




    def position_list(self):

        localctx = PostgreSQLParser.Position_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1300, self.RULE_position_list)
        try:
            self.state = 9595
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 12, 13, 28, 29, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9590
                self.b_expr(0)
                self.state = 9591
                self.match(PostgreSQLParser.IN_P)
                self.state = 9592
                self.b_expr(0)
                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 2)

                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 Substr_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,i)


        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def SIMILAR(self):
            return self.getToken(PostgreSQLParser.SIMILAR, 0)

        def ESCAPE(self):
            return self.getToken(PostgreSQLParser.ESCAPE, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_substr_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSubstr_list" ):
                listener.enterSubstr_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSubstr_list" ):
                listener.exitSubstr_list(self)




    def substr_list(self):

        localctx = PostgreSQLParser.Substr_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1302, self.RULE_substr_list)
        try:
            self.state = 9624
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,628,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9597
                self.a_expr()
                self.state = 9598
                self.match(PostgreSQLParser.FROM)
                self.state = 9599
                self.a_expr()
                self.state = 9600
                self.match(PostgreSQLParser.FOR)
                self.state = 9601
                self.a_expr()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9603
                self.a_expr()
                self.state = 9604
                self.match(PostgreSQLParser.FOR)
                self.state = 9605
                self.a_expr()
                self.state = 9606
                self.match(PostgreSQLParser.FROM)
                self.state = 9607
                self.a_expr()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9609
                self.a_expr()
                self.state = 9610
                self.match(PostgreSQLParser.FROM)
                self.state = 9611
                self.a_expr()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9613
                self.a_expr()
                self.state = 9614
                self.match(PostgreSQLParser.FOR)
                self.state = 9615
                self.a_expr()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 9617
                self.a_expr()
                self.state = 9618
                self.match(PostgreSQLParser.SIMILAR)
                self.state = 9619
                self.a_expr()
                self.state = 9620
                self.match(PostgreSQLParser.ESCAPE)
                self.state = 9621
                self.a_expr()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 9623
                self.expr_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 Trim_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_trim_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTrim_list" ):
                listener.enterTrim_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTrim_list" ):
                listener.exitTrim_list(self)




    def trim_list(self):

        localctx = PostgreSQLParser.Trim_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1304, self.RULE_trim_list)
        try:
            self.state = 9633
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,629,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9626
                self.a_expr()
                self.state = 9627
                self.match(PostgreSQLParser.FROM)
                self.state = 9628
                self.expr_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9630
                self.match(PostgreSQLParser.FROM)
                self.state = 9631
                self.expr_list()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9632
                self.expr_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 In_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_in_expr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class In_expr_listContext(In_exprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a PostgreSQLParser.In_exprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)
        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)

        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIn_expr_list" ):
                listener.enterIn_expr_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIn_expr_list" ):
                listener.exitIn_expr_list(self)


    class In_expr_selectContext(In_exprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a PostgreSQLParser.In_exprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def select_with_parens(self):
            return self.getTypedRuleContext(PostgreSQLParser.Select_with_parensContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIn_expr_select" ):
                listener.enterIn_expr_select(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIn_expr_select" ):
                listener.exitIn_expr_select(self)



    def in_expr(self):

        localctx = PostgreSQLParser.In_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1306, self.RULE_in_expr)
        try:
            self.state = 9640
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,630,self._ctx)
            if la_ == 1:
                localctx = PostgreSQLParser.In_expr_selectContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 9635
                self.select_with_parens()
                pass

            elif la_ == 2:
                localctx = PostgreSQLParser.In_expr_listContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 9636
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 9637
                self.expr_list()
                self.state = 9638
                self.match(PostgreSQLParser.CLOSE_PAREN)
                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_exprContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CASE(self):
            return self.getToken(PostgreSQLParser.CASE, 0)

        def case_arg(self):
            return self.getTypedRuleContext(PostgreSQLParser.Case_argContext,0)


        def when_clause_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.When_clause_listContext,0)


        def case_default(self):
            return self.getTypedRuleContext(PostgreSQLParser.Case_defaultContext,0)


        def END_P(self):
            return self.getToken(PostgreSQLParser.END_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_case_expr

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCase_expr" ):
                listener.enterCase_expr(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCase_expr" ):
                listener.exitCase_expr(self)




    def case_expr(self):

        localctx = PostgreSQLParser.Case_exprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1308, self.RULE_case_expr)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9642
            self.match(PostgreSQLParser.CASE)
            self.state = 9643
            self.case_arg()
            self.state = 9644
            self.when_clause_list()
            self.state = 9645
            self.case_default()
            self.state = 9646
            self.match(PostgreSQLParser.END_P)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class When_clause_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def when_clause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.When_clauseContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.When_clauseContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_when_clause_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWhen_clause_list" ):
                listener.enterWhen_clause_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWhen_clause_list" ):
                listener.exitWhen_clause_list(self)




    def when_clause_list(self):

        localctx = PostgreSQLParser.When_clause_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1310, self.RULE_when_clause_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9649 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 9648
                self.when_clause()
                self.state = 9651 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==102):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class When_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,i)


        def THEN(self):
            return self.getToken(PostgreSQLParser.THEN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_when_clause

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterWhen_clause" ):
                listener.enterWhen_clause(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitWhen_clause" ):
                listener.exitWhen_clause(self)




    def when_clause(self):

        localctx = PostgreSQLParser.When_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1312, self.RULE_when_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9653
            self.match(PostgreSQLParser.WHEN)
            self.state = 9654
            self.a_expr()
            self.state = 9655
            self.match(PostgreSQLParser.THEN)
            self.state = 9656
            self.a_expr()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Case_defaultContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ELSE(self):
            return self.getToken(PostgreSQLParser.ELSE, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_case_default

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCase_default" ):
                listener.enterCase_default(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCase_default" ):
                listener.exitCase_default(self)




    def case_default(self):

        localctx = PostgreSQLParser.Case_defaultContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1314, self.RULE_case_default)
        try:
            self.state = 9661
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [58]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9658
                self.match(PostgreSQLParser.ELSE)
                self.state = 9659
                self.a_expr()
                pass
            elif token in [454]:
                self.enterOuterAlt(localctx, 2)

                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 Case_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_case_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCase_arg" ):
                listener.enterCase_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCase_arg" ):
                listener.exitCase_arg(self)




    def case_arg(self):

        localctx = PostgreSQLParser.Case_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1316, self.RULE_case_arg)
        try:
            self.state = 9665
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 12, 13, 28, 29, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 77, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9663
                self.a_expr()
                pass
            elif token in [102]:
                self.enterOuterAlt(localctx, 2)

                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 ColumnrefContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def indirection(self):
            return self.getTypedRuleContext(PostgreSQLParser.IndirectionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_columnref

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterColumnref" ):
                listener.enterColumnref(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitColumnref" ):
                listener.exitColumnref(self)




    def columnref(self):

        localctx = PostgreSQLParser.ColumnrefContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1318, self.RULE_columnref)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9667
            self.colid()
            self.state = 9669
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,634,self._ctx)
            if la_ == 1:
                self.state = 9668
                self.indirection()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Indirection_elContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DOT(self):
            return self.getToken(PostgreSQLParser.DOT, 0)

        def attr_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Attr_nameContext,0)


        def STAR(self):
            return self.getToken(PostgreSQLParser.STAR, 0)

        def OPEN_BRACKET(self):
            return self.getToken(PostgreSQLParser.OPEN_BRACKET, 0)

        def CLOSE_BRACKET(self):
            return self.getToken(PostgreSQLParser.CLOSE_BRACKET, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def opt_slice_bound(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Opt_slice_boundContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Opt_slice_boundContext,i)


        def COLON(self):
            return self.getToken(PostgreSQLParser.COLON, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_indirection_el

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIndirection_el" ):
                listener.enterIndirection_el(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIndirection_el" ):
                listener.exitIndirection_el(self)




    def indirection_el(self):

        localctx = PostgreSQLParser.Indirection_elContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1320, self.RULE_indirection_el)
        try:
            self.state = 9686
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [11]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9671
                self.match(PostgreSQLParser.DOT)
                self.state = 9674
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                    self.state = 9672
                    self.attr_name()
                    pass
                elif token in [9]:
                    self.state = 9673
                    self.match(PostgreSQLParser.STAR)
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [4]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9676
                self.match(PostgreSQLParser.OPEN_BRACKET)
                self.state = 9682
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,636,self._ctx)
                if la_ == 1:
                    self.state = 9677
                    self.a_expr()
                    pass

                elif la_ == 2:
                    self.state = 9678
                    self.opt_slice_bound()
                    self.state = 9679
                    self.match(PostgreSQLParser.COLON)
                    self.state = 9680
                    self.opt_slice_bound()
                    pass


                self.state = 9684
                self.match(PostgreSQLParser.CLOSE_BRACKET)
                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 Opt_slice_boundContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_slice_bound

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_slice_bound" ):
                listener.enterOpt_slice_bound(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_slice_bound" ):
                listener.exitOpt_slice_bound(self)




    def opt_slice_bound(self):

        localctx = PostgreSQLParser.Opt_slice_boundContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1322, self.RULE_opt_slice_bound)
        try:
            self.state = 9690
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 12, 13, 28, 29, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 77, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9688
                self.a_expr()
                pass
            elif token in [5, 8]:
                self.enterOuterAlt(localctx, 2)

                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 IndirectionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def indirection_el(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Indirection_elContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Indirection_elContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_indirection

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIndirection" ):
                listener.enterIndirection(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIndirection" ):
                listener.exitIndirection(self)




    def indirection(self):

        localctx = PostgreSQLParser.IndirectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1324, self.RULE_indirection)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9693 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 9692
                    self.indirection_el()

                else:
                    raise NoViableAltException(self)
                self.state = 9695 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,639,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 Opt_indirectionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def indirection_el(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Indirection_elContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Indirection_elContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_indirection

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_indirection" ):
                listener.enterOpt_indirection(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_indirection" ):
                listener.exitOpt_indirection(self)




    def opt_indirection(self):

        localctx = PostgreSQLParser.Opt_indirectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1326, self.RULE_opt_indirection)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9700
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,640,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 9697
                    self.indirection_el() 
                self.state = 9702
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,640,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 Opt_target_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def target_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Target_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_target_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_target_list" ):
                listener.enterOpt_target_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_target_list" ):
                listener.exitOpt_target_list(self)




    def opt_target_list(self):

        localctx = PostgreSQLParser.Opt_target_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1328, self.RULE_opt_target_list)
        try:
            self.state = 9705
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,641,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9703
                self.target_list()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Target_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def target_el(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Target_elContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Target_elContext,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_target_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTarget_list" ):
                listener.enterTarget_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTarget_list" ):
                listener.exitTarget_list(self)




    def target_list(self):

        localctx = PostgreSQLParser.Target_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1330, self.RULE_target_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9707
            self.target_el()
            self.state = 9712
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,642,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 9708
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 9709
                    self.target_el() 
                self.state = 9714
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,642,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 Target_elContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_target_el

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class Target_labelContext(Target_elContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a PostgreSQLParser.Target_elContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)
        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTarget_label" ):
                listener.enterTarget_label(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTarget_label" ):
                listener.exitTarget_label(self)


    class Target_starContext(Target_elContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a PostgreSQLParser.Target_elContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def STAR(self):
            return self.getToken(PostgreSQLParser.STAR, 0)

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTarget_star" ):
                listener.enterTarget_star(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTarget_star" ):
                listener.exitTarget_star(self)



    def target_el(self):

        localctx = PostgreSQLParser.Target_elContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1332, self.RULE_target_el)
        try:
            self.state = 9723
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [2, 12, 13, 28, 29, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 77, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                localctx = PostgreSQLParser.Target_labelContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 9715
                self.a_expr()
                self.state = 9720
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,643,self._ctx)
                if la_ == 1:
                    self.state = 9716
                    self.match(PostgreSQLParser.AS)
                    self.state = 9717
                    self.collabel()
                    pass

                elif la_ == 2:
                    self.state = 9718
                    self.identifier()
                    pass

                elif la_ == 3:
                    pass


                pass
            elif token in [9]:
                localctx = PostgreSQLParser.Target_starContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 9722
                self.match(PostgreSQLParser.STAR)
                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 Qualified_name_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def qualified_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Qualified_nameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Qualified_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_qualified_name_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterQualified_name_list" ):
                listener.enterQualified_name_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitQualified_name_list" ):
                listener.exitQualified_name_list(self)




    def qualified_name_list(self):

        localctx = PostgreSQLParser.Qualified_name_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1334, self.RULE_qualified_name_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9725
            self.qualified_name()
            self.state = 9730
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 9726
                self.match(PostgreSQLParser.COMMA)
                self.state = 9727
                self.qualified_name()
                self.state = 9732
                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 Qualified_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def indirection(self):
            return self.getTypedRuleContext(PostgreSQLParser.IndirectionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_qualified_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterQualified_name" ):
                listener.enterQualified_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitQualified_name" ):
                listener.exitQualified_name(self)




    def qualified_name(self):

        localctx = PostgreSQLParser.Qualified_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1336, self.RULE_qualified_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9733
            self.colid()
            self.state = 9735
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==4 or _la==11:
                self.state = 9734
                self.indirection()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Name_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.NameContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.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_name_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterName_list" ):
                listener.enterName_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitName_list" ):
                listener.exitName_list(self)




    def name_list(self):

        localctx = PostgreSQLParser.Name_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1338, self.RULE_name_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9737
            self.name()
            self.state = 9742
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 9738
                self.match(PostgreSQLParser.COMMA)
                self.state = 9739
                self.name()
                self.state = 9744
                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 NameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterName" ):
                listener.enterName(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitName" ):
                listener.exitName(self)




    def name(self):

        localctx = PostgreSQLParser.NameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1340, self.RULE_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9745
            self.colid()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Attr_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def collabel(self):
            return self.getTypedRuleContext(PostgreSQLParser.CollabelContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_attr_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAttr_name" ):
                listener.enterAttr_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAttr_name" ):
                listener.exitAttr_name(self)




    def attr_name(self):

        localctx = PostgreSQLParser.Attr_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1342, self.RULE_attr_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9747
            self.collabel()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class File_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_file_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFile_name" ):
                listener.enterFile_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFile_name" ):
                listener.exitFile_name(self)




    def file_name(self):

        localctx = PostgreSQLParser.File_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1344, self.RULE_file_name)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9749
            self.sconst()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Func_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def builtin_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Builtin_function_nameContext,0)


        def type_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_function_nameContext,0)


        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def indirection(self):
            return self.getTypedRuleContext(PostgreSQLParser.IndirectionContext,0)


        def LEFT(self):
            return self.getToken(PostgreSQLParser.LEFT, 0)

        def RIGHT(self):
            return self.getToken(PostgreSQLParser.RIGHT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_func_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFunc_name" ):
                listener.enterFunc_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFunc_name" ):
                listener.exitFunc_name(self)




    def func_name(self):

        localctx = PostgreSQLParser.Func_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1346, self.RULE_func_name)
        try:
            self.state = 9758
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,648,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9751
                self.builtin_function_name()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9752
                self.type_function_name()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9753
                self.colid()
                self.state = 9754
                self.indirection()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9756
                self.match(PostgreSQLParser.LEFT)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 9757
                self.match(PostgreSQLParser.RIGHT)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AexprconstContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def fconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.FconstContext,0)


        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def bconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.BconstContext,0)


        def xconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.XconstContext,0)


        def func_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_nameContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def func_arg_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Func_arg_listContext,0)


        def opt_sort_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_sort_clauseContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def consttypename(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConsttypenameContext,0)


        def constinterval(self):
            return self.getTypedRuleContext(PostgreSQLParser.ConstintervalContext,0)


        def opt_interval(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_intervalContext,0)


        def TRUE_P(self):
            return self.getToken(PostgreSQLParser.TRUE_P, 0)

        def FALSE_P(self):
            return self.getToken(PostgreSQLParser.FALSE_P, 0)

        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_aexprconst

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAexprconst" ):
                listener.enterAexprconst(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAexprconst" ):
                listener.exitAexprconst(self)




    def aexprconst(self):

        localctx = PostgreSQLParser.AexprconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1348, self.RULE_aexprconst)
        try:
            self.state = 9792
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,651,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9760
                self.iconst()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9761
                self.fconst()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9762
                self.sconst()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9763
                self.bconst()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 9764
                self.xconst()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 9765
                self.func_name()
                self.state = 9773
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [645, 647, 649, 671]:
                    self.state = 9766
                    self.sconst()
                    pass
                elif token in [2]:
                    self.state = 9767
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 9768
                    self.func_arg_list()
                    self.state = 9769
                    self.opt_sort_clause()
                    self.state = 9770
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    self.state = 9771
                    self.sconst()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 9775
                self.consttypename()
                self.state = 9776
                self.sconst()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 9778
                self.constinterval()
                self.state = 9787
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [645, 647, 649, 671]:
                    self.state = 9779
                    self.sconst()
                    self.state = 9780
                    self.opt_interval()
                    pass
                elif token in [2]:
                    self.state = 9782
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 9783
                    self.iconst()
                    self.state = 9784
                    self.match(PostgreSQLParser.CLOSE_PAREN)
                    self.state = 9785
                    self.sconst()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 9789
                self.match(PostgreSQLParser.TRUE_P)
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 9790
                self.match(PostgreSQLParser.FALSE_P)
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 9791
                self.match(PostgreSQLParser.NULL_P)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class XconstContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def HexadecimalStringConstant(self):
            return self.getToken(PostgreSQLParser.HexadecimalStringConstant, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_xconst

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXconst" ):
                listener.enterXconst(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXconst" ):
                listener.exitXconst(self)




    def xconst(self):

        localctx = PostgreSQLParser.XconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1350, self.RULE_xconst)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9794
            self.match(PostgreSQLParser.HexadecimalStringConstant)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BconstContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BinaryStringConstant(self):
            return self.getToken(PostgreSQLParser.BinaryStringConstant, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_bconst

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBconst" ):
                listener.enterBconst(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBconst" ):
                listener.exitBconst(self)




    def bconst(self):

        localctx = PostgreSQLParser.BconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1352, self.RULE_bconst)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9796
            self.match(PostgreSQLParser.BinaryStringConstant)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FconstContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Numeric(self):
            return self.getToken(PostgreSQLParser.Numeric, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_fconst

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFconst" ):
                listener.enterFconst(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFconst" ):
                listener.exitFconst(self)




    def fconst(self):

        localctx = PostgreSQLParser.FconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1354, self.RULE_fconst)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9798
            self.match(PostgreSQLParser.Numeric)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IconstContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Integral(self):
            return self.getToken(PostgreSQLParser.Integral, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_iconst

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIconst" ):
                listener.enterIconst(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIconst" ):
                listener.exitIconst(self)




    def iconst(self):

        localctx = PostgreSQLParser.IconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1356, self.RULE_iconst)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9800
            self.match(PostgreSQLParser.Integral)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SconstContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def anysconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.AnysconstContext,0)


        def opt_uescape(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_uescapeContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sconst

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSconst" ):
                listener.enterSconst(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSconst" ):
                listener.exitSconst(self)




    def sconst(self):

        localctx = PostgreSQLParser.SconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1358, self.RULE_sconst)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9802
            self.anysconst()
            self.state = 9803
            self.opt_uescape()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AnysconstContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def StringConstant(self):
            return self.getToken(PostgreSQLParser.StringConstant, 0)

        def UnicodeEscapeStringConstant(self):
            return self.getToken(PostgreSQLParser.UnicodeEscapeStringConstant, 0)

        def BeginDollarStringConstant(self):
            return self.getToken(PostgreSQLParser.BeginDollarStringConstant, 0)

        def EndDollarStringConstant(self):
            return self.getToken(PostgreSQLParser.EndDollarStringConstant, 0)

        def DollarText(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.DollarText)
            else:
                return self.getToken(PostgreSQLParser.DollarText, i)

        def EscapeStringConstant(self):
            return self.getToken(PostgreSQLParser.EscapeStringConstant, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_anysconst

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAnysconst" ):
                listener.enterAnysconst(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAnysconst" ):
                listener.exitAnysconst(self)




    def anysconst(self):

        localctx = PostgreSQLParser.AnysconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1360, self.RULE_anysconst)
        self._la = 0 # Token type
        try:
            self.state = 9816
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [645]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9805
                self.match(PostgreSQLParser.StringConstant)
                pass
            elif token in [647]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9806
                self.match(PostgreSQLParser.UnicodeEscapeStringConstant)
                pass
            elif token in [649]:
                self.enterOuterAlt(localctx, 3)
                self.state = 9807
                self.match(PostgreSQLParser.BeginDollarStringConstant)
                self.state = 9811
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==677:
                    self.state = 9808
                    self.match(PostgreSQLParser.DollarText)
                    self.state = 9813
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 9814
                self.match(PostgreSQLParser.EndDollarStringConstant)
                pass
            elif token in [671]:
                self.enterOuterAlt(localctx, 4)
                self.state = 9815
                self.match(PostgreSQLParser.EscapeStringConstant)
                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 Opt_uescapeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def UESCAPE(self):
            return self.getToken(PostgreSQLParser.UESCAPE, 0)

        def anysconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.AnysconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_uescape

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_uescape" ):
                listener.enterOpt_uescape(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_uescape" ):
                listener.exitOpt_uescape(self)




    def opt_uescape(self):

        localctx = PostgreSQLParser.Opt_uescapeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1362, self.RULE_opt_uescape)
        try:
            self.state = 9821
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,654,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9818
                self.match(PostgreSQLParser.UESCAPE)
                self.state = 9819
                self.anysconst()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SignediconstContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,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_signediconst

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSignediconst" ):
                listener.enterSignediconst(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSignediconst" ):
                listener.exitSignediconst(self)




    def signediconst(self):

        localctx = PostgreSQLParser.SignediconstContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1364, self.RULE_signediconst)
        try:
            self.state = 9828
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [658]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9823
                self.iconst()
                pass
            elif token in [12]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9824
                self.match(PostgreSQLParser.PLUS)
                self.state = 9825
                self.iconst()
                pass
            elif token in [13]:
                self.enterOuterAlt(localctx, 3)
                self.state = 9826
                self.match(PostgreSQLParser.MINUS)
                self.state = 9827
                self.iconst()
                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 RoleidContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def rolespec(self):
            return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_roleid

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRoleid" ):
                listener.enterRoleid(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRoleid" ):
                listener.exitRoleid(self)




    def roleid(self):

        localctx = PostgreSQLParser.RoleidContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1366, self.RULE_roleid)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9830
            self.rolespec()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RolespecContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def nonreservedword(self):
            return self.getTypedRuleContext(PostgreSQLParser.NonreservedwordContext,0)


        def CURRENT_USER(self):
            return self.getToken(PostgreSQLParser.CURRENT_USER, 0)

        def SESSION_USER(self):
            return self.getToken(PostgreSQLParser.SESSION_USER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_rolespec

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRolespec" ):
                listener.enterRolespec(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRolespec" ):
                listener.exitRolespec(self)




    def rolespec(self):

        localctx = PostgreSQLParser.RolespecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1368, self.RULE_rolespec)
        try:
            self.state = 9835
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9832
                self.nonreservedword()
                pass
            elif token in [52]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9833
                self.match(PostgreSQLParser.CURRENT_USER)
                pass
            elif token in [89]:
                self.enterOuterAlt(localctx, 3)
                self.state = 9834
                self.match(PostgreSQLParser.SESSION_USER)
                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 Role_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def rolespec(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.RolespecContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.RolespecContext,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_role_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRole_list" ):
                listener.enterRole_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRole_list" ):
                listener.exitRole_list(self)




    def role_list(self):

        localctx = PostgreSQLParser.Role_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1370, self.RULE_role_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9837
            self.rolespec()
            self.state = 9842
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 9838
                self.match(PostgreSQLParser.COMMA)
                self.state = 9839
                self.rolespec()
                self.state = 9844
                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 ColidContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Unreserved_keywordContext,0)


        def col_name_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Col_name_keywordContext,0)


        def plsql_unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_unreserved_keywordContext,0)


        def LEFT(self):
            return self.getToken(PostgreSQLParser.LEFT, 0)

        def RIGHT(self):
            return self.getToken(PostgreSQLParser.RIGHT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_colid

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterColid" ):
                listener.enterColid(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitColid" ):
                listener.exitColid(self)




    def colid(self):

        localctx = PostgreSQLParser.ColidContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1372, self.RULE_colid)
        try:
            self.state = 9851
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,658,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9845
                self.identifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9846
                self.unreserved_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9847
                self.col_name_keyword()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9848
                self.plsql_unreserved_keyword()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 9849
                self.match(PostgreSQLParser.LEFT)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 9850
                self.match(PostgreSQLParser.RIGHT)
                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_aliasContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Unreserved_keywordContext,0)


        def col_name_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Col_name_keywordContext,0)


        def plsql_unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_unreserved_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_table_alias

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTable_alias" ):
                listener.enterTable_alias(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTable_alias" ):
                listener.exitTable_alias(self)




    def table_alias(self):

        localctx = PostgreSQLParser.Table_aliasContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1374, self.RULE_table_alias)
        try:
            self.state = 9857
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,659,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9853
                self.identifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9854
                self.unreserved_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9855
                self.col_name_keyword()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9856
                self.plsql_unreserved_keyword()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Type_function_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Unreserved_keywordContext,0)


        def plsql_unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_unreserved_keywordContext,0)


        def type_func_name_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_func_name_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_type_function_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterType_function_name" ):
                listener.enterType_function_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitType_function_name" ):
                listener.exitType_function_name(self)




    def type_function_name(self):

        localctx = PostgreSQLParser.Type_function_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1376, self.RULE_type_function_name)
        try:
            self.state = 9863
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,660,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9859
                self.identifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9860
                self.unreserved_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9861
                self.plsql_unreserved_keyword()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9862
                self.type_func_name_keyword()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NonreservedwordContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Unreserved_keywordContext,0)


        def col_name_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Col_name_keywordContext,0)


        def type_func_name_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_func_name_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_nonreservedword

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNonreservedword" ):
                listener.enterNonreservedword(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNonreservedword" ):
                listener.exitNonreservedword(self)




    def nonreservedword(self):

        localctx = PostgreSQLParser.NonreservedwordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1378, self.RULE_nonreservedword)
        try:
            self.state = 9869
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,661,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9865
                self.identifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9866
                self.unreserved_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9867
                self.col_name_keyword()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9868
                self.type_func_name_keyword()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CollabelContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def plsql_unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_unreserved_keywordContext,0)


        def unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Unreserved_keywordContext,0)


        def col_name_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Col_name_keywordContext,0)


        def type_func_name_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Type_func_name_keywordContext,0)


        def reserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reserved_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_collabel

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCollabel" ):
                listener.enterCollabel(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCollabel" ):
                listener.exitCollabel(self)




    def collabel(self):

        localctx = PostgreSQLParser.CollabelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1380, self.RULE_collabel)
        try:
            self.state = 9877
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,662,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9871
                self.identifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9872
                self.plsql_unreserved_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9873
                self.unreserved_keyword()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9874
                self.col_name_keyword()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 9875
                self.type_func_name_keyword()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 9876
                self.reserved_keyword()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IdentifierContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Identifier(self):
            return self.getToken(PostgreSQLParser.Identifier, 0)

        def opt_uescape(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_uescapeContext,0)


        def QuotedIdentifier(self):
            return self.getToken(PostgreSQLParser.QuotedIdentifier, 0)

        def UnicodeQuotedIdentifier(self):
            return self.getToken(PostgreSQLParser.UnicodeQuotedIdentifier, 0)

        def plsqlvariablename(self):
            return self.getTypedRuleContext(PostgreSQLParser.PlsqlvariablenameContext,0)


        def plsqlidentifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.PlsqlidentifierContext,0)


        def plsql_unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_unreserved_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_identifier

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIdentifier" ):
                listener.enterIdentifier(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIdentifier" ):
                listener.exitIdentifier(self)




    def identifier(self):

        localctx = PostgreSQLParser.IdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1382, self.RULE_identifier)
        try:
            self.state = 9886
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [636]:
                self.enterOuterAlt(localctx, 1)
                self.state = 9879
                self.match(PostgreSQLParser.Identifier)
                self.state = 9880
                self.opt_uescape()
                pass
            elif token in [637]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9881
                self.match(PostgreSQLParser.QuotedIdentifier)
                pass
            elif token in [641]:
                self.enterOuterAlt(localctx, 3)
                self.state = 9882
                self.match(PostgreSQLParser.UnicodeQuotedIdentifier)
                pass
            elif token in [661]:
                self.enterOuterAlt(localctx, 4)
                self.state = 9883
                self.plsqlvariablename()
                pass
            elif token in [662]:
                self.enterOuterAlt(localctx, 5)
                self.state = 9884
                self.plsqlidentifier()
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 123, 130, 144, 153, 157, 161, 167, 172, 207, 210, 232, 240, 258, 261, 262, 272, 286, 300, 306, 312, 316, 317, 326, 353, 433, 434, 477, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 506, 507, 508, 509, 510, 511, 512, 514, 515, 516, 517, 518, 520]:
                self.enterOuterAlt(localctx, 6)
                self.state = 9885
                self.plsql_unreserved_keyword()
                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 PlsqlidentifierContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PLSQLIDENTIFIER(self):
            return self.getToken(PostgreSQLParser.PLSQLIDENTIFIER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_plsqlidentifier

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPlsqlidentifier" ):
                listener.enterPlsqlidentifier(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPlsqlidentifier" ):
                listener.exitPlsqlidentifier(self)




    def plsqlidentifier(self):

        localctx = PostgreSQLParser.PlsqlidentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1384, self.RULE_plsqlidentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9888
            self.match(PostgreSQLParser.PLSQLIDENTIFIER)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Unreserved_keywordContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ABORT_P(self):
            return self.getToken(PostgreSQLParser.ABORT_P, 0)

        def ABSOLUTE_P(self):
            return self.getToken(PostgreSQLParser.ABSOLUTE_P, 0)

        def ACCESS(self):
            return self.getToken(PostgreSQLParser.ACCESS, 0)

        def ACTION(self):
            return self.getToken(PostgreSQLParser.ACTION, 0)

        def ADD_P(self):
            return self.getToken(PostgreSQLParser.ADD_P, 0)

        def ADMIN(self):
            return self.getToken(PostgreSQLParser.ADMIN, 0)

        def AFTER(self):
            return self.getToken(PostgreSQLParser.AFTER, 0)

        def AGGREGATE(self):
            return self.getToken(PostgreSQLParser.AGGREGATE, 0)

        def ALSO(self):
            return self.getToken(PostgreSQLParser.ALSO, 0)

        def ALTER(self):
            return self.getToken(PostgreSQLParser.ALTER, 0)

        def ALWAYS(self):
            return self.getToken(PostgreSQLParser.ALWAYS, 0)

        def ASSERTION(self):
            return self.getToken(PostgreSQLParser.ASSERTION, 0)

        def ASSIGNMENT(self):
            return self.getToken(PostgreSQLParser.ASSIGNMENT, 0)

        def AT(self):
            return self.getToken(PostgreSQLParser.AT, 0)

        def ATTACH(self):
            return self.getToken(PostgreSQLParser.ATTACH, 0)

        def ATTRIBUTE(self):
            return self.getToken(PostgreSQLParser.ATTRIBUTE, 0)

        def BACKWARD(self):
            return self.getToken(PostgreSQLParser.BACKWARD, 0)

        def BEFORE(self):
            return self.getToken(PostgreSQLParser.BEFORE, 0)

        def BEGIN_P(self):
            return self.getToken(PostgreSQLParser.BEGIN_P, 0)

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def CACHE(self):
            return self.getToken(PostgreSQLParser.CACHE, 0)

        def CALL(self):
            return self.getToken(PostgreSQLParser.CALL, 0)

        def CALLED(self):
            return self.getToken(PostgreSQLParser.CALLED, 0)

        def CASCADE(self):
            return self.getToken(PostgreSQLParser.CASCADE, 0)

        def CASCADED(self):
            return self.getToken(PostgreSQLParser.CASCADED, 0)

        def CATALOG(self):
            return self.getToken(PostgreSQLParser.CATALOG, 0)

        def CHAIN(self):
            return self.getToken(PostgreSQLParser.CHAIN, 0)

        def CHARACTERISTICS(self):
            return self.getToken(PostgreSQLParser.CHARACTERISTICS, 0)

        def CHECKPOINT(self):
            return self.getToken(PostgreSQLParser.CHECKPOINT, 0)

        def CLASS(self):
            return self.getToken(PostgreSQLParser.CLASS, 0)

        def CLOSE(self):
            return self.getToken(PostgreSQLParser.CLOSE, 0)

        def CLUSTER(self):
            return self.getToken(PostgreSQLParser.CLUSTER, 0)

        def COLUMNS(self):
            return self.getToken(PostgreSQLParser.COLUMNS, 0)

        def COMMENT(self):
            return self.getToken(PostgreSQLParser.COMMENT, 0)

        def COMMENTS(self):
            return self.getToken(PostgreSQLParser.COMMENTS, 0)

        def COMMIT(self):
            return self.getToken(PostgreSQLParser.COMMIT, 0)

        def COMMITTED(self):
            return self.getToken(PostgreSQLParser.COMMITTED, 0)

        def CONFIGURATION(self):
            return self.getToken(PostgreSQLParser.CONFIGURATION, 0)

        def CONFLICT(self):
            return self.getToken(PostgreSQLParser.CONFLICT, 0)

        def CONNECTION(self):
            return self.getToken(PostgreSQLParser.CONNECTION, 0)

        def CONSTRAINTS(self):
            return self.getToken(PostgreSQLParser.CONSTRAINTS, 0)

        def CONTENT_P(self):
            return self.getToken(PostgreSQLParser.CONTENT_P, 0)

        def CONTINUE_P(self):
            return self.getToken(PostgreSQLParser.CONTINUE_P, 0)

        def CONVERSION_P(self):
            return self.getToken(PostgreSQLParser.CONVERSION_P, 0)

        def COPY(self):
            return self.getToken(PostgreSQLParser.COPY, 0)

        def COST(self):
            return self.getToken(PostgreSQLParser.COST, 0)

        def CSV(self):
            return self.getToken(PostgreSQLParser.CSV, 0)

        def CUBE(self):
            return self.getToken(PostgreSQLParser.CUBE, 0)

        def CURRENT_P(self):
            return self.getToken(PostgreSQLParser.CURRENT_P, 0)

        def CURSOR(self):
            return self.getToken(PostgreSQLParser.CURSOR, 0)

        def CYCLE(self):
            return self.getToken(PostgreSQLParser.CYCLE, 0)

        def DATA_P(self):
            return self.getToken(PostgreSQLParser.DATA_P, 0)

        def DATABASE(self):
            return self.getToken(PostgreSQLParser.DATABASE, 0)

        def DAY_P(self):
            return self.getToken(PostgreSQLParser.DAY_P, 0)

        def DEALLOCATE(self):
            return self.getToken(PostgreSQLParser.DEALLOCATE, 0)

        def DECLARE(self):
            return self.getToken(PostgreSQLParser.DECLARE, 0)

        def DEFAULTS(self):
            return self.getToken(PostgreSQLParser.DEFAULTS, 0)

        def DEFERRED(self):
            return self.getToken(PostgreSQLParser.DEFERRED, 0)

        def DEFINER(self):
            return self.getToken(PostgreSQLParser.DEFINER, 0)

        def DELETE_P(self):
            return self.getToken(PostgreSQLParser.DELETE_P, 0)

        def DELIMITER(self):
            return self.getToken(PostgreSQLParser.DELIMITER, 0)

        def DELIMITERS(self):
            return self.getToken(PostgreSQLParser.DELIMITERS, 0)

        def DEPENDS(self):
            return self.getToken(PostgreSQLParser.DEPENDS, 0)

        def DETACH(self):
            return self.getToken(PostgreSQLParser.DETACH, 0)

        def DICTIONARY(self):
            return self.getToken(PostgreSQLParser.DICTIONARY, 0)

        def DISABLE_P(self):
            return self.getToken(PostgreSQLParser.DISABLE_P, 0)

        def DISCARD(self):
            return self.getToken(PostgreSQLParser.DISCARD, 0)

        def DOCUMENT_P(self):
            return self.getToken(PostgreSQLParser.DOCUMENT_P, 0)

        def DOMAIN_P(self):
            return self.getToken(PostgreSQLParser.DOMAIN_P, 0)

        def DOUBLE_P(self):
            return self.getToken(PostgreSQLParser.DOUBLE_P, 0)

        def DROP(self):
            return self.getToken(PostgreSQLParser.DROP, 0)

        def EACH(self):
            return self.getToken(PostgreSQLParser.EACH, 0)

        def ENABLE_P(self):
            return self.getToken(PostgreSQLParser.ENABLE_P, 0)

        def ENCODING(self):
            return self.getToken(PostgreSQLParser.ENCODING, 0)

        def ENCRYPTED(self):
            return self.getToken(PostgreSQLParser.ENCRYPTED, 0)

        def ENUM_P(self):
            return self.getToken(PostgreSQLParser.ENUM_P, 0)

        def ESCAPE(self):
            return self.getToken(PostgreSQLParser.ESCAPE, 0)

        def EVENT(self):
            return self.getToken(PostgreSQLParser.EVENT, 0)

        def EXCLUDE(self):
            return self.getToken(PostgreSQLParser.EXCLUDE, 0)

        def EXCLUDING(self):
            return self.getToken(PostgreSQLParser.EXCLUDING, 0)

        def EXCLUSIVE(self):
            return self.getToken(PostgreSQLParser.EXCLUSIVE, 0)

        def EXECUTE(self):
            return self.getToken(PostgreSQLParser.EXECUTE, 0)

        def EXPLAIN(self):
            return self.getToken(PostgreSQLParser.EXPLAIN, 0)

        def EXPRESSION(self):
            return self.getToken(PostgreSQLParser.EXPRESSION, 0)

        def EXTENSION(self):
            return self.getToken(PostgreSQLParser.EXTENSION, 0)

        def EXTERNAL(self):
            return self.getToken(PostgreSQLParser.EXTERNAL, 0)

        def FAMILY(self):
            return self.getToken(PostgreSQLParser.FAMILY, 0)

        def FILTER(self):
            return self.getToken(PostgreSQLParser.FILTER, 0)

        def FIRST_P(self):
            return self.getToken(PostgreSQLParser.FIRST_P, 0)

        def FOLLOWING(self):
            return self.getToken(PostgreSQLParser.FOLLOWING, 0)

        def FORCE(self):
            return self.getToken(PostgreSQLParser.FORCE, 0)

        def FORWARD(self):
            return self.getToken(PostgreSQLParser.FORWARD, 0)

        def FUNCTION(self):
            return self.getToken(PostgreSQLParser.FUNCTION, 0)

        def FUNCTIONS(self):
            return self.getToken(PostgreSQLParser.FUNCTIONS, 0)

        def GENERATED(self):
            return self.getToken(PostgreSQLParser.GENERATED, 0)

        def GLOBAL(self):
            return self.getToken(PostgreSQLParser.GLOBAL, 0)

        def GRANTED(self):
            return self.getToken(PostgreSQLParser.GRANTED, 0)

        def GROUPS(self):
            return self.getToken(PostgreSQLParser.GROUPS, 0)

        def HANDLER(self):
            return self.getToken(PostgreSQLParser.HANDLER, 0)

        def HEADER_P(self):
            return self.getToken(PostgreSQLParser.HEADER_P, 0)

        def HOLD(self):
            return self.getToken(PostgreSQLParser.HOLD, 0)

        def HOUR_P(self):
            return self.getToken(PostgreSQLParser.HOUR_P, 0)

        def IDENTITY_P(self):
            return self.getToken(PostgreSQLParser.IDENTITY_P, 0)

        def IF_P(self):
            return self.getToken(PostgreSQLParser.IF_P, 0)

        def IMMEDIATE(self):
            return self.getToken(PostgreSQLParser.IMMEDIATE, 0)

        def IMMUTABLE(self):
            return self.getToken(PostgreSQLParser.IMMUTABLE, 0)

        def IMPLICIT_P(self):
            return self.getToken(PostgreSQLParser.IMPLICIT_P, 0)

        def IMPORT_P(self):
            return self.getToken(PostgreSQLParser.IMPORT_P, 0)

        def INCLUDE(self):
            return self.getToken(PostgreSQLParser.INCLUDE, 0)

        def INCLUDING(self):
            return self.getToken(PostgreSQLParser.INCLUDING, 0)

        def INCREMENT(self):
            return self.getToken(PostgreSQLParser.INCREMENT, 0)

        def INDEX(self):
            return self.getToken(PostgreSQLParser.INDEX, 0)

        def INDEXES(self):
            return self.getToken(PostgreSQLParser.INDEXES, 0)

        def INHERIT(self):
            return self.getToken(PostgreSQLParser.INHERIT, 0)

        def INHERITS(self):
            return self.getToken(PostgreSQLParser.INHERITS, 0)

        def INLINE_P(self):
            return self.getToken(PostgreSQLParser.INLINE_P, 0)

        def INPUT_P(self):
            return self.getToken(PostgreSQLParser.INPUT_P, 0)

        def INSENSITIVE(self):
            return self.getToken(PostgreSQLParser.INSENSITIVE, 0)

        def INSERT(self):
            return self.getToken(PostgreSQLParser.INSERT, 0)

        def INSTEAD(self):
            return self.getToken(PostgreSQLParser.INSTEAD, 0)

        def INVOKER(self):
            return self.getToken(PostgreSQLParser.INVOKER, 0)

        def ISOLATION(self):
            return self.getToken(PostgreSQLParser.ISOLATION, 0)

        def KEY(self):
            return self.getToken(PostgreSQLParser.KEY, 0)

        def LABEL(self):
            return self.getToken(PostgreSQLParser.LABEL, 0)

        def LANGUAGE(self):
            return self.getToken(PostgreSQLParser.LANGUAGE, 0)

        def LARGE_P(self):
            return self.getToken(PostgreSQLParser.LARGE_P, 0)

        def LAST_P(self):
            return self.getToken(PostgreSQLParser.LAST_P, 0)

        def LEAKPROOF(self):
            return self.getToken(PostgreSQLParser.LEAKPROOF, 0)

        def LEVEL(self):
            return self.getToken(PostgreSQLParser.LEVEL, 0)

        def LISTEN(self):
            return self.getToken(PostgreSQLParser.LISTEN, 0)

        def LOAD(self):
            return self.getToken(PostgreSQLParser.LOAD, 0)

        def LOCAL(self):
            return self.getToken(PostgreSQLParser.LOCAL, 0)

        def LOCATION(self):
            return self.getToken(PostgreSQLParser.LOCATION, 0)

        def LOCK_P(self):
            return self.getToken(PostgreSQLParser.LOCK_P, 0)

        def LOCKED(self):
            return self.getToken(PostgreSQLParser.LOCKED, 0)

        def LOGGED(self):
            return self.getToken(PostgreSQLParser.LOGGED, 0)

        def MAPPING(self):
            return self.getToken(PostgreSQLParser.MAPPING, 0)

        def MATCH(self):
            return self.getToken(PostgreSQLParser.MATCH, 0)

        def MATERIALIZED(self):
            return self.getToken(PostgreSQLParser.MATERIALIZED, 0)

        def MAXVALUE(self):
            return self.getToken(PostgreSQLParser.MAXVALUE, 0)

        def METHOD(self):
            return self.getToken(PostgreSQLParser.METHOD, 0)

        def MINUTE_P(self):
            return self.getToken(PostgreSQLParser.MINUTE_P, 0)

        def MINVALUE(self):
            return self.getToken(PostgreSQLParser.MINVALUE, 0)

        def MODE(self):
            return self.getToken(PostgreSQLParser.MODE, 0)

        def MONTH_P(self):
            return self.getToken(PostgreSQLParser.MONTH_P, 0)

        def MOVE(self):
            return self.getToken(PostgreSQLParser.MOVE, 0)

        def NAME_P(self):
            return self.getToken(PostgreSQLParser.NAME_P, 0)

        def NAMES(self):
            return self.getToken(PostgreSQLParser.NAMES, 0)

        def NEW(self):
            return self.getToken(PostgreSQLParser.NEW, 0)

        def NEXT(self):
            return self.getToken(PostgreSQLParser.NEXT, 0)

        def NFC(self):
            return self.getToken(PostgreSQLParser.NFC, 0)

        def NFD(self):
            return self.getToken(PostgreSQLParser.NFD, 0)

        def NFKC(self):
            return self.getToken(PostgreSQLParser.NFKC, 0)

        def NFKD(self):
            return self.getToken(PostgreSQLParser.NFKD, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def NORMALIZED(self):
            return self.getToken(PostgreSQLParser.NORMALIZED, 0)

        def NOTHING(self):
            return self.getToken(PostgreSQLParser.NOTHING, 0)

        def NOTIFY(self):
            return self.getToken(PostgreSQLParser.NOTIFY, 0)

        def NOWAIT(self):
            return self.getToken(PostgreSQLParser.NOWAIT, 0)

        def NULLS_P(self):
            return self.getToken(PostgreSQLParser.NULLS_P, 0)

        def OBJECT_P(self):
            return self.getToken(PostgreSQLParser.OBJECT_P, 0)

        def OF(self):
            return self.getToken(PostgreSQLParser.OF, 0)

        def OFF(self):
            return self.getToken(PostgreSQLParser.OFF, 0)

        def OIDS(self):
            return self.getToken(PostgreSQLParser.OIDS, 0)

        def OLD(self):
            return self.getToken(PostgreSQLParser.OLD, 0)

        def OPERATOR(self):
            return self.getToken(PostgreSQLParser.OPERATOR, 0)

        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def OPTIONS(self):
            return self.getToken(PostgreSQLParser.OPTIONS, 0)

        def ORDINALITY(self):
            return self.getToken(PostgreSQLParser.ORDINALITY, 0)

        def OTHERS(self):
            return self.getToken(PostgreSQLParser.OTHERS, 0)

        def OVER(self):
            return self.getToken(PostgreSQLParser.OVER, 0)

        def OVERRIDING(self):
            return self.getToken(PostgreSQLParser.OVERRIDING, 0)

        def OWNED(self):
            return self.getToken(PostgreSQLParser.OWNED, 0)

        def OWNER(self):
            return self.getToken(PostgreSQLParser.OWNER, 0)

        def PARALLEL(self):
            return self.getToken(PostgreSQLParser.PARALLEL, 0)

        def PARSER(self):
            return self.getToken(PostgreSQLParser.PARSER, 0)

        def PARTIAL(self):
            return self.getToken(PostgreSQLParser.PARTIAL, 0)

        def PARTITION(self):
            return self.getToken(PostgreSQLParser.PARTITION, 0)

        def PASSING(self):
            return self.getToken(PostgreSQLParser.PASSING, 0)

        def PASSWORD(self):
            return self.getToken(PostgreSQLParser.PASSWORD, 0)

        def PLANS(self):
            return self.getToken(PostgreSQLParser.PLANS, 0)

        def POLICY(self):
            return self.getToken(PostgreSQLParser.POLICY, 0)

        def PRECEDING(self):
            return self.getToken(PostgreSQLParser.PRECEDING, 0)

        def PREPARE(self):
            return self.getToken(PostgreSQLParser.PREPARE, 0)

        def PREPARED(self):
            return self.getToken(PostgreSQLParser.PREPARED, 0)

        def PRESERVE(self):
            return self.getToken(PostgreSQLParser.PRESERVE, 0)

        def PRIOR(self):
            return self.getToken(PostgreSQLParser.PRIOR, 0)

        def PRIVILEGES(self):
            return self.getToken(PostgreSQLParser.PRIVILEGES, 0)

        def PROCEDURAL(self):
            return self.getToken(PostgreSQLParser.PROCEDURAL, 0)

        def PROCEDURE(self):
            return self.getToken(PostgreSQLParser.PROCEDURE, 0)

        def PROCEDURES(self):
            return self.getToken(PostgreSQLParser.PROCEDURES, 0)

        def PROGRAM(self):
            return self.getToken(PostgreSQLParser.PROGRAM, 0)

        def PUBLICATION(self):
            return self.getToken(PostgreSQLParser.PUBLICATION, 0)

        def QUOTE(self):
            return self.getToken(PostgreSQLParser.QUOTE, 0)

        def RANGE(self):
            return self.getToken(PostgreSQLParser.RANGE, 0)

        def READ(self):
            return self.getToken(PostgreSQLParser.READ, 0)

        def REASSIGN(self):
            return self.getToken(PostgreSQLParser.REASSIGN, 0)

        def RECHECK(self):
            return self.getToken(PostgreSQLParser.RECHECK, 0)

        def RECURSIVE(self):
            return self.getToken(PostgreSQLParser.RECURSIVE, 0)

        def REF(self):
            return self.getToken(PostgreSQLParser.REF, 0)

        def REFERENCING(self):
            return self.getToken(PostgreSQLParser.REFERENCING, 0)

        def REFRESH(self):
            return self.getToken(PostgreSQLParser.REFRESH, 0)

        def REINDEX(self):
            return self.getToken(PostgreSQLParser.REINDEX, 0)

        def RELATIVE_P(self):
            return self.getToken(PostgreSQLParser.RELATIVE_P, 0)

        def RELEASE(self):
            return self.getToken(PostgreSQLParser.RELEASE, 0)

        def RENAME(self):
            return self.getToken(PostgreSQLParser.RENAME, 0)

        def REPEATABLE(self):
            return self.getToken(PostgreSQLParser.REPEATABLE, 0)

        def REPLICA(self):
            return self.getToken(PostgreSQLParser.REPLICA, 0)

        def RESET(self):
            return self.getToken(PostgreSQLParser.RESET, 0)

        def RESTART(self):
            return self.getToken(PostgreSQLParser.RESTART, 0)

        def RESTRICT(self):
            return self.getToken(PostgreSQLParser.RESTRICT, 0)

        def RETURNS(self):
            return self.getToken(PostgreSQLParser.RETURNS, 0)

        def REVOKE(self):
            return self.getToken(PostgreSQLParser.REVOKE, 0)

        def ROLE(self):
            return self.getToken(PostgreSQLParser.ROLE, 0)

        def ROLLBACK(self):
            return self.getToken(PostgreSQLParser.ROLLBACK, 0)

        def ROLLUP(self):
            return self.getToken(PostgreSQLParser.ROLLUP, 0)

        def ROUTINE(self):
            return self.getToken(PostgreSQLParser.ROUTINE, 0)

        def ROUTINES(self):
            return self.getToken(PostgreSQLParser.ROUTINES, 0)

        def ROWS(self):
            return self.getToken(PostgreSQLParser.ROWS, 0)

        def RULE(self):
            return self.getToken(PostgreSQLParser.RULE, 0)

        def SAVEPOINT(self):
            return self.getToken(PostgreSQLParser.SAVEPOINT, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def SCHEMAS(self):
            return self.getToken(PostgreSQLParser.SCHEMAS, 0)

        def SCROLL(self):
            return self.getToken(PostgreSQLParser.SCROLL, 0)

        def SEARCH(self):
            return self.getToken(PostgreSQLParser.SEARCH, 0)

        def SECOND_P(self):
            return self.getToken(PostgreSQLParser.SECOND_P, 0)

        def SECURITY(self):
            return self.getToken(PostgreSQLParser.SECURITY, 0)

        def SEQUENCE(self):
            return self.getToken(PostgreSQLParser.SEQUENCE, 0)

        def SEQUENCES(self):
            return self.getToken(PostgreSQLParser.SEQUENCES, 0)

        def SERIALIZABLE(self):
            return self.getToken(PostgreSQLParser.SERIALIZABLE, 0)

        def SERVER(self):
            return self.getToken(PostgreSQLParser.SERVER, 0)

        def SESSION(self):
            return self.getToken(PostgreSQLParser.SESSION, 0)

        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def SETS(self):
            return self.getToken(PostgreSQLParser.SETS, 0)

        def SHARE(self):
            return self.getToken(PostgreSQLParser.SHARE, 0)

        def SHOW(self):
            return self.getToken(PostgreSQLParser.SHOW, 0)

        def SIMPLE(self):
            return self.getToken(PostgreSQLParser.SIMPLE, 0)

        def SKIP_P(self):
            return self.getToken(PostgreSQLParser.SKIP_P, 0)

        def SNAPSHOT(self):
            return self.getToken(PostgreSQLParser.SNAPSHOT, 0)

        def SQL_P(self):
            return self.getToken(PostgreSQLParser.SQL_P, 0)

        def STABLE(self):
            return self.getToken(PostgreSQLParser.STABLE, 0)

        def STANDALONE_P(self):
            return self.getToken(PostgreSQLParser.STANDALONE_P, 0)

        def START(self):
            return self.getToken(PostgreSQLParser.START, 0)

        def STATEMENT(self):
            return self.getToken(PostgreSQLParser.STATEMENT, 0)

        def STATISTICS(self):
            return self.getToken(PostgreSQLParser.STATISTICS, 0)

        def STDIN(self):
            return self.getToken(PostgreSQLParser.STDIN, 0)

        def STDOUT(self):
            return self.getToken(PostgreSQLParser.STDOUT, 0)

        def STORAGE(self):
            return self.getToken(PostgreSQLParser.STORAGE, 0)

        def STORED(self):
            return self.getToken(PostgreSQLParser.STORED, 0)

        def STRICT_P(self):
            return self.getToken(PostgreSQLParser.STRICT_P, 0)

        def STRIP_P(self):
            return self.getToken(PostgreSQLParser.STRIP_P, 0)

        def SUBSCRIPTION(self):
            return self.getToken(PostgreSQLParser.SUBSCRIPTION, 0)

        def SUPPORT(self):
            return self.getToken(PostgreSQLParser.SUPPORT, 0)

        def SYSID(self):
            return self.getToken(PostgreSQLParser.SYSID, 0)

        def SYSTEM_P(self):
            return self.getToken(PostgreSQLParser.SYSTEM_P, 0)

        def TABLES(self):
            return self.getToken(PostgreSQLParser.TABLES, 0)

        def TABLESPACE(self):
            return self.getToken(PostgreSQLParser.TABLESPACE, 0)

        def TEMP(self):
            return self.getToken(PostgreSQLParser.TEMP, 0)

        def TEMPLATE(self):
            return self.getToken(PostgreSQLParser.TEMPLATE, 0)

        def TEMPORARY(self):
            return self.getToken(PostgreSQLParser.TEMPORARY, 0)

        def TEXT_P(self):
            return self.getToken(PostgreSQLParser.TEXT_P, 0)

        def TIES(self):
            return self.getToken(PostgreSQLParser.TIES, 0)

        def TRANSACTION(self):
            return self.getToken(PostgreSQLParser.TRANSACTION, 0)

        def TRANSFORM(self):
            return self.getToken(PostgreSQLParser.TRANSFORM, 0)

        def TRIGGER(self):
            return self.getToken(PostgreSQLParser.TRIGGER, 0)

        def TRUNCATE(self):
            return self.getToken(PostgreSQLParser.TRUNCATE, 0)

        def TRUSTED(self):
            return self.getToken(PostgreSQLParser.TRUSTED, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def TYPES_P(self):
            return self.getToken(PostgreSQLParser.TYPES_P, 0)

        def UESCAPE(self):
            return self.getToken(PostgreSQLParser.UESCAPE, 0)

        def UNBOUNDED(self):
            return self.getToken(PostgreSQLParser.UNBOUNDED, 0)

        def UNCOMMITTED(self):
            return self.getToken(PostgreSQLParser.UNCOMMITTED, 0)

        def UNENCRYPTED(self):
            return self.getToken(PostgreSQLParser.UNENCRYPTED, 0)

        def UNKNOWN(self):
            return self.getToken(PostgreSQLParser.UNKNOWN, 0)

        def UNLISTEN(self):
            return self.getToken(PostgreSQLParser.UNLISTEN, 0)

        def UNLOGGED(self):
            return self.getToken(PostgreSQLParser.UNLOGGED, 0)

        def UNTIL(self):
            return self.getToken(PostgreSQLParser.UNTIL, 0)

        def UPDATE(self):
            return self.getToken(PostgreSQLParser.UPDATE, 0)

        def VACUUM(self):
            return self.getToken(PostgreSQLParser.VACUUM, 0)

        def VALID(self):
            return self.getToken(PostgreSQLParser.VALID, 0)

        def VALIDATE(self):
            return self.getToken(PostgreSQLParser.VALIDATE, 0)

        def VALIDATOR(self):
            return self.getToken(PostgreSQLParser.VALIDATOR, 0)

        def VALUE_P(self):
            return self.getToken(PostgreSQLParser.VALUE_P, 0)

        def VARYING(self):
            return self.getToken(PostgreSQLParser.VARYING, 0)

        def VERSION_P(self):
            return self.getToken(PostgreSQLParser.VERSION_P, 0)

        def VIEW(self):
            return self.getToken(PostgreSQLParser.VIEW, 0)

        def VIEWS(self):
            return self.getToken(PostgreSQLParser.VIEWS, 0)

        def VOLATILE(self):
            return self.getToken(PostgreSQLParser.VOLATILE, 0)

        def WHITESPACE_P(self):
            return self.getToken(PostgreSQLParser.WHITESPACE_P, 0)

        def WITHIN(self):
            return self.getToken(PostgreSQLParser.WITHIN, 0)

        def WITHOUT(self):
            return self.getToken(PostgreSQLParser.WITHOUT, 0)

        def WORK(self):
            return self.getToken(PostgreSQLParser.WORK, 0)

        def WRAPPER(self):
            return self.getToken(PostgreSQLParser.WRAPPER, 0)

        def WRITE(self):
            return self.getToken(PostgreSQLParser.WRITE, 0)

        def XML_P(self):
            return self.getToken(PostgreSQLParser.XML_P, 0)

        def YEAR_P(self):
            return self.getToken(PostgreSQLParser.YEAR_P, 0)

        def YES_P(self):
            return self.getToken(PostgreSQLParser.YES_P, 0)

        def ZONE(self):
            return self.getToken(PostgreSQLParser.ZONE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_unreserved_keyword

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterUnreserved_keyword" ):
                listener.enterUnreserved_keyword(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitUnreserved_keyword" ):
                listener.exitUnreserved_keyword(self)




    def unreserved_keyword(self):

        localctx = PostgreSQLParser.Unreserved_keywordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1386, self.RULE_unreserved_keyword)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9890
            _la = self._input.LA(1)
            if not(((((_la - 124)) & ~0x3f) == 0 and ((1 << (_la - 124)) & -31) != 0) or ((((_la - 188)) & ~0x3f) == 0 and ((1 << (_la - 188)) & -4611686018427387905) != 0) or ((((_la - 252)) & ~0x3f) == 0 and ((1 << (_la - 252)) & -4503599627370499) != 0) or ((((_la - 316)) & ~0x3f) == 0 and ((1 << (_la - 316)) & -1) != 0) or ((((_la - 433)) & ~0x3f) == 0 and ((1 << (_la - 433)) & 72028319537692671) != 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 Col_name_keywordContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BETWEEN(self):
            return self.getToken(PostgreSQLParser.BETWEEN, 0)

        def BIGINT(self):
            return self.getToken(PostgreSQLParser.BIGINT, 0)

        def bit(self):
            return self.getTypedRuleContext(PostgreSQLParser.BitContext,0)


        def BOOLEAN_P(self):
            return self.getToken(PostgreSQLParser.BOOLEAN_P, 0)

        def CHAR_P(self):
            return self.getToken(PostgreSQLParser.CHAR_P, 0)

        def character(self):
            return self.getTypedRuleContext(PostgreSQLParser.CharacterContext,0)


        def COALESCE(self):
            return self.getToken(PostgreSQLParser.COALESCE, 0)

        def DEC(self):
            return self.getToken(PostgreSQLParser.DEC, 0)

        def DECIMAL_P(self):
            return self.getToken(PostgreSQLParser.DECIMAL_P, 0)

        def EXISTS(self):
            return self.getToken(PostgreSQLParser.EXISTS, 0)

        def EXTRACT(self):
            return self.getToken(PostgreSQLParser.EXTRACT, 0)

        def FLOAT_P(self):
            return self.getToken(PostgreSQLParser.FLOAT_P, 0)

        def GREATEST(self):
            return self.getToken(PostgreSQLParser.GREATEST, 0)

        def GROUPING(self):
            return self.getToken(PostgreSQLParser.GROUPING, 0)

        def INOUT(self):
            return self.getToken(PostgreSQLParser.INOUT, 0)

        def INT_P(self):
            return self.getToken(PostgreSQLParser.INT_P, 0)

        def INTEGER(self):
            return self.getToken(PostgreSQLParser.INTEGER, 0)

        def INTERVAL(self):
            return self.getToken(PostgreSQLParser.INTERVAL, 0)

        def LEAST(self):
            return self.getToken(PostgreSQLParser.LEAST, 0)

        def NATIONAL(self):
            return self.getToken(PostgreSQLParser.NATIONAL, 0)

        def NCHAR(self):
            return self.getToken(PostgreSQLParser.NCHAR, 0)

        def NONE(self):
            return self.getToken(PostgreSQLParser.NONE, 0)

        def NORMALIZE(self):
            return self.getToken(PostgreSQLParser.NORMALIZE, 0)

        def NULLIF(self):
            return self.getToken(PostgreSQLParser.NULLIF, 0)

        def numeric(self):
            return self.getTypedRuleContext(PostgreSQLParser.NumericContext,0)


        def OUT_P(self):
            return self.getToken(PostgreSQLParser.OUT_P, 0)

        def OVERLAY(self):
            return self.getToken(PostgreSQLParser.OVERLAY, 0)

        def POSITION(self):
            return self.getToken(PostgreSQLParser.POSITION, 0)

        def PRECISION(self):
            return self.getToken(PostgreSQLParser.PRECISION, 0)

        def REAL(self):
            return self.getToken(PostgreSQLParser.REAL, 0)

        def ROW(self):
            return self.getToken(PostgreSQLParser.ROW, 0)

        def SETOF(self):
            return self.getToken(PostgreSQLParser.SETOF, 0)

        def SMALLINT(self):
            return self.getToken(PostgreSQLParser.SMALLINT, 0)

        def SUBSTRING(self):
            return self.getToken(PostgreSQLParser.SUBSTRING, 0)

        def TIME(self):
            return self.getToken(PostgreSQLParser.TIME, 0)

        def TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.TIMESTAMP, 0)

        def TREAT(self):
            return self.getToken(PostgreSQLParser.TREAT, 0)

        def TRIM(self):
            return self.getToken(PostgreSQLParser.TRIM, 0)

        def VALUES(self):
            return self.getToken(PostgreSQLParser.VALUES, 0)

        def VARCHAR(self):
            return self.getToken(PostgreSQLParser.VARCHAR, 0)

        def XMLATTRIBUTES(self):
            return self.getToken(PostgreSQLParser.XMLATTRIBUTES, 0)

        def XMLCONCAT(self):
            return self.getToken(PostgreSQLParser.XMLCONCAT, 0)

        def XMLELEMENT(self):
            return self.getToken(PostgreSQLParser.XMLELEMENT, 0)

        def XMLEXISTS(self):
            return self.getToken(PostgreSQLParser.XMLEXISTS, 0)

        def XMLFOREST(self):
            return self.getToken(PostgreSQLParser.XMLFOREST, 0)

        def XMLNAMESPACES(self):
            return self.getToken(PostgreSQLParser.XMLNAMESPACES, 0)

        def XMLPARSE(self):
            return self.getToken(PostgreSQLParser.XMLPARSE, 0)

        def XMLPI(self):
            return self.getToken(PostgreSQLParser.XMLPI, 0)

        def XMLROOT(self):
            return self.getToken(PostgreSQLParser.XMLROOT, 0)

        def XMLSERIALIZE(self):
            return self.getToken(PostgreSQLParser.XMLSERIALIZE, 0)

        def XMLTABLE(self):
            return self.getToken(PostgreSQLParser.XMLTABLE, 0)

        def builtin_function_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Builtin_function_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_col_name_keyword

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCol_name_keyword" ):
                listener.enterCol_name_keyword(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCol_name_keyword" ):
                listener.exitCol_name_keyword(self)




    def col_name_keyword(self):

        localctx = PostgreSQLParser.Col_name_keywordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1388, self.RULE_col_name_keyword)
        try:
            self.state = 9944
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,664,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9892
                self.match(PostgreSQLParser.BETWEEN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9893
                self.match(PostgreSQLParser.BIGINT)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9894
                self.bit()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9895
                self.match(PostgreSQLParser.BOOLEAN_P)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 9896
                self.match(PostgreSQLParser.CHAR_P)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 9897
                self.character()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 9898
                self.match(PostgreSQLParser.COALESCE)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 9899
                self.match(PostgreSQLParser.DEC)
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 9900
                self.match(PostgreSQLParser.DECIMAL_P)
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 9901
                self.match(PostgreSQLParser.EXISTS)
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 9902
                self.match(PostgreSQLParser.EXTRACT)
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 9903
                self.match(PostgreSQLParser.FLOAT_P)
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 9904
                self.match(PostgreSQLParser.GREATEST)
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 9905
                self.match(PostgreSQLParser.GROUPING)
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 9906
                self.match(PostgreSQLParser.INOUT)
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 9907
                self.match(PostgreSQLParser.INT_P)
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 9908
                self.match(PostgreSQLParser.INTEGER)
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 9909
                self.match(PostgreSQLParser.INTERVAL)
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 9910
                self.match(PostgreSQLParser.LEAST)
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 9911
                self.match(PostgreSQLParser.NATIONAL)
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 9912
                self.match(PostgreSQLParser.NCHAR)
                pass

            elif la_ == 22:
                self.enterOuterAlt(localctx, 22)
                self.state = 9913
                self.match(PostgreSQLParser.NONE)
                pass

            elif la_ == 23:
                self.enterOuterAlt(localctx, 23)
                self.state = 9914
                self.match(PostgreSQLParser.NORMALIZE)
                pass

            elif la_ == 24:
                self.enterOuterAlt(localctx, 24)
                self.state = 9915
                self.match(PostgreSQLParser.NULLIF)
                pass

            elif la_ == 25:
                self.enterOuterAlt(localctx, 25)
                self.state = 9916
                self.numeric()
                pass

            elif la_ == 26:
                self.enterOuterAlt(localctx, 26)
                self.state = 9917
                self.match(PostgreSQLParser.OUT_P)
                pass

            elif la_ == 27:
                self.enterOuterAlt(localctx, 27)
                self.state = 9918
                self.match(PostgreSQLParser.OVERLAY)
                pass

            elif la_ == 28:
                self.enterOuterAlt(localctx, 28)
                self.state = 9919
                self.match(PostgreSQLParser.POSITION)
                pass

            elif la_ == 29:
                self.enterOuterAlt(localctx, 29)
                self.state = 9920
                self.match(PostgreSQLParser.PRECISION)
                pass

            elif la_ == 30:
                self.enterOuterAlt(localctx, 30)
                self.state = 9921
                self.match(PostgreSQLParser.REAL)
                pass

            elif la_ == 31:
                self.enterOuterAlt(localctx, 31)
                self.state = 9922
                self.match(PostgreSQLParser.ROW)
                pass

            elif la_ == 32:
                self.enterOuterAlt(localctx, 32)
                self.state = 9923
                self.match(PostgreSQLParser.SETOF)
                pass

            elif la_ == 33:
                self.enterOuterAlt(localctx, 33)
                self.state = 9924
                self.match(PostgreSQLParser.SMALLINT)
                pass

            elif la_ == 34:
                self.enterOuterAlt(localctx, 34)
                self.state = 9925
                self.match(PostgreSQLParser.SUBSTRING)
                pass

            elif la_ == 35:
                self.enterOuterAlt(localctx, 35)
                self.state = 9926
                self.match(PostgreSQLParser.TIME)
                pass

            elif la_ == 36:
                self.enterOuterAlt(localctx, 36)
                self.state = 9927
                self.match(PostgreSQLParser.TIMESTAMP)
                pass

            elif la_ == 37:
                self.enterOuterAlt(localctx, 37)
                self.state = 9928
                self.match(PostgreSQLParser.TREAT)
                pass

            elif la_ == 38:
                self.enterOuterAlt(localctx, 38)
                self.state = 9929
                self.match(PostgreSQLParser.TRIM)
                pass

            elif la_ == 39:
                self.enterOuterAlt(localctx, 39)
                self.state = 9930
                self.match(PostgreSQLParser.VALUES)
                pass

            elif la_ == 40:
                self.enterOuterAlt(localctx, 40)
                self.state = 9931
                self.match(PostgreSQLParser.VARCHAR)
                pass

            elif la_ == 41:
                self.enterOuterAlt(localctx, 41)
                self.state = 9932
                self.match(PostgreSQLParser.XMLATTRIBUTES)
                pass

            elif la_ == 42:
                self.enterOuterAlt(localctx, 42)
                self.state = 9933
                self.match(PostgreSQLParser.XMLCONCAT)
                pass

            elif la_ == 43:
                self.enterOuterAlt(localctx, 43)
                self.state = 9934
                self.match(PostgreSQLParser.XMLELEMENT)
                pass

            elif la_ == 44:
                self.enterOuterAlt(localctx, 44)
                self.state = 9935
                self.match(PostgreSQLParser.XMLEXISTS)
                pass

            elif la_ == 45:
                self.enterOuterAlt(localctx, 45)
                self.state = 9936
                self.match(PostgreSQLParser.XMLFOREST)
                pass

            elif la_ == 46:
                self.enterOuterAlt(localctx, 46)
                self.state = 9937
                self.match(PostgreSQLParser.XMLNAMESPACES)
                pass

            elif la_ == 47:
                self.enterOuterAlt(localctx, 47)
                self.state = 9938
                self.match(PostgreSQLParser.XMLPARSE)
                pass

            elif la_ == 48:
                self.enterOuterAlt(localctx, 48)
                self.state = 9939
                self.match(PostgreSQLParser.XMLPI)
                pass

            elif la_ == 49:
                self.enterOuterAlt(localctx, 49)
                self.state = 9940
                self.match(PostgreSQLParser.XMLROOT)
                pass

            elif la_ == 50:
                self.enterOuterAlt(localctx, 50)
                self.state = 9941
                self.match(PostgreSQLParser.XMLSERIALIZE)
                pass

            elif la_ == 51:
                self.enterOuterAlt(localctx, 51)
                self.state = 9942
                self.match(PostgreSQLParser.XMLTABLE)
                pass

            elif la_ == 52:
                self.enterOuterAlt(localctx, 52)
                self.state = 9943
                self.builtin_function_name()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Type_func_name_keywordContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AUTHORIZATION(self):
            return self.getToken(PostgreSQLParser.AUTHORIZATION, 0)

        def BINARY(self):
            return self.getToken(PostgreSQLParser.BINARY, 0)

        def COLLATION(self):
            return self.getToken(PostgreSQLParser.COLLATION, 0)

        def CONCURRENTLY(self):
            return self.getToken(PostgreSQLParser.CONCURRENTLY, 0)

        def CROSS(self):
            return self.getToken(PostgreSQLParser.CROSS, 0)

        def CURRENT_SCHEMA(self):
            return self.getToken(PostgreSQLParser.CURRENT_SCHEMA, 0)

        def FREEZE(self):
            return self.getToken(PostgreSQLParser.FREEZE, 0)

        def FULL(self):
            return self.getToken(PostgreSQLParser.FULL, 0)

        def ILIKE(self):
            return self.getToken(PostgreSQLParser.ILIKE, 0)

        def INNER_P(self):
            return self.getToken(PostgreSQLParser.INNER_P, 0)

        def IS(self):
            return self.getToken(PostgreSQLParser.IS, 0)

        def ISNULL(self):
            return self.getToken(PostgreSQLParser.ISNULL, 0)

        def JOIN(self):
            return self.getToken(PostgreSQLParser.JOIN, 0)

        def LIKE(self):
            return self.getToken(PostgreSQLParser.LIKE, 0)

        def NATURAL(self):
            return self.getToken(PostgreSQLParser.NATURAL, 0)

        def NOTNULL(self):
            return self.getToken(PostgreSQLParser.NOTNULL, 0)

        def OUTER_P(self):
            return self.getToken(PostgreSQLParser.OUTER_P, 0)

        def OVERLAPS(self):
            return self.getToken(PostgreSQLParser.OVERLAPS, 0)

        def SIMILAR(self):
            return self.getToken(PostgreSQLParser.SIMILAR, 0)

        def TABLESAMPLE(self):
            return self.getToken(PostgreSQLParser.TABLESAMPLE, 0)

        def VERBOSE(self):
            return self.getToken(PostgreSQLParser.VERBOSE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_type_func_name_keyword

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterType_func_name_keyword" ):
                listener.enterType_func_name_keyword(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitType_func_name_keyword" ):
                listener.exitType_func_name_keyword(self)




    def type_func_name_keyword(self):

        localctx = PostgreSQLParser.Type_func_name_keywordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1390, self.RULE_type_func_name_keyword)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9946
            _la = self._input.LA(1)
            if not(((((_la - 106)) & ~0x3f) == 0 and ((1 << (_la - 106)) & 7069695) != 0) or _la==472):
                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 Reserved_keywordContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def ANALYSE(self):
            return self.getToken(PostgreSQLParser.ANALYSE, 0)

        def ANALYZE(self):
            return self.getToken(PostgreSQLParser.ANALYZE, 0)

        def AND(self):
            return self.getToken(PostgreSQLParser.AND, 0)

        def ANY(self):
            return self.getToken(PostgreSQLParser.ANY, 0)

        def ARRAY(self):
            return self.getToken(PostgreSQLParser.ARRAY, 0)

        def AS(self):
            return self.getToken(PostgreSQLParser.AS, 0)

        def ASC(self):
            return self.getToken(PostgreSQLParser.ASC, 0)

        def ASYMMETRIC(self):
            return self.getToken(PostgreSQLParser.ASYMMETRIC, 0)

        def BOTH(self):
            return self.getToken(PostgreSQLParser.BOTH, 0)

        def CASE(self):
            return self.getToken(PostgreSQLParser.CASE, 0)

        def CAST(self):
            return self.getToken(PostgreSQLParser.CAST, 0)

        def CHECK(self):
            return self.getToken(PostgreSQLParser.CHECK, 0)

        def COLLATE(self):
            return self.getToken(PostgreSQLParser.COLLATE, 0)

        def COLUMN(self):
            return self.getToken(PostgreSQLParser.COLUMN, 0)

        def CONSTRAINT(self):
            return self.getToken(PostgreSQLParser.CONSTRAINT, 0)

        def CREATE(self):
            return self.getToken(PostgreSQLParser.CREATE, 0)

        def CURRENT_CATALOG(self):
            return self.getToken(PostgreSQLParser.CURRENT_CATALOG, 0)

        def CURRENT_DATE(self):
            return self.getToken(PostgreSQLParser.CURRENT_DATE, 0)

        def CURRENT_ROLE(self):
            return self.getToken(PostgreSQLParser.CURRENT_ROLE, 0)

        def CURRENT_TIME(self):
            return self.getToken(PostgreSQLParser.CURRENT_TIME, 0)

        def CURRENT_TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.CURRENT_TIMESTAMP, 0)

        def CURRENT_USER(self):
            return self.getToken(PostgreSQLParser.CURRENT_USER, 0)

        def DEFERRABLE(self):
            return self.getToken(PostgreSQLParser.DEFERRABLE, 0)

        def DESC(self):
            return self.getToken(PostgreSQLParser.DESC, 0)

        def DISTINCT(self):
            return self.getToken(PostgreSQLParser.DISTINCT, 0)

        def DO(self):
            return self.getToken(PostgreSQLParser.DO, 0)

        def ELSE(self):
            return self.getToken(PostgreSQLParser.ELSE, 0)

        def END_P(self):
            return self.getToken(PostgreSQLParser.END_P, 0)

        def EXCEPT(self):
            return self.getToken(PostgreSQLParser.EXCEPT, 0)

        def FALSE_P(self):
            return self.getToken(PostgreSQLParser.FALSE_P, 0)

        def FETCH(self):
            return self.getToken(PostgreSQLParser.FETCH, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def FOREIGN(self):
            return self.getToken(PostgreSQLParser.FOREIGN, 0)

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def GRANT(self):
            return self.getToken(PostgreSQLParser.GRANT, 0)

        def GROUP_P(self):
            return self.getToken(PostgreSQLParser.GROUP_P, 0)

        def HAVING(self):
            return self.getToken(PostgreSQLParser.HAVING, 0)

        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def INITIALLY(self):
            return self.getToken(PostgreSQLParser.INITIALLY, 0)

        def INTERSECT(self):
            return self.getToken(PostgreSQLParser.INTERSECT, 0)

        def LATERAL_P(self):
            return self.getToken(PostgreSQLParser.LATERAL_P, 0)

        def LEADING(self):
            return self.getToken(PostgreSQLParser.LEADING, 0)

        def LIMIT(self):
            return self.getToken(PostgreSQLParser.LIMIT, 0)

        def LOCALTIME(self):
            return self.getToken(PostgreSQLParser.LOCALTIME, 0)

        def LOCALTIMESTAMP(self):
            return self.getToken(PostgreSQLParser.LOCALTIMESTAMP, 0)

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def OFFSET(self):
            return self.getToken(PostgreSQLParser.OFFSET, 0)

        def ON(self):
            return self.getToken(PostgreSQLParser.ON, 0)

        def ONLY(self):
            return self.getToken(PostgreSQLParser.ONLY, 0)

        def OR(self):
            return self.getToken(PostgreSQLParser.OR, 0)

        def ORDER(self):
            return self.getToken(PostgreSQLParser.ORDER, 0)

        def PLACING(self):
            return self.getToken(PostgreSQLParser.PLACING, 0)

        def PRIMARY(self):
            return self.getToken(PostgreSQLParser.PRIMARY, 0)

        def REFERENCES(self):
            return self.getToken(PostgreSQLParser.REFERENCES, 0)

        def RETURNING(self):
            return self.getToken(PostgreSQLParser.RETURNING, 0)

        def SELECT(self):
            return self.getToken(PostgreSQLParser.SELECT, 0)

        def SESSION_USER(self):
            return self.getToken(PostgreSQLParser.SESSION_USER, 0)

        def SOME(self):
            return self.getToken(PostgreSQLParser.SOME, 0)

        def SYMMETRIC(self):
            return self.getToken(PostgreSQLParser.SYMMETRIC, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def THEN(self):
            return self.getToken(PostgreSQLParser.THEN, 0)

        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def TRAILING(self):
            return self.getToken(PostgreSQLParser.TRAILING, 0)

        def TRUE_P(self):
            return self.getToken(PostgreSQLParser.TRUE_P, 0)

        def UNION(self):
            return self.getToken(PostgreSQLParser.UNION, 0)

        def UNIQUE(self):
            return self.getToken(PostgreSQLParser.UNIQUE, 0)

        def USER(self):
            return self.getToken(PostgreSQLParser.USER, 0)

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def VARIADIC(self):
            return self.getToken(PostgreSQLParser.VARIADIC, 0)

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def WHERE(self):
            return self.getToken(PostgreSQLParser.WHERE, 0)

        def WINDOW(self):
            return self.getToken(PostgreSQLParser.WINDOW, 0)

        def WITH(self):
            return self.getToken(PostgreSQLParser.WITH, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_reserved_keyword

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterReserved_keyword" ):
                listener.enterReserved_keyword(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitReserved_keyword" ):
                listener.exitReserved_keyword(self)




    def reserved_keyword(self):

        localctx = PostgreSQLParser.Reserved_keywordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1392, self.RULE_reserved_keyword)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9948
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & -9007200328482816) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & 4398046510975) != 0) or _la==454):
                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 Builtin_function_nameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def XMLCOMMENT(self):
            return self.getToken(PostgreSQLParser.XMLCOMMENT, 0)

        def XML_IS_WELL_FORMED(self):
            return self.getToken(PostgreSQLParser.XML_IS_WELL_FORMED, 0)

        def XML_IS_WELL_FORMED_DOCUMENT(self):
            return self.getToken(PostgreSQLParser.XML_IS_WELL_FORMED_DOCUMENT, 0)

        def XML_IS_WELL_FORMED_CONTENT(self):
            return self.getToken(PostgreSQLParser.XML_IS_WELL_FORMED_CONTENT, 0)

        def XMLAGG(self):
            return self.getToken(PostgreSQLParser.XMLAGG, 0)

        def XPATH(self):
            return self.getToken(PostgreSQLParser.XPATH, 0)

        def XPATH_EXISTS(self):
            return self.getToken(PostgreSQLParser.XPATH_EXISTS, 0)

        def ABS(self):
            return self.getToken(PostgreSQLParser.ABS, 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 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 FACTORIAL(self):
            return self.getToken(PostgreSQLParser.FACTORIAL, 0)

        def FLOOR(self):
            return self.getToken(PostgreSQLParser.FLOOR, 0)

        def GCD(self):
            return self.getToken(PostgreSQLParser.GCD, 0)

        def LCM(self):
            return self.getToken(PostgreSQLParser.LCM, 0)

        def LN(self):
            return self.getToken(PostgreSQLParser.LN, 0)

        def LOG(self):
            return self.getToken(PostgreSQLParser.LOG, 0)

        def LOG10(self):
            return self.getToken(PostgreSQLParser.LOG10, 0)

        def MIN_SCALE(self):
            return self.getToken(PostgreSQLParser.MIN_SCALE, 0)

        def MOD(self):
            return self.getToken(PostgreSQLParser.MOD, 0)

        def PI(self):
            return self.getToken(PostgreSQLParser.PI, 0)

        def POWER(self):
            return self.getToken(PostgreSQLParser.POWER, 0)

        def RADIANS(self):
            return self.getToken(PostgreSQLParser.RADIANS, 0)

        def ROUND(self):
            return self.getToken(PostgreSQLParser.ROUND, 0)

        def SCALE(self):
            return self.getToken(PostgreSQLParser.SCALE, 0)

        def SIGN(self):
            return self.getToken(PostgreSQLParser.SIGN, 0)

        def SQRT(self):
            return self.getToken(PostgreSQLParser.SQRT, 0)

        def TRIM_SCALE(self):
            return self.getToken(PostgreSQLParser.TRIM_SCALE, 0)

        def TRUNC(self):
            return self.getToken(PostgreSQLParser.TRUNC, 0)

        def WIDTH_BUCKET(self):
            return self.getToken(PostgreSQLParser.WIDTH_BUCKET, 0)

        def RANDOM(self):
            return self.getToken(PostgreSQLParser.RANDOM, 0)

        def SETSEED(self):
            return self.getToken(PostgreSQLParser.SETSEED, 0)

        def ACOS(self):
            return self.getToken(PostgreSQLParser.ACOS, 0)

        def ACOSD(self):
            return self.getToken(PostgreSQLParser.ACOSD, 0)

        def ACOSH(self):
            return self.getToken(PostgreSQLParser.ACOSH, 0)

        def ASIN(self):
            return self.getToken(PostgreSQLParser.ASIN, 0)

        def ASIND(self):
            return self.getToken(PostgreSQLParser.ASIND, 0)

        def ASINH(self):
            return self.getToken(PostgreSQLParser.ASINH, 0)

        def ATAN(self):
            return self.getToken(PostgreSQLParser.ATAN, 0)

        def ATAND(self):
            return self.getToken(PostgreSQLParser.ATAND, 0)

        def ATANH(self):
            return self.getToken(PostgreSQLParser.ATANH, 0)

        def ATAN2(self):
            return self.getToken(PostgreSQLParser.ATAN2, 0)

        def ATAN2D(self):
            return self.getToken(PostgreSQLParser.ATAN2D, 0)

        def COS(self):
            return self.getToken(PostgreSQLParser.COS, 0)

        def COSD(self):
            return self.getToken(PostgreSQLParser.COSD, 0)

        def COSH(self):
            return self.getToken(PostgreSQLParser.COSH, 0)

        def COT(self):
            return self.getToken(PostgreSQLParser.COT, 0)

        def COTD(self):
            return self.getToken(PostgreSQLParser.COTD, 0)

        def SIN(self):
            return self.getToken(PostgreSQLParser.SIN, 0)

        def SIND(self):
            return self.getToken(PostgreSQLParser.SIND, 0)

        def SINH(self):
            return self.getToken(PostgreSQLParser.SINH, 0)

        def TAN(self):
            return self.getToken(PostgreSQLParser.TAN, 0)

        def TAND(self):
            return self.getToken(PostgreSQLParser.TAND, 0)

        def TANH(self):
            return self.getToken(PostgreSQLParser.TANH, 0)

        def BIT_LENGTH(self):
            return self.getToken(PostgreSQLParser.BIT_LENGTH, 0)

        def CHAR_LENGTH(self):
            return self.getToken(PostgreSQLParser.CHAR_LENGTH, 0)

        def CHARACTER_LENGTH(self):
            return self.getToken(PostgreSQLParser.CHARACTER_LENGTH, 0)

        def LOWER(self):
            return self.getToken(PostgreSQLParser.LOWER, 0)

        def OCTET_LENGTH(self):
            return self.getToken(PostgreSQLParser.OCTET_LENGTH, 0)

        def UPPER(self):
            return self.getToken(PostgreSQLParser.UPPER, 0)

        def ASCII(self):
            return self.getToken(PostgreSQLParser.ASCII, 0)

        def BTRIM(self):
            return self.getToken(PostgreSQLParser.BTRIM, 0)

        def CHR(self):
            return self.getToken(PostgreSQLParser.CHR, 0)

        def CONCAT(self):
            return self.getToken(PostgreSQLParser.CONCAT, 0)

        def CONCAT_WS(self):
            return self.getToken(PostgreSQLParser.CONCAT_WS, 0)

        def FORMAT(self):
            return self.getToken(PostgreSQLParser.FORMAT, 0)

        def INITCAP(self):
            return self.getToken(PostgreSQLParser.INITCAP, 0)

        def LENGTH(self):
            return self.getToken(PostgreSQLParser.LENGTH, 0)

        def LPAD(self):
            return self.getToken(PostgreSQLParser.LPAD, 0)

        def LTRIM(self):
            return self.getToken(PostgreSQLParser.LTRIM, 0)

        def MD5(self):
            return self.getToken(PostgreSQLParser.MD5, 0)

        def PARSE_IDENT(self):
            return self.getToken(PostgreSQLParser.PARSE_IDENT, 0)

        def PG_CLIENT_ENCODING(self):
            return self.getToken(PostgreSQLParser.PG_CLIENT_ENCODING, 0)

        def QUOTE_IDENT(self):
            return self.getToken(PostgreSQLParser.QUOTE_IDENT, 0)

        def QUOTE_LITERAL(self):
            return self.getToken(PostgreSQLParser.QUOTE_LITERAL, 0)

        def QUOTE_NULLABLE(self):
            return self.getToken(PostgreSQLParser.QUOTE_NULLABLE, 0)

        def REGEXP_COUNT(self):
            return self.getToken(PostgreSQLParser.REGEXP_COUNT, 0)

        def REGEXP_INSTR(self):
            return self.getToken(PostgreSQLParser.REGEXP_INSTR, 0)

        def REGEXP_LIKE(self):
            return self.getToken(PostgreSQLParser.REGEXP_LIKE, 0)

        def REGEXP_MATCH(self):
            return self.getToken(PostgreSQLParser.REGEXP_MATCH, 0)

        def REGEXP_MATCHES(self):
            return self.getToken(PostgreSQLParser.REGEXP_MATCHES, 0)

        def REGEXP_REPLACE(self):
            return self.getToken(PostgreSQLParser.REGEXP_REPLACE, 0)

        def REGEXP_SPLIT_TO_ARRAY(self):
            return self.getToken(PostgreSQLParser.REGEXP_SPLIT_TO_ARRAY, 0)

        def REGEXP_SPLIT_TO_TABLE(self):
            return self.getToken(PostgreSQLParser.REGEXP_SPLIT_TO_TABLE, 0)

        def REGEXP_SUBSTR(self):
            return self.getToken(PostgreSQLParser.REGEXP_SUBSTR, 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 RPAD(self):
            return self.getToken(PostgreSQLParser.RPAD, 0)

        def RTRIM(self):
            return self.getToken(PostgreSQLParser.RTRIM, 0)

        def SPLIT_PART(self):
            return self.getToken(PostgreSQLParser.SPLIT_PART, 0)

        def STARTS_WITH(self):
            return self.getToken(PostgreSQLParser.STARTS_WITH, 0)

        def STRING_TO_ARRAY(self):
            return self.getToken(PostgreSQLParser.STRING_TO_ARRAY, 0)

        def STRING_TO_TABLE(self):
            return self.getToken(PostgreSQLParser.STRING_TO_TABLE, 0)

        def STRPOS(self):
            return self.getToken(PostgreSQLParser.STRPOS, 0)

        def SUBSTR(self):
            return self.getToken(PostgreSQLParser.SUBSTR, 0)

        def TO_ASCII(self):
            return self.getToken(PostgreSQLParser.TO_ASCII, 0)

        def TO_HEX(self):
            return self.getToken(PostgreSQLParser.TO_HEX, 0)

        def TRANSLATE(self):
            return self.getToken(PostgreSQLParser.TRANSLATE, 0)

        def UNISTR(self):
            return self.getToken(PostgreSQLParser.UNISTR, 0)

        def AGE(self):
            return self.getToken(PostgreSQLParser.AGE, 0)

        def DATE_BIN(self):
            return self.getToken(PostgreSQLParser.DATE_BIN, 0)

        def DATE_PART(self):
            return self.getToken(PostgreSQLParser.DATE_PART, 0)

        def DATE_TRUNC(self):
            return self.getToken(PostgreSQLParser.DATE_TRUNC, 0)

        def ISFINITE(self):
            return self.getToken(PostgreSQLParser.ISFINITE, 0)

        def JUSTIFY_DAYS(self):
            return self.getToken(PostgreSQLParser.JUSTIFY_DAYS, 0)

        def JUSTIFY_HOURS(self):
            return self.getToken(PostgreSQLParser.JUSTIFY_HOURS, 0)

        def JUSTIFY_INTERVAL(self):
            return self.getToken(PostgreSQLParser.JUSTIFY_INTERVAL, 0)

        def MAKE_DATE(self):
            return self.getToken(PostgreSQLParser.MAKE_DATE, 0)

        def MAKE_INTERVAL(self):
            return self.getToken(PostgreSQLParser.MAKE_INTERVAL, 0)

        def MAKE_TIME(self):
            return self.getToken(PostgreSQLParser.MAKE_TIME, 0)

        def MAKE_TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.MAKE_TIMESTAMP, 0)

        def MAKE_TIMESTAMPTZ(self):
            return self.getToken(PostgreSQLParser.MAKE_TIMESTAMPTZ, 0)

        def CLOCK_TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.CLOCK_TIMESTAMP, 0)

        def NOW(self):
            return self.getToken(PostgreSQLParser.NOW, 0)

        def STATEMENT_TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.STATEMENT_TIMESTAMP, 0)

        def TIMEOFDAY(self):
            return self.getToken(PostgreSQLParser.TIMEOFDAY, 0)

        def TRANSACTION_TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.TRANSACTION_TIMESTAMP, 0)

        def TO_TIMESTAMP(self):
            return self.getToken(PostgreSQLParser.TO_TIMESTAMP, 0)

        def TO_CHAR(self):
            return self.getToken(PostgreSQLParser.TO_CHAR, 0)

        def TO_DATE(self):
            return self.getToken(PostgreSQLParser.TO_DATE, 0)

        def TO_NUMBER(self):
            return self.getToken(PostgreSQLParser.TO_NUMBER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_builtin_function_name

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBuiltin_function_name" ):
                listener.enterBuiltin_function_name(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBuiltin_function_name" ):
                listener.exitBuiltin_function_name(self)




    def builtin_function_name(self):

        localctx = PostgreSQLParser.Builtin_function_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1394, self.RULE_builtin_function_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9950
            _la = self._input.LA(1)
            if not(_la==304 or ((((_la - 418)) & ~0x3f) == 0 and ((1 << (_la - 418)) & 127) != 0) or ((((_la - 504)) & ~0x3f) == 0 and ((1 << (_la - 504)) & -130559) != 0) or ((((_la - 568)) & ~0x3f) == 0 and ((1 << (_la - 568)) & -1) != 0) or ((((_la - 632)) & ~0x3f) == 0 and ((1 << (_la - 632)) & 15) != 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 Pl_functionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def comp_options(self):
            return self.getTypedRuleContext(PostgreSQLParser.Comp_optionsContext,0)


        def pl_block(self):
            return self.getTypedRuleContext(PostgreSQLParser.Pl_blockContext,0)


        def opt_semi(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_semiContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_pl_function

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPl_function" ):
                listener.enterPl_function(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPl_function" ):
                listener.exitPl_function(self)




    def pl_function(self):

        localctx = PostgreSQLParser.Pl_functionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1396, self.RULE_pl_function)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9952
            self.comp_options()
            self.state = 9953
            self.pl_block()
            self.state = 9954
            self.opt_semi()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Comp_optionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def comp_option(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Comp_optionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Comp_optionContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_comp_options

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterComp_options" ):
                listener.enterComp_options(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitComp_options" ):
                listener.exitComp_options(self)




    def comp_options(self):

        localctx = PostgreSQLParser.Comp_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1398, self.RULE_comp_options)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9959
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==29:
                self.state = 9956
                self.comp_option()
                self.state = 9961
                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 Comp_optionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sharp(self):
            return self.getTypedRuleContext(PostgreSQLParser.SharpContext,0)


        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def DUMP(self):
            return self.getToken(PostgreSQLParser.DUMP, 0)

        def PRINT_STRICT_PARAMS(self):
            return self.getToken(PostgreSQLParser.PRINT_STRICT_PARAMS, 0)

        def option_value(self):
            return self.getTypedRuleContext(PostgreSQLParser.Option_valueContext,0)


        def VARIABLE_CONFLICT(self):
            return self.getToken(PostgreSQLParser.VARIABLE_CONFLICT, 0)

        def ERROR(self):
            return self.getToken(PostgreSQLParser.ERROR, 0)

        def USE_VARIABLE(self):
            return self.getToken(PostgreSQLParser.USE_VARIABLE, 0)

        def USE_COLUMN(self):
            return self.getToken(PostgreSQLParser.USE_COLUMN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_comp_option

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterComp_option" ):
                listener.enterComp_option(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitComp_option" ):
                listener.exitComp_option(self)




    def comp_option(self):

        localctx = PostgreSQLParser.Comp_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1400, self.RULE_comp_option)
        try:
            self.state = 9982
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,666,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9962
                self.sharp()
                self.state = 9963
                self.match(PostgreSQLParser.OPTION)
                self.state = 9964
                self.match(PostgreSQLParser.DUMP)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9966
                self.sharp()
                self.state = 9967
                self.match(PostgreSQLParser.PRINT_STRICT_PARAMS)
                self.state = 9968
                self.option_value()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9970
                self.sharp()
                self.state = 9971
                self.match(PostgreSQLParser.VARIABLE_CONFLICT)
                self.state = 9972
                self.match(PostgreSQLParser.ERROR)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9974
                self.sharp()
                self.state = 9975
                self.match(PostgreSQLParser.VARIABLE_CONFLICT)
                self.state = 9976
                self.match(PostgreSQLParser.USE_VARIABLE)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 9978
                self.sharp()
                self.state = 9979
                self.match(PostgreSQLParser.VARIABLE_CONFLICT)
                self.state = 9980
                self.match(PostgreSQLParser.USE_COLUMN)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SharpContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Operator(self):
            return self.getToken(PostgreSQLParser.Operator, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sharp

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSharp" ):
                listener.enterSharp(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSharp" ):
                listener.exitSharp(self)




    def sharp(self):

        localctx = PostgreSQLParser.SharpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1402, self.RULE_sharp)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9984
            self.match(PostgreSQLParser.Operator)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Option_valueContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def reserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Reserved_keywordContext,0)


        def plsql_unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_unreserved_keywordContext,0)


        def unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Unreserved_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_option_value

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOption_value" ):
                listener.enterOption_value(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOption_value" ):
                listener.exitOption_value(self)




    def option_value(self):

        localctx = PostgreSQLParser.Option_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1404, self.RULE_option_value)
        try:
            self.state = 9990
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,667,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 9986
                self.sconst()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 9987
                self.reserved_keyword()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 9988
                self.plsql_unreserved_keyword()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 9989
                self.unreserved_keyword()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_semiContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_semi

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_semi" ):
                listener.enterOpt_semi(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_semi" ):
                listener.exitOpt_semi(self)




    def opt_semi(self):

        localctx = PostgreSQLParser.Opt_semiContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1406, self.RULE_opt_semi)
        try:
            self.state = 9994
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [-1]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [7]:
                self.enterOuterAlt(localctx, 2)
                self.state = 9993
                self.match(PostgreSQLParser.SEMI)
                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 Pl_blockContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def decl_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_sectContext,0)


        def BEGIN_P(self):
            return self.getToken(PostgreSQLParser.BEGIN_P, 0)

        def proc_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_sectContext,0)


        def exception_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Exception_sectContext,0)


        def END_P(self):
            return self.getToken(PostgreSQLParser.END_P, 0)

        def opt_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_labelContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_pl_block

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPl_block" ):
                listener.enterPl_block(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPl_block" ):
                listener.exitPl_block(self)




    def pl_block(self):

        localctx = PostgreSQLParser.Pl_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1408, self.RULE_pl_block)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 9996
            self.decl_sect()
            self.state = 9997
            self.match(PostgreSQLParser.BEGIN_P)
            self.state = 9998
            self.proc_sect()
            self.state = 9999
            self.exception_sect()
            self.state = 10000
            self.match(PostgreSQLParser.END_P)
            self.state = 10001
            self.opt_label()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_sectContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_block_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_block_labelContext,0)


        def decl_start(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_startContext,0)


        def decl_stmts(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_stmtsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_sect

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_sect" ):
                listener.enterDecl_sect(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_sect" ):
                listener.exitDecl_sect(self)




    def decl_sect(self):

        localctx = PostgreSQLParser.Decl_sectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1410, self.RULE_decl_sect)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10003
            self.opt_block_label()
            self.state = 10008
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==178:
                self.state = 10004
                self.decl_start()
                self.state = 10006
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,669,self._ctx)
                if la_ == 1:
                    self.state = 10005
                    self.decl_stmts()




        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_startContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DECLARE(self):
            return self.getToken(PostgreSQLParser.DECLARE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_start

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_start" ):
                listener.enterDecl_start(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_start" ):
                listener.exitDecl_start(self)




    def decl_start(self):

        localctx = PostgreSQLParser.Decl_startContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1412, self.RULE_decl_start)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10010
            self.match(PostgreSQLParser.DECLARE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_stmtsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def decl_stmt(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Decl_stmtContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Decl_stmtContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_stmts

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_stmts" ):
                listener.enterDecl_stmts(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_stmts" ):
                listener.exitDecl_stmts(self)




    def decl_stmts(self):

        localctx = PostgreSQLParser.Decl_stmtsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1414, self.RULE_decl_stmts)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10013 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 10012
                    self.decl_stmt()

                else:
                    raise NoViableAltException(self)
                self.state = 10015 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,671,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 Label_declContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LESS_LESS(self):
            return self.getToken(PostgreSQLParser.LESS_LESS, 0)

        def any_identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_identifierContext,0)


        def GREATER_GREATER(self):
            return self.getToken(PostgreSQLParser.GREATER_GREATER, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_label_decl

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLabel_decl" ):
                listener.enterLabel_decl(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLabel_decl" ):
                listener.exitLabel_decl(self)




    def label_decl(self):

        localctx = PostgreSQLParser.Label_declContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1416, self.RULE_label_decl)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10017
            self.match(PostgreSQLParser.LESS_LESS)
            self.state = 10018
            self.any_identifier()
            self.state = 10019
            self.match(PostgreSQLParser.GREATER_GREATER)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_stmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def decl_statement(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_statementContext,0)


        def DECLARE(self):
            return self.getToken(PostgreSQLParser.DECLARE, 0)

        def label_decl(self):
            return self.getTypedRuleContext(PostgreSQLParser.Label_declContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_stmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_stmt" ):
                listener.enterDecl_stmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_stmt" ):
                listener.exitDecl_stmt(self)




    def decl_stmt(self):

        localctx = PostgreSQLParser.Decl_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1418, self.RULE_decl_stmt)
        try:
            self.state = 10024
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,672,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 10021
                self.decl_statement()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10022
                self.match(PostgreSQLParser.DECLARE)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 10023
                self.label_decl()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_statementContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def decl_varname(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_varnameContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def ALIAS(self):
            return self.getToken(PostgreSQLParser.ALIAS, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def decl_aliasitem(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_aliasitemContext,0)


        def decl_const(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_constContext,0)


        def decl_datatype(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_datatypeContext,0)


        def decl_collate(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_collateContext,0)


        def decl_notnull(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_notnullContext,0)


        def decl_defval(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_defvalContext,0)


        def opt_scrollable(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_scrollableContext,0)


        def CURSOR(self):
            return self.getToken(PostgreSQLParser.CURSOR, 0)

        def decl_cursor_args(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_cursor_argsContext,0)


        def decl_is_for(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_is_forContext,0)


        def decl_cursor_query(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_cursor_queryContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_statement

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_statement" ):
                listener.enterDecl_statement(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_statement" ):
                listener.exitDecl_statement(self)




    def decl_statement(self):

        localctx = PostgreSQLParser.Decl_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1420, self.RULE_decl_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10026
            self.decl_varname()
            self.state = 10042
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,673,self._ctx)
            if la_ == 1:
                self.state = 10027
                self.match(PostgreSQLParser.ALIAS)
                self.state = 10028
                self.match(PostgreSQLParser.FOR)
                self.state = 10029
                self.decl_aliasitem()
                pass

            elif la_ == 2:
                self.state = 10030
                self.decl_const()
                self.state = 10031
                self.decl_datatype()
                self.state = 10032
                self.decl_collate()
                self.state = 10033
                self.decl_notnull()
                self.state = 10034
                self.decl_defval()
                pass

            elif la_ == 3:
                self.state = 10036
                self.opt_scrollable()
                self.state = 10037
                self.match(PostgreSQLParser.CURSOR)
                self.state = 10038
                self.decl_cursor_args()
                self.state = 10039
                self.decl_is_for()
                self.state = 10040
                self.decl_cursor_query()
                pass


            self.state = 10044
            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 Opt_scrollableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def SCROLL(self):
            return self.getToken(PostgreSQLParser.SCROLL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_scrollable

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_scrollable" ):
                listener.enterOpt_scrollable(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_scrollable" ):
                listener.exitOpt_scrollable(self)




    def opt_scrollable(self):

        localctx = PostgreSQLParser.Opt_scrollableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1422, self.RULE_opt_scrollable)
        try:
            self.state = 10050
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [172]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [262]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10047
                self.match(PostgreSQLParser.NO)
                self.state = 10048
                self.match(PostgreSQLParser.SCROLL)
                pass
            elif token in [317]:
                self.enterOuterAlt(localctx, 3)
                self.state = 10049
                self.match(PostgreSQLParser.SCROLL)
                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 Decl_cursor_queryContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_cursor_query

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_cursor_query" ):
                listener.enterDecl_cursor_query(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_cursor_query" ):
                listener.exitDecl_cursor_query(self)




    def decl_cursor_query(self):

        localctx = PostgreSQLParser.Decl_cursor_queryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1424, self.RULE_decl_cursor_query)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10052
            self.selectstmt()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_cursor_argsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def decl_cursor_arglist(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_cursor_arglistContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_cursor_args

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_cursor_args" ):
                listener.enterDecl_cursor_args(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_cursor_args" ):
                listener.exitDecl_cursor_args(self)




    def decl_cursor_args(self):

        localctx = PostgreSQLParser.Decl_cursor_argsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1426, self.RULE_decl_cursor_args)
        try:
            self.state = 10059
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62, 116]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10055
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 10056
                self.decl_cursor_arglist()
                self.state = 10057
                self.match(PostgreSQLParser.CLOSE_PAREN)
                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 Decl_cursor_arglistContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def decl_cursor_arg(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Decl_cursor_argContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Decl_cursor_argContext,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_decl_cursor_arglist

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_cursor_arglist" ):
                listener.enterDecl_cursor_arglist(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_cursor_arglist" ):
                listener.exitDecl_cursor_arglist(self)




    def decl_cursor_arglist(self):

        localctx = PostgreSQLParser.Decl_cursor_arglistContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1428, self.RULE_decl_cursor_arglist)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10061
            self.decl_cursor_arg()
            self.state = 10066
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 10062
                self.match(PostgreSQLParser.COMMA)
                self.state = 10063
                self.decl_cursor_arg()
                self.state = 10068
                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 Decl_cursor_argContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def decl_varname(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_varnameContext,0)


        def decl_datatype(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_datatypeContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_cursor_arg

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_cursor_arg" ):
                listener.enterDecl_cursor_arg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_cursor_arg" ):
                listener.exitDecl_cursor_arg(self)




    def decl_cursor_arg(self):

        localctx = PostgreSQLParser.Decl_cursor_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1430, self.RULE_decl_cursor_arg)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10069
            self.decl_varname()
            self.state = 10070
            self.decl_datatype()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_is_forContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def IS(self):
            return self.getToken(PostgreSQLParser.IS, 0)

        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_is_for

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_is_for" ):
                listener.enterDecl_is_for(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_is_for" ):
                listener.exitDecl_is_for(self)




    def decl_is_for(self):

        localctx = PostgreSQLParser.Decl_is_forContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1432, self.RULE_decl_is_for)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10072
            _la = self._input.LA(1)
            if not(_la==62 or _la==116):
                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 Decl_aliasitemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PARAM(self):
            return self.getToken(PostgreSQLParser.PARAM, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_aliasitem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_aliasitem" ):
                listener.enterDecl_aliasitem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_aliasitem" ):
                listener.exitDecl_aliasitem(self)




    def decl_aliasitem(self):

        localctx = PostgreSQLParser.Decl_aliasitemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1434, self.RULE_decl_aliasitem)
        try:
            self.state = 10076
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [28]:
                self.enterOuterAlt(localctx, 1)
                self.state = 10074
                self.match(PostgreSQLParser.PARAM)
                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10075
                self.colid()
                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 Decl_varnameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def any_identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_identifierContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_varname

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_varname" ):
                listener.enterDecl_varname(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_varname" ):
                listener.exitDecl_varname(self)




    def decl_varname(self):

        localctx = PostgreSQLParser.Decl_varnameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1436, self.RULE_decl_varname)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10078
            self.any_identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_constContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CONSTANT(self):
            return self.getToken(PostgreSQLParser.CONSTANT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_const

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_const" ):
                listener.enterDecl_const(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_const" ):
                listener.exitDecl_const(self)




    def decl_const(self):

        localctx = PostgreSQLParser.Decl_constContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1438, self.RULE_decl_const)
        try:
            self.state = 10082
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,678,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10081
                self.match(PostgreSQLParser.CONSTANT)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_datatypeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def typename(self):
            return self.getTypedRuleContext(PostgreSQLParser.TypenameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_datatype

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_datatype" ):
                listener.enterDecl_datatype(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_datatype" ):
                listener.exitDecl_datatype(self)




    def decl_datatype(self):

        localctx = PostgreSQLParser.Decl_datatypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1440, self.RULE_decl_datatype)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10084
            self.typename()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Decl_collateContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COLLATE(self):
            return self.getToken(PostgreSQLParser.COLLATE, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_collate

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_collate" ):
                listener.enterDecl_collate(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_collate" ):
                listener.exitDecl_collate(self)




    def decl_collate(self):

        localctx = PostgreSQLParser.Decl_collateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1442, self.RULE_decl_collate)
        try:
            self.state = 10089
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7, 10, 20, 53, 77]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [43]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10087
                self.match(PostgreSQLParser.COLLATE)
                self.state = 10088
                self.any_name()
                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 Decl_notnullContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NOT(self):
            return self.getToken(PostgreSQLParser.NOT, 0)

        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_notnull

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_notnull" ):
                listener.enterDecl_notnull(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_notnull" ):
                listener.exitDecl_notnull(self)




    def decl_notnull(self):

        localctx = PostgreSQLParser.Decl_notnullContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1444, self.RULE_decl_notnull)
        try:
            self.state = 10094
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7, 10, 20, 53]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [77]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10092
                self.match(PostgreSQLParser.NOT)
                self.state = 10093
                self.match(PostgreSQLParser.NULL_P)
                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 Decl_defvalContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def decl_defkey(self):
            return self.getTypedRuleContext(PostgreSQLParser.Decl_defkeyContext,0)


        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_defval

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_defval" ):
                listener.enterDecl_defval(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_defval" ):
                listener.exitDecl_defval(self)




    def decl_defval(self):

        localctx = PostgreSQLParser.Decl_defvalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1446, self.RULE_decl_defval)
        try:
            self.state = 10100
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [10, 20, 53]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10097
                self.decl_defkey()
                self.state = 10098
                self.sql_expression()
                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 Decl_defkeyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def assign_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Assign_operatorContext,0)


        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_decl_defkey

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDecl_defkey" ):
                listener.enterDecl_defkey(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDecl_defkey" ):
                listener.exitDecl_defkey(self)




    def decl_defkey(self):

        localctx = PostgreSQLParser.Decl_defkeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1448, self.RULE_decl_defkey)
        try:
            self.state = 10104
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [10, 20]:
                self.enterOuterAlt(localctx, 1)
                self.state = 10102
                self.assign_operator()
                pass
            elif token in [53]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10103
                self.match(PostgreSQLParser.DEFAULT)
                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 Assign_operatorContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def COLON_EQUALS(self):
            return self.getToken(PostgreSQLParser.COLON_EQUALS, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_assign_operator

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAssign_operator" ):
                listener.enterAssign_operator(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAssign_operator" ):
                listener.exitAssign_operator(self)




    def assign_operator(self):

        localctx = PostgreSQLParser.Assign_operatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1450, self.RULE_assign_operator)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10106
            _la = self._input.LA(1)
            if not(_la==10 or _la==20):
                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 Proc_sectContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def proc_stmt(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Proc_stmtContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Proc_stmtContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_proc_sect

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProc_sect" ):
                listener.enterProc_sect(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProc_sect" ):
                listener.exitProc_sect(self)




    def proc_sect(self):

        localctx = PostgreSQLParser.Proc_sectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1452, self.RULE_proc_sect)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10111
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,683,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 10108
                    self.proc_stmt() 
                self.state = 10113
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,683,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 Proc_stmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def pl_block(self):
            return self.getTypedRuleContext(PostgreSQLParser.Pl_blockContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def stmt_return(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_returnContext,0)


        def stmt_raise(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_raiseContext,0)


        def stmt_assign(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_assignContext,0)


        def stmt_if(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_ifContext,0)


        def stmt_case(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_caseContext,0)


        def stmt_loop(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_loopContext,0)


        def stmt_while(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_whileContext,0)


        def stmt_for(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_forContext,0)


        def stmt_foreach_a(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_foreach_aContext,0)


        def stmt_exit(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_exitContext,0)


        def stmt_assert(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_assertContext,0)


        def stmt_execsql(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_execsqlContext,0)


        def stmt_dynexecute(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_dynexecuteContext,0)


        def stmt_perform(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_performContext,0)


        def stmt_call(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_callContext,0)


        def stmt_getdiag(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_getdiagContext,0)


        def stmt_open(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_openContext,0)


        def stmt_fetch(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_fetchContext,0)


        def stmt_move(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_moveContext,0)


        def stmt_close(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_closeContext,0)


        def stmt_null(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_nullContext,0)


        def stmt_commit(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_commitContext,0)


        def stmt_rollback(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_rollbackContext,0)


        def stmt_set(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_setContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_proc_stmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProc_stmt" ):
                listener.enterProc_stmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProc_stmt" ):
                listener.exitProc_stmt(self)




    def proc_stmt(self):

        localctx = PostgreSQLParser.Proc_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1454, self.RULE_proc_stmt)
        try:
            self.state = 10141
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,684,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 10114
                self.pl_block()
                self.state = 10115
                self.match(PostgreSQLParser.SEMI)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10117
                self.stmt_return()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 10118
                self.stmt_raise()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 10119
                self.stmt_assign()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 10120
                self.stmt_if()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 10121
                self.stmt_case()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 10122
                self.stmt_loop()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 10123
                self.stmt_while()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 10124
                self.stmt_for()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 10125
                self.stmt_foreach_a()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 10126
                self.stmt_exit()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 10127
                self.stmt_assert()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 10128
                self.stmt_execsql()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 10129
                self.stmt_dynexecute()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 10130
                self.stmt_perform()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 10131
                self.stmt_call()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 10132
                self.stmt_getdiag()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 10133
                self.stmt_open()
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 10134
                self.stmt_fetch()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 10135
                self.stmt_move()
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 10136
                self.stmt_close()
                pass

            elif la_ == 22:
                self.enterOuterAlt(localctx, 22)
                self.state = 10137
                self.stmt_null()
                pass

            elif la_ == 23:
                self.enterOuterAlt(localctx, 23)
                self.state = 10138
                self.stmt_commit()
                pass

            elif la_ == 24:
                self.enterOuterAlt(localctx, 24)
                self.state = 10139
                self.stmt_rollback()
                pass

            elif la_ == 25:
                self.enterOuterAlt(localctx, 25)
                self.state = 10140
                self.stmt_set()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Stmt_performContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PERFORM(self):
            return self.getToken(PostgreSQLParser.PERFORM, 0)

        def expr_until_semi(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_until_semiContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_perform

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_perform" ):
                listener.enterStmt_perform(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_perform" ):
                listener.exitStmt_perform(self)




    def stmt_perform(self):

        localctx = PostgreSQLParser.Stmt_performContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1456, self.RULE_stmt_perform)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10143
            self.match(PostgreSQLParser.PERFORM)
            self.state = 10144
            self.expr_until_semi()
            self.state = 10145
            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 Stmt_callContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CALL(self):
            return self.getToken(PostgreSQLParser.CALL, 0)

        def any_identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_identifierContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def opt_expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_expr_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def DO(self):
            return self.getToken(PostgreSQLParser.DO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_call

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_call" ):
                listener.enterStmt_call(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_call" ):
                listener.exitStmt_call(self)




    def stmt_call(self):

        localctx = PostgreSQLParser.Stmt_callContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1458, self.RULE_stmt_call)
        try:
            self.state = 10161
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [433]:
                self.enterOuterAlt(localctx, 1)
                self.state = 10147
                self.match(PostgreSQLParser.CALL)
                self.state = 10148
                self.any_identifier()
                self.state = 10149
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 10150
                self.opt_expr_list()
                self.state = 10151
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 10152
                self.match(PostgreSQLParser.SEMI)
                pass
            elif token in [57]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10154
                self.match(PostgreSQLParser.DO)
                self.state = 10155
                self.any_identifier()
                self.state = 10156
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 10157
                self.opt_expr_list()
                self.state = 10158
                self.match(PostgreSQLParser.CLOSE_PAREN)
                self.state = 10159
                self.match(PostgreSQLParser.SEMI)
                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 Opt_expr_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_expr_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_expr_list" ):
                listener.enterOpt_expr_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_expr_list" ):
                listener.exitOpt_expr_list(self)




    def opt_expr_list(self):

        localctx = PostgreSQLParser.Opt_expr_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1460, self.RULE_opt_expr_list)
        try:
            self.state = 10165
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [3]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [2, 12, 13, 28, 29, 33, 35, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 57, 60, 61, 75, 76, 77, 78, 89, 92, 96, 98, 99, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 645, 647, 649, 650, 654, 658, 660, 661, 662, 671]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10164
                self.expr_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 Stmt_assignContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def assign_var(self):
            return self.getTypedRuleContext(PostgreSQLParser.Assign_varContext,0)


        def assign_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Assign_operatorContext,0)


        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_assign

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_assign" ):
                listener.enterStmt_assign(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_assign" ):
                listener.exitStmt_assign(self)




    def stmt_assign(self):

        localctx = PostgreSQLParser.Stmt_assignContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1462, self.RULE_stmt_assign)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10167
            self.assign_var()
            self.state = 10168
            self.assign_operator()
            self.state = 10169
            self.sql_expression()
            self.state = 10170
            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 Stmt_getdiagContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def GET(self):
            return self.getToken(PostgreSQLParser.GET, 0)

        def getdiag_area_opt(self):
            return self.getTypedRuleContext(PostgreSQLParser.Getdiag_area_optContext,0)


        def DIAGNOSTICS(self):
            return self.getToken(PostgreSQLParser.DIAGNOSTICS, 0)

        def getdiag_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Getdiag_listContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_getdiag

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_getdiag" ):
                listener.enterStmt_getdiag(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_getdiag" ):
                listener.exitStmt_getdiag(self)




    def stmt_getdiag(self):

        localctx = PostgreSQLParser.Stmt_getdiagContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1464, self.RULE_stmt_getdiag)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10172
            self.match(PostgreSQLParser.GET)
            self.state = 10173
            self.getdiag_area_opt()
            self.state = 10174
            self.match(PostgreSQLParser.DIAGNOSTICS)
            self.state = 10175
            self.getdiag_list()
            self.state = 10176
            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 Getdiag_area_optContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CURRENT_P(self):
            return self.getToken(PostgreSQLParser.CURRENT_P, 0)

        def STACKED(self):
            return self.getToken(PostgreSQLParser.STACKED, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_getdiag_area_opt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGetdiag_area_opt" ):
                listener.enterGetdiag_area_opt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGetdiag_area_opt" ):
                listener.exitGetdiag_area_opt(self)




    def getdiag_area_opt(self):

        localctx = PostgreSQLParser.Getdiag_area_optContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1466, self.RULE_getdiag_area_opt)
        try:
            self.state = 10181
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [500]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [434]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10179
                self.match(PostgreSQLParser.CURRENT_P)
                pass
            elif token in [501]:
                self.enterOuterAlt(localctx, 3)
                self.state = 10180
                self.match(PostgreSQLParser.STACKED)
                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 Getdiag_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def getdiag_list_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Getdiag_list_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Getdiag_list_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_getdiag_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGetdiag_list" ):
                listener.enterGetdiag_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGetdiag_list" ):
                listener.exitGetdiag_list(self)




    def getdiag_list(self):

        localctx = PostgreSQLParser.Getdiag_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1468, self.RULE_getdiag_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10183
            self.getdiag_list_item()
            self.state = 10188
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 10184
                self.match(PostgreSQLParser.COMMA)
                self.state = 10185
                self.getdiag_list_item()
                self.state = 10190
                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 Getdiag_list_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def getdiag_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Getdiag_targetContext,0)


        def assign_operator(self):
            return self.getTypedRuleContext(PostgreSQLParser.Assign_operatorContext,0)


        def getdiag_item(self):
            return self.getTypedRuleContext(PostgreSQLParser.Getdiag_itemContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_getdiag_list_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGetdiag_list_item" ):
                listener.enterGetdiag_list_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGetdiag_list_item" ):
                listener.exitGetdiag_list_item(self)




    def getdiag_list_item(self):

        localctx = PostgreSQLParser.Getdiag_list_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1470, self.RULE_getdiag_list_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10191
            self.getdiag_target()
            self.state = 10192
            self.assign_operator()
            self.state = 10193
            self.getdiag_item()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Getdiag_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_getdiag_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGetdiag_item" ):
                listener.enterGetdiag_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGetdiag_item" ):
                listener.exitGetdiag_item(self)




    def getdiag_item(self):

        localctx = PostgreSQLParser.Getdiag_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1472, self.RULE_getdiag_item)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10195
            self.colid()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Getdiag_targetContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def assign_var(self):
            return self.getTypedRuleContext(PostgreSQLParser.Assign_varContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_getdiag_target

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGetdiag_target" ):
                listener.enterGetdiag_target(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGetdiag_target" ):
                listener.exitGetdiag_target(self)




    def getdiag_target(self):

        localctx = PostgreSQLParser.Getdiag_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1474, self.RULE_getdiag_target)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10197
            self.assign_var()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Assign_varContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def PARAM(self):
            return self.getToken(PostgreSQLParser.PARAM, 0)

        def OPEN_BRACKET(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.OPEN_BRACKET)
            else:
                return self.getToken(PostgreSQLParser.OPEN_BRACKET, i)

        def expr_until_rightbracket(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Expr_until_rightbracketContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Expr_until_rightbracketContext,i)


        def CLOSE_BRACKET(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.CLOSE_BRACKET)
            else:
                return self.getToken(PostgreSQLParser.CLOSE_BRACKET, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_assign_var

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAssign_var" ):
                listener.enterAssign_var(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAssign_var" ):
                listener.exitAssign_var(self)




    def assign_var(self):

        localctx = PostgreSQLParser.Assign_varContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1476, self.RULE_assign_var)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10201
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.state = 10199
                self.any_name()
                pass
            elif token in [28]:
                self.state = 10200
                self.match(PostgreSQLParser.PARAM)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 10209
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==4:
                self.state = 10203
                self.match(PostgreSQLParser.OPEN_BRACKET)
                self.state = 10204
                self.expr_until_rightbracket()
                self.state = 10205
                self.match(PostgreSQLParser.CLOSE_BRACKET)
                self.state = 10211
                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 Stmt_ifContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def IF_P(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.IF_P)
            else:
                return self.getToken(PostgreSQLParser.IF_P, i)

        def expr_until_then(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_until_thenContext,0)


        def THEN(self):
            return self.getToken(PostgreSQLParser.THEN, 0)

        def proc_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_sectContext,0)


        def stmt_elsifs(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_elsifsContext,0)


        def stmt_else(self):
            return self.getTypedRuleContext(PostgreSQLParser.Stmt_elseContext,0)


        def END_P(self):
            return self.getToken(PostgreSQLParser.END_P, 0)

        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_if

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_if" ):
                listener.enterStmt_if(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_if" ):
                listener.exitStmt_if(self)




    def stmt_if(self):

        localctx = PostgreSQLParser.Stmt_ifContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1478, self.RULE_stmt_if)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10212
            self.match(PostgreSQLParser.IF_P)
            self.state = 10213
            self.expr_until_then()
            self.state = 10214
            self.match(PostgreSQLParser.THEN)
            self.state = 10215
            self.proc_sect()
            self.state = 10216
            self.stmt_elsifs()
            self.state = 10217
            self.stmt_else()
            self.state = 10218
            self.match(PostgreSQLParser.END_P)
            self.state = 10219
            self.match(PostgreSQLParser.IF_P)
            self.state = 10220
            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 Stmt_elsifsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ELSIF(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.ELSIF)
            else:
                return self.getToken(PostgreSQLParser.ELSIF, i)

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,i)


        def THEN(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.THEN)
            else:
                return self.getToken(PostgreSQLParser.THEN, i)

        def proc_sect(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Proc_sectContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Proc_sectContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_elsifs

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_elsifs" ):
                listener.enterStmt_elsifs(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_elsifs" ):
                listener.exitStmt_elsifs(self)




    def stmt_elsifs(self):

        localctx = PostgreSQLParser.Stmt_elsifsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1480, self.RULE_stmt_elsifs)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10229
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==502:
                self.state = 10222
                self.match(PostgreSQLParser.ELSIF)
                self.state = 10223
                self.a_expr()
                self.state = 10224
                self.match(PostgreSQLParser.THEN)
                self.state = 10225
                self.proc_sect()
                self.state = 10231
                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 Stmt_elseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ELSE(self):
            return self.getToken(PostgreSQLParser.ELSE, 0)

        def proc_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_sectContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_else

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_else" ):
                listener.enterStmt_else(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_else" ):
                listener.exitStmt_else(self)




    def stmt_else(self):

        localctx = PostgreSQLParser.Stmt_elseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1482, self.RULE_stmt_else)
        try:
            self.state = 10235
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [454]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [58]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10233
                self.match(PostgreSQLParser.ELSE)
                self.state = 10234
                self.proc_sect()
                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 Stmt_caseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CASE(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.CASE)
            else:
                return self.getToken(PostgreSQLParser.CASE, i)

        def opt_expr_until_when(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_expr_until_whenContext,0)


        def case_when_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Case_when_listContext,0)


        def opt_case_else(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_case_elseContext,0)


        def END_P(self):
            return self.getToken(PostgreSQLParser.END_P, 0)

        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_case

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_case" ):
                listener.enterStmt_case(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_case" ):
                listener.exitStmt_case(self)




    def stmt_case(self):

        localctx = PostgreSQLParser.Stmt_caseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1484, self.RULE_stmt_case)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10237
            self.match(PostgreSQLParser.CASE)
            self.state = 10238
            self.opt_expr_until_when()
            self.state = 10239
            self.case_when_list()
            self.state = 10240
            self.opt_case_else()
            self.state = 10241
            self.match(PostgreSQLParser.END_P)
            self.state = 10242
            self.match(PostgreSQLParser.CASE)
            self.state = 10243
            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 Opt_expr_until_whenContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_expr_until_when

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_expr_until_when" ):
                listener.enterOpt_expr_until_when(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_expr_until_when" ):
                listener.exitOpt_expr_until_when(self)




    def opt_expr_until_when(self):

        localctx = PostgreSQLParser.Opt_expr_until_whenContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1486, self.RULE_opt_expr_until_when)
        try:
            self.state = 10247
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,693,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10246
                self.sql_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 Case_when_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def case_when(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Case_whenContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Case_whenContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_case_when_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCase_when_list" ):
                listener.enterCase_when_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCase_when_list" ):
                listener.exitCase_when_list(self)




    def case_when_list(self):

        localctx = PostgreSQLParser.Case_when_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1488, self.RULE_case_when_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10250 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 10249
                self.case_when()
                self.state = 10252 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==102):
                    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_whenContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def THEN(self):
            return self.getToken(PostgreSQLParser.THEN, 0)

        def proc_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_sectContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_case_when

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCase_when" ):
                listener.enterCase_when(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCase_when" ):
                listener.exitCase_when(self)




    def case_when(self):

        localctx = PostgreSQLParser.Case_whenContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1490, self.RULE_case_when)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10254
            self.match(PostgreSQLParser.WHEN)
            self.state = 10255
            self.expr_list()
            self.state = 10256
            self.match(PostgreSQLParser.THEN)
            self.state = 10257
            self.proc_sect()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_case_elseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ELSE(self):
            return self.getToken(PostgreSQLParser.ELSE, 0)

        def proc_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_sectContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_case_else

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_case_else" ):
                listener.enterOpt_case_else(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_case_else" ):
                listener.exitOpt_case_else(self)




    def opt_case_else(self):

        localctx = PostgreSQLParser.Opt_case_elseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1492, self.RULE_opt_case_else)
        try:
            self.state = 10262
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [454]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [58]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10260
                self.match(PostgreSQLParser.ELSE)
                self.state = 10261
                self.proc_sect()
                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 Stmt_loopContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_loop_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_loop_labelContext,0)


        def loop_body(self):
            return self.getTypedRuleContext(PostgreSQLParser.Loop_bodyContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_loop

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_loop" ):
                listener.enterStmt_loop(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_loop" ):
                listener.exitStmt_loop(self)




    def stmt_loop(self):

        localctx = PostgreSQLParser.Stmt_loopContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1494, self.RULE_stmt_loop)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10264
            self.opt_loop_label()
            self.state = 10265
            self.loop_body()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Stmt_whileContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_loop_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_loop_labelContext,0)


        def WHILE(self):
            return self.getToken(PostgreSQLParser.WHILE, 0)

        def expr_until_loop(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_until_loopContext,0)


        def loop_body(self):
            return self.getTypedRuleContext(PostgreSQLParser.Loop_bodyContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_while

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_while" ):
                listener.enterStmt_while(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_while" ):
                listener.exitStmt_while(self)




    def stmt_while(self):

        localctx = PostgreSQLParser.Stmt_whileContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1496, self.RULE_stmt_while)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10267
            self.opt_loop_label()
            self.state = 10268
            self.match(PostgreSQLParser.WHILE)
            self.state = 10269
            self.expr_until_loop()
            self.state = 10270
            self.loop_body()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Stmt_forContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_loop_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_loop_labelContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def for_control(self):
            return self.getTypedRuleContext(PostgreSQLParser.For_controlContext,0)


        def loop_body(self):
            return self.getTypedRuleContext(PostgreSQLParser.Loop_bodyContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_for

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_for" ):
                listener.enterStmt_for(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_for" ):
                listener.exitStmt_for(self)




    def stmt_for(self):

        localctx = PostgreSQLParser.Stmt_forContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1498, self.RULE_stmt_for)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10272
            self.opt_loop_label()
            self.state = 10273
            self.match(PostgreSQLParser.FOR)
            self.state = 10274
            self.for_control()
            self.state = 10275
            self.loop_body()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class For_controlContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def for_variable(self):
            return self.getTypedRuleContext(PostgreSQLParser.For_variableContext,0)


        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def cursor_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_nameContext,0)


        def opt_cursor_parameters(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_cursor_parametersContext,0)


        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def explainstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.ExplainstmtContext,0)


        def EXECUTE(self):
            return self.getToken(PostgreSQLParser.EXECUTE, 0)

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,i)


        def opt_for_using_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_for_using_expressionContext,0)


        def opt_reverse(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_reverseContext,0)


        def DOT_DOT(self):
            return self.getToken(PostgreSQLParser.DOT_DOT, 0)

        def opt_by_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_by_expressionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_for_control

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_control" ):
                listener.enterFor_control(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_control" ):
                listener.exitFor_control(self)




    def for_control(self):

        localctx = PostgreSQLParser.For_controlContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1500, self.RULE_for_control)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10277
            self.for_variable()
            self.state = 10278
            self.match(PostgreSQLParser.IN_P)
            self.state = 10294
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,696,self._ctx)
            if la_ == 1:
                self.state = 10279
                self.cursor_name()
                self.state = 10280
                self.opt_cursor_parameters()
                pass

            elif la_ == 2:
                self.state = 10282
                self.selectstmt()
                pass

            elif la_ == 3:
                self.state = 10283
                self.explainstmt()
                pass

            elif la_ == 4:
                self.state = 10284
                self.match(PostgreSQLParser.EXECUTE)
                self.state = 10285
                self.a_expr()
                self.state = 10286
                self.opt_for_using_expression()
                pass

            elif la_ == 5:
                self.state = 10288
                self.opt_reverse()
                self.state = 10289
                self.a_expr()
                self.state = 10290
                self.match(PostgreSQLParser.DOT_DOT)
                self.state = 10291
                self.a_expr()
                self.state = 10292
                self.opt_by_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 Opt_for_using_expressionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_for_using_expression

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_for_using_expression" ):
                listener.enterOpt_for_using_expression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_for_using_expression" ):
                listener.exitOpt_for_using_expression(self)




    def opt_for_using_expression(self):

        localctx = PostgreSQLParser.Opt_for_using_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1502, self.RULE_opt_for_using_expression)
        try:
            self.state = 10299
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7, 519]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [100]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10297
                self.match(PostgreSQLParser.USING)
                self.state = 10298
                self.expr_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 Opt_cursor_parametersContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,i)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 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_opt_cursor_parameters

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_cursor_parameters" ):
                listener.enterOpt_cursor_parameters(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_cursor_parameters" ):
                listener.exitOpt_cursor_parameters(self)




    def opt_cursor_parameters(self):

        localctx = PostgreSQLParser.Opt_cursor_parametersContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1504, self.RULE_opt_cursor_parameters)
        self._la = 0 # Token type
        try:
            self.state = 10313
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [519]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10302
                self.match(PostgreSQLParser.OPEN_PAREN)
                self.state = 10303
                self.a_expr()
                self.state = 10308
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==6:
                    self.state = 10304
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 10305
                    self.a_expr()
                    self.state = 10310
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 10311
                self.match(PostgreSQLParser.CLOSE_PAREN)
                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 Opt_reverseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def REVERSE(self):
            return self.getToken(PostgreSQLParser.REVERSE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_reverse

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_reverse" ):
                listener.enterOpt_reverse(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_reverse" ):
                listener.exitOpt_reverse(self)




    def opt_reverse(self):

        localctx = PostgreSQLParser.Opt_reverseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1506, self.RULE_opt_reverse)
        try:
            self.state = 10317
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,700,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10316
                self.match(PostgreSQLParser.REVERSE)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_by_expressionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BY(self):
            return self.getToken(PostgreSQLParser.BY, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_by_expression

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_by_expression" ):
                listener.enterOpt_by_expression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_by_expression" ):
                listener.exitOpt_by_expression(self)




    def opt_by_expression(self):

        localctx = PostgreSQLParser.Opt_by_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1508, self.RULE_opt_by_expression)
        try:
            self.state = 10322
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [519]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [147]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10320
                self.match(PostgreSQLParser.BY)
                self.state = 10321
                self.a_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


    class For_variableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def any_name_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_name_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_for_variable

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFor_variable" ):
                listener.enterFor_variable(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFor_variable" ):
                listener.exitFor_variable(self)




    def for_variable(self):

        localctx = PostgreSQLParser.For_variableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1510, self.RULE_for_variable)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10324
            self.any_name_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Stmt_foreach_aContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_loop_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_loop_labelContext,0)


        def FOREACH(self):
            return self.getToken(PostgreSQLParser.FOREACH, 0)

        def for_variable(self):
            return self.getTypedRuleContext(PostgreSQLParser.For_variableContext,0)


        def foreach_slice(self):
            return self.getTypedRuleContext(PostgreSQLParser.Foreach_sliceContext,0)


        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def ARRAY(self):
            return self.getToken(PostgreSQLParser.ARRAY, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def loop_body(self):
            return self.getTypedRuleContext(PostgreSQLParser.Loop_bodyContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_foreach_a

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_foreach_a" ):
                listener.enterStmt_foreach_a(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_foreach_a" ):
                listener.exitStmt_foreach_a(self)




    def stmt_foreach_a(self):

        localctx = PostgreSQLParser.Stmt_foreach_aContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1512, self.RULE_stmt_foreach_a)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10326
            self.opt_loop_label()
            self.state = 10327
            self.match(PostgreSQLParser.FOREACH)
            self.state = 10328
            self.for_variable()
            self.state = 10329
            self.foreach_slice()
            self.state = 10330
            self.match(PostgreSQLParser.IN_P)
            self.state = 10331
            self.match(PostgreSQLParser.ARRAY)
            self.state = 10332
            self.a_expr()
            self.state = 10333
            self.loop_body()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Foreach_sliceContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SLICE(self):
            return self.getToken(PostgreSQLParser.SLICE, 0)

        def iconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.IconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_foreach_slice

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterForeach_slice" ):
                listener.enterForeach_slice(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitForeach_slice" ):
                listener.exitForeach_slice(self)




    def foreach_slice(self):

        localctx = PostgreSQLParser.Foreach_sliceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1514, self.RULE_foreach_slice)
        try:
            self.state = 10338
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [68]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [506]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10336
                self.match(PostgreSQLParser.SLICE)
                self.state = 10337
                self.iconst()
                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 Stmt_exitContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def exit_type(self):
            return self.getTypedRuleContext(PostgreSQLParser.Exit_typeContext,0)


        def opt_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_labelContext,0)


        def opt_exitcond(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_exitcondContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_exit

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_exit" ):
                listener.enterStmt_exit(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_exit" ):
                listener.exitStmt_exit(self)




    def stmt_exit(self):

        localctx = PostgreSQLParser.Stmt_exitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1516, self.RULE_stmt_exit)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10340
            self.exit_type()
            self.state = 10341
            self.opt_label()
            self.state = 10342
            self.opt_exitcond()
            self.state = 10343
            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 Exit_typeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EXIT(self):
            return self.getToken(PostgreSQLParser.EXIT, 0)

        def CONTINUE_P(self):
            return self.getToken(PostgreSQLParser.CONTINUE_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_exit_type

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExit_type" ):
                listener.enterExit_type(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExit_type" ):
                listener.exitExit_type(self)




    def exit_type(self):

        localctx = PostgreSQLParser.Exit_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1518, self.RULE_exit_type)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10345
            _la = self._input.LA(1)
            if not(_la==167 or _la==507):
                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 Stmt_returnContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def RETURN(self):
            return self.getToken(PostgreSQLParser.RETURN, 0)

        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def NEXT(self):
            return self.getToken(PostgreSQLParser.NEXT, 0)

        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def QUERY(self):
            return self.getToken(PostgreSQLParser.QUERY, 0)

        def opt_return_result(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_return_resultContext,0)


        def EXECUTE(self):
            return self.getToken(PostgreSQLParser.EXECUTE, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def opt_for_using_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_for_using_expressionContext,0)


        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_return

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_return" ):
                listener.enterStmt_return(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_return" ):
                listener.exitStmt_return(self)




    def stmt_return(self):

        localctx = PostgreSQLParser.Stmt_returnContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1520, self.RULE_stmt_return)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10347
            self.match(PostgreSQLParser.RETURN)
            self.state = 10359
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,704,self._ctx)
            if la_ == 1:
                self.state = 10348
                self.match(PostgreSQLParser.NEXT)
                self.state = 10349
                self.sql_expression()
                pass

            elif la_ == 2:
                self.state = 10350
                self.match(PostgreSQLParser.QUERY)
                self.state = 10356
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [202]:
                    self.state = 10351
                    self.match(PostgreSQLParser.EXECUTE)
                    self.state = 10352
                    self.a_expr()
                    self.state = 10353
                    self.opt_for_using_expression()
                    pass
                elif token in [2, 88, 92, 105, 415]:
                    self.state = 10355
                    self.selectstmt()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 3:
                self.state = 10358
                self.opt_return_result()
                pass


            self.state = 10361
            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 Opt_return_resultContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_return_result

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_return_result" ):
                listener.enterOpt_return_result(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_return_result" ):
                listener.exitOpt_return_result(self)




    def opt_return_result(self):

        localctx = PostgreSQLParser.Opt_return_resultContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1522, self.RULE_opt_return_result)
        try:
            self.state = 10365
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,705,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10364
                self.sql_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 Stmt_raiseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def RAISE(self):
            return self.getToken(PostgreSQLParser.RAISE, 0)

        def opt_stmt_raise_level(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_stmt_raise_levelContext,0)


        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def opt_raise_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_raise_listContext,0)


        def opt_raise_using(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_raise_usingContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def SQLSTATE(self):
            return self.getToken(PostgreSQLParser.SQLSTATE, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_raise

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_raise" ):
                listener.enterStmt_raise(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_raise" ):
                listener.exitStmt_raise(self)




    def stmt_raise(self):

        localctx = PostgreSQLParser.Stmt_raiseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1524, self.RULE_stmt_raise)
        try:
            self.state = 10393
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,706,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 10367
                self.match(PostgreSQLParser.RAISE)
                self.state = 10368
                self.opt_stmt_raise_level()
                self.state = 10369
                self.sconst()
                self.state = 10370
                self.opt_raise_list()
                self.state = 10371
                self.opt_raise_using()
                self.state = 10372
                self.match(PostgreSQLParser.SEMI)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10374
                self.match(PostgreSQLParser.RAISE)
                self.state = 10375
                self.opt_stmt_raise_level()
                self.state = 10376
                self.identifier()
                self.state = 10377
                self.opt_raise_using()
                self.state = 10378
                self.match(PostgreSQLParser.SEMI)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 10380
                self.match(PostgreSQLParser.RAISE)
                self.state = 10381
                self.opt_stmt_raise_level()
                self.state = 10382
                self.match(PostgreSQLParser.SQLSTATE)
                self.state = 10383
                self.sconst()
                self.state = 10384
                self.opt_raise_using()
                self.state = 10385
                self.match(PostgreSQLParser.SEMI)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 10387
                self.match(PostgreSQLParser.RAISE)
                self.state = 10388
                self.opt_stmt_raise_level()
                self.state = 10389
                self.opt_raise_using()
                self.state = 10390
                self.match(PostgreSQLParser.SEMI)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 10392
                self.match(PostgreSQLParser.RAISE)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_stmt_raise_levelContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DEBUG(self):
            return self.getToken(PostgreSQLParser.DEBUG, 0)

        def LOG(self):
            return self.getToken(PostgreSQLParser.LOG, 0)

        def INFO(self):
            return self.getToken(PostgreSQLParser.INFO, 0)

        def NOTICE(self):
            return self.getToken(PostgreSQLParser.NOTICE, 0)

        def WARNING(self):
            return self.getToken(PostgreSQLParser.WARNING, 0)

        def EXCEPTION(self):
            return self.getToken(PostgreSQLParser.EXCEPTION, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_stmt_raise_level

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_stmt_raise_level" ):
                listener.enterOpt_stmt_raise_level(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_stmt_raise_level" ):
                listener.exitOpt_stmt_raise_level(self)




    def opt_stmt_raise_level(self):

        localctx = PostgreSQLParser.Opt_stmt_raise_levelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1526, self.RULE_opt_stmt_raise_level)
        try:
            self.state = 10403
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,707,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 10397
                self.match(PostgreSQLParser.DEBUG)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 10398
                self.match(PostgreSQLParser.LOG)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 10399
                self.match(PostgreSQLParser.INFO)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 10400
                self.match(PostgreSQLParser.NOTICE)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 10401
                self.match(PostgreSQLParser.WARNING)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 10402
                self.match(PostgreSQLParser.EXCEPTION)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_raise_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.COMMA)
            else:
                return self.getToken(PostgreSQLParser.COMMA, i)

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_raise_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_raise_list" ):
                listener.enterOpt_raise_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_raise_list" ):
                listener.exitOpt_raise_list(self)




    def opt_raise_list(self):

        localctx = PostgreSQLParser.Opt_raise_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1528, self.RULE_opt_raise_list)
        self._la = 0 # Token type
        try:
            self.state = 10412
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7, 100]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [6]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10408 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 10406
                    self.match(PostgreSQLParser.COMMA)
                    self.state = 10407
                    self.a_expr()
                    self.state = 10410 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==6):
                        break

                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 Opt_raise_usingContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def opt_raise_using_elem_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_raise_using_elem_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_raise_using

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_raise_using" ):
                listener.enterOpt_raise_using(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_raise_using" ):
                listener.exitOpt_raise_using(self)




    def opt_raise_using(self):

        localctx = PostgreSQLParser.Opt_raise_usingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1530, self.RULE_opt_raise_using)
        try:
            self.state = 10417
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [100]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10415
                self.match(PostgreSQLParser.USING)
                self.state = 10416
                self.opt_raise_using_elem_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 Opt_raise_using_elemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.IdentifierContext,0)


        def EQUAL(self):
            return self.getToken(PostgreSQLParser.EQUAL, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_raise_using_elem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_raise_using_elem" ):
                listener.enterOpt_raise_using_elem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_raise_using_elem" ):
                listener.exitOpt_raise_using_elem(self)




    def opt_raise_using_elem(self):

        localctx = PostgreSQLParser.Opt_raise_using_elemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1532, self.RULE_opt_raise_using_elem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10419
            self.identifier()
            self.state = 10420
            self.match(PostgreSQLParser.EQUAL)
            self.state = 10421
            self.a_expr()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_raise_using_elem_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_raise_using_elem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Opt_raise_using_elemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Opt_raise_using_elemContext,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_opt_raise_using_elem_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_raise_using_elem_list" ):
                listener.enterOpt_raise_using_elem_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_raise_using_elem_list" ):
                listener.exitOpt_raise_using_elem_list(self)




    def opt_raise_using_elem_list(self):

        localctx = PostgreSQLParser.Opt_raise_using_elem_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1534, self.RULE_opt_raise_using_elem_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10423
            self.opt_raise_using_elem()
            self.state = 10428
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 10424
                self.match(PostgreSQLParser.COMMA)
                self.state = 10425
                self.opt_raise_using_elem()
                self.state = 10430
                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 Stmt_assertContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ASSERT(self):
            return self.getToken(PostgreSQLParser.ASSERT, 0)

        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def opt_stmt_assert_message(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_stmt_assert_messageContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_assert

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_assert" ):
                listener.enterStmt_assert(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_assert" ):
                listener.exitStmt_assert(self)




    def stmt_assert(self):

        localctx = PostgreSQLParser.Stmt_assertContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1536, self.RULE_stmt_assert)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10431
            self.match(PostgreSQLParser.ASSERT)
            self.state = 10432
            self.sql_expression()
            self.state = 10433
            self.opt_stmt_assert_message()
            self.state = 10434
            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 Opt_stmt_assert_messageContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COMMA(self):
            return self.getToken(PostgreSQLParser.COMMA, 0)

        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_stmt_assert_message

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_stmt_assert_message" ):
                listener.enterOpt_stmt_assert_message(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_stmt_assert_message" ):
                listener.exitOpt_stmt_assert_message(self)




    def opt_stmt_assert_message(self):

        localctx = PostgreSQLParser.Opt_stmt_assert_messageContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1538, self.RULE_opt_stmt_assert_message)
        try:
            self.state = 10439
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [6]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10437
                self.match(PostgreSQLParser.COMMA)
                self.state = 10438
                self.sql_expression()
                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 Loop_bodyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LOOP(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.LOOP)
            else:
                return self.getToken(PostgreSQLParser.LOOP, i)

        def proc_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_sectContext,0)


        def END_P(self):
            return self.getToken(PostgreSQLParser.END_P, 0)

        def opt_label(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_labelContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_loop_body

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLoop_body" ):
                listener.enterLoop_body(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLoop_body" ):
                listener.exitLoop_body(self)




    def loop_body(self):

        localctx = PostgreSQLParser.Loop_bodyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1540, self.RULE_loop_body)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10441
            self.match(PostgreSQLParser.LOOP)
            self.state = 10442
            self.proc_sect()
            self.state = 10443
            self.match(PostgreSQLParser.END_P)
            self.state = 10444
            self.match(PostgreSQLParser.LOOP)
            self.state = 10445
            self.opt_label()
            self.state = 10446
            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 Stmt_execsqlContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def make_execsql_stmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.Make_execsql_stmtContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_execsql

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_execsql" ):
                listener.enterStmt_execsql(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_execsql" ):
                listener.exitStmt_execsql(self)




    def stmt_execsql(self):

        localctx = PostgreSQLParser.Stmt_execsqlContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1542, self.RULE_stmt_execsql)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10448
            self.make_execsql_stmt()
            self.state = 10449
            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 Stmt_dynexecuteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EXECUTE(self):
            return self.getToken(PostgreSQLParser.EXECUTE, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def opt_execute_into(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_execute_intoContext,0)


        def opt_execute_using(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_execute_usingContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_dynexecute

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_dynexecute" ):
                listener.enterStmt_dynexecute(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_dynexecute" ):
                listener.exitStmt_dynexecute(self)




    def stmt_dynexecute(self):

        localctx = PostgreSQLParser.Stmt_dynexecuteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1544, self.RULE_stmt_dynexecute)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10451
            self.match(PostgreSQLParser.EXECUTE)
            self.state = 10452
            self.a_expr()
            self.state = 10460
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,713,self._ctx)
            if la_ == 1:
                self.state = 10453
                self.opt_execute_into()
                self.state = 10454
                self.opt_execute_using()
                pass

            elif la_ == 2:
                self.state = 10456
                self.opt_execute_using()
                self.state = 10457
                self.opt_execute_into()
                pass

            elif la_ == 3:
                pass


            self.state = 10462
            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 Opt_execute_usingContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def opt_execute_using_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_execute_using_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_execute_using

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_execute_using" ):
                listener.enterOpt_execute_using(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_execute_using" ):
                listener.exitOpt_execute_using(self)




    def opt_execute_using(self):

        localctx = PostgreSQLParser.Opt_execute_usingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1546, self.RULE_opt_execute_using)
        try:
            self.state = 10467
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7, 71]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [100]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10465
                self.match(PostgreSQLParser.USING)
                self.state = 10466
                self.opt_execute_using_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 Opt_execute_using_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.A_exprContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.A_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 getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_execute_using_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_execute_using_list" ):
                listener.enterOpt_execute_using_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_execute_using_list" ):
                listener.exitOpt_execute_using_list(self)




    def opt_execute_using_list(self):

        localctx = PostgreSQLParser.Opt_execute_using_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1548, self.RULE_opt_execute_using_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10469
            self.a_expr()
            self.state = 10474
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 10470
                self.match(PostgreSQLParser.COMMA)
                self.state = 10471
                self.a_expr()
                self.state = 10476
                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 Opt_execute_intoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INTO(self):
            return self.getToken(PostgreSQLParser.INTO, 0)

        def into_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Into_targetContext,0)


        def STRICT_P(self):
            return self.getToken(PostgreSQLParser.STRICT_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_execute_into

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_execute_into" ):
                listener.enterOpt_execute_into(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_execute_into" ):
                listener.exitOpt_execute_into(self)




    def opt_execute_into(self):

        localctx = PostgreSQLParser.Opt_execute_intoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1550, self.RULE_opt_execute_into)
        try:
            self.state = 10483
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7, 100]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [71]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10478
                self.match(PostgreSQLParser.INTO)
                self.state = 10480
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,716,self._ctx)
                if la_ == 1:
                    self.state = 10479
                    self.match(PostgreSQLParser.STRICT_P)


                self.state = 10482
                self.into_target()
                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 Stmt_openContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OPEN(self):
            return self.getToken(PostgreSQLParser.OPEN, 0)

        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def cursor_variable(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_variableContext,0)


        def opt_scroll_option(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_scroll_optionContext,0)


        def FOR(self):
            return self.getToken(PostgreSQLParser.FOR, 0)

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def selectstmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.SelectstmtContext,0)


        def EXECUTE(self):
            return self.getToken(PostgreSQLParser.EXECUTE, 0)

        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def opt_open_using(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_open_usingContext,0)


        def OPEN_PAREN(self):
            return self.getToken(PostgreSQLParser.OPEN_PAREN, 0)

        def opt_open_bound_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_open_bound_listContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(PostgreSQLParser.CLOSE_PAREN, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_open

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_open" ):
                listener.enterStmt_open(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_open" ):
                listener.exitStmt_open(self)




    def stmt_open(self):

        localctx = PostgreSQLParser.Stmt_openContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1552, self.RULE_stmt_open)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10485
            self.match(PostgreSQLParser.OPEN)
            self.state = 10503
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,720,self._ctx)
            if la_ == 1:
                self.state = 10486
                self.cursor_variable()
                self.state = 10487
                self.opt_scroll_option()
                self.state = 10488
                self.match(PostgreSQLParser.FOR)
                self.state = 10494
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [2, 88, 92, 105, 415]:
                    self.state = 10489
                    self.selectstmt()
                    pass
                elif token in [202]:
                    self.state = 10490
                    self.match(PostgreSQLParser.EXECUTE)
                    self.state = 10491
                    self.sql_expression()
                    self.state = 10492
                    self.opt_open_using()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 2:
                self.state = 10496
                self.colid()
                self.state = 10501
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==2:
                    self.state = 10497
                    self.match(PostgreSQLParser.OPEN_PAREN)
                    self.state = 10498
                    self.opt_open_bound_list()
                    self.state = 10499
                    self.match(PostgreSQLParser.CLOSE_PAREN)


                pass


            self.state = 10505
            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 Opt_open_bound_list_itemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def COLON_EQUALS(self):
            return self.getToken(PostgreSQLParser.COLON_EQUALS, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_open_bound_list_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_open_bound_list_item" ):
                listener.enterOpt_open_bound_list_item(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_open_bound_list_item" ):
                listener.exitOpt_open_bound_list_item(self)




    def opt_open_bound_list_item(self):

        localctx = PostgreSQLParser.Opt_open_bound_list_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1554, self.RULE_opt_open_bound_list_item)
        try:
            self.state = 10512
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,721,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 10507
                self.colid()
                self.state = 10508
                self.match(PostgreSQLParser.COLON_EQUALS)
                self.state = 10509
                self.a_expr()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10511
                self.a_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 Opt_open_bound_listContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_open_bound_list_item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Opt_open_bound_list_itemContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Opt_open_bound_list_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_opt_open_bound_list

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_open_bound_list" ):
                listener.enterOpt_open_bound_list(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_open_bound_list" ):
                listener.exitOpt_open_bound_list(self)




    def opt_open_bound_list(self):

        localctx = PostgreSQLParser.Opt_open_bound_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1556, self.RULE_opt_open_bound_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10514
            self.opt_open_bound_list_item()
            self.state = 10519
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==6:
                self.state = 10515
                self.match(PostgreSQLParser.COMMA)
                self.state = 10516
                self.opt_open_bound_list_item()
                self.state = 10521
                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 Opt_open_usingContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def USING(self):
            return self.getToken(PostgreSQLParser.USING, 0)

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_open_using

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_open_using" ):
                listener.enterOpt_open_using(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_open_using" ):
                listener.exitOpt_open_using(self)




    def opt_open_using(self):

        localctx = PostgreSQLParser.Opt_open_usingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1558, self.RULE_opt_open_using)
        try:
            self.state = 10525
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [7]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [100]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10523
                self.match(PostgreSQLParser.USING)
                self.state = 10524
                self.expr_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 Opt_scroll_optionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_scroll_option_no(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_scroll_option_noContext,0)


        def SCROLL(self):
            return self.getToken(PostgreSQLParser.SCROLL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_scroll_option

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_scroll_option" ):
                listener.enterOpt_scroll_option(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_scroll_option" ):
                listener.exitOpt_scroll_option(self)




    def opt_scroll_option(self):

        localctx = PostgreSQLParser.Opt_scroll_optionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1560, self.RULE_opt_scroll_option)
        try:
            self.state = 10531
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [262, 317]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10528
                self.opt_scroll_option_no()
                self.state = 10529
                self.match(PostgreSQLParser.SCROLL)
                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 Opt_scroll_option_noContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_scroll_option_no

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_scroll_option_no" ):
                listener.enterOpt_scroll_option_no(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_scroll_option_no" ):
                listener.exitOpt_scroll_option_no(self)




    def opt_scroll_option_no(self):

        localctx = PostgreSQLParser.Opt_scroll_option_noContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1562, self.RULE_opt_scroll_option_no)
        try:
            self.state = 10535
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [317]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [262]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10534
                self.match(PostgreSQLParser.NO)
                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 Stmt_fetchContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.direction = None # Opt_fetch_directionContext

        def FETCH(self):
            return self.getToken(PostgreSQLParser.FETCH, 0)

        def opt_cursor_from(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_cursor_fromContext,0)


        def cursor_variable(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_variableContext,0)


        def INTO(self):
            return self.getToken(PostgreSQLParser.INTO, 0)

        def into_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Into_targetContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def opt_fetch_direction(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_fetch_directionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_fetch

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_fetch" ):
                listener.enterStmt_fetch(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_fetch" ):
                listener.exitStmt_fetch(self)




    def stmt_fetch(self):

        localctx = PostgreSQLParser.Stmt_fetchContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1564, self.RULE_stmt_fetch)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10537
            self.match(PostgreSQLParser.FETCH)
            self.state = 10538
            localctx.direction = self.opt_fetch_direction()
            self.state = 10539
            self.opt_cursor_from()
            self.state = 10540
            self.cursor_variable()
            self.state = 10541
            self.match(PostgreSQLParser.INTO)
            self.state = 10542
            self.into_target()
            self.state = 10543
            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 Into_targetContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def expr_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_listContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_into_target

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInto_target" ):
                listener.enterInto_target(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInto_target" ):
                listener.exitInto_target(self)




    def into_target(self):

        localctx = PostgreSQLParser.Into_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1566, self.RULE_into_target)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10545
            self.expr_list()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_cursor_fromContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FROM(self):
            return self.getToken(PostgreSQLParser.FROM, 0)

        def IN_P(self):
            return self.getToken(PostgreSQLParser.IN_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_cursor_from

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_cursor_from" ):
                listener.enterOpt_cursor_from(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_cursor_from" ):
                listener.exitOpt_cursor_from(self)




    def opt_cursor_from(self):

        localctx = PostgreSQLParser.Opt_cursor_fromContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1568, self.RULE_opt_cursor_from)
        try:
            self.state = 10550
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [28, 33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [64]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10548
                self.match(PostgreSQLParser.FROM)
                pass
            elif token in [68]:
                self.enterOuterAlt(localctx, 3)
                self.state = 10549
                self.match(PostgreSQLParser.IN_P)
                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 Opt_fetch_directionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NEXT(self):
            return self.getToken(PostgreSQLParser.NEXT, 0)

        def PRIOR(self):
            return self.getToken(PostgreSQLParser.PRIOR, 0)

        def FIRST_P(self):
            return self.getToken(PostgreSQLParser.FIRST_P, 0)

        def LAST_P(self):
            return self.getToken(PostgreSQLParser.LAST_P, 0)

        def ABSOLUTE_P(self):
            return self.getToken(PostgreSQLParser.ABSOLUTE_P, 0)

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def RELATIVE_P(self):
            return self.getToken(PostgreSQLParser.RELATIVE_P, 0)

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def FORWARD(self):
            return self.getToken(PostgreSQLParser.FORWARD, 0)

        def BACKWARD(self):
            return self.getToken(PostgreSQLParser.BACKWARD, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_fetch_direction

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_fetch_direction" ):
                listener.enterOpt_fetch_direction(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_fetch_direction" ):
                listener.exitOpt_fetch_direction(self)




    def opt_fetch_direction(self):

        localctx = PostgreSQLParser.Opt_fetch_directionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1570, self.RULE_opt_fetch_direction)
        self._la = 0 # Token type
        try:
            self.state = 10569
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,728,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)

                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 10554
                self.match(PostgreSQLParser.NEXT)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 10555
                self.match(PostgreSQLParser.PRIOR)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 10556
                self.match(PostgreSQLParser.FIRST_P)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 10557
                self.match(PostgreSQLParser.LAST_P)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 10558
                self.match(PostgreSQLParser.ABSOLUTE_P)
                self.state = 10559
                self.a_expr()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 10560
                self.match(PostgreSQLParser.RELATIVE_P)
                self.state = 10561
                self.a_expr()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 10562
                self.a_expr()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 10563
                self.match(PostgreSQLParser.ALL)
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 10564
                _la = self._input.LA(1)
                if not(_la==144 or _la==210):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 10567
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,727,self._ctx)
                if la_ == 1:
                    self.state = 10565
                    self.a_expr()

                elif la_ == 2:
                    self.state = 10566
                    self.match(PostgreSQLParser.ALL)


                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Stmt_moveContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def MOVE(self):
            return self.getToken(PostgreSQLParser.MOVE, 0)

        def opt_fetch_direction(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_fetch_directionContext,0)


        def cursor_variable(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_variableContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_move

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_move" ):
                listener.enterStmt_move(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_move" ):
                listener.exitStmt_move(self)




    def stmt_move(self):

        localctx = PostgreSQLParser.Stmt_moveContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1572, self.RULE_stmt_move)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10571
            self.match(PostgreSQLParser.MOVE)
            self.state = 10572
            self.opt_fetch_direction()
            self.state = 10573
            self.cursor_variable()
            self.state = 10574
            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 Stmt_closeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CLOSE(self):
            return self.getToken(PostgreSQLParser.CLOSE, 0)

        def cursor_variable(self):
            return self.getTypedRuleContext(PostgreSQLParser.Cursor_variableContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_close

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_close" ):
                listener.enterStmt_close(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_close" ):
                listener.exitStmt_close(self)




    def stmt_close(self):

        localctx = PostgreSQLParser.Stmt_closeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1574, self.RULE_stmt_close)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10576
            self.match(PostgreSQLParser.CLOSE)
            self.state = 10577
            self.cursor_variable()
            self.state = 10578
            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 Stmt_nullContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NULL_P(self):
            return self.getToken(PostgreSQLParser.NULL_P, 0)

        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_null

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_null" ):
                listener.enterStmt_null(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_null" ):
                listener.exitStmt_null(self)




    def stmt_null(self):

        localctx = PostgreSQLParser.Stmt_nullContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1576, self.RULE_stmt_null)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10580
            self.match(PostgreSQLParser.NULL_P)
            self.state = 10581
            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 Stmt_commitContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COMMIT(self):
            return self.getToken(PostgreSQLParser.COMMIT, 0)

        def plsql_opt_transaction_chain(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_opt_transaction_chainContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_commit

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_commit" ):
                listener.enterStmt_commit(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_commit" ):
                listener.exitStmt_commit(self)




    def stmt_commit(self):

        localctx = PostgreSQLParser.Stmt_commitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1578, self.RULE_stmt_commit)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10583
            self.match(PostgreSQLParser.COMMIT)
            self.state = 10584
            self.plsql_opt_transaction_chain()
            self.state = 10585
            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 Stmt_rollbackContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ROLLBACK(self):
            return self.getToken(PostgreSQLParser.ROLLBACK, 0)

        def plsql_opt_transaction_chain(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_opt_transaction_chainContext,0)


        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_rollback

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_rollback" ):
                listener.enterStmt_rollback(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_rollback" ):
                listener.exitStmt_rollback(self)




    def stmt_rollback(self):

        localctx = PostgreSQLParser.Stmt_rollbackContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1580, self.RULE_stmt_rollback)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10587
            self.match(PostgreSQLParser.ROLLBACK)
            self.state = 10588
            self.plsql_opt_transaction_chain()
            self.state = 10589
            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 Plsql_opt_transaction_chainContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AND(self):
            return self.getToken(PostgreSQLParser.AND, 0)

        def CHAIN(self):
            return self.getToken(PostgreSQLParser.CHAIN, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_plsql_opt_transaction_chain

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPlsql_opt_transaction_chain" ):
                listener.enterPlsql_opt_transaction_chain(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPlsql_opt_transaction_chain" ):
                listener.exitPlsql_opt_transaction_chain(self)




    def plsql_opt_transaction_chain(self):

        localctx = PostgreSQLParser.Plsql_opt_transaction_chainContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1582, self.RULE_plsql_opt_transaction_chain)
        self._la = 0 # Token type
        try:
            self.state = 10597
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33]:
                self.enterOuterAlt(localctx, 1)
                self.state = 10591
                self.match(PostgreSQLParser.AND)
                self.state = 10593
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==262:
                    self.state = 10592
                    self.match(PostgreSQLParser.NO)


                self.state = 10595
                self.match(PostgreSQLParser.CHAIN)
                pass
            elif token in [7]:
                self.enterOuterAlt(localctx, 2)

                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 Stmt_setContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def any_name(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_nameContext,0)


        def TO(self):
            return self.getToken(PostgreSQLParser.TO, 0)

        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def SEMI(self):
            return self.getToken(PostgreSQLParser.SEMI, 0)

        def RESET(self):
            return self.getToken(PostgreSQLParser.RESET, 0)

        def ALL(self):
            return self.getToken(PostgreSQLParser.ALL, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_stmt_set

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStmt_set" ):
                listener.enterStmt_set(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStmt_set" ):
                listener.exitStmt_set(self)




    def stmt_set(self):

        localctx = PostgreSQLParser.Stmt_setContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1584, self.RULE_stmt_set)
        try:
            self.state = 10611
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [326]:
                self.enterOuterAlt(localctx, 1)
                self.state = 10599
                self.match(PostgreSQLParser.SET)
                self.state = 10600
                self.any_name()
                self.state = 10601
                self.match(PostgreSQLParser.TO)
                self.state = 10602
                self.match(PostgreSQLParser.DEFAULT)
                self.state = 10603
                self.match(PostgreSQLParser.SEMI)
                pass
            elif token in [306]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10605
                self.match(PostgreSQLParser.RESET)
                self.state = 10608
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                    self.state = 10606
                    self.any_name()
                    pass
                elif token in [30]:
                    self.state = 10607
                    self.match(PostgreSQLParser.ALL)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 10610
                self.match(PostgreSQLParser.SEMI)
                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 Cursor_variableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def PARAM(self):
            return self.getToken(PostgreSQLParser.PARAM, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_cursor_variable

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterCursor_variable" ):
                listener.enterCursor_variable(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitCursor_variable" ):
                listener.exitCursor_variable(self)




    def cursor_variable(self):

        localctx = PostgreSQLParser.Cursor_variableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1586, self.RULE_cursor_variable)
        try:
            self.state = 10615
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 1)
                self.state = 10613
                self.colid()
                pass
            elif token in [28]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10614
                self.match(PostgreSQLParser.PARAM)
                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 Exception_sectContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EXCEPTION(self):
            return self.getToken(PostgreSQLParser.EXCEPTION, 0)

        def proc_exceptions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_exceptionsContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_exception_sect

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterException_sect" ):
                listener.enterException_sect(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitException_sect" ):
                listener.exitException_sect(self)




    def exception_sect(self):

        localctx = PostgreSQLParser.Exception_sectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1588, self.RULE_exception_sect)
        try:
            self.state = 10620
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [454]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [517]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10618
                self.match(PostgreSQLParser.EXCEPTION)
                self.state = 10619
                self.proc_exceptions()
                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 Proc_exceptionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def proc_exception(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Proc_exceptionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Proc_exceptionContext,i)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_proc_exceptions

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProc_exceptions" ):
                listener.enterProc_exceptions(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProc_exceptions" ):
                listener.exitProc_exceptions(self)




    def proc_exceptions(self):

        localctx = PostgreSQLParser.Proc_exceptionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1590, self.RULE_proc_exceptions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10623 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 10622
                self.proc_exception()
                self.state = 10625 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==102):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Proc_exceptionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def proc_conditions(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_conditionsContext,0)


        def THEN(self):
            return self.getToken(PostgreSQLParser.THEN, 0)

        def proc_sect(self):
            return self.getTypedRuleContext(PostgreSQLParser.Proc_sectContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_proc_exception

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProc_exception" ):
                listener.enterProc_exception(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProc_exception" ):
                listener.exitProc_exception(self)




    def proc_exception(self):

        localctx = PostgreSQLParser.Proc_exceptionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1592, self.RULE_proc_exception)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10627
            self.match(PostgreSQLParser.WHEN)
            self.state = 10628
            self.proc_conditions()
            self.state = 10629
            self.match(PostgreSQLParser.THEN)
            self.state = 10630
            self.proc_sect()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Proc_conditionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def proc_condition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(PostgreSQLParser.Proc_conditionContext)
            else:
                return self.getTypedRuleContext(PostgreSQLParser.Proc_conditionContext,i)


        def OR(self, i:int=None):
            if i is None:
                return self.getTokens(PostgreSQLParser.OR)
            else:
                return self.getToken(PostgreSQLParser.OR, i)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_proc_conditions

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProc_conditions" ):
                listener.enterProc_conditions(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProc_conditions" ):
                listener.exitProc_conditions(self)




    def proc_conditions(self):

        localctx = PostgreSQLParser.Proc_conditionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1594, self.RULE_proc_conditions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10632
            self.proc_condition()
            self.state = 10637
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==82:
                self.state = 10633
                self.match(PostgreSQLParser.OR)
                self.state = 10634
                self.proc_condition()
                self.state = 10639
                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 Proc_conditionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def any_identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_identifierContext,0)


        def SQLSTATE(self):
            return self.getToken(PostgreSQLParser.SQLSTATE, 0)

        def sconst(self):
            return self.getTypedRuleContext(PostgreSQLParser.SconstContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_proc_condition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProc_condition" ):
                listener.enterProc_condition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProc_condition" ):
                listener.exitProc_condition(self)




    def proc_condition(self):

        localctx = PostgreSQLParser.Proc_conditionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1596, self.RULE_proc_condition)
        try:
            self.state = 10643
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,737,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 10640
                self.any_identifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10641
                self.match(PostgreSQLParser.SQLSTATE)
                self.state = 10642
                self.sconst()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_block_labelContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def label_decl(self):
            return self.getTypedRuleContext(PostgreSQLParser.Label_declContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_block_label

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_block_label" ):
                listener.enterOpt_block_label(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_block_label" ):
                listener.exitOpt_block_label(self)




    def opt_block_label(self):

        localctx = PostgreSQLParser.Opt_block_labelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1598, self.RULE_opt_block_label)
        try:
            self.state = 10647
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [146, 178]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [18]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10646
                self.label_decl()
                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 Opt_loop_labelContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def label_decl(self):
            return self.getTypedRuleContext(PostgreSQLParser.Label_declContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_loop_label

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_loop_label" ):
                listener.enterOpt_loop_label(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_loop_label" ):
                listener.exitOpt_loop_label(self)




    def opt_loop_label(self):

        localctx = PostgreSQLParser.Opt_loop_labelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1600, self.RULE_opt_loop_label)
        try:
            self.state = 10651
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [62, 503, 505, 519]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [18]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10650
                self.label_decl()
                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 Opt_labelContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def any_identifier(self):
            return self.getTypedRuleContext(PostgreSQLParser.Any_identifierContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_label

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_label" ):
                listener.enterOpt_label(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_label" ):
                listener.exitOpt_label(self)




    def opt_label(self):

        localctx = PostgreSQLParser.Opt_labelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1602, self.RULE_opt_label)
        try:
            self.state = 10655
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [-1, 7, 102]:
                self.enterOuterAlt(localctx, 1)

                pass
            elif token in [33, 35, 43, 44, 45, 53, 57, 61, 92, 116, 119, 123, 124, 126, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 251, 252, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 504, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 641, 661, 662]:
                self.enterOuterAlt(localctx, 2)
                self.state = 10654
                self.any_identifier()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_exitcondContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WHEN(self):
            return self.getToken(PostgreSQLParser.WHEN, 0)

        def expr_until_semi(self):
            return self.getTypedRuleContext(PostgreSQLParser.Expr_until_semiContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_exitcond

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_exitcond" ):
                listener.enterOpt_exitcond(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_exitcond" ):
                listener.exitOpt_exitcond(self)




    def opt_exitcond(self):

        localctx = PostgreSQLParser.Opt_exitcondContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1604, self.RULE_opt_exitcond)
        try:
            self.state = 10660
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [102]:
                self.enterOuterAlt(localctx, 1)
                self.state = 10657
                self.match(PostgreSQLParser.WHEN)
                self.state = 10658
                self.expr_until_semi()
                pass
            elif token in [7]:
                self.enterOuterAlt(localctx, 2)

                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 Any_identifierContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def colid(self):
            return self.getTypedRuleContext(PostgreSQLParser.ColidContext,0)


        def plsql_unreserved_keyword(self):
            return self.getTypedRuleContext(PostgreSQLParser.Plsql_unreserved_keywordContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_any_identifier

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAny_identifier" ):
                listener.enterAny_identifier(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAny_identifier" ):
                listener.exitAny_identifier(self)




    def any_identifier(self):

        localctx = PostgreSQLParser.Any_identifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1606, self.RULE_any_identifier)
        try:
            self.state = 10664
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,742,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 10662
                self.colid()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 10663
                self.plsql_unreserved_keyword()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Plsql_unreserved_keywordContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ABSOLUTE_P(self):
            return self.getToken(PostgreSQLParser.ABSOLUTE_P, 0)

        def ALIAS(self):
            return self.getToken(PostgreSQLParser.ALIAS, 0)

        def AND(self):
            return self.getToken(PostgreSQLParser.AND, 0)

        def ARRAY(self):
            return self.getToken(PostgreSQLParser.ARRAY, 0)

        def ASSERT(self):
            return self.getToken(PostgreSQLParser.ASSERT, 0)

        def BACKWARD(self):
            return self.getToken(PostgreSQLParser.BACKWARD, 0)

        def CALL(self):
            return self.getToken(PostgreSQLParser.CALL, 0)

        def CHAIN(self):
            return self.getToken(PostgreSQLParser.CHAIN, 0)

        def CLOSE(self):
            return self.getToken(PostgreSQLParser.CLOSE, 0)

        def COLLATE(self):
            return self.getToken(PostgreSQLParser.COLLATE, 0)

        def COLUMN(self):
            return self.getToken(PostgreSQLParser.COLUMN, 0)

        def COMMIT(self):
            return self.getToken(PostgreSQLParser.COMMIT, 0)

        def CONSTANT(self):
            return self.getToken(PostgreSQLParser.CONSTANT, 0)

        def CONSTRAINT(self):
            return self.getToken(PostgreSQLParser.CONSTRAINT, 0)

        def CONTINUE_P(self):
            return self.getToken(PostgreSQLParser.CONTINUE_P, 0)

        def CURRENT_P(self):
            return self.getToken(PostgreSQLParser.CURRENT_P, 0)

        def CURSOR(self):
            return self.getToken(PostgreSQLParser.CURSOR, 0)

        def DEBUG(self):
            return self.getToken(PostgreSQLParser.DEBUG, 0)

        def DEFAULT(self):
            return self.getToken(PostgreSQLParser.DEFAULT, 0)

        def DIAGNOSTICS(self):
            return self.getToken(PostgreSQLParser.DIAGNOSTICS, 0)

        def DO(self):
            return self.getToken(PostgreSQLParser.DO, 0)

        def DUMP(self):
            return self.getToken(PostgreSQLParser.DUMP, 0)

        def ELSIF(self):
            return self.getToken(PostgreSQLParser.ELSIF, 0)

        def ERROR(self):
            return self.getToken(PostgreSQLParser.ERROR, 0)

        def EXCEPTION(self):
            return self.getToken(PostgreSQLParser.EXCEPTION, 0)

        def EXIT(self):
            return self.getToken(PostgreSQLParser.EXIT, 0)

        def FETCH(self):
            return self.getToken(PostgreSQLParser.FETCH, 0)

        def FIRST_P(self):
            return self.getToken(PostgreSQLParser.FIRST_P, 0)

        def FORWARD(self):
            return self.getToken(PostgreSQLParser.FORWARD, 0)

        def GET(self):
            return self.getToken(PostgreSQLParser.GET, 0)

        def INFO(self):
            return self.getToken(PostgreSQLParser.INFO, 0)

        def INSERT(self):
            return self.getToken(PostgreSQLParser.INSERT, 0)

        def IS(self):
            return self.getToken(PostgreSQLParser.IS, 0)

        def LAST_P(self):
            return self.getToken(PostgreSQLParser.LAST_P, 0)

        def MOVE(self):
            return self.getToken(PostgreSQLParser.MOVE, 0)

        def NEXT(self):
            return self.getToken(PostgreSQLParser.NEXT, 0)

        def NO(self):
            return self.getToken(PostgreSQLParser.NO, 0)

        def NOTICE(self):
            return self.getToken(PostgreSQLParser.NOTICE, 0)

        def OPEN(self):
            return self.getToken(PostgreSQLParser.OPEN, 0)

        def OPTION(self):
            return self.getToken(PostgreSQLParser.OPTION, 0)

        def PERFORM(self):
            return self.getToken(PostgreSQLParser.PERFORM, 0)

        def PRINT_STRICT_PARAMS(self):
            return self.getToken(PostgreSQLParser.PRINT_STRICT_PARAMS, 0)

        def PRIOR(self):
            return self.getToken(PostgreSQLParser.PRIOR, 0)

        def QUERY(self):
            return self.getToken(PostgreSQLParser.QUERY, 0)

        def RAISE(self):
            return self.getToken(PostgreSQLParser.RAISE, 0)

        def RELATIVE_P(self):
            return self.getToken(PostgreSQLParser.RELATIVE_P, 0)

        def RESET(self):
            return self.getToken(PostgreSQLParser.RESET, 0)

        def RETURN(self):
            return self.getToken(PostgreSQLParser.RETURN, 0)

        def ROLLBACK(self):
            return self.getToken(PostgreSQLParser.ROLLBACK, 0)

        def ROWTYPE(self):
            return self.getToken(PostgreSQLParser.ROWTYPE, 0)

        def SCHEMA(self):
            return self.getToken(PostgreSQLParser.SCHEMA, 0)

        def SCROLL(self):
            return self.getToken(PostgreSQLParser.SCROLL, 0)

        def SET(self):
            return self.getToken(PostgreSQLParser.SET, 0)

        def SLICE(self):
            return self.getToken(PostgreSQLParser.SLICE, 0)

        def SQLSTATE(self):
            return self.getToken(PostgreSQLParser.SQLSTATE, 0)

        def STACKED(self):
            return self.getToken(PostgreSQLParser.STACKED, 0)

        def TABLE(self):
            return self.getToken(PostgreSQLParser.TABLE, 0)

        def TYPE_P(self):
            return self.getToken(PostgreSQLParser.TYPE_P, 0)

        def USE_COLUMN(self):
            return self.getToken(PostgreSQLParser.USE_COLUMN, 0)

        def USE_VARIABLE(self):
            return self.getToken(PostgreSQLParser.USE_VARIABLE, 0)

        def VARIABLE_CONFLICT(self):
            return self.getToken(PostgreSQLParser.VARIABLE_CONFLICT, 0)

        def WARNING(self):
            return self.getToken(PostgreSQLParser.WARNING, 0)

        def OUTER_P(self):
            return self.getToken(PostgreSQLParser.OUTER_P, 0)

        def getRuleIndex(self):
            return PostgreSQLParser.RULE_plsql_unreserved_keyword

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPlsql_unreserved_keyword" ):
                listener.enterPlsql_unreserved_keyword(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPlsql_unreserved_keyword" ):
                listener.exitPlsql_unreserved_keyword(self)




    def plsql_unreserved_keyword(self):

        localctx = PostgreSQLParser.Plsql_unreserved_keywordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1608, self.RULE_plsql_unreserved_keyword)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10666
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 2459027012145119232) != 0) or ((((_la - 92)) & ~0x3f) == 0 and ((1 << (_la - 92)) & 2310346885883232257) != 0) or ((((_la - 157)) & ~0x3f) == 0 and ((1 << (_la - 157)) & 10133099161617425) != 0) or ((((_la - 232)) & ~0x3f) == 0 and ((1 << (_la - 232)) & 18015499698831617) != 0) or ((((_la - 300)) & ~0x3f) == 0 and ((1 << (_la - 300)) & 9007199322050625) != 0) or ((((_la - 433)) & ~0x3f) == 0 and ((1 << (_la - 433)) & -144097595889811453) != 0) or ((((_la - 497)) & ~0x3f) == 0 and ((1 << (_la - 497)) & 12516927) != 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 Sql_expressionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def opt_target_list(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_target_listContext,0)


        def into_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Into_clauseContext,0)


        def from_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.From_clauseContext,0)


        def where_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Where_clauseContext,0)


        def group_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Group_clauseContext,0)


        def having_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Having_clauseContext,0)


        def window_clause(self):
            return self.getTypedRuleContext(PostgreSQLParser.Window_clauseContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_sql_expression

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSql_expression" ):
                listener.enterSql_expression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSql_expression" ):
                listener.exitSql_expression(self)




    def sql_expression(self):

        localctx = PostgreSQLParser.Sql_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1610, self.RULE_sql_expression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10668
            self.opt_target_list()
            self.state = 10669
            self.into_clause()
            self.state = 10670
            self.from_clause()
            self.state = 10671
            self.where_clause()
            self.state = 10672
            self.group_clause()
            self.state = 10673
            self.having_clause()
            self.state = 10674
            self.window_clause()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Expr_until_thenContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_expr_until_then

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpr_until_then" ):
                listener.enterExpr_until_then(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpr_until_then" ):
                listener.exitExpr_until_then(self)




    def expr_until_then(self):

        localctx = PostgreSQLParser.Expr_until_thenContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1612, self.RULE_expr_until_then)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10676
            self.sql_expression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Expr_until_semiContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sql_expression(self):
            return self.getTypedRuleContext(PostgreSQLParser.Sql_expressionContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_expr_until_semi

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpr_until_semi" ):
                listener.enterExpr_until_semi(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpr_until_semi" ):
                listener.exitExpr_until_semi(self)




    def expr_until_semi(self):

        localctx = PostgreSQLParser.Expr_until_semiContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1614, self.RULE_expr_until_semi)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10678
            self.sql_expression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Expr_until_rightbracketContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_expr_until_rightbracket

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpr_until_rightbracket" ):
                listener.enterExpr_until_rightbracket(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpr_until_rightbracket" ):
                listener.exitExpr_until_rightbracket(self)




    def expr_until_rightbracket(self):

        localctx = PostgreSQLParser.Expr_until_rightbracketContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1616, self.RULE_expr_until_rightbracket)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10680
            self.a_expr()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Expr_until_loopContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def a_expr(self):
            return self.getTypedRuleContext(PostgreSQLParser.A_exprContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_expr_until_loop

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpr_until_loop" ):
                listener.enterExpr_until_loop(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpr_until_loop" ):
                listener.exitExpr_until_loop(self)




    def expr_until_loop(self):

        localctx = PostgreSQLParser.Expr_until_loopContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1618, self.RULE_expr_until_loop)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10682
            self.a_expr()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Make_execsql_stmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def stmt(self):
            return self.getTypedRuleContext(PostgreSQLParser.StmtContext,0)


        def opt_returning_clause_into(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_returning_clause_intoContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_make_execsql_stmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMake_execsql_stmt" ):
                listener.enterMake_execsql_stmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMake_execsql_stmt" ):
                listener.exitMake_execsql_stmt(self)




    def make_execsql_stmt(self):

        localctx = PostgreSQLParser.Make_execsql_stmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1620, self.RULE_make_execsql_stmt)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 10684
            self.stmt()
            self.state = 10685
            self.opt_returning_clause_into()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Opt_returning_clause_intoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INTO(self):
            return self.getToken(PostgreSQLParser.INTO, 0)

        def opt_strict(self):
            return self.getTypedRuleContext(PostgreSQLParser.Opt_strictContext,0)


        def into_target(self):
            return self.getTypedRuleContext(PostgreSQLParser.Into_targetContext,0)


        def getRuleIndex(self):
            return PostgreSQLParser.RULE_opt_returning_clause_into

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOpt_returning_clause_into" ):
                listener.enterOpt_returning_clause_into(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOpt_returning_clause_into" ):
                listener.exitOpt_returning_clause_into(self)




    def opt_returning_clause_into(self):

        localctx = PostgreSQLParser.Opt_returning_clause_intoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 1622, self.RULE_opt_returning_clause_into)
        try:
            self.state = 10692
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [71]:
                self.enterOuterAlt(localctx, 1)
                self.state = 10687
                self.match(PostgreSQLParser.INTO)
                self.state = 10688
                self.opt_strict()
                self.state = 10689
                self.into_target()
                pass
            elif token in [7]:
                self.enterOuterAlt(localctx, 2)

                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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[602] = self.b_expr_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

    def b_expr_sempred(self, localctx:B_exprContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 8)
         

            if predIndex == 1:
                return self.precpred(self._ctx, 7)
         

            if predIndex == 2:
                return self.precpred(self._ctx, 6)
         

            if predIndex == 3:
                return self.precpred(self._ctx, 5)
         

            if predIndex == 4:
                return self.precpred(self._ctx, 4)
         

            if predIndex == 5:
                return self.precpred(self._ctx, 10)
         

            if predIndex == 6:
                return self.precpred(self._ctx, 2)
         

            if predIndex == 7:
                return self.precpred(self._ctx, 1)
         




