# flake8: noqa
# Generated from cql.g4 by ANTLR 4.13.2
# 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,169,1195,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,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3,0,220,8,0,
        1,1,3,1,223,8,1,1,1,5,1,226,8,1,10,1,12,1,229,9,1,1,1,5,1,232,8,
        1,10,1,12,1,235,9,1,1,1,1,1,1,2,1,2,1,2,1,2,3,2,243,8,2,1,3,1,3,
        1,3,1,3,3,3,249,8,3,1,3,1,3,3,3,253,8,3,1,4,1,4,1,4,1,4,3,4,259,
        8,4,1,4,1,4,3,4,263,8,4,1,5,1,5,1,6,1,6,1,7,3,7,270,8,7,1,7,1,7,
        1,7,3,7,275,8,7,1,7,1,7,3,7,279,8,7,1,8,3,8,282,8,8,1,8,1,8,1,8,
        1,8,1,8,1,8,3,8,290,8,8,1,9,3,9,293,8,9,1,9,1,9,1,9,1,9,1,9,1,9,
        3,9,301,8,9,1,9,3,9,304,8,9,1,10,1,10,1,10,1,10,1,10,5,10,311,8,
        10,10,10,12,10,314,9,10,1,10,1,10,1,11,1,11,1,11,3,11,321,8,11,1,
        11,1,11,1,12,1,12,1,13,3,13,328,8,13,1,13,1,13,1,13,1,13,1,13,1,
        13,1,13,3,13,337,8,13,1,14,3,14,340,8,14,1,14,1,14,1,14,1,14,1,14,
        1,14,1,14,5,14,349,8,14,10,14,12,14,352,9,14,1,14,1,14,3,14,356,
        8,14,1,15,1,15,1,15,3,15,361,8,15,1,15,1,15,1,16,1,16,1,17,1,17,
        1,18,1,18,1,19,1,19,1,20,1,20,1,20,1,20,1,20,3,20,378,8,20,1,21,
        1,21,1,21,5,21,383,8,21,10,21,12,21,386,9,21,1,21,1,21,1,22,1,22,
        1,23,1,23,1,23,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,25,1,25,1,25,
        1,25,1,25,5,25,407,8,25,10,25,12,25,410,9,25,1,25,1,25,1,26,1,26,
        1,26,1,27,1,27,1,27,1,27,1,27,5,27,422,8,27,10,27,12,27,425,9,27,
        1,27,1,27,1,28,1,28,1,28,3,28,432,8,28,1,29,1,29,3,29,436,8,29,1,
        29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,3,30,446,8,30,1,30,1,30,1,
        31,1,31,1,32,1,32,3,32,454,8,32,1,32,3,32,457,8,32,1,32,1,32,1,32,
        1,32,1,32,1,32,5,32,465,8,32,10,32,12,32,468,9,32,3,32,470,8,32,
        1,32,1,32,1,32,3,32,475,8,32,1,32,1,32,1,32,3,32,480,8,32,1,33,1,
        33,1,33,1,34,1,34,1,35,1,35,1,35,1,35,1,35,1,35,3,35,493,8,35,1,
        36,1,36,1,36,1,37,1,37,1,38,1,38,3,38,502,8,38,1,39,1,39,1,39,1,
        39,1,39,1,40,1,40,1,40,1,40,1,40,1,41,1,41,1,41,1,41,3,41,518,8,
        41,1,41,1,41,1,41,1,41,1,41,3,41,525,8,41,1,41,3,41,528,8,41,1,41,
        1,41,1,42,1,42,1,43,1,43,1,44,1,44,1,45,1,45,3,45,540,8,45,1,46,
        1,46,1,47,1,47,3,47,546,8,47,1,47,5,47,549,8,47,10,47,12,47,552,
        9,47,1,47,3,47,555,8,47,1,47,1,47,3,47,559,8,47,1,47,3,47,562,8,
        47,1,48,3,48,565,8,48,1,48,1,48,1,48,5,48,570,8,48,10,48,12,48,573,
        9,48,1,49,1,49,1,49,1,49,5,49,579,8,49,10,49,12,49,582,9,49,1,50,
        1,50,1,50,1,50,1,51,1,51,1,51,1,52,1,52,3,52,593,8,52,1,52,1,52,
        1,53,1,53,3,53,599,8,53,1,53,1,53,3,53,603,8,53,1,53,1,53,1,53,1,
        54,1,54,1,54,1,54,1,54,1,54,1,54,3,54,615,8,54,1,55,1,55,1,55,1,
        55,1,55,1,55,5,55,623,8,55,10,55,12,55,626,9,55,3,55,628,8,55,1,
        56,1,56,1,57,1,57,3,57,634,8,57,1,58,1,58,1,58,5,58,639,8,58,10,
        58,12,58,642,9,58,1,58,1,58,1,59,1,59,1,59,5,59,649,8,59,10,59,12,
        59,652,9,59,1,59,1,59,1,60,1,60,1,61,1,61,1,61,1,61,1,61,1,61,1,
        61,1,61,1,61,1,61,1,61,5,61,669,8,61,10,61,12,61,672,9,61,1,62,1,
        62,3,62,676,8,62,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,
        63,1,63,1,63,1,63,1,63,1,63,3,63,693,8,63,1,63,1,63,1,63,1,63,1,
        63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,3,63,709,8,63,1,
        63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,
        63,1,63,1,63,3,63,727,8,63,1,63,1,63,1,63,1,63,1,63,3,63,734,8,63,
        1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,1,63,
        3,63,749,8,63,1,63,1,63,1,63,1,63,1,63,1,63,3,63,757,8,63,1,63,1,
        63,1,63,1,63,1,63,5,63,764,8,63,10,63,12,63,767,9,63,1,64,1,64,1,
        65,1,65,1,65,1,65,1,65,3,65,776,8,65,1,66,1,66,1,67,1,67,1,67,1,
        67,1,67,1,67,1,67,3,67,787,8,67,1,67,1,67,1,67,1,67,1,67,1,67,1,
        67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,
        67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,
        67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,
        67,1,67,3,67,836,8,67,1,67,4,67,839,8,67,11,67,12,67,840,1,67,1,
        67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,3,67,854,8,67,3,
        67,856,8,67,3,67,858,8,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,
        1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,1,67,5,67,877,8,67,10,67,
        12,67,880,9,67,1,68,1,68,1,68,1,68,1,68,1,69,1,69,1,69,1,70,1,70,
        1,71,1,71,1,72,1,72,1,73,1,73,3,73,898,8,73,1,73,1,73,1,73,3,73,
        903,8,73,1,74,3,74,906,8,74,1,74,1,74,1,74,3,74,911,8,74,3,74,913,
        8,74,1,75,3,75,916,8,75,1,75,1,75,3,75,920,8,75,1,75,1,75,3,75,924,
        8,75,1,75,3,75,927,8,75,1,75,3,75,930,8,75,1,75,1,75,3,75,934,8,
        75,1,75,3,75,937,8,75,1,75,3,75,940,8,75,1,75,3,75,943,8,75,1,75,
        1,75,3,75,947,8,75,1,75,3,75,950,8,75,1,75,3,75,953,8,75,1,75,1,
        75,3,75,957,8,75,1,75,3,75,960,8,75,1,75,3,75,963,8,75,1,75,3,75,
        966,8,75,1,75,1,75,1,75,1,75,3,75,972,8,75,1,75,1,75,3,75,976,8,
        75,1,75,3,75,979,8,75,1,75,1,75,3,75,983,8,75,1,75,3,75,986,8,75,
        1,75,1,75,3,75,990,8,75,1,75,1,75,3,75,994,8,75,3,75,996,8,75,1,
        76,1,76,1,76,1,76,1,76,1,76,1,76,1,76,1,76,1,76,1,76,1,76,1,76,3,
        76,1011,8,76,1,77,1,77,3,77,1015,8,77,1,78,1,78,1,78,3,78,1020,8,
        78,1,78,1,78,1,79,1,79,1,79,1,79,1,79,3,79,1029,8,79,1,80,1,80,1,
        80,3,80,1034,8,80,1,80,1,80,1,81,1,81,1,81,1,81,1,82,1,82,1,82,1,
        82,1,82,1,82,1,82,1,82,1,82,1,82,3,82,1052,8,82,1,83,1,83,1,83,1,
        83,1,83,1,83,1,83,1,84,3,84,1062,8,84,1,84,1,84,1,84,1,84,1,84,5,
        84,1069,8,84,10,84,12,84,1072,9,84,3,84,1074,8,84,1,84,1,84,1,85,
        1,85,1,85,1,85,1,86,1,86,1,86,1,86,1,86,1,86,5,86,1088,8,86,10,86,
        12,86,1091,9,86,3,86,1093,8,86,1,86,1,86,1,87,1,87,1,87,1,87,1,88,
        1,88,1,88,1,88,1,88,3,88,1106,8,88,3,88,1108,8,88,1,88,1,88,1,88,
        1,88,5,88,1114,8,88,10,88,12,88,1117,9,88,3,88,1119,8,88,1,88,1,
        88,1,89,1,89,1,89,1,90,1,90,1,90,1,90,1,90,3,90,1131,8,90,1,91,1,
        91,1,91,1,91,1,91,5,91,1138,8,91,10,91,12,91,1141,9,91,1,91,1,91,
        3,91,1145,8,91,1,92,1,92,1,93,1,93,1,94,1,94,1,95,1,95,1,96,1,96,
        1,97,1,97,1,98,1,98,3,98,1161,8,98,1,99,1,99,3,99,1165,8,99,1,100,
        1,100,3,100,1169,8,100,1,101,1,101,1,102,1,102,1,102,3,102,1176,
        8,102,1,103,1,103,1,103,5,103,1181,8,103,10,103,12,103,1184,9,103,
        1,104,1,104,3,104,1188,8,104,1,105,1,105,1,105,3,105,1193,8,105,
        1,105,0,3,122,126,134,106,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,0,36,1,0,6,7,1,0,41,43,1,0,47,48,1,0,53,56,1,0,70,73,2,0,22,
        23,74,75,2,0,42,43,76,77,2,0,41,41,78,78,1,0,79,80,1,0,59,61,2,0,
        57,57,62,62,1,0,82,89,1,0,94,101,1,0,104,105,1,0,106,107,1,0,114,
        115,2,0,48,48,126,126,1,0,127,128,1,0,117,120,2,0,104,105,121,121,
        1,0,131,132,1,0,133,134,1,0,135,136,1,0,138,139,1,0,141,143,1,0,
        146,147,1,0,60,61,2,0,31,31,38,38,2,0,32,32,40,40,15,0,1,10,12,13,
        18,21,24,25,27,30,35,37,41,41,44,69,71,73,78,103,106,115,119,120,
        122,134,137,150,154,156,19,0,19,19,21,21,24,25,35,37,41,41,44,44,
        46,49,51,51,57,69,79,79,82,89,94,103,108,108,112,115,122,130,137,
        140,143,144,146,148,155,156,20,0,1,10,12,13,18,18,20,20,27,30,45,
        45,50,50,52,56,71,73,78,78,80,81,90,93,106,107,109,111,119,120,131,
        134,141,142,145,145,149,150,154,154,11,0,2,2,18,18,20,20,45,45,47,
        48,58,58,64,64,78,78,90,93,106,107,154,156,16,0,1,10,12,13,18,21,
        24,25,27,30,35,37,41,41,44,69,71,73,78,103,106,115,119,120,122,134,
        138,139,141,150,154,156,2,0,90,91,155,156,2,0,158,158,163,164,1299,
        0,219,1,0,0,0,2,222,1,0,0,0,4,238,1,0,0,0,6,244,1,0,0,0,8,254,1,
        0,0,0,10,264,1,0,0,0,12,266,1,0,0,0,14,269,1,0,0,0,16,281,1,0,0,
        0,18,292,1,0,0,0,20,305,1,0,0,0,22,320,1,0,0,0,24,324,1,0,0,0,26,
        327,1,0,0,0,28,339,1,0,0,0,30,360,1,0,0,0,32,364,1,0,0,0,34,366,
        1,0,0,0,36,368,1,0,0,0,38,370,1,0,0,0,40,377,1,0,0,0,42,384,1,0,
        0,0,44,389,1,0,0,0,46,391,1,0,0,0,48,396,1,0,0,0,50,401,1,0,0,0,
        52,413,1,0,0,0,54,416,1,0,0,0,56,431,1,0,0,0,58,433,1,0,0,0,60,441,
        1,0,0,0,62,449,1,0,0,0,64,451,1,0,0,0,66,481,1,0,0,0,68,484,1,0,
        0,0,70,492,1,0,0,0,72,494,1,0,0,0,74,497,1,0,0,0,76,501,1,0,0,0,
        78,503,1,0,0,0,80,508,1,0,0,0,82,513,1,0,0,0,84,531,1,0,0,0,86,533,
        1,0,0,0,88,535,1,0,0,0,90,539,1,0,0,0,92,541,1,0,0,0,94,543,1,0,
        0,0,96,564,1,0,0,0,98,574,1,0,0,0,100,583,1,0,0,0,102,587,1,0,0,
        0,104,590,1,0,0,0,106,596,1,0,0,0,108,607,1,0,0,0,110,616,1,0,0,
        0,112,629,1,0,0,0,114,631,1,0,0,0,116,640,1,0,0,0,118,650,1,0,0,
        0,120,655,1,0,0,0,122,657,1,0,0,0,124,675,1,0,0,0,126,708,1,0,0,
        0,128,768,1,0,0,0,130,775,1,0,0,0,132,777,1,0,0,0,134,857,1,0,0,
        0,136,881,1,0,0,0,138,886,1,0,0,0,140,889,1,0,0,0,142,891,1,0,0,
        0,144,893,1,0,0,0,146,902,1,0,0,0,148,912,1,0,0,0,150,995,1,0,0,
        0,152,1010,1,0,0,0,154,1014,1,0,0,0,156,1016,1,0,0,0,158,1028,1,
        0,0,0,160,1030,1,0,0,0,162,1037,1,0,0,0,164,1051,1,0,0,0,166,1053,
        1,0,0,0,168,1061,1,0,0,0,170,1077,1,0,0,0,172,1081,1,0,0,0,174,1096,
        1,0,0,0,176,1107,1,0,0,0,178,1122,1,0,0,0,180,1125,1,0,0,0,182,1132,
        1,0,0,0,184,1146,1,0,0,0,186,1148,1,0,0,0,188,1150,1,0,0,0,190,1152,
        1,0,0,0,192,1154,1,0,0,0,194,1156,1,0,0,0,196,1160,1,0,0,0,198,1164,
        1,0,0,0,200,1168,1,0,0,0,202,1170,1,0,0,0,204,1172,1,0,0,0,206,1177,
        1,0,0,0,208,1185,1,0,0,0,210,1192,1,0,0,0,212,220,3,6,3,0,213,220,
        3,8,4,0,214,220,3,16,8,0,215,220,3,18,9,0,216,220,3,26,13,0,217,
        220,3,28,14,0,218,220,3,14,7,0,219,212,1,0,0,0,219,213,1,0,0,0,219,
        214,1,0,0,0,219,215,1,0,0,0,219,216,1,0,0,0,219,217,1,0,0,0,219,
        218,1,0,0,0,220,1,1,0,0,0,221,223,3,4,2,0,222,221,1,0,0,0,222,223,
        1,0,0,0,223,227,1,0,0,0,224,226,3,0,0,0,225,224,1,0,0,0,226,229,
        1,0,0,0,227,225,1,0,0,0,227,228,1,0,0,0,228,233,1,0,0,0,229,227,
        1,0,0,0,230,232,3,56,28,0,231,230,1,0,0,0,232,235,1,0,0,0,233,231,
        1,0,0,0,233,234,1,0,0,0,234,236,1,0,0,0,235,233,1,0,0,0,236,237,
        5,0,0,1,237,3,1,0,0,0,238,239,5,1,0,0,239,242,3,116,58,0,240,241,
        5,2,0,0,241,243,3,36,18,0,242,240,1,0,0,0,242,243,1,0,0,0,243,5,
        1,0,0,0,244,245,5,3,0,0,245,248,3,116,58,0,246,247,5,2,0,0,247,249,
        3,36,18,0,248,246,1,0,0,0,248,249,1,0,0,0,249,252,1,0,0,0,250,251,
        5,4,0,0,251,253,3,10,5,0,252,250,1,0,0,0,252,253,1,0,0,0,253,7,1,
        0,0,0,254,255,5,5,0,0,255,258,3,116,58,0,256,257,5,2,0,0,257,259,
        3,36,18,0,258,256,1,0,0,0,258,259,1,0,0,0,259,262,1,0,0,0,260,261,
        5,4,0,0,261,263,3,10,5,0,262,260,1,0,0,0,262,263,1,0,0,0,263,9,1,
        0,0,0,264,265,3,202,101,0,265,11,1,0,0,0,266,267,7,0,0,0,267,13,
        1,0,0,0,268,270,3,12,6,0,269,268,1,0,0,0,269,270,1,0,0,0,270,271,
        1,0,0,0,271,272,5,8,0,0,272,274,3,202,101,0,273,275,3,40,20,0,274,
        273,1,0,0,0,274,275,1,0,0,0,275,278,1,0,0,0,276,277,5,9,0,0,277,
        279,3,126,63,0,278,276,1,0,0,0,278,279,1,0,0,0,279,15,1,0,0,0,280,
        282,3,12,6,0,281,280,1,0,0,0,281,282,1,0,0,0,282,283,1,0,0,0,283,
        284,5,10,0,0,284,285,3,202,101,0,285,286,5,11,0,0,286,289,3,32,16,
        0,287,288,5,2,0,0,288,290,3,36,18,0,289,287,1,0,0,0,289,290,1,0,
        0,0,290,17,1,0,0,0,291,293,3,12,6,0,292,291,1,0,0,0,292,293,1,0,
        0,0,293,294,1,0,0,0,294,295,5,12,0,0,295,296,3,202,101,0,296,297,
        5,11,0,0,297,300,3,34,17,0,298,299,5,2,0,0,299,301,3,36,18,0,300,
        298,1,0,0,0,300,301,1,0,0,0,301,303,1,0,0,0,302,304,3,20,10,0,303,
        302,1,0,0,0,303,304,1,0,0,0,304,19,1,0,0,0,305,306,5,13,0,0,306,
        307,5,14,0,0,307,312,3,22,11,0,308,309,5,15,0,0,309,311,3,22,11,
        0,310,308,1,0,0,0,311,314,1,0,0,0,312,310,1,0,0,0,312,313,1,0,0,
        0,313,315,1,0,0,0,314,312,1,0,0,0,315,316,5,16,0,0,316,21,1,0,0,
        0,317,318,3,24,12,0,318,319,5,17,0,0,319,321,1,0,0,0,320,317,1,0,
        0,0,320,321,1,0,0,0,321,322,1,0,0,0,322,323,3,202,101,0,323,23,1,
        0,0,0,324,325,3,202,101,0,325,25,1,0,0,0,326,328,3,12,6,0,327,326,
        1,0,0,0,327,328,1,0,0,0,328,329,1,0,0,0,329,330,5,18,0,0,330,331,
        3,202,101,0,331,332,5,11,0,0,332,333,3,38,19,0,333,334,5,19,0,0,
        334,336,3,22,11,0,335,337,3,178,89,0,336,335,1,0,0,0,336,337,1,0,
        0,0,337,27,1,0,0,0,338,340,3,12,6,0,339,338,1,0,0,0,339,340,1,0,
        0,0,340,341,1,0,0,0,341,342,5,20,0,0,342,343,3,202,101,0,343,344,
        5,11,0,0,344,345,5,14,0,0,345,350,3,30,15,0,346,347,5,15,0,0,347,
        349,3,30,15,0,348,346,1,0,0,0,349,352,1,0,0,0,350,348,1,0,0,0,350,
        351,1,0,0,0,351,353,1,0,0,0,352,350,1,0,0,0,353,355,5,16,0,0,354,
        356,3,178,89,0,355,354,1,0,0,0,355,356,1,0,0,0,356,29,1,0,0,0,357,
        358,3,24,12,0,358,359,5,17,0,0,359,361,1,0,0,0,360,357,1,0,0,0,360,
        361,1,0,0,0,361,362,1,0,0,0,362,363,3,202,101,0,363,31,1,0,0,0,364,
        365,5,165,0,0,365,33,1,0,0,0,366,367,5,165,0,0,367,35,1,0,0,0,368,
        369,5,165,0,0,369,37,1,0,0,0,370,371,5,165,0,0,371,39,1,0,0,0,372,
        378,3,42,21,0,373,378,3,46,23,0,374,378,3,48,24,0,375,378,3,50,25,
        0,376,378,3,54,27,0,377,372,1,0,0,0,377,373,1,0,0,0,377,374,1,0,
        0,0,377,375,1,0,0,0,377,376,1,0,0,0,378,41,1,0,0,0,379,380,3,92,
        46,0,380,381,5,17,0,0,381,383,1,0,0,0,382,379,1,0,0,0,383,386,1,
        0,0,0,384,382,1,0,0,0,384,385,1,0,0,0,385,387,1,0,0,0,386,384,1,
        0,0,0,387,388,3,198,99,0,388,43,1,0,0,0,389,390,3,202,101,0,390,
        45,1,0,0,0,391,392,5,21,0,0,392,393,5,22,0,0,393,394,3,40,20,0,394,
        395,5,23,0,0,395,47,1,0,0,0,396,397,5,24,0,0,397,398,5,22,0,0,398,
        399,3,40,20,0,399,400,5,23,0,0,400,49,1,0,0,0,401,402,5,25,0,0,402,
        403,5,14,0,0,403,408,3,52,26,0,404,405,5,15,0,0,405,407,3,52,26,
        0,406,404,1,0,0,0,407,410,1,0,0,0,408,406,1,0,0,0,408,409,1,0,0,
        0,409,411,1,0,0,0,410,408,1,0,0,0,411,412,5,16,0,0,412,51,1,0,0,
        0,413,414,3,196,98,0,414,415,3,40,20,0,415,53,1,0,0,0,416,417,5,
        26,0,0,417,418,5,22,0,0,418,423,3,40,20,0,419,420,5,15,0,0,420,422,
        3,40,20,0,421,419,1,0,0,0,422,425,1,0,0,0,423,421,1,0,0,0,423,424,
        1,0,0,0,424,426,1,0,0,0,425,423,1,0,0,0,426,427,5,23,0,0,427,55,
        1,0,0,0,428,432,3,58,29,0,429,432,3,60,30,0,430,432,3,64,32,0,431,
        428,1,0,0,0,431,429,1,0,0,0,431,430,1,0,0,0,432,57,1,0,0,0,433,435,
        5,27,0,0,434,436,3,12,6,0,435,434,1,0,0,0,435,436,1,0,0,0,436,437,
        1,0,0,0,437,438,3,202,101,0,438,439,5,11,0,0,439,440,3,126,63,0,
        440,59,1,0,0,0,441,445,5,28,0,0,442,443,3,44,22,0,443,444,5,17,0,
        0,444,446,1,0,0,0,445,442,1,0,0,0,445,446,1,0,0,0,446,447,1,0,0,
        0,447,448,3,202,101,0,448,61,1,0,0,0,449,450,5,29,0,0,450,63,1,0,
        0,0,451,453,5,27,0,0,452,454,3,12,6,0,453,452,1,0,0,0,453,454,1,
        0,0,0,454,456,1,0,0,0,455,457,3,62,31,0,456,455,1,0,0,0,456,457,
        1,0,0,0,457,458,1,0,0,0,458,459,5,30,0,0,459,460,3,200,100,0,460,
        469,5,31,0,0,461,466,3,66,33,0,462,463,5,15,0,0,463,465,3,66,33,
        0,464,462,1,0,0,0,465,468,1,0,0,0,466,464,1,0,0,0,466,467,1,0,0,
        0,467,470,1,0,0,0,468,466,1,0,0,0,469,461,1,0,0,0,469,470,1,0,0,
        0,470,471,1,0,0,0,471,474,5,32,0,0,472,473,5,33,0,0,473,475,3,40,
        20,0,474,472,1,0,0,0,474,475,1,0,0,0,475,476,1,0,0,0,476,479,5,11,
        0,0,477,480,3,68,34,0,478,480,5,34,0,0,479,477,1,0,0,0,479,478,1,
        0,0,0,480,65,1,0,0,0,481,482,3,196,98,0,482,483,3,40,20,0,483,67,
        1,0,0,0,484,485,3,126,63,0,485,69,1,0,0,0,486,493,3,82,41,0,487,
        493,3,118,59,0,488,489,5,31,0,0,489,490,3,126,63,0,490,491,5,32,
        0,0,491,493,1,0,0,0,492,486,1,0,0,0,492,487,1,0,0,0,492,488,1,0,
        0,0,493,71,1,0,0,0,494,495,3,70,35,0,495,496,3,74,37,0,496,73,1,
        0,0,0,497,498,3,202,101,0,498,75,1,0,0,0,499,502,3,78,39,0,500,502,
        3,80,40,0,501,499,1,0,0,0,501,500,1,0,0,0,502,77,1,0,0,0,503,504,
        5,35,0,0,504,505,3,72,36,0,505,506,5,36,0,0,506,507,3,126,63,0,507,
        79,1,0,0,0,508,509,5,37,0,0,509,510,3,72,36,0,510,511,5,36,0,0,511,
        512,3,126,63,0,512,81,1,0,0,0,513,517,5,38,0,0,514,515,3,84,42,0,
        515,516,5,39,0,0,516,518,1,0,0,0,517,514,1,0,0,0,517,518,1,0,0,0,
        518,519,1,0,0,0,519,527,3,42,21,0,520,524,5,11,0,0,521,522,3,86,
        43,0,522,523,3,88,44,0,523,525,1,0,0,0,524,521,1,0,0,0,524,525,1,
        0,0,0,525,526,1,0,0,0,526,528,3,90,45,0,527,520,1,0,0,0,527,528,
        1,0,0,0,528,529,1,0,0,0,529,530,5,40,0,0,530,83,1,0,0,0,531,532,
        3,118,59,0,532,85,1,0,0,0,533,534,3,122,61,0,534,87,1,0,0,0,535,
        536,7,1,0,0,536,89,1,0,0,0,537,540,3,118,59,0,538,540,3,126,63,0,
        539,537,1,0,0,0,539,538,1,0,0,0,540,91,1,0,0,0,541,542,3,202,101,
        0,542,93,1,0,0,0,543,545,3,96,48,0,544,546,3,98,49,0,545,544,1,0,
        0,0,545,546,1,0,0,0,546,550,1,0,0,0,547,549,3,76,38,0,548,547,1,
        0,0,0,549,552,1,0,0,0,550,548,1,0,0,0,550,551,1,0,0,0,551,554,1,
        0,0,0,552,550,1,0,0,0,553,555,3,102,51,0,554,553,1,0,0,0,554,555,
        1,0,0,0,555,558,1,0,0,0,556,559,3,106,53,0,557,559,3,104,52,0,558,
        556,1,0,0,0,558,557,1,0,0,0,558,559,1,0,0,0,559,561,1,0,0,0,560,
        562,3,110,55,0,561,560,1,0,0,0,561,562,1,0,0,0,562,95,1,0,0,0,563,
        565,5,19,0,0,564,563,1,0,0,0,564,565,1,0,0,0,565,566,1,0,0,0,566,
        571,3,72,36,0,567,568,5,15,0,0,568,570,3,72,36,0,569,567,1,0,0,0,
        570,573,1,0,0,0,571,569,1,0,0,0,571,572,1,0,0,0,572,97,1,0,0,0,573,
        571,1,0,0,0,574,575,5,44,0,0,575,580,3,100,50,0,576,577,5,15,0,0,
        577,579,3,100,50,0,578,576,1,0,0,0,579,582,1,0,0,0,580,578,1,0,0,
        0,580,581,1,0,0,0,581,99,1,0,0,0,582,580,1,0,0,0,583,584,3,202,101,
        0,584,585,5,11,0,0,585,586,3,126,63,0,586,101,1,0,0,0,587,588,5,
        45,0,0,588,589,3,126,63,0,589,103,1,0,0,0,590,592,5,46,0,0,591,593,
        7,2,0,0,592,591,1,0,0,0,592,593,1,0,0,0,593,594,1,0,0,0,594,595,
        3,126,63,0,595,105,1,0,0,0,596,598,5,49,0,0,597,599,7,2,0,0,598,
        597,1,0,0,0,598,599,1,0,0,0,599,600,1,0,0,0,600,602,3,202,101,0,
        601,603,3,108,54,0,602,601,1,0,0,0,602,603,1,0,0,0,603,604,1,0,0,
        0,604,605,5,11,0,0,605,606,3,126,63,0,606,107,1,0,0,0,607,614,5,
        50,0,0,608,615,3,124,62,0,609,615,3,208,104,0,610,611,5,31,0,0,611,
        612,3,126,63,0,612,613,5,32,0,0,613,615,1,0,0,0,614,608,1,0,0,0,
        614,609,1,0,0,0,614,610,1,0,0,0,615,109,1,0,0,0,616,627,5,51,0,0,
        617,628,3,112,56,0,618,619,5,52,0,0,619,624,3,114,57,0,620,621,5,
        15,0,0,621,623,3,114,57,0,622,620,1,0,0,0,623,626,1,0,0,0,624,622,
        1,0,0,0,624,625,1,0,0,0,625,628,1,0,0,0,626,624,1,0,0,0,627,617,
        1,0,0,0,627,618,1,0,0,0,628,111,1,0,0,0,629,630,7,3,0,0,630,113,
        1,0,0,0,631,633,3,134,67,0,632,634,3,112,56,0,633,632,1,0,0,0,633,
        634,1,0,0,0,634,115,1,0,0,0,635,636,3,92,46,0,636,637,5,17,0,0,637,
        639,1,0,0,0,638,635,1,0,0,0,639,642,1,0,0,0,640,638,1,0,0,0,640,
        641,1,0,0,0,641,643,1,0,0,0,642,640,1,0,0,0,643,644,3,202,101,0,
        644,117,1,0,0,0,645,646,3,120,60,0,646,647,5,17,0,0,647,649,1,0,
        0,0,648,645,1,0,0,0,649,652,1,0,0,0,650,648,1,0,0,0,650,651,1,0,
        0,0,651,653,1,0,0,0,652,650,1,0,0,0,653,654,3,196,98,0,654,119,1,
        0,0,0,655,656,3,196,98,0,656,121,1,0,0,0,657,658,6,61,-1,0,658,659,
        3,196,98,0,659,670,1,0,0,0,660,661,10,2,0,0,661,662,5,17,0,0,662,
        669,3,196,98,0,663,664,10,1,0,0,664,665,5,38,0,0,665,666,3,124,62,
        0,666,667,5,40,0,0,667,669,1,0,0,0,668,660,1,0,0,0,668,663,1,0,0,
        0,669,672,1,0,0,0,670,668,1,0,0,0,670,671,1,0,0,0,671,123,1,0,0,
        0,672,670,1,0,0,0,673,676,5,165,0,0,674,676,5,166,0,0,675,673,1,
        0,0,0,675,674,1,0,0,0,676,125,1,0,0,0,677,678,6,63,-1,0,678,709,
        3,134,67,0,679,709,3,82,41,0,680,709,3,94,47,0,681,682,5,63,0,0,
        682,683,3,126,63,0,683,684,5,62,0,0,684,685,3,40,20,0,685,709,1,
        0,0,0,686,687,5,58,0,0,687,709,3,126,63,14,688,689,5,64,0,0,689,
        709,3,126,63,13,690,691,5,68,0,0,691,693,5,41,0,0,692,690,1,0,0,
        0,692,693,1,0,0,0,693,694,1,0,0,0,694,695,3,132,66,0,695,696,5,66,
        0,0,696,697,3,134,67,0,697,698,5,67,0,0,698,699,3,134,67,0,699,709,
        1,0,0,0,700,701,5,69,0,0,701,702,5,41,0,0,702,703,3,132,66,0,703,
        704,5,66,0,0,704,705,3,134,67,0,705,706,5,67,0,0,706,707,3,134,67,
        0,707,709,1,0,0,0,708,677,1,0,0,0,708,679,1,0,0,0,708,680,1,0,0,
        0,708,681,1,0,0,0,708,686,1,0,0,0,708,688,1,0,0,0,708,692,1,0,0,
        0,708,700,1,0,0,0,709,765,1,0,0,0,710,711,10,9,0,0,711,712,7,4,0,
        0,712,764,3,126,63,10,713,714,10,8,0,0,714,715,7,5,0,0,715,764,3,
        126,63,9,716,717,10,7,0,0,717,718,3,150,75,0,718,719,3,126,63,8,
        719,764,1,0,0,0,720,721,10,6,0,0,721,722,7,6,0,0,722,764,3,126,63,
        7,723,724,10,5,0,0,724,726,7,7,0,0,725,727,3,138,69,0,726,725,1,
        0,0,0,726,727,1,0,0,0,727,728,1,0,0,0,728,764,3,126,63,6,729,730,
        10,4,0,0,730,731,5,58,0,0,731,733,7,7,0,0,732,734,3,138,69,0,733,
        732,1,0,0,0,733,734,1,0,0,0,734,735,1,0,0,0,735,764,3,126,63,5,736,
        737,10,3,0,0,737,738,5,67,0,0,738,764,3,126,63,4,739,740,10,2,0,
        0,740,741,7,8,0,0,741,764,3,126,63,3,742,743,10,1,0,0,743,744,5,
        81,0,0,744,764,3,126,63,2,745,746,10,17,0,0,746,748,5,57,0,0,747,
        749,5,58,0,0,748,747,1,0,0,0,748,749,1,0,0,0,749,750,1,0,0,0,750,
        764,7,9,0,0,751,752,10,16,0,0,752,753,7,10,0,0,753,764,3,40,20,0,
        754,756,10,12,0,0,755,757,5,65,0,0,756,755,1,0,0,0,756,757,1,0,0,
        0,757,758,1,0,0,0,758,759,5,66,0,0,759,760,3,134,67,0,760,761,5,
        67,0,0,761,762,3,134,67,0,762,764,1,0,0,0,763,710,1,0,0,0,763,713,
        1,0,0,0,763,716,1,0,0,0,763,720,1,0,0,0,763,723,1,0,0,0,763,729,
        1,0,0,0,763,736,1,0,0,0,763,739,1,0,0,0,763,742,1,0,0,0,763,745,
        1,0,0,0,763,751,1,0,0,0,763,754,1,0,0,0,764,767,1,0,0,0,765,763,
        1,0,0,0,765,766,1,0,0,0,766,127,1,0,0,0,767,765,1,0,0,0,768,769,
        7,11,0,0,769,129,1,0,0,0,770,776,3,128,64,0,771,776,5,90,0,0,772,
        776,5,91,0,0,773,776,5,92,0,0,774,776,5,93,0,0,775,770,1,0,0,0,775,
        771,1,0,0,0,775,772,1,0,0,0,775,773,1,0,0,0,775,774,1,0,0,0,776,
        131,1,0,0,0,777,778,7,12,0,0,778,133,1,0,0,0,779,780,6,67,-1,0,780,
        858,3,152,76,0,781,782,5,102,0,0,782,783,3,126,63,0,783,786,5,103,
        0,0,784,787,3,40,20,0,785,787,3,210,105,0,786,784,1,0,0,0,786,785,
        1,0,0,0,787,858,1,0,0,0,788,789,7,13,0,0,789,858,3,134,67,18,790,
        791,7,14,0,0,791,792,5,108,0,0,792,858,3,134,67,17,793,794,3,130,
        65,0,794,795,5,19,0,0,795,796,3,134,67,16,796,858,1,0,0,0,797,798,
        5,68,0,0,798,799,5,41,0,0,799,800,3,132,66,0,800,801,5,108,0,0,801,
        802,3,134,67,15,802,858,1,0,0,0,803,804,5,69,0,0,804,805,5,41,0,
        0,805,806,3,132,66,0,806,807,5,108,0,0,807,808,3,134,67,14,808,858,
        1,0,0,0,809,810,5,109,0,0,810,811,5,108,0,0,811,858,3,134,67,13,
        812,813,5,110,0,0,813,814,5,108,0,0,814,858,3,134,67,12,815,816,
        5,111,0,0,816,817,5,108,0,0,817,858,3,134,67,11,818,819,5,112,0,
        0,819,820,5,19,0,0,820,858,3,134,67,10,821,822,5,113,0,0,822,823,
        5,19,0,0,823,858,3,134,67,9,824,825,7,15,0,0,825,858,3,42,21,0,826,
        827,5,122,0,0,827,828,3,126,63,0,828,829,5,123,0,0,829,830,3,126,
        63,0,830,831,5,124,0,0,831,832,3,126,63,0,832,858,1,0,0,0,833,835,
        5,125,0,0,834,836,3,126,63,0,835,834,1,0,0,0,835,836,1,0,0,0,836,
        838,1,0,0,0,837,839,3,136,68,0,838,837,1,0,0,0,839,840,1,0,0,0,840,
        838,1,0,0,0,840,841,1,0,0,0,841,842,1,0,0,0,842,843,5,124,0,0,843,
        844,3,126,63,0,844,845,5,107,0,0,845,858,1,0,0,0,846,847,7,16,0,
        0,847,858,3,126,63,0,848,849,7,17,0,0,849,855,3,126,63,0,850,853,
        5,129,0,0,851,854,3,128,64,0,852,854,3,126,63,0,853,851,1,0,0,0,
        853,852,1,0,0,0,854,856,1,0,0,0,855,850,1,0,0,0,855,856,1,0,0,0,
        856,858,1,0,0,0,857,779,1,0,0,0,857,781,1,0,0,0,857,788,1,0,0,0,
        857,790,1,0,0,0,857,793,1,0,0,0,857,797,1,0,0,0,857,803,1,0,0,0,
        857,809,1,0,0,0,857,812,1,0,0,0,857,815,1,0,0,0,857,818,1,0,0,0,
        857,821,1,0,0,0,857,824,1,0,0,0,857,826,1,0,0,0,857,833,1,0,0,0,
        857,846,1,0,0,0,857,848,1,0,0,0,858,878,1,0,0,0,859,860,10,7,0,0,
        860,861,5,116,0,0,861,877,3,134,67,8,862,863,10,6,0,0,863,864,7,
        18,0,0,864,877,3,134,67,7,865,866,10,5,0,0,866,867,7,19,0,0,867,
        877,3,134,67,6,868,869,10,21,0,0,869,870,5,17,0,0,870,877,3,154,
        77,0,871,872,10,20,0,0,872,873,5,38,0,0,873,874,3,126,63,0,874,875,
        5,40,0,0,875,877,1,0,0,0,876,859,1,0,0,0,876,862,1,0,0,0,876,865,
        1,0,0,0,876,868,1,0,0,0,876,871,1,0,0,0,877,880,1,0,0,0,878,876,
        1,0,0,0,878,879,1,0,0,0,879,135,1,0,0,0,880,878,1,0,0,0,881,882,
        5,130,0,0,882,883,3,126,63,0,883,884,5,123,0,0,884,885,3,126,63,
        0,885,137,1,0,0,0,886,887,3,128,64,0,887,888,5,108,0,0,888,139,1,
        0,0,0,889,890,7,20,0,0,890,141,1,0,0,0,891,892,7,21,0,0,892,143,
        1,0,0,0,893,894,7,22,0,0,894,145,1,0,0,0,895,897,3,208,104,0,896,
        898,3,142,71,0,897,896,1,0,0,0,897,898,1,0,0,0,898,903,1,0,0,0,899,
        900,3,144,72,0,900,901,3,208,104,0,901,903,1,0,0,0,902,895,1,0,0,
        0,902,899,1,0,0,0,903,147,1,0,0,0,904,906,5,137,0,0,905,904,1,0,
        0,0,905,906,1,0,0,0,906,907,1,0,0,0,907,913,7,23,0,0,908,910,7,23,
        0,0,909,911,5,140,0,0,910,909,1,0,0,0,910,911,1,0,0,0,911,913,1,
        0,0,0,912,905,1,0,0,0,912,908,1,0,0,0,913,149,1,0,0,0,914,916,7,
        24,0,0,915,914,1,0,0,0,915,916,1,0,0,0,916,917,1,0,0,0,917,919,5,
        144,0,0,918,920,3,128,64,0,919,918,1,0,0,0,919,920,1,0,0,0,920,923,
        1,0,0,0,921,924,3,140,70,0,922,924,5,62,0,0,923,921,1,0,0,0,923,
        922,1,0,0,0,924,926,1,0,0,0,925,927,7,14,0,0,926,925,1,0,0,0,926,
        927,1,0,0,0,927,996,1,0,0,0,928,930,5,65,0,0,929,928,1,0,0,0,929,
        930,1,0,0,0,930,931,1,0,0,0,931,933,5,145,0,0,932,934,3,138,69,0,
        933,932,1,0,0,0,933,934,1,0,0,0,934,936,1,0,0,0,935,937,7,14,0,0,
        936,935,1,0,0,0,936,937,1,0,0,0,937,996,1,0,0,0,938,940,7,24,0,0,
        939,938,1,0,0,0,939,940,1,0,0,0,940,942,1,0,0,0,941,943,5,65,0,0,
        942,941,1,0,0,0,942,943,1,0,0,0,943,944,1,0,0,0,944,946,7,25,0,0,
        945,947,3,138,69,0,946,945,1,0,0,0,946,947,1,0,0,0,947,996,1,0,0,
        0,948,950,7,24,0,0,949,948,1,0,0,0,949,950,1,0,0,0,950,952,1,0,0,
        0,951,953,3,146,73,0,952,951,1,0,0,0,952,953,1,0,0,0,953,954,1,0,
        0,0,954,956,3,148,74,0,955,957,3,138,69,0,956,955,1,0,0,0,956,957,
        1,0,0,0,957,959,1,0,0,0,958,960,7,14,0,0,959,958,1,0,0,0,959,960,
        1,0,0,0,960,996,1,0,0,0,961,963,7,24,0,0,962,961,1,0,0,0,962,963,
        1,0,0,0,963,965,1,0,0,0,964,966,5,65,0,0,965,964,1,0,0,0,965,966,
        1,0,0,0,966,967,1,0,0,0,967,968,5,148,0,0,968,969,3,208,104,0,969,
        971,5,108,0,0,970,972,7,14,0,0,971,970,1,0,0,0,971,972,1,0,0,0,972,
        996,1,0,0,0,973,975,5,149,0,0,974,976,7,23,0,0,975,974,1,0,0,0,975,
        976,1,0,0,0,976,978,1,0,0,0,977,979,3,138,69,0,978,977,1,0,0,0,978,
        979,1,0,0,0,979,996,1,0,0,0,980,982,5,150,0,0,981,983,7,23,0,0,982,
        981,1,0,0,0,982,983,1,0,0,0,983,985,1,0,0,0,984,986,3,138,69,0,985,
        984,1,0,0,0,985,986,1,0,0,0,986,996,1,0,0,0,987,989,5,141,0,0,988,
        990,3,138,69,0,989,988,1,0,0,0,989,990,1,0,0,0,990,996,1,0,0,0,991,
        993,5,142,0,0,992,994,3,138,69,0,993,992,1,0,0,0,993,994,1,0,0,0,
        994,996,1,0,0,0,995,915,1,0,0,0,995,929,1,0,0,0,995,939,1,0,0,0,
        995,949,1,0,0,0,995,962,1,0,0,0,995,973,1,0,0,0,995,980,1,0,0,0,
        995,987,1,0,0,0,995,991,1,0,0,0,996,151,1,0,0,0,997,1011,3,158,79,
        0,998,1011,3,164,82,0,999,1011,3,204,102,0,1000,1011,3,166,83,0,
        1001,1011,3,168,84,0,1002,1011,3,172,86,0,1003,1011,3,176,88,0,1004,
        1011,3,180,90,0,1005,1011,3,182,91,0,1006,1007,5,31,0,0,1007,1008,
        3,126,63,0,1008,1009,5,32,0,0,1009,1011,1,0,0,0,1010,997,1,0,0,0,
        1010,998,1,0,0,0,1010,999,1,0,0,0,1010,1000,1,0,0,0,1010,1001,1,
        0,0,0,1010,1002,1,0,0,0,1010,1003,1,0,0,0,1010,1004,1,0,0,0,1010,
        1005,1,0,0,0,1010,1006,1,0,0,0,1011,153,1,0,0,0,1012,1015,3,196,
        98,0,1013,1015,3,156,78,0,1014,1012,1,0,0,0,1014,1013,1,0,0,0,1015,
        155,1,0,0,0,1016,1017,3,200,100,0,1017,1019,5,31,0,0,1018,1020,3,
        206,103,0,1019,1018,1,0,0,0,1019,1020,1,0,0,0,1020,1021,1,0,0,0,
        1021,1022,5,32,0,0,1022,157,1,0,0,0,1023,1029,3,196,98,0,1024,1029,
        3,160,80,0,1025,1029,5,151,0,0,1026,1029,5,152,0,0,1027,1029,5,153,
        0,0,1028,1023,1,0,0,0,1028,1024,1,0,0,0,1028,1025,1,0,0,0,1028,1026,
        1,0,0,0,1028,1027,1,0,0,0,1029,159,1,0,0,0,1030,1031,3,196,98,0,
        1031,1033,5,31,0,0,1032,1034,3,206,103,0,1033,1032,1,0,0,0,1033,
        1034,1,0,0,0,1034,1035,1,0,0,0,1035,1036,5,32,0,0,1036,161,1,0,0,
        0,1037,1038,3,208,104,0,1038,1039,5,11,0,0,1039,1040,3,208,104,0,
        1040,163,1,0,0,0,1041,1052,7,26,0,0,1042,1052,5,59,0,0,1043,1052,
        5,165,0,0,1044,1052,5,166,0,0,1045,1052,5,160,0,0,1046,1052,5,159,
        0,0,1047,1052,5,161,0,0,1048,1052,5,162,0,0,1049,1052,3,208,104,
        0,1050,1052,3,162,81,0,1051,1041,1,0,0,0,1051,1042,1,0,0,0,1051,
        1043,1,0,0,0,1051,1044,1,0,0,0,1051,1045,1,0,0,0,1051,1046,1,0,0,
        0,1051,1047,1,0,0,0,1051,1048,1,0,0,0,1051,1049,1,0,0,0,1051,1050,
        1,0,0,0,1052,165,1,0,0,0,1053,1054,5,24,0,0,1054,1055,7,27,0,0,1055,
        1056,3,126,63,0,1056,1057,5,15,0,0,1057,1058,3,126,63,0,1058,1059,
        7,28,0,0,1059,167,1,0,0,0,1060,1062,5,25,0,0,1061,1060,1,0,0,0,1061,
        1062,1,0,0,0,1062,1063,1,0,0,0,1063,1073,5,14,0,0,1064,1074,5,11,
        0,0,1065,1070,3,170,85,0,1066,1067,5,15,0,0,1067,1069,3,170,85,0,
        1068,1066,1,0,0,0,1069,1072,1,0,0,0,1070,1068,1,0,0,0,1070,1071,
        1,0,0,0,1071,1074,1,0,0,0,1072,1070,1,0,0,0,1073,1064,1,0,0,0,1073,
        1065,1,0,0,0,1074,1075,1,0,0,0,1075,1076,5,16,0,0,1076,169,1,0,0,
        0,1077,1078,3,196,98,0,1078,1079,5,11,0,0,1079,1080,3,126,63,0,1080,
        171,1,0,0,0,1081,1082,3,42,21,0,1082,1092,5,14,0,0,1083,1093,5,11,
        0,0,1084,1089,3,174,87,0,1085,1086,5,15,0,0,1086,1088,3,174,87,0,
        1087,1085,1,0,0,0,1088,1091,1,0,0,0,1089,1087,1,0,0,0,1089,1090,
        1,0,0,0,1090,1093,1,0,0,0,1091,1089,1,0,0,0,1092,1083,1,0,0,0,1092,
        1084,1,0,0,0,1093,1094,1,0,0,0,1094,1095,5,16,0,0,1095,173,1,0,0,
        0,1096,1097,3,196,98,0,1097,1098,5,11,0,0,1098,1099,3,126,63,0,1099,
        175,1,0,0,0,1100,1105,5,21,0,0,1101,1102,5,22,0,0,1102,1103,3,40,
        20,0,1103,1104,5,23,0,0,1104,1106,1,0,0,0,1105,1101,1,0,0,0,1105,
        1106,1,0,0,0,1106,1108,1,0,0,0,1107,1100,1,0,0,0,1107,1108,1,0,0,
        0,1108,1109,1,0,0,0,1109,1118,5,14,0,0,1110,1115,3,126,63,0,1111,
        1112,5,15,0,0,1112,1114,3,126,63,0,1113,1111,1,0,0,0,1114,1117,1,
        0,0,0,1115,1113,1,0,0,0,1115,1116,1,0,0,0,1116,1119,1,0,0,0,1117,
        1115,1,0,0,0,1118,1110,1,0,0,0,1118,1119,1,0,0,0,1119,1120,1,0,0,
        0,1120,1121,5,16,0,0,1121,177,1,0,0,0,1122,1123,5,154,0,0,1123,1124,
        5,165,0,0,1124,179,1,0,0,0,1125,1126,5,155,0,0,1126,1127,5,165,0,
        0,1127,1128,5,19,0,0,1128,1130,3,22,11,0,1129,1131,3,178,89,0,1130,
        1129,1,0,0,0,1130,1131,1,0,0,0,1131,181,1,0,0,0,1132,1133,5,156,
        0,0,1133,1134,5,14,0,0,1134,1139,3,180,90,0,1135,1136,5,15,0,0,1136,
        1138,3,180,90,0,1137,1135,1,0,0,0,1138,1141,1,0,0,0,1139,1137,1,
        0,0,0,1139,1140,1,0,0,0,1140,1142,1,0,0,0,1141,1139,1,0,0,0,1142,
        1144,5,16,0,0,1143,1145,3,178,89,0,1144,1143,1,0,0,0,1144,1145,1,
        0,0,0,1145,183,1,0,0,0,1146,1147,7,29,0,0,1147,185,1,0,0,0,1148,
        1149,7,30,0,0,1149,187,1,0,0,0,1150,1151,7,31,0,0,1151,189,1,0,0,
        0,1152,1153,7,32,0,0,1153,191,1,0,0,0,1154,1155,7,33,0,0,1155,193,
        1,0,0,0,1156,1157,7,34,0,0,1157,195,1,0,0,0,1158,1161,3,202,101,
        0,1159,1161,3,188,94,0,1160,1158,1,0,0,0,1160,1159,1,0,0,0,1161,
        197,1,0,0,0,1162,1165,3,196,98,0,1163,1165,3,194,97,0,1164,1162,
        1,0,0,0,1164,1163,1,0,0,0,1165,199,1,0,0,0,1166,1169,3,202,101,0,
        1167,1169,3,192,96,0,1168,1166,1,0,0,0,1168,1167,1,0,0,0,1169,201,
        1,0,0,0,1170,1171,7,35,0,0,1171,203,1,0,0,0,1172,1175,5,157,0,0,
        1173,1176,3,202,101,0,1174,1176,5,165,0,0,1175,1173,1,0,0,0,1175,
        1174,1,0,0,0,1176,205,1,0,0,0,1177,1182,3,126,63,0,1178,1179,5,15,
        0,0,1179,1181,3,126,63,0,1180,1178,1,0,0,0,1181,1184,1,0,0,0,1182,
        1180,1,0,0,0,1182,1183,1,0,0,0,1183,207,1,0,0,0,1184,1182,1,0,0,
        0,1185,1187,5,166,0,0,1186,1188,3,210,105,0,1187,1186,1,0,0,0,1187,
        1188,1,0,0,0,1188,209,1,0,0,0,1189,1193,3,128,64,0,1190,1193,3,132,
        66,0,1191,1193,5,165,0,0,1192,1189,1,0,0,0,1192,1190,1,0,0,0,1192,
        1191,1,0,0,0,1193,211,1,0,0,0,135,219,222,227,233,242,248,252,258,
        262,269,274,278,281,289,292,300,303,312,320,327,336,339,350,355,
        360,377,384,408,423,431,435,445,453,456,466,469,474,479,492,501,
        517,524,527,539,545,550,554,558,561,564,571,580,592,598,602,614,
        624,627,633,640,650,668,670,675,692,708,726,733,748,756,763,765,
        775,786,835,840,853,855,857,876,878,897,902,905,910,912,915,919,
        923,926,929,933,936,939,942,946,949,952,956,959,962,965,971,975,
        978,982,985,989,993,995,1010,1014,1019,1028,1033,1051,1061,1070,
        1073,1089,1092,1105,1107,1115,1118,1130,1139,1144,1160,1164,1168,
        1175,1182,1187,1192
    ]

class cqlParser ( Parser ):

    grammarFileName = "cql.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'library'", "'version'", "'using'", "'called'", 
                     "'include'", "'public'", "'private'", "'parameter'", 
                     "'default'", "'codesystem'", "':'", "'valueset'", "'codesystems'", 
                     "'{'", "','", "'}'", "'.'", "'code'", "'from'", "'concept'", 
                     "'List'", "'<'", "'>'", "'Interval'", "'Tuple'", "'Choice'", 
                     "'define'", "'context'", "'fluent'", "'function'", 
                     "'('", "')'", "'returns'", "'external'", "'with'", 
                     "'such that'", "'without'", "'['", "'->'", "']'", "'in'", 
                     "'='", "'~'", "'let'", "'where'", "'return'", "'all'", 
                     "'distinct'", "'aggregate'", "'starting'", "'sort'", 
                     "'by'", "'asc'", "'ascending'", "'desc'", "'descending'", 
                     "'is'", "'not'", "'null'", "'true'", "'false'", "'as'", 
                     "'cast'", "'exists'", "'properly'", "'between'", "'and'", 
                     "'duration'", "'difference'", "'|'", "'union'", "'intersect'", 
                     "'except'", "'<='", "'>='", "'!='", "'!~'", "'contains'", 
                     "'or'", "'xor'", "'implies'", "'year'", "'month'", 
                     "'week'", "'day'", "'hour'", "'minute'", "'second'", 
                     "'millisecond'", "'date'", "'time'", "'timezone'", 
                     "'timezoneoffset'", "'years'", "'months'", "'weeks'", 
                     "'days'", "'hours'", "'minutes'", "'seconds'", "'milliseconds'", 
                     "'convert'", "'to'", "'+'", "'-'", "'start'", "'end'", 
                     "'of'", "'width'", "'successor'", "'predecessor'", 
                     "'singleton'", "'point'", "'minimum'", "'maximum'", 
                     "'^'", "'*'", "'/'", "'div'", "'mod'", "'&'", "'if'", 
                     "'then'", "'else'", "'case'", "'flatten'", "'expand'", 
                     "'collapse'", "'per'", "'when'", "'or before'", "'or after'", 
                     "'or more'", "'or less'", "'less than'", "'more than'", 
                     "'on or'", "'before'", "'after'", "'or on'", "'starts'", 
                     "'ends'", "'occurs'", "'same'", "'includes'", "'during'", 
                     "'included in'", "'within'", "'meets'", "'overlaps'", 
                     "'$this'", "'$index'", "'$total'", "'display'", "'Code'", 
                     "'Concept'", "'%'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "QUOTEDIDENTIFIER", "DATETIME", 
                      "LONGNUMBER", "DATE", "TIME", "IDENTIFIER", "DELIMITEDIDENTIFIER", 
                      "STRING", "NUMBER", "WS", "COMMENT", "LINE_COMMENT" ]

    RULE_definition = 0
    RULE_library = 1
    RULE_libraryDefinition = 2
    RULE_usingDefinition = 3
    RULE_includeDefinition = 4
    RULE_localIdentifier = 5
    RULE_accessModifier = 6
    RULE_parameterDefinition = 7
    RULE_codesystemDefinition = 8
    RULE_valuesetDefinition = 9
    RULE_codesystems = 10
    RULE_codesystemIdentifier = 11
    RULE_libraryIdentifier = 12
    RULE_codeDefinition = 13
    RULE_conceptDefinition = 14
    RULE_codeIdentifier = 15
    RULE_codesystemId = 16
    RULE_valuesetId = 17
    RULE_versionSpecifier = 18
    RULE_codeId = 19
    RULE_typeSpecifier = 20
    RULE_namedTypeSpecifier = 21
    RULE_modelIdentifier = 22
    RULE_listTypeSpecifier = 23
    RULE_intervalTypeSpecifier = 24
    RULE_tupleTypeSpecifier = 25
    RULE_tupleElementDefinition = 26
    RULE_choiceTypeSpecifier = 27
    RULE_statement = 28
    RULE_expressionDefinition = 29
    RULE_contextDefinition = 30
    RULE_fluentModifier = 31
    RULE_functionDefinition = 32
    RULE_operandDefinition = 33
    RULE_functionBody = 34
    RULE_querySource = 35
    RULE_aliasedQuerySource = 36
    RULE_alias = 37
    RULE_queryInclusionClause = 38
    RULE_withClause = 39
    RULE_withoutClause = 40
    RULE_retrieve = 41
    RULE_contextIdentifier = 42
    RULE_codePath = 43
    RULE_codeComparator = 44
    RULE_terminology = 45
    RULE_qualifier = 46
    RULE_query = 47
    RULE_sourceClause = 48
    RULE_letClause = 49
    RULE_letClauseItem = 50
    RULE_whereClause = 51
    RULE_returnClause = 52
    RULE_aggregateClause = 53
    RULE_startingClause = 54
    RULE_sortClause = 55
    RULE_sortDirection = 56
    RULE_sortByItem = 57
    RULE_qualifiedIdentifier = 58
    RULE_qualifiedIdentifierExpression = 59
    RULE_qualifierExpression = 60
    RULE_simplePath = 61
    RULE_simpleLiteral = 62
    RULE_expression = 63
    RULE_dateTimePrecision = 64
    RULE_dateTimeComponent = 65
    RULE_pluralDateTimePrecision = 66
    RULE_expressionTerm = 67
    RULE_caseExpressionItem = 68
    RULE_dateTimePrecisionSpecifier = 69
    RULE_relativeQualifier = 70
    RULE_offsetRelativeQualifier = 71
    RULE_exclusiveRelativeQualifier = 72
    RULE_quantityOffset = 73
    RULE_temporalRelationship = 74
    RULE_intervalOperatorPhrase = 75
    RULE_term = 76
    RULE_qualifiedInvocation = 77
    RULE_qualifiedFunction = 78
    RULE_invocation = 79
    RULE_function = 80
    RULE_ratio = 81
    RULE_literal = 82
    RULE_intervalSelector = 83
    RULE_tupleSelector = 84
    RULE_tupleElementSelector = 85
    RULE_instanceSelector = 86
    RULE_instanceElementSelector = 87
    RULE_listSelector = 88
    RULE_displayClause = 89
    RULE_codeSelector = 90
    RULE_conceptSelector = 91
    RULE_keyword = 92
    RULE_reservedWord = 93
    RULE_keywordIdentifier = 94
    RULE_obsoleteIdentifier = 95
    RULE_functionIdentifier = 96
    RULE_typeNameIdentifier = 97
    RULE_referentialIdentifier = 98
    RULE_referentialOrTypeNameIdentifier = 99
    RULE_identifierOrFunctionIdentifier = 100
    RULE_identifier = 101
    RULE_externalConstant = 102
    RULE_paramList = 103
    RULE_quantity = 104
    RULE_unit = 105

    ruleNames =  [ "definition", "library", "libraryDefinition", "usingDefinition", 
                   "includeDefinition", "localIdentifier", "accessModifier", 
                   "parameterDefinition", "codesystemDefinition", "valuesetDefinition", 
                   "codesystems", "codesystemIdentifier", "libraryIdentifier", 
                   "codeDefinition", "conceptDefinition", "codeIdentifier", 
                   "codesystemId", "valuesetId", "versionSpecifier", "codeId", 
                   "typeSpecifier", "namedTypeSpecifier", "modelIdentifier", 
                   "listTypeSpecifier", "intervalTypeSpecifier", "tupleTypeSpecifier", 
                   "tupleElementDefinition", "choiceTypeSpecifier", "statement", 
                   "expressionDefinition", "contextDefinition", "fluentModifier", 
                   "functionDefinition", "operandDefinition", "functionBody", 
                   "querySource", "aliasedQuerySource", "alias", "queryInclusionClause", 
                   "withClause", "withoutClause", "retrieve", "contextIdentifier", 
                   "codePath", "codeComparator", "terminology", "qualifier", 
                   "query", "sourceClause", "letClause", "letClauseItem", 
                   "whereClause", "returnClause", "aggregateClause", "startingClause", 
                   "sortClause", "sortDirection", "sortByItem", "qualifiedIdentifier", 
                   "qualifiedIdentifierExpression", "qualifierExpression", 
                   "simplePath", "simpleLiteral", "expression", "dateTimePrecision", 
                   "dateTimeComponent", "pluralDateTimePrecision", "expressionTerm", 
                   "caseExpressionItem", "dateTimePrecisionSpecifier", "relativeQualifier", 
                   "offsetRelativeQualifier", "exclusiveRelativeQualifier", 
                   "quantityOffset", "temporalRelationship", "intervalOperatorPhrase", 
                   "term", "qualifiedInvocation", "qualifiedFunction", "invocation", 
                   "function", "ratio", "literal", "intervalSelector", "tupleSelector", 
                   "tupleElementSelector", "instanceSelector", "instanceElementSelector", 
                   "listSelector", "displayClause", "codeSelector", "conceptSelector", 
                   "keyword", "reservedWord", "keywordIdentifier", "obsoleteIdentifier", 
                   "functionIdentifier", "typeNameIdentifier", "referentialIdentifier", 
                   "referentialOrTypeNameIdentifier", "identifierOrFunctionIdentifier", 
                   "identifier", "externalConstant", "paramList", "quantity", 
                   "unit" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    T__10=11
    T__11=12
    T__12=13
    T__13=14
    T__14=15
    T__15=16
    T__16=17
    T__17=18
    T__18=19
    T__19=20
    T__20=21
    T__21=22
    T__22=23
    T__23=24
    T__24=25
    T__25=26
    T__26=27
    T__27=28
    T__28=29
    T__29=30
    T__30=31
    T__31=32
    T__32=33
    T__33=34
    T__34=35
    T__35=36
    T__36=37
    T__37=38
    T__38=39
    T__39=40
    T__40=41
    T__41=42
    T__42=43
    T__43=44
    T__44=45
    T__45=46
    T__46=47
    T__47=48
    T__48=49
    T__49=50
    T__50=51
    T__51=52
    T__52=53
    T__53=54
    T__54=55
    T__55=56
    T__56=57
    T__57=58
    T__58=59
    T__59=60
    T__60=61
    T__61=62
    T__62=63
    T__63=64
    T__64=65
    T__65=66
    T__66=67
    T__67=68
    T__68=69
    T__69=70
    T__70=71
    T__71=72
    T__72=73
    T__73=74
    T__74=75
    T__75=76
    T__76=77
    T__77=78
    T__78=79
    T__79=80
    T__80=81
    T__81=82
    T__82=83
    T__83=84
    T__84=85
    T__85=86
    T__86=87
    T__87=88
    T__88=89
    T__89=90
    T__90=91
    T__91=92
    T__92=93
    T__93=94
    T__94=95
    T__95=96
    T__96=97
    T__97=98
    T__98=99
    T__99=100
    T__100=101
    T__101=102
    T__102=103
    T__103=104
    T__104=105
    T__105=106
    T__106=107
    T__107=108
    T__108=109
    T__109=110
    T__110=111
    T__111=112
    T__112=113
    T__113=114
    T__114=115
    T__115=116
    T__116=117
    T__117=118
    T__118=119
    T__119=120
    T__120=121
    T__121=122
    T__122=123
    T__123=124
    T__124=125
    T__125=126
    T__126=127
    T__127=128
    T__128=129
    T__129=130
    T__130=131
    T__131=132
    T__132=133
    T__133=134
    T__134=135
    T__135=136
    T__136=137
    T__137=138
    T__138=139
    T__139=140
    T__140=141
    T__141=142
    T__142=143
    T__143=144
    T__144=145
    T__145=146
    T__146=147
    T__147=148
    T__148=149
    T__149=150
    T__150=151
    T__151=152
    T__152=153
    T__153=154
    T__154=155
    T__155=156
    T__156=157
    QUOTEDIDENTIFIER=158
    DATETIME=159
    LONGNUMBER=160
    DATE=161
    TIME=162
    IDENTIFIER=163
    DELIMITEDIDENTIFIER=164
    STRING=165
    NUMBER=166
    WS=167
    COMMENT=168
    LINE_COMMENT=169

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




    class DefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def usingDefinition(self):
            return self.getTypedRuleContext(cqlParser.UsingDefinitionContext,0)


        def includeDefinition(self):
            return self.getTypedRuleContext(cqlParser.IncludeDefinitionContext,0)


        def codesystemDefinition(self):
            return self.getTypedRuleContext(cqlParser.CodesystemDefinitionContext,0)


        def valuesetDefinition(self):
            return self.getTypedRuleContext(cqlParser.ValuesetDefinitionContext,0)


        def codeDefinition(self):
            return self.getTypedRuleContext(cqlParser.CodeDefinitionContext,0)


        def conceptDefinition(self):
            return self.getTypedRuleContext(cqlParser.ConceptDefinitionContext,0)


        def parameterDefinition(self):
            return self.getTypedRuleContext(cqlParser.ParameterDefinitionContext,0)


        def getRuleIndex(self):
            return cqlParser.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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDefinition" ):
                return visitor.visitDefinition(self)
            else:
                return visitor.visitChildren(self)




    def definition(self):

        localctx = cqlParser.DefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_definition)
        try:
            self.state = 219
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,0,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 212
                self.usingDefinition()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 213
                self.includeDefinition()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 214
                self.codesystemDefinition()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 215
                self.valuesetDefinition()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 216
                self.codeDefinition()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 217
                self.conceptDefinition()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 218
                self.parameterDefinition()
                pass


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


    class LibraryContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def libraryDefinition(self):
            return self.getTypedRuleContext(cqlParser.LibraryDefinitionContext,0)


        def definition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.DefinitionContext)
            else:
                return self.getTypedRuleContext(cqlParser.DefinitionContext,i)


        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.StatementContext)
            else:
                return self.getTypedRuleContext(cqlParser.StatementContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_library

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

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

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




    def library(self):

        localctx = cqlParser.LibraryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_library)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 222
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==1:
                self.state = 221
                self.libraryDefinition()


            self.state = 227
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 1316328) != 0):
                self.state = 224
                self.definition()
                self.state = 229
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 233
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==27 or _la==28:
                self.state = 230
                self.statement()
                self.state = 235
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 236
            self.match(cqlParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LibraryDefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def qualifiedIdentifier(self):
            return self.getTypedRuleContext(cqlParser.QualifiedIdentifierContext,0)


        def versionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.VersionSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_libraryDefinition

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

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

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




    def libraryDefinition(self):

        localctx = cqlParser.LibraryDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_libraryDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 238
            self.match(cqlParser.T__0)
            self.state = 239
            self.qualifiedIdentifier()
            self.state = 242
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 240
                self.match(cqlParser.T__1)
                self.state = 241
                self.versionSpecifier()


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


    class UsingDefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def qualifiedIdentifier(self):
            return self.getTypedRuleContext(cqlParser.QualifiedIdentifierContext,0)


        def versionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.VersionSpecifierContext,0)


        def localIdentifier(self):
            return self.getTypedRuleContext(cqlParser.LocalIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_usingDefinition

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

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

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




    def usingDefinition(self):

        localctx = cqlParser.UsingDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_usingDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 244
            self.match(cqlParser.T__2)
            self.state = 245
            self.qualifiedIdentifier()
            self.state = 248
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 246
                self.match(cqlParser.T__1)
                self.state = 247
                self.versionSpecifier()


            self.state = 252
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==4:
                self.state = 250
                self.match(cqlParser.T__3)
                self.state = 251
                self.localIdentifier()


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


    class IncludeDefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def qualifiedIdentifier(self):
            return self.getTypedRuleContext(cqlParser.QualifiedIdentifierContext,0)


        def versionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.VersionSpecifierContext,0)


        def localIdentifier(self):
            return self.getTypedRuleContext(cqlParser.LocalIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_includeDefinition

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

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

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




    def includeDefinition(self):

        localctx = cqlParser.IncludeDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_includeDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 254
            self.match(cqlParser.T__4)
            self.state = 255
            self.qualifiedIdentifier()
            self.state = 258
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 256
                self.match(cqlParser.T__1)
                self.state = 257
                self.versionSpecifier()


            self.state = 262
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==4:
                self.state = 260
                self.match(cqlParser.T__3)
                self.state = 261
                self.localIdentifier()


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


    class LocalIdentifierContext(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(cqlParser.IdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_localIdentifier

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

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

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




    def localIdentifier(self):

        localctx = cqlParser.LocalIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_localIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 264
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AccessModifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_accessModifier

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

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

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




    def accessModifier(self):

        localctx = cqlParser.AccessModifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_accessModifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 266
            _la = self._input.LA(1)
            if not(_la==6 or _la==7):
                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 ParameterDefinitionContext(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(cqlParser.IdentifierContext,0)


        def accessModifier(self):
            return self.getTypedRuleContext(cqlParser.AccessModifierContext,0)


        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_parameterDefinition

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

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

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




    def parameterDefinition(self):

        localctx = cqlParser.ParameterDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_parameterDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 269
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==6 or _la==7:
                self.state = 268
                self.accessModifier()


            self.state = 271
            self.match(cqlParser.T__7)
            self.state = 272
            self.identifier()
            self.state = 274
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,10,self._ctx)
            if la_ == 1:
                self.state = 273
                self.typeSpecifier()


            self.state = 278
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==9:
                self.state = 276
                self.match(cqlParser.T__8)
                self.state = 277
                self.expression(0)


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


    class CodesystemDefinitionContext(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(cqlParser.IdentifierContext,0)


        def codesystemId(self):
            return self.getTypedRuleContext(cqlParser.CodesystemIdContext,0)


        def accessModifier(self):
            return self.getTypedRuleContext(cqlParser.AccessModifierContext,0)


        def versionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.VersionSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_codesystemDefinition

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

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

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




    def codesystemDefinition(self):

        localctx = cqlParser.CodesystemDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_codesystemDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 281
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==6 or _la==7:
                self.state = 280
                self.accessModifier()


            self.state = 283
            self.match(cqlParser.T__9)
            self.state = 284
            self.identifier()
            self.state = 285
            self.match(cqlParser.T__10)
            self.state = 286
            self.codesystemId()
            self.state = 289
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 287
                self.match(cqlParser.T__1)
                self.state = 288
                self.versionSpecifier()


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


    class ValuesetDefinitionContext(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(cqlParser.IdentifierContext,0)


        def valuesetId(self):
            return self.getTypedRuleContext(cqlParser.ValuesetIdContext,0)


        def accessModifier(self):
            return self.getTypedRuleContext(cqlParser.AccessModifierContext,0)


        def versionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.VersionSpecifierContext,0)


        def codesystems(self):
            return self.getTypedRuleContext(cqlParser.CodesystemsContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_valuesetDefinition

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

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

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




    def valuesetDefinition(self):

        localctx = cqlParser.ValuesetDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_valuesetDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 292
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==6 or _la==7:
                self.state = 291
                self.accessModifier()


            self.state = 294
            self.match(cqlParser.T__11)
            self.state = 295
            self.identifier()
            self.state = 296
            self.match(cqlParser.T__10)
            self.state = 297
            self.valuesetId()
            self.state = 300
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 298
                self.match(cqlParser.T__1)
                self.state = 299
                self.versionSpecifier()


            self.state = 303
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==13:
                self.state = 302
                self.codesystems()


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


    class CodesystemsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def codesystemIdentifier(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.CodesystemIdentifierContext)
            else:
                return self.getTypedRuleContext(cqlParser.CodesystemIdentifierContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_codesystems

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

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

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




    def codesystems(self):

        localctx = cqlParser.CodesystemsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_codesystems)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 305
            self.match(cqlParser.T__12)
            self.state = 306
            self.match(cqlParser.T__13)
            self.state = 307
            self.codesystemIdentifier()
            self.state = 312
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==15:
                self.state = 308
                self.match(cqlParser.T__14)
                self.state = 309
                self.codesystemIdentifier()
                self.state = 314
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 315
            self.match(cqlParser.T__15)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CodesystemIdentifierContext(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(cqlParser.IdentifierContext,0)


        def libraryIdentifier(self):
            return self.getTypedRuleContext(cqlParser.LibraryIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_codesystemIdentifier

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

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

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




    def codesystemIdentifier(self):

        localctx = cqlParser.CodesystemIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_codesystemIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 320
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
            if la_ == 1:
                self.state = 317
                self.libraryIdentifier()
                self.state = 318
                self.match(cqlParser.T__16)


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


    class LibraryIdentifierContext(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(cqlParser.IdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_libraryIdentifier

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

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

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




    def libraryIdentifier(self):

        localctx = cqlParser.LibraryIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_libraryIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 324
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CodeDefinitionContext(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(cqlParser.IdentifierContext,0)


        def codeId(self):
            return self.getTypedRuleContext(cqlParser.CodeIdContext,0)


        def codesystemIdentifier(self):
            return self.getTypedRuleContext(cqlParser.CodesystemIdentifierContext,0)


        def accessModifier(self):
            return self.getTypedRuleContext(cqlParser.AccessModifierContext,0)


        def displayClause(self):
            return self.getTypedRuleContext(cqlParser.DisplayClauseContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_codeDefinition

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

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

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




    def codeDefinition(self):

        localctx = cqlParser.CodeDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_codeDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 327
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==6 or _la==7:
                self.state = 326
                self.accessModifier()


            self.state = 329
            self.match(cqlParser.T__17)
            self.state = 330
            self.identifier()
            self.state = 331
            self.match(cqlParser.T__10)
            self.state = 332
            self.codeId()
            self.state = 333
            self.match(cqlParser.T__18)
            self.state = 334
            self.codesystemIdentifier()
            self.state = 336
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==154:
                self.state = 335
                self.displayClause()


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


    class ConceptDefinitionContext(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(cqlParser.IdentifierContext,0)


        def codeIdentifier(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.CodeIdentifierContext)
            else:
                return self.getTypedRuleContext(cqlParser.CodeIdentifierContext,i)


        def accessModifier(self):
            return self.getTypedRuleContext(cqlParser.AccessModifierContext,0)


        def displayClause(self):
            return self.getTypedRuleContext(cqlParser.DisplayClauseContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_conceptDefinition

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

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

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




    def conceptDefinition(self):

        localctx = cqlParser.ConceptDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_conceptDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 339
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==6 or _la==7:
                self.state = 338
                self.accessModifier()


            self.state = 341
            self.match(cqlParser.T__19)
            self.state = 342
            self.identifier()
            self.state = 343
            self.match(cqlParser.T__10)
            self.state = 344
            self.match(cqlParser.T__13)
            self.state = 345
            self.codeIdentifier()
            self.state = 350
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==15:
                self.state = 346
                self.match(cqlParser.T__14)
                self.state = 347
                self.codeIdentifier()
                self.state = 352
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 353
            self.match(cqlParser.T__15)
            self.state = 355
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==154:
                self.state = 354
                self.displayClause()


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


    class CodeIdentifierContext(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(cqlParser.IdentifierContext,0)


        def libraryIdentifier(self):
            return self.getTypedRuleContext(cqlParser.LibraryIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_codeIdentifier

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

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

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




    def codeIdentifier(self):

        localctx = cqlParser.CodeIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_codeIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 360
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,24,self._ctx)
            if la_ == 1:
                self.state = 357
                self.libraryIdentifier()
                self.state = 358
                self.match(cqlParser.T__16)


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


    class CodesystemIdContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return cqlParser.RULE_codesystemId

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

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

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




    def codesystemId(self):

        localctx = cqlParser.CodesystemIdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_codesystemId)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 364
            self.match(cqlParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ValuesetIdContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return cqlParser.RULE_valuesetId

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

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

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




    def valuesetId(self):

        localctx = cqlParser.ValuesetIdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_valuesetId)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 366
            self.match(cqlParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class VersionSpecifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return cqlParser.RULE_versionSpecifier

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

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

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




    def versionSpecifier(self):

        localctx = cqlParser.VersionSpecifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_versionSpecifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 368
            self.match(cqlParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CodeIdContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return cqlParser.RULE_codeId

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

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

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




    def codeId(self):

        localctx = cqlParser.CodeIdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_codeId)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 370
            self.match(cqlParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TypeSpecifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def namedTypeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.NamedTypeSpecifierContext,0)


        def listTypeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.ListTypeSpecifierContext,0)


        def intervalTypeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.IntervalTypeSpecifierContext,0)


        def tupleTypeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TupleTypeSpecifierContext,0)


        def choiceTypeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.ChoiceTypeSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_typeSpecifier

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

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

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




    def typeSpecifier(self):

        localctx = cqlParser.TypeSpecifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_typeSpecifier)
        try:
            self.state = 377
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 20, 27, 28, 29, 30, 45, 50, 52, 53, 54, 55, 56, 71, 72, 73, 78, 80, 81, 90, 91, 92, 93, 106, 107, 109, 110, 111, 119, 120, 131, 132, 133, 134, 141, 142, 145, 149, 150, 154, 155, 156, 158, 163, 164]:
                self.enterOuterAlt(localctx, 1)
                self.state = 372
                self.namedTypeSpecifier()
                pass
            elif token in [21]:
                self.enterOuterAlt(localctx, 2)
                self.state = 373
                self.listTypeSpecifier()
                pass
            elif token in [24]:
                self.enterOuterAlt(localctx, 3)
                self.state = 374
                self.intervalTypeSpecifier()
                pass
            elif token in [25]:
                self.enterOuterAlt(localctx, 4)
                self.state = 375
                self.tupleTypeSpecifier()
                pass
            elif token in [26]:
                self.enterOuterAlt(localctx, 5)
                self.state = 376
                self.choiceTypeSpecifier()
                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 NamedTypeSpecifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialOrTypeNameIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialOrTypeNameIdentifierContext,0)


        def qualifier(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.QualifierContext)
            else:
                return self.getTypedRuleContext(cqlParser.QualifierContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_namedTypeSpecifier

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

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

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




    def namedTypeSpecifier(self):

        localctx = cqlParser.NamedTypeSpecifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_namedTypeSpecifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 384
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,26,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 379
                    self.qualifier()
                    self.state = 380
                    self.match(cqlParser.T__16) 
                self.state = 386
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,26,self._ctx)

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


    class ModelIdentifierContext(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(cqlParser.IdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_modelIdentifier

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

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

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




    def modelIdentifier(self):

        localctx = cqlParser.ModelIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_modelIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 389
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ListTypeSpecifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_listTypeSpecifier

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

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

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




    def listTypeSpecifier(self):

        localctx = cqlParser.ListTypeSpecifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_listTypeSpecifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 391
            self.match(cqlParser.T__20)
            self.state = 392
            self.match(cqlParser.T__21)
            self.state = 393
            self.typeSpecifier()
            self.state = 394
            self.match(cqlParser.T__22)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IntervalTypeSpecifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_intervalTypeSpecifier

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

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

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




    def intervalTypeSpecifier(self):

        localctx = cqlParser.IntervalTypeSpecifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_intervalTypeSpecifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 396
            self.match(cqlParser.T__23)
            self.state = 397
            self.match(cqlParser.T__21)
            self.state = 398
            self.typeSpecifier()
            self.state = 399
            self.match(cqlParser.T__22)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TupleTypeSpecifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def tupleElementDefinition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.TupleElementDefinitionContext)
            else:
                return self.getTypedRuleContext(cqlParser.TupleElementDefinitionContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_tupleTypeSpecifier

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

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

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




    def tupleTypeSpecifier(self):

        localctx = cqlParser.TupleTypeSpecifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_tupleTypeSpecifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 401
            self.match(cqlParser.T__24)
            self.state = 402
            self.match(cqlParser.T__13)
            self.state = 403
            self.tupleElementDefinition()
            self.state = 408
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==15:
                self.state = 404
                self.match(cqlParser.T__14)
                self.state = 405
                self.tupleElementDefinition()
                self.state = 410
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 411
            self.match(cqlParser.T__15)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TupleElementDefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_tupleElementDefinition

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

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

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




    def tupleElementDefinition(self):

        localctx = cqlParser.TupleElementDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_tupleElementDefinition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 413
            self.referentialIdentifier()
            self.state = 414
            self.typeSpecifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ChoiceTypeSpecifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def typeSpecifier(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.TypeSpecifierContext)
            else:
                return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_choiceTypeSpecifier

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

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

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




    def choiceTypeSpecifier(self):

        localctx = cqlParser.ChoiceTypeSpecifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_choiceTypeSpecifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 416
            self.match(cqlParser.T__25)
            self.state = 417
            self.match(cqlParser.T__21)
            self.state = 418
            self.typeSpecifier()
            self.state = 423
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==15:
                self.state = 419
                self.match(cqlParser.T__14)
                self.state = 420
                self.typeSpecifier()
                self.state = 425
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 426
            self.match(cqlParser.T__22)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StatementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expressionDefinition(self):
            return self.getTypedRuleContext(cqlParser.ExpressionDefinitionContext,0)


        def contextDefinition(self):
            return self.getTypedRuleContext(cqlParser.ContextDefinitionContext,0)


        def functionDefinition(self):
            return self.getTypedRuleContext(cqlParser.FunctionDefinitionContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_statement

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

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

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




    def statement(self):

        localctx = cqlParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_statement)
        try:
            self.state = 431
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,29,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 428
                self.expressionDefinition()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 429
                self.contextDefinition()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 430
                self.functionDefinition()
                pass


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


    class ExpressionDefinitionContext(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(cqlParser.IdentifierContext,0)


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


        def accessModifier(self):
            return self.getTypedRuleContext(cqlParser.AccessModifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_expressionDefinition

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

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

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




    def expressionDefinition(self):

        localctx = cqlParser.ExpressionDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_expressionDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 433
            self.match(cqlParser.T__26)
            self.state = 435
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==6 or _la==7:
                self.state = 434
                self.accessModifier()


            self.state = 437
            self.identifier()
            self.state = 438
            self.match(cqlParser.T__10)
            self.state = 439
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ContextDefinitionContext(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(cqlParser.IdentifierContext,0)


        def modelIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ModelIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_contextDefinition

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

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

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




    def contextDefinition(self):

        localctx = cqlParser.ContextDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_contextDefinition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 441
            self.match(cqlParser.T__27)
            self.state = 445
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,31,self._ctx)
            if la_ == 1:
                self.state = 442
                self.modelIdentifier()
                self.state = 443
                self.match(cqlParser.T__16)


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


    class FluentModifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_fluentModifier

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

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

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




    def fluentModifier(self):

        localctx = cqlParser.FluentModifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_fluentModifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 449
            self.match(cqlParser.T__28)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FunctionDefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def identifierOrFunctionIdentifier(self):
            return self.getTypedRuleContext(cqlParser.IdentifierOrFunctionIdentifierContext,0)


        def functionBody(self):
            return self.getTypedRuleContext(cqlParser.FunctionBodyContext,0)


        def accessModifier(self):
            return self.getTypedRuleContext(cqlParser.AccessModifierContext,0)


        def fluentModifier(self):
            return self.getTypedRuleContext(cqlParser.FluentModifierContext,0)


        def operandDefinition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.OperandDefinitionContext)
            else:
                return self.getTypedRuleContext(cqlParser.OperandDefinitionContext,i)


        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_functionDefinition

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

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

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




    def functionDefinition(self):

        localctx = cqlParser.FunctionDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_functionDefinition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 451
            self.match(cqlParser.T__26)
            self.state = 453
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==6 or _la==7:
                self.state = 452
                self.accessModifier()


            self.state = 456
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==29:
                self.state = 455
                self.fluentModifier()


            self.state = 458
            self.match(cqlParser.T__29)
            self.state = 459
            self.identifierOrFunctionIdentifier()
            self.state = 460
            self.match(cqlParser.T__30)
            self.state = 469
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 140772674742007806) != 0) or ((((_la - 71)) & ~0x3f) == 0 and ((1 << (_la - 71)) & -1152075052444285305) != 0) or ((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 12722963) != 0):
                self.state = 461
                self.operandDefinition()
                self.state = 466
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 462
                    self.match(cqlParser.T__14)
                    self.state = 463
                    self.operandDefinition()
                    self.state = 468
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 471
            self.match(cqlParser.T__31)
            self.state = 474
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==33:
                self.state = 472
                self.match(cqlParser.T__32)
                self.state = 473
                self.typeSpecifier()


            self.state = 476
            self.match(cqlParser.T__10)
            self.state = 479
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 18, 19, 20, 21, 24, 25, 27, 28, 29, 30, 31, 38, 45, 48, 50, 52, 53, 54, 55, 56, 58, 59, 60, 61, 63, 64, 68, 69, 71, 72, 73, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 109, 110, 111, 112, 113, 114, 115, 119, 120, 122, 125, 126, 127, 128, 131, 132, 133, 134, 141, 142, 145, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166]:
                self.state = 477
                self.functionBody()
                pass
            elif token in [34]:
                self.state = 478
                self.match(cqlParser.T__33)
                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 OperandDefinitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_operandDefinition

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

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

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




    def operandDefinition(self):

        localctx = cqlParser.OperandDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_operandDefinition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 481
            self.referentialIdentifier()
            self.state = 482
            self.typeSpecifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FunctionBodyContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return cqlParser.RULE_functionBody

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

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

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




    def functionBody(self):

        localctx = cqlParser.FunctionBodyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_functionBody)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 484
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class QuerySourceContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def retrieve(self):
            return self.getTypedRuleContext(cqlParser.RetrieveContext,0)


        def qualifiedIdentifierExpression(self):
            return self.getTypedRuleContext(cqlParser.QualifiedIdentifierExpressionContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_querySource

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

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

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




    def querySource(self):

        localctx = cqlParser.QuerySourceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_querySource)
        try:
            self.state = 492
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [38]:
                self.enterOuterAlt(localctx, 1)
                self.state = 486
                self.retrieve()
                pass
            elif token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 20, 27, 28, 29, 30, 45, 50, 52, 53, 54, 55, 56, 71, 72, 73, 78, 80, 81, 90, 91, 92, 93, 106, 107, 109, 110, 111, 119, 120, 131, 132, 133, 134, 141, 142, 145, 149, 150, 154, 158, 163, 164]:
                self.enterOuterAlt(localctx, 2)
                self.state = 487
                self.qualifiedIdentifierExpression()
                pass
            elif token in [31]:
                self.enterOuterAlt(localctx, 3)
                self.state = 488
                self.match(cqlParser.T__30)
                self.state = 489
                self.expression(0)
                self.state = 490
                self.match(cqlParser.T__31)
                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 AliasedQuerySourceContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def querySource(self):
            return self.getTypedRuleContext(cqlParser.QuerySourceContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_aliasedQuerySource

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

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

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




    def aliasedQuerySource(self):

        localctx = cqlParser.AliasedQuerySourceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_aliasedQuerySource)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 494
            self.querySource()
            self.state = 495
            self.alias()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AliasContext(ParserRuleContext):
        __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(cqlParser.IdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_alias

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

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

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




    def alias(self):

        localctx = cqlParser.AliasContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_alias)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 497
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class QueryInclusionClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def withClause(self):
            return self.getTypedRuleContext(cqlParser.WithClauseContext,0)


        def withoutClause(self):
            return self.getTypedRuleContext(cqlParser.WithoutClauseContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_queryInclusionClause

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

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

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




    def queryInclusionClause(self):

        localctx = cqlParser.QueryInclusionClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_queryInclusionClause)
        try:
            self.state = 501
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [35]:
                self.enterOuterAlt(localctx, 1)
                self.state = 499
                self.withClause()
                pass
            elif token in [37]:
                self.enterOuterAlt(localctx, 2)
                self.state = 500
                self.withoutClause()
                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 WithClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def aliasedQuerySource(self):
            return self.getTypedRuleContext(cqlParser.AliasedQuerySourceContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_withClause

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

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

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




    def withClause(self):

        localctx = cqlParser.WithClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_withClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 503
            self.match(cqlParser.T__34)
            self.state = 504
            self.aliasedQuerySource()
            self.state = 505
            self.match(cqlParser.T__35)
            self.state = 506
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class WithoutClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def aliasedQuerySource(self):
            return self.getTypedRuleContext(cqlParser.AliasedQuerySourceContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_withoutClause

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

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

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




    def withoutClause(self):

        localctx = cqlParser.WithoutClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_withoutClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 508
            self.match(cqlParser.T__36)
            self.state = 509
            self.aliasedQuerySource()
            self.state = 510
            self.match(cqlParser.T__35)
            self.state = 511
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RetrieveContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def namedTypeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.NamedTypeSpecifierContext,0)


        def contextIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ContextIdentifierContext,0)


        def terminology(self):
            return self.getTypedRuleContext(cqlParser.TerminologyContext,0)


        def codePath(self):
            return self.getTypedRuleContext(cqlParser.CodePathContext,0)


        def codeComparator(self):
            return self.getTypedRuleContext(cqlParser.CodeComparatorContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_retrieve

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

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

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




    def retrieve(self):

        localctx = cqlParser.RetrieveContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_retrieve)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 513
            self.match(cqlParser.T__37)
            self.state = 517
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,40,self._ctx)
            if la_ == 1:
                self.state = 514
                self.contextIdentifier()
                self.state = 515
                self.match(cqlParser.T__38)


            self.state = 519
            self.namedTypeSpecifier()
            self.state = 527
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==11:
                self.state = 520
                self.match(cqlParser.T__10)
                self.state = 524
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,41,self._ctx)
                if la_ == 1:
                    self.state = 521
                    self.codePath()
                    self.state = 522
                    self.codeComparator()


                self.state = 526
                self.terminology()


            self.state = 529
            self.match(cqlParser.T__39)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ContextIdentifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def qualifiedIdentifierExpression(self):
            return self.getTypedRuleContext(cqlParser.QualifiedIdentifierExpressionContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_contextIdentifier

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

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

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




    def contextIdentifier(self):

        localctx = cqlParser.ContextIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_contextIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 531
            self.qualifiedIdentifierExpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CodePathContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def simplePath(self):
            return self.getTypedRuleContext(cqlParser.SimplePathContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_codePath

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

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

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




    def codePath(self):

        localctx = cqlParser.CodePathContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_codePath)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 533
            self.simplePath(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CodeComparatorContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_codeComparator

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

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

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




    def codeComparator(self):

        localctx = cqlParser.CodeComparatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_codeComparator)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 535
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 15393162788864) != 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 TerminologyContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def qualifiedIdentifierExpression(self):
            return self.getTypedRuleContext(cqlParser.QualifiedIdentifierExpressionContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_terminology

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

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

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




    def terminology(self):

        localctx = cqlParser.TerminologyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_terminology)
        try:
            self.state = 539
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 537
                self.qualifiedIdentifierExpression()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 538
                self.expression(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 QualifierContext(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(cqlParser.IdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_qualifier

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

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

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




    def qualifier(self):

        localctx = cqlParser.QualifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_qualifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 541
            self.identifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class QueryContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def sourceClause(self):
            return self.getTypedRuleContext(cqlParser.SourceClauseContext,0)


        def letClause(self):
            return self.getTypedRuleContext(cqlParser.LetClauseContext,0)


        def queryInclusionClause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.QueryInclusionClauseContext)
            else:
                return self.getTypedRuleContext(cqlParser.QueryInclusionClauseContext,i)


        def whereClause(self):
            return self.getTypedRuleContext(cqlParser.WhereClauseContext,0)


        def aggregateClause(self):
            return self.getTypedRuleContext(cqlParser.AggregateClauseContext,0)


        def returnClause(self):
            return self.getTypedRuleContext(cqlParser.ReturnClauseContext,0)


        def sortClause(self):
            return self.getTypedRuleContext(cqlParser.SortClauseContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_query

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

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

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




    def query(self):

        localctx = cqlParser.QueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_query)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 543
            self.sourceClause()
            self.state = 545
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,44,self._ctx)
            if la_ == 1:
                self.state = 544
                self.letClause()


            self.state = 550
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,45,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 547
                    self.queryInclusionClause() 
                self.state = 552
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,45,self._ctx)

            self.state = 554
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,46,self._ctx)
            if la_ == 1:
                self.state = 553
                self.whereClause()


            self.state = 558
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,47,self._ctx)
            if la_ == 1:
                self.state = 556
                self.aggregateClause()

            elif la_ == 2:
                self.state = 557
                self.returnClause()


            self.state = 561
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,48,self._ctx)
            if la_ == 1:
                self.state = 560
                self.sortClause()


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


    class SourceClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def aliasedQuerySource(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.AliasedQuerySourceContext)
            else:
                return self.getTypedRuleContext(cqlParser.AliasedQuerySourceContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_sourceClause

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

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

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




    def sourceClause(self):

        localctx = cqlParser.SourceClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_sourceClause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 564
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==19:
                self.state = 563
                self.match(cqlParser.T__18)


            self.state = 566
            self.aliasedQuerySource()
            self.state = 571
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,50,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 567
                    self.match(cqlParser.T__14)
                    self.state = 568
                    self.aliasedQuerySource() 
                self.state = 573
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,50,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 LetClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def letClauseItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.LetClauseItemContext)
            else:
                return self.getTypedRuleContext(cqlParser.LetClauseItemContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_letClause

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

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

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




    def letClause(self):

        localctx = cqlParser.LetClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_letClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 574
            self.match(cqlParser.T__43)
            self.state = 575
            self.letClauseItem()
            self.state = 580
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,51,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 576
                    self.match(cqlParser.T__14)
                    self.state = 577
                    self.letClauseItem() 
                self.state = 582
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,51,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 LetClauseItemContext(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(cqlParser.IdentifierContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_letClauseItem

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

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

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




    def letClauseItem(self):

        localctx = cqlParser.LetClauseItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_letClauseItem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 583
            self.identifier()
            self.state = 584
            self.match(cqlParser.T__10)
            self.state = 585
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class WhereClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return cqlParser.RULE_whereClause

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

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

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




    def whereClause(self):

        localctx = cqlParser.WhereClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_whereClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 587
            self.match(cqlParser.T__44)
            self.state = 588
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ReturnClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return cqlParser.RULE_returnClause

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

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

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




    def returnClause(self):

        localctx = cqlParser.ReturnClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_returnClause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 590
            self.match(cqlParser.T__45)
            self.state = 592
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,52,self._ctx)
            if la_ == 1:
                self.state = 591
                _la = self._input.LA(1)
                if not(_la==47 or _la==48):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


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


    class AggregateClauseContext(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(cqlParser.IdentifierContext,0)


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


        def startingClause(self):
            return self.getTypedRuleContext(cqlParser.StartingClauseContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_aggregateClause

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

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

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




    def aggregateClause(self):

        localctx = cqlParser.AggregateClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_aggregateClause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 596
            self.match(cqlParser.T__48)
            self.state = 598
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==47 or _la==48:
                self.state = 597
                _la = self._input.LA(1)
                if not(_la==47 or _la==48):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 600
            self.identifier()
            self.state = 602
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==50:
                self.state = 601
                self.startingClause()


            self.state = 604
            self.match(cqlParser.T__10)
            self.state = 605
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StartingClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def simpleLiteral(self):
            return self.getTypedRuleContext(cqlParser.SimpleLiteralContext,0)


        def quantity(self):
            return self.getTypedRuleContext(cqlParser.QuantityContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_startingClause

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

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

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




    def startingClause(self):

        localctx = cqlParser.StartingClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_startingClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 607
            self.match(cqlParser.T__49)
            self.state = 614
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,55,self._ctx)
            if la_ == 1:
                self.state = 608
                self.simpleLiteral()
                pass

            elif la_ == 2:
                self.state = 609
                self.quantity()
                pass

            elif la_ == 3:
                self.state = 610
                self.match(cqlParser.T__30)
                self.state = 611
                self.expression(0)
                self.state = 612
                self.match(cqlParser.T__31)
                pass


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


    class SortClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def sortDirection(self):
            return self.getTypedRuleContext(cqlParser.SortDirectionContext,0)


        def sortByItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.SortByItemContext)
            else:
                return self.getTypedRuleContext(cqlParser.SortByItemContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_sortClause

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

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

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




    def sortClause(self):

        localctx = cqlParser.SortClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_sortClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 616
            self.match(cqlParser.T__50)
            self.state = 627
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [53, 54, 55, 56]:
                self.state = 617
                self.sortDirection()
                pass
            elif token in [52]:
                self.state = 618
                self.match(cqlParser.T__51)
                self.state = 619
                self.sortByItem()
                self.state = 624
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,56,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 620
                        self.match(cqlParser.T__14)
                        self.state = 621
                        self.sortByItem() 
                    self.state = 626
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,56,self._ctx)

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

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


        def getRuleIndex(self):
            return cqlParser.RULE_sortDirection

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

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

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




    def sortDirection(self):

        localctx = cqlParser.SortDirectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_sortDirection)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 629
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 135107988821114880) != 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 SortByItemContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


        def sortDirection(self):
            return self.getTypedRuleContext(cqlParser.SortDirectionContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_sortByItem

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

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

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




    def sortByItem(self):

        localctx = cqlParser.SortByItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_sortByItem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 631
            self.expressionTerm(0)
            self.state = 633
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,58,self._ctx)
            if la_ == 1:
                self.state = 632
                self.sortDirection()


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


    class QualifiedIdentifierContext(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(cqlParser.IdentifierContext,0)


        def qualifier(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.QualifierContext)
            else:
                return self.getTypedRuleContext(cqlParser.QualifierContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_qualifiedIdentifier

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

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

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




    def qualifiedIdentifier(self):

        localctx = cqlParser.QualifiedIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_qualifiedIdentifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 640
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,59,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 635
                    self.qualifier()
                    self.state = 636
                    self.match(cqlParser.T__16) 
                self.state = 642
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,59,self._ctx)

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


    class QualifiedIdentifierExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


        def qualifierExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.QualifierExpressionContext)
            else:
                return self.getTypedRuleContext(cqlParser.QualifierExpressionContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_qualifiedIdentifierExpression

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

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

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




    def qualifiedIdentifierExpression(self):

        localctx = cqlParser.QualifiedIdentifierExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 118, self.RULE_qualifiedIdentifierExpression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 650
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,60,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 645
                    self.qualifierExpression()
                    self.state = 646
                    self.match(cqlParser.T__16) 
                self.state = 652
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,60,self._ctx)

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


    class QualifierExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_qualifierExpression

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

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

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




    def qualifierExpression(self):

        localctx = cqlParser.QualifierExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_qualifierExpression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 655
            self.referentialIdentifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SimplePathContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_simplePath

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


    class SimplePathIndexerContext(SimplePathContext):

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

        def simplePath(self):
            return self.getTypedRuleContext(cqlParser.SimplePathContext,0)

        def simpleLiteral(self):
            return self.getTypedRuleContext(cqlParser.SimpleLiteralContext,0)


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

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

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


    class SimplePathQualifiedIdentifierContext(SimplePathContext):

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

        def simplePath(self):
            return self.getTypedRuleContext(cqlParser.SimplePathContext,0)

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


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

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

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


    class SimplePathReferentialIdentifierContext(SimplePathContext):

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


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

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

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



    def simplePath(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = cqlParser.SimplePathContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 122
        self.enterRecursionRule(localctx, 122, self.RULE_simplePath, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            localctx = cqlParser.SimplePathReferentialIdentifierContext(self, localctx)
            self._ctx = localctx
            _prevctx = localctx

            self.state = 658
            self.referentialIdentifier()
            self._ctx.stop = self._input.LT(-1)
            self.state = 670
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,62,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 = 668
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,61,self._ctx)
                    if la_ == 1:
                        localctx = cqlParser.SimplePathQualifiedIdentifierContext(self, cqlParser.SimplePathContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_simplePath)
                        self.state = 660
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 661
                        self.match(cqlParser.T__16)
                        self.state = 662
                        self.referentialIdentifier()
                        pass

                    elif la_ == 2:
                        localctx = cqlParser.SimplePathIndexerContext(self, cqlParser.SimplePathContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_simplePath)
                        self.state = 663
                        if not self.precpred(self._ctx, 1):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                        self.state = 664
                        self.match(cqlParser.T__37)
                        self.state = 665
                        self.simpleLiteral()
                        self.state = 666
                        self.match(cqlParser.T__39)
                        pass

             
                self.state = 672
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,62,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 SimpleLiteralContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_simpleLiteral

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



    class SimpleNumberLiteralContext(SimpleLiteralContext):

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

        def NUMBER(self):
            return self.getToken(cqlParser.NUMBER, 0)

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

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

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


    class SimpleStringLiteralContext(SimpleLiteralContext):

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

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

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

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

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



    def simpleLiteral(self):

        localctx = cqlParser.SimpleLiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_simpleLiteral)
        try:
            self.state = 675
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [165]:
                localctx = cqlParser.SimpleStringLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 673
                self.match(cqlParser.STRING)
                pass
            elif token in [166]:
                localctx = cqlParser.SimpleNumberLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 674
                self.match(cqlParser.NUMBER)
                pass
            else:
                raise NoViableAltException(self)

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


    class ExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_expression

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


    class DurationBetweenExpressionContext(ExpressionContext):

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

        def pluralDateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.PluralDateTimePrecisionContext,0)

        def expressionTerm(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.ExpressionTermContext)
            else:
                return self.getTypedRuleContext(cqlParser.ExpressionTermContext,i)


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

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

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


    class InFixSetExpressionContext(ExpressionContext):

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

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


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

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

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


    class RetrieveExpressionContext(ExpressionContext):

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

        def retrieve(self):
            return self.getTypedRuleContext(cqlParser.RetrieveContext,0)


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

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

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


    class TimingExpressionContext(ExpressionContext):

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

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

        def intervalOperatorPhrase(self):
            return self.getTypedRuleContext(cqlParser.IntervalOperatorPhraseContext,0)


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

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

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


    class QueryExpressionContext(ExpressionContext):

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

        def query(self):
            return self.getTypedRuleContext(cqlParser.QueryContext,0)


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

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

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


    class NotExpressionContext(ExpressionContext):

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

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


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

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

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


    class BooleanExpressionContext(ExpressionContext):

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

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


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

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

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


    class OrExpressionContext(ExpressionContext):

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

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


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

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

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


    class CastExpressionContext(ExpressionContext):

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

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

        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


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

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

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


    class AndExpressionContext(ExpressionContext):

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

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


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

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

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


    class BetweenExpressionContext(ExpressionContext):

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

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

        def expressionTerm(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.ExpressionTermContext)
            else:
                return self.getTypedRuleContext(cqlParser.ExpressionTermContext,i)


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

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

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


    class MembershipExpressionContext(ExpressionContext):

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

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

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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


    class DifferenceBetweenExpressionContext(ExpressionContext):

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

        def pluralDateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.PluralDateTimePrecisionContext,0)

        def expressionTerm(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.ExpressionTermContext)
            else:
                return self.getTypedRuleContext(cqlParser.ExpressionTermContext,i)


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

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

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


    class InequalityExpressionContext(ExpressionContext):

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

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


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

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

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


    class EqualityExpressionContext(ExpressionContext):

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

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


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

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

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


    class ExistenceExpressionContext(ExpressionContext):

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

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


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

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

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


    class ImpliesExpressionContext(ExpressionContext):

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

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


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

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

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


    class NegateMembershipExpressionContext(ExpressionContext):

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

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

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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


    class TermExpressionContext(ExpressionContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class TypeExpressionContext(ExpressionContext):

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

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

        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


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

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

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



    def expression(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = cqlParser.ExpressionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 126
        self.enterRecursionRule(localctx, 126, self.RULE_expression, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 708
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,65,self._ctx)
            if la_ == 1:
                localctx = cqlParser.TermExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 678
                self.expressionTerm(0)
                pass

            elif la_ == 2:
                localctx = cqlParser.RetrieveExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 679
                self.retrieve()
                pass

            elif la_ == 3:
                localctx = cqlParser.QueryExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 680
                self.query()
                pass

            elif la_ == 4:
                localctx = cqlParser.CastExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 681
                self.match(cqlParser.T__62)
                self.state = 682
                self.expression(0)
                self.state = 683
                self.match(cqlParser.T__61)
                self.state = 684
                self.typeSpecifier()
                pass

            elif la_ == 5:
                localctx = cqlParser.NotExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 686
                self.match(cqlParser.T__57)
                self.state = 687
                self.expression(14)
                pass

            elif la_ == 6:
                localctx = cqlParser.ExistenceExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 688
                self.match(cqlParser.T__63)
                self.state = 689
                self.expression(13)
                pass

            elif la_ == 7:
                localctx = cqlParser.DurationBetweenExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 692
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==68:
                    self.state = 690
                    self.match(cqlParser.T__67)
                    self.state = 691
                    self.match(cqlParser.T__40)


                self.state = 694
                self.pluralDateTimePrecision()
                self.state = 695
                self.match(cqlParser.T__65)
                self.state = 696
                self.expressionTerm(0)
                self.state = 697
                self.match(cqlParser.T__66)
                self.state = 698
                self.expressionTerm(0)
                pass

            elif la_ == 8:
                localctx = cqlParser.DifferenceBetweenExpressionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 700
                self.match(cqlParser.T__68)
                self.state = 701
                self.match(cqlParser.T__40)
                self.state = 702
                self.pluralDateTimePrecision()
                self.state = 703
                self.match(cqlParser.T__65)
                self.state = 704
                self.expressionTerm(0)
                self.state = 705
                self.match(cqlParser.T__66)
                self.state = 706
                self.expressionTerm(0)
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 765
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,71,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 = 763
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,70,self._ctx)
                    if la_ == 1:
                        localctx = cqlParser.InFixSetExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 710
                        if not self.precpred(self._ctx, 9):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
                        self.state = 711
                        _la = self._input.LA(1)
                        if not(((((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 15) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 712
                        self.expression(10)
                        pass

                    elif la_ == 2:
                        localctx = cqlParser.InequalityExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 713
                        if not self.precpred(self._ctx, 8):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
                        self.state = 714
                        _la = self._input.LA(1)
                        if not(((((_la - 22)) & ~0x3f) == 0 and ((1 << (_la - 22)) & 13510798882111491) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 715
                        self.expression(9)
                        pass

                    elif la_ == 3:
                        localctx = cqlParser.TimingExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 716
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 717
                        self.intervalOperatorPhrase()
                        self.state = 718
                        self.expression(8)
                        pass

                    elif la_ == 4:
                        localctx = cqlParser.EqualityExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 720
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 721
                        _la = self._input.LA(1)
                        if not(((((_la - 42)) & ~0x3f) == 0 and ((1 << (_la - 42)) & 51539607555) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 722
                        self.expression(7)
                        pass

                    elif la_ == 5:
                        localctx = cqlParser.MembershipExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 723
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 724
                        _la = self._input.LA(1)
                        if not(_la==41 or _la==78):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 726
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,66,self._ctx)
                        if la_ == 1:
                            self.state = 725
                            self.dateTimePrecisionSpecifier()


                        self.state = 728
                        self.expression(6)
                        pass

                    elif la_ == 6:
                        localctx = cqlParser.NegateMembershipExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 729
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 730
                        self.match(cqlParser.T__57)
                        self.state = 731
                        _la = self._input.LA(1)
                        if not(_la==41 or _la==78):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 733
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,67,self._ctx)
                        if la_ == 1:
                            self.state = 732
                            self.dateTimePrecisionSpecifier()


                        self.state = 735
                        self.expression(5)
                        pass

                    elif la_ == 7:
                        localctx = cqlParser.AndExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 736
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 737
                        self.match(cqlParser.T__66)
                        self.state = 738
                        self.expression(4)
                        pass

                    elif la_ == 8:
                        localctx = cqlParser.OrExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 739
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 740
                        _la = self._input.LA(1)
                        if not(_la==79 or _la==80):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 741
                        self.expression(3)
                        pass

                    elif la_ == 9:
                        localctx = cqlParser.ImpliesExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 742
                        if not self.precpred(self._ctx, 1):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                        self.state = 743
                        self.match(cqlParser.T__80)
                        self.state = 744
                        self.expression(2)
                        pass

                    elif la_ == 10:
                        localctx = cqlParser.BooleanExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 745
                        if not self.precpred(self._ctx, 17):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 17)")
                        self.state = 746
                        self.match(cqlParser.T__56)
                        self.state = 748
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==58:
                            self.state = 747
                            self.match(cqlParser.T__57)


                        self.state = 750
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 4035225266123964416) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        pass

                    elif la_ == 11:
                        localctx = cqlParser.TypeExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 751
                        if not self.precpred(self._ctx, 16):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 16)")
                        self.state = 752
                        _la = self._input.LA(1)
                        if not(_la==57 or _la==62):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 753
                        self.typeSpecifier()
                        pass

                    elif la_ == 12:
                        localctx = cqlParser.BetweenExpressionContext(self, cqlParser.ExpressionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
                        self.state = 754
                        if not self.precpred(self._ctx, 12):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 12)")
                        self.state = 756
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==65:
                            self.state = 755
                            self.match(cqlParser.T__64)


                        self.state = 758
                        self.match(cqlParser.T__65)
                        self.state = 759
                        self.expressionTerm(0)
                        self.state = 760
                        self.match(cqlParser.T__66)
                        self.state = 761
                        self.expressionTerm(0)
                        pass

             
                self.state = 767
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,71,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 DateTimePrecisionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_dateTimePrecision

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

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

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




    def dateTimePrecision(self):

        localctx = cqlParser.DateTimePrecisionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_dateTimePrecision)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 768
            _la = self._input.LA(1)
            if not(((((_la - 82)) & ~0x3f) == 0 and ((1 << (_la - 82)) & 255) != 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 DateTimeComponentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def dateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_dateTimeComponent

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

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

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




    def dateTimeComponent(self):

        localctx = cqlParser.DateTimeComponentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_dateTimeComponent)
        try:
            self.state = 775
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [82, 83, 84, 85, 86, 87, 88, 89]:
                self.enterOuterAlt(localctx, 1)
                self.state = 770
                self.dateTimePrecision()
                pass
            elif token in [90]:
                self.enterOuterAlt(localctx, 2)
                self.state = 771
                self.match(cqlParser.T__89)
                pass
            elif token in [91]:
                self.enterOuterAlt(localctx, 3)
                self.state = 772
                self.match(cqlParser.T__90)
                pass
            elif token in [92]:
                self.enterOuterAlt(localctx, 4)
                self.state = 773
                self.match(cqlParser.T__91)
                pass
            elif token in [93]:
                self.enterOuterAlt(localctx, 5)
                self.state = 774
                self.match(cqlParser.T__92)
                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 PluralDateTimePrecisionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_pluralDateTimePrecision

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

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

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




    def pluralDateTimePrecision(self):

        localctx = cqlParser.PluralDateTimePrecisionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_pluralDateTimePrecision)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 777
            _la = self._input.LA(1)
            if not(((((_la - 94)) & ~0x3f) == 0 and ((1 << (_la - 94)) & 255) != 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 ExpressionTermContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_expressionTerm

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


    class AdditionExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.ExpressionTermContext)
            else:
                return self.getTypedRuleContext(cqlParser.ExpressionTermContext,i)


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

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

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


    class IndexedExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)

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


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

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

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


    class WidthExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class SetAggregateExpressionTermContext(ExpressionTermContext):

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

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

        def dateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionContext,0)


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

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

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


    class TimeUnitExpressionTermContext(ExpressionTermContext):

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

        def dateTimeComponent(self):
            return self.getTypedRuleContext(cqlParser.DateTimeComponentContext,0)

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class IfThenElseExpressionTermContext(ExpressionTermContext):

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

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


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

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

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


    class TimeBoundaryExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class ElementExtractorExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class ConversionExpressionTermContext(ExpressionTermContext):

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

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

        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)

        def unit(self):
            return self.getTypedRuleContext(cqlParser.UnitContext,0)


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

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

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


    class TypeExtentExpressionTermContext(ExpressionTermContext):

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

        def namedTypeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.NamedTypeSpecifierContext,0)


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

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

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


    class PredecessorExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class PointExtractorExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class MultiplicationExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.ExpressionTermContext)
            else:
                return self.getTypedRuleContext(cqlParser.ExpressionTermContext,i)


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

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

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


    class AggregateExpressionTermContext(ExpressionTermContext):

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

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


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

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

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


    class DurationExpressionTermContext(ExpressionTermContext):

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

        def pluralDateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.PluralDateTimePrecisionContext,0)

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class DifferenceExpressionTermContext(ExpressionTermContext):

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

        def pluralDateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.PluralDateTimePrecisionContext,0)

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class CaseExpressionTermContext(ExpressionTermContext):

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

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

        def caseExpressionItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.CaseExpressionItemContext)
            else:
                return self.getTypedRuleContext(cqlParser.CaseExpressionItemContext,i)


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

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

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


    class PowerExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.ExpressionTermContext)
            else:
                return self.getTypedRuleContext(cqlParser.ExpressionTermContext,i)


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

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

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


    class SuccessorExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class PolarityExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)


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

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

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


    class TermExpressionTermContext(ExpressionTermContext):

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

        def term(self):
            return self.getTypedRuleContext(cqlParser.TermContext,0)


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

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

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


    class InvocationExpressionTermContext(ExpressionTermContext):

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

        def expressionTerm(self):
            return self.getTypedRuleContext(cqlParser.ExpressionTermContext,0)

        def qualifiedInvocation(self):
            return self.getTypedRuleContext(cqlParser.QualifiedInvocationContext,0)


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

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

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



    def expressionTerm(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = cqlParser.ExpressionTermContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 134
        self.enterRecursionRule(localctx, 134, self.RULE_expressionTerm, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 857
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,78,self._ctx)
            if la_ == 1:
                localctx = cqlParser.TermExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 780
                self.term()
                pass

            elif la_ == 2:
                localctx = cqlParser.ConversionExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 781
                self.match(cqlParser.T__101)
                self.state = 782
                self.expression(0)
                self.state = 783
                self.match(cqlParser.T__102)
                self.state = 786
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 20, 21, 24, 25, 26, 27, 28, 29, 30, 45, 50, 52, 53, 54, 55, 56, 71, 72, 73, 78, 80, 81, 90, 91, 92, 93, 106, 107, 109, 110, 111, 119, 120, 131, 132, 133, 134, 141, 142, 145, 149, 150, 154, 155, 156, 158, 163, 164]:
                    self.state = 784
                    self.typeSpecifier()
                    pass
                elif token in [82, 83, 84, 85, 86, 87, 88, 89, 94, 95, 96, 97, 98, 99, 100, 101, 165]:
                    self.state = 785
                    self.unit()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 3:
                localctx = cqlParser.PolarityExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 788
                _la = self._input.LA(1)
                if not(_la==104 or _la==105):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 789
                self.expressionTerm(18)
                pass

            elif la_ == 4:
                localctx = cqlParser.TimeBoundaryExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 790
                _la = self._input.LA(1)
                if not(_la==106 or _la==107):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 791
                self.match(cqlParser.T__107)
                self.state = 792
                self.expressionTerm(17)
                pass

            elif la_ == 5:
                localctx = cqlParser.TimeUnitExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 793
                self.dateTimeComponent()
                self.state = 794
                self.match(cqlParser.T__18)
                self.state = 795
                self.expressionTerm(16)
                pass

            elif la_ == 6:
                localctx = cqlParser.DurationExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 797
                self.match(cqlParser.T__67)
                self.state = 798
                self.match(cqlParser.T__40)
                self.state = 799
                self.pluralDateTimePrecision()
                self.state = 800
                self.match(cqlParser.T__107)
                self.state = 801
                self.expressionTerm(15)
                pass

            elif la_ == 7:
                localctx = cqlParser.DifferenceExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 803
                self.match(cqlParser.T__68)
                self.state = 804
                self.match(cqlParser.T__40)
                self.state = 805
                self.pluralDateTimePrecision()
                self.state = 806
                self.match(cqlParser.T__107)
                self.state = 807
                self.expressionTerm(14)
                pass

            elif la_ == 8:
                localctx = cqlParser.WidthExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 809
                self.match(cqlParser.T__108)
                self.state = 810
                self.match(cqlParser.T__107)
                self.state = 811
                self.expressionTerm(13)
                pass

            elif la_ == 9:
                localctx = cqlParser.SuccessorExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 812
                self.match(cqlParser.T__109)
                self.state = 813
                self.match(cqlParser.T__107)
                self.state = 814
                self.expressionTerm(12)
                pass

            elif la_ == 10:
                localctx = cqlParser.PredecessorExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 815
                self.match(cqlParser.T__110)
                self.state = 816
                self.match(cqlParser.T__107)
                self.state = 817
                self.expressionTerm(11)
                pass

            elif la_ == 11:
                localctx = cqlParser.ElementExtractorExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 818
                self.match(cqlParser.T__111)
                self.state = 819
                self.match(cqlParser.T__18)
                self.state = 820
                self.expressionTerm(10)
                pass

            elif la_ == 12:
                localctx = cqlParser.PointExtractorExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 821
                self.match(cqlParser.T__112)
                self.state = 822
                self.match(cqlParser.T__18)
                self.state = 823
                self.expressionTerm(9)
                pass

            elif la_ == 13:
                localctx = cqlParser.TypeExtentExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 824
                _la = self._input.LA(1)
                if not(_la==114 or _la==115):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 825
                self.namedTypeSpecifier()
                pass

            elif la_ == 14:
                localctx = cqlParser.IfThenElseExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 826
                self.match(cqlParser.T__121)
                self.state = 827
                self.expression(0)
                self.state = 828
                self.match(cqlParser.T__122)
                self.state = 829
                self.expression(0)
                self.state = 830
                self.match(cqlParser.T__123)
                self.state = 831
                self.expression(0)
                pass

            elif la_ == 15:
                localctx = cqlParser.CaseExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 833
                self.match(cqlParser.T__124)
                self.state = 835
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & -4758861967782021122) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -1905040784319626319) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 549753872505) != 0):
                    self.state = 834
                    self.expression(0)


                self.state = 838 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 837
                    self.caseExpressionItem()
                    self.state = 840 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==130):
                        break

                self.state = 842
                self.match(cqlParser.T__123)
                self.state = 843
                self.expression(0)
                self.state = 844
                self.match(cqlParser.T__106)
                pass

            elif la_ == 16:
                localctx = cqlParser.AggregateExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 846
                _la = self._input.LA(1)
                if not(_la==48 or _la==126):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 847
                self.expression(0)
                pass

            elif la_ == 17:
                localctx = cqlParser.SetAggregateExpressionTermContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 848
                _la = self._input.LA(1)
                if not(_la==127 or _la==128):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 849
                self.expression(0)
                self.state = 855
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,77,self._ctx)
                if la_ == 1:
                    self.state = 850
                    self.match(cqlParser.T__128)
                    self.state = 853
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,76,self._ctx)
                    if la_ == 1:
                        self.state = 851
                        self.dateTimePrecision()
                        pass

                    elif la_ == 2:
                        self.state = 852
                        self.expression(0)
                        pass




                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 878
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,80,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 = 876
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,79,self._ctx)
                    if la_ == 1:
                        localctx = cqlParser.PowerExpressionTermContext(self, cqlParser.ExpressionTermContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expressionTerm)
                        self.state = 859
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 860
                        self.match(cqlParser.T__115)
                        self.state = 861
                        self.expressionTerm(8)
                        pass

                    elif la_ == 2:
                        localctx = cqlParser.MultiplicationExpressionTermContext(self, cqlParser.ExpressionTermContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expressionTerm)
                        self.state = 862
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 863
                        _la = self._input.LA(1)
                        if not(((((_la - 117)) & ~0x3f) == 0 and ((1 << (_la - 117)) & 15) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 864
                        self.expressionTerm(7)
                        pass

                    elif la_ == 3:
                        localctx = cqlParser.AdditionExpressionTermContext(self, cqlParser.ExpressionTermContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expressionTerm)
                        self.state = 865
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 866
                        _la = self._input.LA(1)
                        if not(((((_la - 104)) & ~0x3f) == 0 and ((1 << (_la - 104)) & 131075) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 867
                        self.expressionTerm(6)
                        pass

                    elif la_ == 4:
                        localctx = cqlParser.InvocationExpressionTermContext(self, cqlParser.ExpressionTermContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expressionTerm)
                        self.state = 868
                        if not self.precpred(self._ctx, 21):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 21)")
                        self.state = 869
                        self.match(cqlParser.T__16)
                        self.state = 870
                        self.qualifiedInvocation()
                        pass

                    elif la_ == 5:
                        localctx = cqlParser.IndexedExpressionTermContext(self, cqlParser.ExpressionTermContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expressionTerm)
                        self.state = 871
                        if not self.precpred(self._ctx, 20):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 20)")
                        self.state = 872
                        self.match(cqlParser.T__37)
                        self.state = 873
                        self.expression(0)
                        self.state = 874
                        self.match(cqlParser.T__39)
                        pass

             
                self.state = 880
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,80,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 CaseExpressionItemContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return cqlParser.RULE_caseExpressionItem

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

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

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




    def caseExpressionItem(self):

        localctx = cqlParser.CaseExpressionItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_caseExpressionItem)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 881
            self.match(cqlParser.T__129)
            self.state = 882
            self.expression(0)
            self.state = 883
            self.match(cqlParser.T__122)
            self.state = 884
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DateTimePrecisionSpecifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def dateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_dateTimePrecisionSpecifier

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

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

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




    def dateTimePrecisionSpecifier(self):

        localctx = cqlParser.DateTimePrecisionSpecifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_dateTimePrecisionSpecifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 886
            self.dateTimePrecision()
            self.state = 887
            self.match(cqlParser.T__107)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RelativeQualifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_relativeQualifier

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

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

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




    def relativeQualifier(self):

        localctx = cqlParser.RelativeQualifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_relativeQualifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 889
            _la = self._input.LA(1)
            if not(_la==131 or _la==132):
                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 OffsetRelativeQualifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_offsetRelativeQualifier

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

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

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




    def offsetRelativeQualifier(self):

        localctx = cqlParser.OffsetRelativeQualifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 142, self.RULE_offsetRelativeQualifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 891
            _la = self._input.LA(1)
            if not(_la==133 or _la==134):
                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 ExclusiveRelativeQualifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_exclusiveRelativeQualifier

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

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

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




    def exclusiveRelativeQualifier(self):

        localctx = cqlParser.ExclusiveRelativeQualifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 144, self.RULE_exclusiveRelativeQualifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 893
            _la = self._input.LA(1)
            if not(_la==135 or _la==136):
                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 QuantityOffsetContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def quantity(self):
            return self.getTypedRuleContext(cqlParser.QuantityContext,0)


        def offsetRelativeQualifier(self):
            return self.getTypedRuleContext(cqlParser.OffsetRelativeQualifierContext,0)


        def exclusiveRelativeQualifier(self):
            return self.getTypedRuleContext(cqlParser.ExclusiveRelativeQualifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_quantityOffset

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

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

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




    def quantityOffset(self):

        localctx = cqlParser.QuantityOffsetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 146, self.RULE_quantityOffset)
        self._la = 0 # Token type
        try:
            self.state = 902
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [166]:
                self.enterOuterAlt(localctx, 1)
                self.state = 895
                self.quantity()
                self.state = 897
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==133 or _la==134:
                    self.state = 896
                    self.offsetRelativeQualifier()


                pass
            elif token in [135, 136]:
                self.enterOuterAlt(localctx, 2)
                self.state = 899
                self.exclusiveRelativeQualifier()
                self.state = 900
                self.quantity()
                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 TemporalRelationshipContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_temporalRelationship

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

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

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




    def temporalRelationship(self):

        localctx = cqlParser.TemporalRelationshipContext(self, self._ctx, self.state)
        self.enterRule(localctx, 148, self.RULE_temporalRelationship)
        self._la = 0 # Token type
        try:
            self.state = 912
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,85,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 905
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==137:
                    self.state = 904
                    self.match(cqlParser.T__136)


                self.state = 907
                _la = self._input.LA(1)
                if not(_la==138 or _la==139):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 908
                _la = self._input.LA(1)
                if not(_la==138 or _la==139):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 910
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==140:
                    self.state = 909
                    self.match(cqlParser.T__139)


                pass


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


    class IntervalOperatorPhraseContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_intervalOperatorPhrase

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



    class WithinIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def quantity(self):
            return self.getTypedRuleContext(cqlParser.QuantityContext,0)


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

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

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


    class IncludedInIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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


    class EndsIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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


    class ConcurrentWithIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def relativeQualifier(self):
            return self.getTypedRuleContext(cqlParser.RelativeQualifierContext,0)

        def dateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionContext,0)


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

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

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


    class OverlapsIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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


    class IncludesIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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


    class BeforeOrAfterIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def temporalRelationship(self):
            return self.getTypedRuleContext(cqlParser.TemporalRelationshipContext,0)

        def quantityOffset(self):
            return self.getTypedRuleContext(cqlParser.QuantityOffsetContext,0)

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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


    class MeetsIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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


    class StartsIntervalOperatorPhraseContext(IntervalOperatorPhraseContext):

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

        def dateTimePrecisionSpecifier(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionSpecifierContext,0)


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

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

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



    def intervalOperatorPhrase(self):

        localctx = cqlParser.IntervalOperatorPhraseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 150, self.RULE_intervalOperatorPhrase)
        self._la = 0 # Token type
        try:
            self.state = 995
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,109,self._ctx)
            if la_ == 1:
                localctx = cqlParser.ConcurrentWithIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 915
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 7) != 0):
                    self.state = 914
                    _la = self._input.LA(1)
                    if not(((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 7) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 917
                self.match(cqlParser.T__143)
                self.state = 919
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 82)) & ~0x3f) == 0 and ((1 << (_la - 82)) & 255) != 0):
                    self.state = 918
                    self.dateTimePrecision()


                self.state = 923
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [131, 132]:
                    self.state = 921
                    self.relativeQualifier()
                    pass
                elif token in [62]:
                    self.state = 922
                    self.match(cqlParser.T__61)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 926
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,89,self._ctx)
                if la_ == 1:
                    self.state = 925
                    _la = self._input.LA(1)
                    if not(_la==106 or _la==107):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                pass

            elif la_ == 2:
                localctx = cqlParser.IncludesIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 929
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==65:
                    self.state = 928
                    self.match(cqlParser.T__64)


                self.state = 931
                self.match(cqlParser.T__144)
                self.state = 933
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,91,self._ctx)
                if la_ == 1:
                    self.state = 932
                    self.dateTimePrecisionSpecifier()


                self.state = 936
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,92,self._ctx)
                if la_ == 1:
                    self.state = 935
                    _la = self._input.LA(1)
                    if not(_la==106 or _la==107):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                pass

            elif la_ == 3:
                localctx = cqlParser.IncludedInIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 939
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 7) != 0):
                    self.state = 938
                    _la = self._input.LA(1)
                    if not(((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 7) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 942
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==65:
                    self.state = 941
                    self.match(cqlParser.T__64)


                self.state = 944
                _la = self._input.LA(1)
                if not(_la==146 or _la==147):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 946
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,95,self._ctx)
                if la_ == 1:
                    self.state = 945
                    self.dateTimePrecisionSpecifier()


                pass

            elif la_ == 4:
                localctx = cqlParser.BeforeOrAfterIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 949
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 7) != 0):
                    self.state = 948
                    _la = self._input.LA(1)
                    if not(((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 7) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 952
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 135)) & ~0x3f) == 0 and ((1 << (_la - 135)) & 2147483651) != 0):
                    self.state = 951
                    self.quantityOffset()


                self.state = 954
                self.temporalRelationship()
                self.state = 956
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,98,self._ctx)
                if la_ == 1:
                    self.state = 955
                    self.dateTimePrecisionSpecifier()


                self.state = 959
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,99,self._ctx)
                if la_ == 1:
                    self.state = 958
                    _la = self._input.LA(1)
                    if not(_la==106 or _la==107):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                pass

            elif la_ == 5:
                localctx = cqlParser.WithinIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 962
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 7) != 0):
                    self.state = 961
                    _la = self._input.LA(1)
                    if not(((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 7) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 965
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==65:
                    self.state = 964
                    self.match(cqlParser.T__64)


                self.state = 967
                self.match(cqlParser.T__147)
                self.state = 968
                self.quantity()
                self.state = 969
                self.match(cqlParser.T__107)
                self.state = 971
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,102,self._ctx)
                if la_ == 1:
                    self.state = 970
                    _la = self._input.LA(1)
                    if not(_la==106 or _la==107):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                pass

            elif la_ == 6:
                localctx = cqlParser.MeetsIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 973
                self.match(cqlParser.T__148)
                self.state = 975
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==138 or _la==139:
                    self.state = 974
                    _la = self._input.LA(1)
                    if not(_la==138 or _la==139):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 978
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,104,self._ctx)
                if la_ == 1:
                    self.state = 977
                    self.dateTimePrecisionSpecifier()


                pass

            elif la_ == 7:
                localctx = cqlParser.OverlapsIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 980
                self.match(cqlParser.T__149)
                self.state = 982
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==138 or _la==139:
                    self.state = 981
                    _la = self._input.LA(1)
                    if not(_la==138 or _la==139):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 985
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,106,self._ctx)
                if la_ == 1:
                    self.state = 984
                    self.dateTimePrecisionSpecifier()


                pass

            elif la_ == 8:
                localctx = cqlParser.StartsIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 987
                self.match(cqlParser.T__140)
                self.state = 989
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,107,self._ctx)
                if la_ == 1:
                    self.state = 988
                    self.dateTimePrecisionSpecifier()


                pass

            elif la_ == 9:
                localctx = cqlParser.EndsIntervalOperatorPhraseContext(self, localctx)
                self.enterOuterAlt(localctx, 9)
                self.state = 991
                self.match(cqlParser.T__141)
                self.state = 993
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,108,self._ctx)
                if la_ == 1:
                    self.state = 992
                    self.dateTimePrecisionSpecifier()


                pass


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


    class TermContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_term

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



    class ExternalConstantTermContext(TermContext):

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

        def externalConstant(self):
            return self.getTypedRuleContext(cqlParser.ExternalConstantContext,0)


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

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

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


    class TupleSelectorTermContext(TermContext):

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

        def tupleSelector(self):
            return self.getTypedRuleContext(cqlParser.TupleSelectorContext,0)


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

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

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


    class LiteralTermContext(TermContext):

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

        def literal(self):
            return self.getTypedRuleContext(cqlParser.LiteralContext,0)


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

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

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


    class ConceptSelectorTermContext(TermContext):

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

        def conceptSelector(self):
            return self.getTypedRuleContext(cqlParser.ConceptSelectorContext,0)


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

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

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


    class ParenthesizedTermContext(TermContext):

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

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


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

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

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


    class CodeSelectorTermContext(TermContext):

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

        def codeSelector(self):
            return self.getTypedRuleContext(cqlParser.CodeSelectorContext,0)


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

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

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


    class InvocationTermContext(TermContext):

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

        def invocation(self):
            return self.getTypedRuleContext(cqlParser.InvocationContext,0)


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

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

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


    class InstanceSelectorTermContext(TermContext):

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

        def instanceSelector(self):
            return self.getTypedRuleContext(cqlParser.InstanceSelectorContext,0)


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

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

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


    class IntervalSelectorTermContext(TermContext):

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

        def intervalSelector(self):
            return self.getTypedRuleContext(cqlParser.IntervalSelectorContext,0)


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

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

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


    class ListSelectorTermContext(TermContext):

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

        def listSelector(self):
            return self.getTypedRuleContext(cqlParser.ListSelectorContext,0)


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

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

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



    def term(self):

        localctx = cqlParser.TermContext(self, self._ctx, self.state)
        self.enterRule(localctx, 152, self.RULE_term)
        try:
            self.state = 1010
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,110,self._ctx)
            if la_ == 1:
                localctx = cqlParser.InvocationTermContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 997
                self.invocation()
                pass

            elif la_ == 2:
                localctx = cqlParser.LiteralTermContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 998
                self.literal()
                pass

            elif la_ == 3:
                localctx = cqlParser.ExternalConstantTermContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 999
                self.externalConstant()
                pass

            elif la_ == 4:
                localctx = cqlParser.IntervalSelectorTermContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 1000
                self.intervalSelector()
                pass

            elif la_ == 5:
                localctx = cqlParser.TupleSelectorTermContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 1001
                self.tupleSelector()
                pass

            elif la_ == 6:
                localctx = cqlParser.InstanceSelectorTermContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 1002
                self.instanceSelector()
                pass

            elif la_ == 7:
                localctx = cqlParser.ListSelectorTermContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 1003
                self.listSelector()
                pass

            elif la_ == 8:
                localctx = cqlParser.CodeSelectorTermContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 1004
                self.codeSelector()
                pass

            elif la_ == 9:
                localctx = cqlParser.ConceptSelectorTermContext(self, localctx)
                self.enterOuterAlt(localctx, 9)
                self.state = 1005
                self.conceptSelector()
                pass

            elif la_ == 10:
                localctx = cqlParser.ParenthesizedTermContext(self, localctx)
                self.enterOuterAlt(localctx, 10)
                self.state = 1006
                self.match(cqlParser.T__30)
                self.state = 1007
                self.expression(0)
                self.state = 1008
                self.match(cqlParser.T__31)
                pass


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


    class QualifiedInvocationContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_qualifiedInvocation

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



    class QualifiedFunctionInvocationContext(QualifiedInvocationContext):

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

        def qualifiedFunction(self):
            return self.getTypedRuleContext(cqlParser.QualifiedFunctionContext,0)


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

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

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


    class QualifiedMemberInvocationContext(QualifiedInvocationContext):

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


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

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

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



    def qualifiedInvocation(self):

        localctx = cqlParser.QualifiedInvocationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 154, self.RULE_qualifiedInvocation)
        try:
            self.state = 1014
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,111,self._ctx)
            if la_ == 1:
                localctx = cqlParser.QualifiedMemberInvocationContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 1012
                self.referentialIdentifier()
                pass

            elif la_ == 2:
                localctx = cqlParser.QualifiedFunctionInvocationContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 1013
                self.qualifiedFunction()
                pass


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


    class QualifiedFunctionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def identifierOrFunctionIdentifier(self):
            return self.getTypedRuleContext(cqlParser.IdentifierOrFunctionIdentifierContext,0)


        def paramList(self):
            return self.getTypedRuleContext(cqlParser.ParamListContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_qualifiedFunction

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

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

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




    def qualifiedFunction(self):

        localctx = cqlParser.QualifiedFunctionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 156, self.RULE_qualifiedFunction)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1016
            self.identifierOrFunctionIdentifier()
            self.state = 1017
            self.match(cqlParser.T__30)
            self.state = 1019
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & -4758861967782021122) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -1905040784319626319) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 549753872505) != 0):
                self.state = 1018
                self.paramList()


            self.state = 1021
            self.match(cqlParser.T__31)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InvocationContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_invocation

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



    class TotalInvocationContext(InvocationContext):

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


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

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

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


    class ThisInvocationContext(InvocationContext):

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


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

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

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


    class IndexInvocationContext(InvocationContext):

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


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

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

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


    class FunctionInvocationContext(InvocationContext):

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

        def function(self):
            return self.getTypedRuleContext(cqlParser.FunctionContext,0)


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

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

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


    class MemberInvocationContext(InvocationContext):

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


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

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

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



    def invocation(self):

        localctx = cqlParser.InvocationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 158, self.RULE_invocation)
        try:
            self.state = 1028
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,113,self._ctx)
            if la_ == 1:
                localctx = cqlParser.MemberInvocationContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 1023
                self.referentialIdentifier()
                pass

            elif la_ == 2:
                localctx = cqlParser.FunctionInvocationContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 1024
                self.function()
                pass

            elif la_ == 3:
                localctx = cqlParser.ThisInvocationContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 1025
                self.match(cqlParser.T__150)
                pass

            elif la_ == 4:
                localctx = cqlParser.IndexInvocationContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 1026
                self.match(cqlParser.T__151)
                pass

            elif la_ == 5:
                localctx = cqlParser.TotalInvocationContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 1027
                self.match(cqlParser.T__152)
                pass


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


    class FunctionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


        def paramList(self):
            return self.getTypedRuleContext(cqlParser.ParamListContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_function

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

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

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




    def function(self):

        localctx = cqlParser.FunctionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 160, self.RULE_function)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1030
            self.referentialIdentifier()
            self.state = 1031
            self.match(cqlParser.T__30)
            self.state = 1033
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & -4758861967782021122) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -1905040784319626319) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 549753872505) != 0):
                self.state = 1032
                self.paramList()


            self.state = 1035
            self.match(cqlParser.T__31)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RatioContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def quantity(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.QuantityContext)
            else:
                return self.getTypedRuleContext(cqlParser.QuantityContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_ratio

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

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

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




    def ratio(self):

        localctx = cqlParser.RatioContext(self, self._ctx, self.state)
        self.enterRule(localctx, 162, self.RULE_ratio)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1037
            self.quantity()
            self.state = 1038
            self.match(cqlParser.T__10)
            self.state = 1039
            self.quantity()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LiteralContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_literal

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



    class TimeLiteralContext(LiteralContext):

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

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

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

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

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


    class NullLiteralContext(LiteralContext):

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


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

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

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


    class RatioLiteralContext(LiteralContext):

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

        def ratio(self):
            return self.getTypedRuleContext(cqlParser.RatioContext,0)


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

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

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


    class DateTimeLiteralContext(LiteralContext):

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

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

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

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

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


    class StringLiteralContext(LiteralContext):

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

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

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

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

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


    class DateLiteralContext(LiteralContext):

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

        def DATE(self):
            return self.getToken(cqlParser.DATE, 0)

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

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

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


    class BooleanLiteralContext(LiteralContext):

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


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

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

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


    class NumberLiteralContext(LiteralContext):

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

        def NUMBER(self):
            return self.getToken(cqlParser.NUMBER, 0)

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

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

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


    class LongNumberLiteralContext(LiteralContext):

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

        def LONGNUMBER(self):
            return self.getToken(cqlParser.LONGNUMBER, 0)

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

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

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


    class QuantityLiteralContext(LiteralContext):

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

        def quantity(self):
            return self.getTypedRuleContext(cqlParser.QuantityContext,0)


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

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

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



    def literal(self):

        localctx = cqlParser.LiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 164, self.RULE_literal)
        self._la = 0 # Token type
        try:
            self.state = 1051
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,115,self._ctx)
            if la_ == 1:
                localctx = cqlParser.BooleanLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 1041
                _la = self._input.LA(1)
                if not(_la==60 or _la==61):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass

            elif la_ == 2:
                localctx = cqlParser.NullLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 1042
                self.match(cqlParser.T__58)
                pass

            elif la_ == 3:
                localctx = cqlParser.StringLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 1043
                self.match(cqlParser.STRING)
                pass

            elif la_ == 4:
                localctx = cqlParser.NumberLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 1044
                self.match(cqlParser.NUMBER)
                pass

            elif la_ == 5:
                localctx = cqlParser.LongNumberLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 1045
                self.match(cqlParser.LONGNUMBER)
                pass

            elif la_ == 6:
                localctx = cqlParser.DateTimeLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 1046
                self.match(cqlParser.DATETIME)
                pass

            elif la_ == 7:
                localctx = cqlParser.DateLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 1047
                self.match(cqlParser.DATE)
                pass

            elif la_ == 8:
                localctx = cqlParser.TimeLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 1048
                self.match(cqlParser.TIME)
                pass

            elif la_ == 9:
                localctx = cqlParser.QuantityLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 9)
                self.state = 1049
                self.quantity()
                pass

            elif la_ == 10:
                localctx = cqlParser.RatioLiteralContext(self, localctx)
                self.enterOuterAlt(localctx, 10)
                self.state = 1050
                self.ratio()
                pass


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


    class IntervalSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return cqlParser.RULE_intervalSelector

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

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

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




    def intervalSelector(self):

        localctx = cqlParser.IntervalSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 166, self.RULE_intervalSelector)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1053
            self.match(cqlParser.T__23)
            self.state = 1054
            _la = self._input.LA(1)
            if not(_la==31 or _la==38):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 1055
            self.expression(0)
            self.state = 1056
            self.match(cqlParser.T__14)
            self.state = 1057
            self.expression(0)
            self.state = 1058
            _la = self._input.LA(1)
            if not(_la==32 or _la==40):
                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 TupleSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def tupleElementSelector(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.TupleElementSelectorContext)
            else:
                return self.getTypedRuleContext(cqlParser.TupleElementSelectorContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_tupleSelector

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

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

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




    def tupleSelector(self):

        localctx = cqlParser.TupleSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 168, self.RULE_tupleSelector)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1061
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==25:
                self.state = 1060
                self.match(cqlParser.T__24)


            self.state = 1063
            self.match(cqlParser.T__13)
            self.state = 1073
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [11]:
                self.state = 1064
                self.match(cqlParser.T__10)
                pass
            elif token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 20, 27, 28, 29, 30, 45, 50, 52, 53, 54, 55, 56, 71, 72, 73, 78, 80, 81, 90, 91, 92, 93, 106, 107, 109, 110, 111, 119, 120, 131, 132, 133, 134, 141, 142, 145, 149, 150, 154, 158, 163, 164]:
                self.state = 1065
                self.tupleElementSelector()
                self.state = 1070
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 1066
                    self.match(cqlParser.T__14)
                    self.state = 1067
                    self.tupleElementSelector()
                    self.state = 1072
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            else:
                raise NoViableAltException(self)

            self.state = 1075
            self.match(cqlParser.T__15)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TupleElementSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_tupleElementSelector

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

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

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




    def tupleElementSelector(self):

        localctx = cqlParser.TupleElementSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 170, self.RULE_tupleElementSelector)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1077
            self.referentialIdentifier()
            self.state = 1078
            self.match(cqlParser.T__10)
            self.state = 1079
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InstanceSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def namedTypeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.NamedTypeSpecifierContext,0)


        def instanceElementSelector(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.InstanceElementSelectorContext)
            else:
                return self.getTypedRuleContext(cqlParser.InstanceElementSelectorContext,i)


        def getRuleIndex(self):
            return cqlParser.RULE_instanceSelector

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

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

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




    def instanceSelector(self):

        localctx = cqlParser.InstanceSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 172, self.RULE_instanceSelector)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1081
            self.namedTypeSpecifier()
            self.state = 1082
            self.match(cqlParser.T__13)
            self.state = 1092
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [11]:
                self.state = 1083
                self.match(cqlParser.T__10)
                pass
            elif token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 20, 27, 28, 29, 30, 45, 50, 52, 53, 54, 55, 56, 71, 72, 73, 78, 80, 81, 90, 91, 92, 93, 106, 107, 109, 110, 111, 119, 120, 131, 132, 133, 134, 141, 142, 145, 149, 150, 154, 158, 163, 164]:
                self.state = 1084
                self.instanceElementSelector()
                self.state = 1089
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 1085
                    self.match(cqlParser.T__14)
                    self.state = 1086
                    self.instanceElementSelector()
                    self.state = 1091
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            else:
                raise NoViableAltException(self)

            self.state = 1094
            self.match(cqlParser.T__15)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InstanceElementSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


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


        def getRuleIndex(self):
            return cqlParser.RULE_instanceElementSelector

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

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

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




    def instanceElementSelector(self):

        localctx = cqlParser.InstanceElementSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 174, self.RULE_instanceElementSelector)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1096
            self.referentialIdentifier()
            self.state = 1097
            self.match(cqlParser.T__10)
            self.state = 1098
            self.expression(0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ListSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def typeSpecifier(self):
            return self.getTypedRuleContext(cqlParser.TypeSpecifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_listSelector

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

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

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




    def listSelector(self):

        localctx = cqlParser.ListSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 176, self.RULE_listSelector)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1107
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==21:
                self.state = 1100
                self.match(cqlParser.T__20)
                self.state = 1105
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==22:
                    self.state = 1101
                    self.match(cqlParser.T__21)
                    self.state = 1102
                    self.typeSpecifier()
                    self.state = 1103
                    self.match(cqlParser.T__22)




            self.state = 1109
            self.match(cqlParser.T__13)
            self.state = 1118
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & -4758861967782021122) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -1905040784319626319) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 549753872505) != 0):
                self.state = 1110
                self.expression(0)
                self.state = 1115
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 1111
                    self.match(cqlParser.T__14)
                    self.state = 1112
                    self.expression(0)
                    self.state = 1117
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 1120
            self.match(cqlParser.T__15)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DisplayClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return cqlParser.RULE_displayClause

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

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

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




    def displayClause(self):

        localctx = cqlParser.DisplayClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 178, self.RULE_displayClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1122
            self.match(cqlParser.T__153)
            self.state = 1123
            self.match(cqlParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CodeSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def codesystemIdentifier(self):
            return self.getTypedRuleContext(cqlParser.CodesystemIdentifierContext,0)


        def displayClause(self):
            return self.getTypedRuleContext(cqlParser.DisplayClauseContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_codeSelector

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

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

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




    def codeSelector(self):

        localctx = cqlParser.CodeSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 180, self.RULE_codeSelector)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1125
            self.match(cqlParser.T__154)
            self.state = 1126
            self.match(cqlParser.STRING)
            self.state = 1127
            self.match(cqlParser.T__18)
            self.state = 1128
            self.codesystemIdentifier()
            self.state = 1130
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,125,self._ctx)
            if la_ == 1:
                self.state = 1129
                self.displayClause()


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


    class ConceptSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def codeSelector(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(cqlParser.CodeSelectorContext)
            else:
                return self.getTypedRuleContext(cqlParser.CodeSelectorContext,i)


        def displayClause(self):
            return self.getTypedRuleContext(cqlParser.DisplayClauseContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_conceptSelector

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

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

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




    def conceptSelector(self):

        localctx = cqlParser.ConceptSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 182, self.RULE_conceptSelector)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1132
            self.match(cqlParser.T__155)
            self.state = 1133
            self.match(cqlParser.T__13)
            self.state = 1134
            self.codeSelector()
            self.state = 1139
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==15:
                self.state = 1135
                self.match(cqlParser.T__14)
                self.state = 1136
                self.codeSelector()
                self.state = 1141
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 1142
            self.match(cqlParser.T__15)
            self.state = 1144
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,127,self._ctx)
            if la_ == 1:
                self.state = 1143
                self.displayClause()


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


    class KeywordContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_keyword

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

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

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




    def keyword(self):

        localctx = cqlParser.KeywordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 184, self.RULE_keyword)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1146
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & -15150577076226) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -175643684002348097) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 478150271) != 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 ReservedWordContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_reservedWord

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

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

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




    def reservedWord(self):

        localctx = cqlParser.ReservedWordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 186, self.RULE_reservedWord)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1148
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & -140787825319084032) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -283989560810241985) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 404594183) != 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 KeywordIdentifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_keywordIdentifier

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

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

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




    def keywordIdentifier(self):

        localctx = cqlParser.KeywordIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 188, self.RULE_keywordIdentifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1150
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 140772674742007806) != 0) or ((((_la - 71)) & ~0x3f) == 0 and ((1 << (_la - 71)) & -1152075052444285305) != 0) or ((((_la - 141)) & ~0x3f) == 0 and ((1 << (_la - 141)) & 8979) != 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 ObsoleteIdentifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_obsoleteIdentifier

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

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

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




    def obsoleteIdentifier(self):

        localctx = cqlParser.ObsoleteIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 190, self.RULE_obsoleteIdentifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1152
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 288687772990177284) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & 13195146182657) != 0) or ((((_la - 154)) & ~0x3f) == 0 and ((1 << (_la - 154)) & 7) != 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 FunctionIdentifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_functionIdentifier

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

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

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




    def functionIdentifier(self):

        localctx = cqlParser.FunctionIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 192, self.RULE_functionIdentifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1154
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & -15150577076226) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -175643684002348097) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 478145663) != 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 TypeNameIdentifierContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return cqlParser.RULE_typeNameIdentifier

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

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

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




    def typeNameIdentifier(self):

        localctx = cqlParser.TypeNameIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 194, self.RULE_typeNameIdentifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1156
            _la = self._input.LA(1)
            if not(_la==90 or _la==91 or _la==155 or _la==156):
                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 ReferentialIdentifierContext(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(cqlParser.IdentifierContext,0)


        def keywordIdentifier(self):
            return self.getTypedRuleContext(cqlParser.KeywordIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_referentialIdentifier

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

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

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




    def referentialIdentifier(self):

        localctx = cqlParser.ReferentialIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 196, self.RULE_referentialIdentifier)
        try:
            self.state = 1160
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [158, 163, 164]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1158
                self.identifier()
                pass
            elif token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 20, 27, 28, 29, 30, 45, 50, 52, 53, 54, 55, 56, 71, 72, 73, 78, 80, 81, 90, 91, 92, 93, 106, 107, 109, 110, 111, 119, 120, 131, 132, 133, 134, 141, 142, 145, 149, 150, 154]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1159
                self.keywordIdentifier()
                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 ReferentialOrTypeNameIdentifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def referentialIdentifier(self):
            return self.getTypedRuleContext(cqlParser.ReferentialIdentifierContext,0)


        def typeNameIdentifier(self):
            return self.getTypedRuleContext(cqlParser.TypeNameIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_referentialOrTypeNameIdentifier

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

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

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




    def referentialOrTypeNameIdentifier(self):

        localctx = cqlParser.ReferentialOrTypeNameIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 198, self.RULE_referentialOrTypeNameIdentifier)
        try:
            self.state = 1164
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,129,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 1162
                self.referentialIdentifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 1163
                self.typeNameIdentifier()
                pass


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


    class IdentifierOrFunctionIdentifierContext(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(cqlParser.IdentifierContext,0)


        def functionIdentifier(self):
            return self.getTypedRuleContext(cqlParser.FunctionIdentifierContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_identifierOrFunctionIdentifier

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

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

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




    def identifierOrFunctionIdentifier(self):

        localctx = cqlParser.IdentifierOrFunctionIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 200, self.RULE_identifierOrFunctionIdentifier)
        try:
            self.state = 1168
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [158, 163, 164]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1166
                self.identifier()
                pass
            elif token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 18, 19, 20, 21, 24, 25, 27, 28, 29, 30, 35, 36, 37, 41, 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, 71, 72, 73, 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, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 138, 139, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 154, 155, 156]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1167
                self.functionIdentifier()
                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 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(cqlParser.IDENTIFIER, 0)

        def DELIMITEDIDENTIFIER(self):
            return self.getToken(cqlParser.DELIMITEDIDENTIFIER, 0)

        def QUOTEDIDENTIFIER(self):
            return self.getToken(cqlParser.QUOTEDIDENTIFIER, 0)

        def getRuleIndex(self):
            return cqlParser.RULE_identifier

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

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

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




    def identifier(self):

        localctx = cqlParser.IdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 202, self.RULE_identifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1170
            _la = self._input.LA(1)
            if not(((((_la - 158)) & ~0x3f) == 0 and ((1 << (_la - 158)) & 97) != 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 ExternalConstantContext(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(cqlParser.IdentifierContext,0)


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

        def getRuleIndex(self):
            return cqlParser.RULE_externalConstant

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

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

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




    def externalConstant(self):

        localctx = cqlParser.ExternalConstantContext(self, self._ctx, self.state)
        self.enterRule(localctx, 204, self.RULE_externalConstant)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1172
            self.match(cqlParser.T__156)
            self.state = 1175
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [158, 163, 164]:
                self.state = 1173
                self.identifier()
                pass
            elif token in [165]:
                self.state = 1174
                self.match(cqlParser.STRING)
                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 ParamListContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return cqlParser.RULE_paramList

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

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

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




    def paramList(self):

        localctx = cqlParser.ParamListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 206, self.RULE_paramList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1177
            self.expression(0)
            self.state = 1182
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==15:
                self.state = 1178
                self.match(cqlParser.T__14)
                self.state = 1179
                self.expression(0)
                self.state = 1184
                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 QuantityContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NUMBER(self):
            return self.getToken(cqlParser.NUMBER, 0)

        def unit(self):
            return self.getTypedRuleContext(cqlParser.UnitContext,0)


        def getRuleIndex(self):
            return cqlParser.RULE_quantity

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

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

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




    def quantity(self):

        localctx = cqlParser.QuantityContext(self, self._ctx, self.state)
        self.enterRule(localctx, 208, self.RULE_quantity)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1185
            self.match(cqlParser.NUMBER)
            self.state = 1187
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,133,self._ctx)
            if la_ == 1:
                self.state = 1186
                self.unit()


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


    class UnitContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def dateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.DateTimePrecisionContext,0)


        def pluralDateTimePrecision(self):
            return self.getTypedRuleContext(cqlParser.PluralDateTimePrecisionContext,0)


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

        def getRuleIndex(self):
            return cqlParser.RULE_unit

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterUnit" ):
                listener.enterUnit(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitUnit" ):
                listener.exitUnit(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitUnit" ):
                return visitor.visitUnit(self)
            else:
                return visitor.visitChildren(self)




    def unit(self):

        localctx = cqlParser.UnitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 210, self.RULE_unit)
        try:
            self.state = 1192
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [82, 83, 84, 85, 86, 87, 88, 89]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1189
                self.dateTimePrecision()
                pass
            elif token in [94, 95, 96, 97, 98, 99, 100, 101]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1190
                self.pluralDateTimePrecision()
                pass
            elif token in [165]:
                self.enterOuterAlt(localctx, 3)
                self.state = 1191
                self.match(cqlParser.STRING)
                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[61] = self.simplePath_sempred
        self._predicates[63] = self.expression_sempred
        self._predicates[67] = self.expressionTerm_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 simplePath_sempred(self, localctx:SimplePathContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 2)
         

            if predIndex == 1:
                return self.precpred(self._ctx, 1)
         

    def expression_sempred(self, localctx:ExpressionContext, predIndex:int):
            if predIndex == 2:
                return self.precpred(self._ctx, 9)
         

            if predIndex == 3:
                return self.precpred(self._ctx, 8)
         

            if predIndex == 4:
                return self.precpred(self._ctx, 7)
         

            if predIndex == 5:
                return self.precpred(self._ctx, 6)
         

            if predIndex == 6:
                return self.precpred(self._ctx, 5)
         

            if predIndex == 7:
                return self.precpred(self._ctx, 4)
         

            if predIndex == 8:
                return self.precpred(self._ctx, 3)
         

            if predIndex == 9:
                return self.precpred(self._ctx, 2)
         

            if predIndex == 10:
                return self.precpred(self._ctx, 1)
         

            if predIndex == 11:
                return self.precpred(self._ctx, 17)
         

            if predIndex == 12:
                return self.precpred(self._ctx, 16)
         

            if predIndex == 13:
                return self.precpred(self._ctx, 12)
         

    def expressionTerm_sempred(self, localctx:ExpressionTermContext, predIndex:int):
            if predIndex == 14:
                return self.precpred(self._ctx, 7)
         

            if predIndex == 15:
                return self.precpred(self._ctx, 6)
         

            if predIndex == 16:
                return self.precpred(self._ctx, 5)
         

            if predIndex == 17:
                return self.precpred(self._ctx, 21)
         

            if predIndex == 18:
                return self.precpred(self._ctx, 20)
         




