github.com/rohankumardubey/aresdb@v0.0.2-0.20190517170215-e54e3ca06b9c/query/sql/antlrgen/sqlbase_parser.go (about) 1 // Code generated from query/sql/SqlBase.g4 by ANTLR 4.7.1. DO NOT EDIT. 2 3 package antlrgen // SqlBase 4 import ( 5 "fmt" 6 "reflect" 7 "strconv" 8 9 "github.com/antlr/antlr4/runtime/Go/antlr" 10 ) 11 12 // Suppress unused import errors 13 var _ = fmt.Printf 14 var _ = reflect.Copy 15 var _ = strconv.Itoa 16 17 var parserATN = []uint16{ 18 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 222, 1393, 19 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 20 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 21 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 22 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 23 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 24 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 25 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 26 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 27 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 28 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 29 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 30 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 31 3, 4, 5, 4, 134, 10, 4, 3, 4, 3, 4, 3, 4, 5, 4, 139, 10, 4, 3, 4, 3, 4, 32 3, 4, 3, 4, 5, 4, 145, 10, 4, 3, 4, 3, 4, 5, 4, 149, 10, 4, 3, 4, 3, 4, 33 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 163, 34 10, 4, 3, 4, 3, 4, 5, 4, 167, 10, 4, 3, 4, 3, 4, 5, 4, 171, 10, 4, 3, 4, 35 3, 4, 5, 4, 175, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 183, 36 10, 4, 3, 4, 3, 4, 5, 4, 187, 10, 4, 3, 4, 5, 4, 190, 10, 4, 3, 4, 3, 4, 37 3, 4, 3, 4, 3, 4, 5, 4, 197, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 38 204, 10, 4, 12, 4, 14, 4, 207, 11, 4, 3, 4, 3, 4, 3, 4, 5, 4, 212, 10, 39 4, 3, 4, 3, 4, 5, 4, 216, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 222, 10, 40 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 229, 10, 4, 3, 4, 3, 4, 3, 4, 3, 41 4, 3, 4, 3, 4, 3, 4, 5, 4, 238, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 42 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 43 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 44 4, 3, 4, 3, 4, 3, 4, 5, 4, 273, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 45 4, 3, 4, 3, 4, 3, 4, 5, 4, 284, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 46 4, 3, 4, 7, 4, 293, 10, 4, 12, 4, 14, 4, 296, 11, 4, 5, 4, 298, 10, 4, 47 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 306, 10, 4, 12, 4, 14, 4, 309, 48 11, 4, 3, 4, 3, 4, 5, 4, 313, 10, 4, 3, 4, 3, 4, 5, 4, 317, 10, 4, 3, 4, 49 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 325, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 50 5, 4, 331, 10, 4, 3, 4, 3, 4, 3, 4, 7, 4, 336, 10, 4, 12, 4, 14, 4, 339, 51 11, 4, 3, 4, 3, 4, 5, 4, 343, 10, 4, 3, 4, 3, 4, 5, 4, 347, 10, 4, 3, 4, 52 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 357, 10, 4, 3, 4, 5, 4, 53 360, 10, 4, 3, 4, 3, 4, 5, 4, 364, 10, 4, 3, 4, 5, 4, 367, 10, 4, 3, 4, 54 3, 4, 3, 4, 3, 4, 7, 4, 373, 10, 4, 12, 4, 14, 4, 376, 11, 4, 3, 4, 3, 55 4, 5, 4, 380, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 56 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 395, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 57 4, 401, 10, 4, 5, 4, 403, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 409, 10, 58 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 415, 10, 4, 5, 4, 417, 10, 4, 3, 4, 3, 59 4, 3, 4, 3, 4, 5, 4, 423, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 60 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 61 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 62 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 463, 10, 4, 3, 4, 3, 63 4, 3, 4, 3, 4, 3, 4, 7, 4, 470, 10, 4, 12, 4, 14, 4, 473, 11, 4, 5, 4, 64 475, 10, 4, 3, 4, 3, 4, 5, 4, 479, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 65 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 495, 10, 4, 66 12, 4, 14, 4, 498, 11, 4, 5, 4, 500, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 67 4, 3, 4, 5, 4, 508, 10, 4, 3, 5, 5, 5, 511, 10, 5, 3, 5, 3, 5, 3, 6, 3, 68 6, 5, 6, 517, 10, 6, 3, 6, 3, 6, 3, 6, 7, 6, 522, 10, 6, 12, 6, 14, 6, 69 525, 11, 6, 3, 7, 3, 7, 5, 7, 529, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 70 535, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 541, 10, 9, 3, 10, 3, 10, 3, 71 10, 3, 10, 7, 10, 547, 10, 10, 12, 10, 14, 10, 550, 11, 10, 3, 10, 3, 10, 72 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 73 12, 564, 10, 12, 12, 12, 14, 12, 567, 11, 12, 5, 12, 569, 10, 12, 3, 12, 74 3, 12, 5, 12, 573, 10, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 75 13, 581, 10, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 587, 10, 13, 3, 13, 76 7, 13, 590, 10, 13, 12, 13, 14, 13, 593, 11, 13, 3, 14, 3, 14, 3, 14, 3, 77 14, 3, 14, 3, 14, 3, 14, 7, 14, 602, 10, 14, 12, 14, 14, 14, 605, 11, 14, 78 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 611, 10, 14, 3, 15, 3, 15, 5, 15, 615, 79 10, 15, 3, 15, 3, 15, 5, 15, 619, 10, 15, 3, 16, 3, 16, 5, 16, 623, 10, 80 16, 3, 16, 3, 16, 3, 16, 7, 16, 628, 10, 16, 12, 16, 14, 16, 631, 11, 16, 81 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 637, 10, 16, 12, 16, 14, 16, 640, 11, 82 16, 5, 16, 642, 10, 16, 3, 16, 3, 16, 5, 16, 646, 10, 16, 3, 16, 3, 16, 83 3, 16, 5, 16, 651, 10, 16, 3, 16, 3, 16, 5, 16, 655, 10, 16, 3, 17, 5, 84 17, 658, 10, 17, 3, 17, 3, 17, 3, 17, 7, 17, 663, 10, 17, 12, 17, 14, 17, 85 666, 11, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 7, 18, 674, 10, 86 18, 12, 18, 14, 18, 677, 11, 18, 5, 18, 679, 10, 18, 3, 18, 3, 18, 3, 18, 87 3, 18, 3, 18, 3, 18, 7, 18, 687, 10, 18, 12, 18, 14, 18, 690, 11, 18, 5, 88 18, 692, 10, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 7, 18, 89 701, 10, 18, 12, 18, 14, 18, 704, 11, 18, 3, 18, 3, 18, 5, 18, 708, 10, 90 18, 3, 19, 3, 19, 3, 19, 3, 19, 7, 19, 714, 10, 19, 12, 19, 14, 19, 717, 91 11, 19, 5, 19, 719, 10, 19, 3, 19, 3, 19, 5, 19, 723, 10, 19, 3, 20, 3, 92 20, 3, 20, 3, 20, 7, 20, 729, 10, 20, 12, 20, 14, 20, 732, 11, 20, 5, 20, 93 734, 10, 20, 3, 20, 3, 20, 5, 20, 738, 10, 20, 3, 21, 3, 21, 5, 21, 742, 94 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 95 5, 23, 753, 10, 23, 3, 23, 5, 23, 756, 10, 23, 3, 23, 3, 23, 3, 23, 3, 96 23, 3, 23, 5, 23, 763, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 97 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 98 24, 5, 24, 782, 10, 24, 7, 24, 784, 10, 24, 12, 24, 14, 24, 787, 11, 24, 99 3, 25, 5, 25, 790, 10, 25, 3, 25, 3, 25, 5, 25, 794, 10, 25, 3, 25, 3, 100 25, 5, 25, 798, 10, 25, 3, 25, 3, 25, 5, 25, 802, 10, 25, 5, 25, 804, 10, 101 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 7, 26, 813, 10, 26, 102 12, 26, 14, 26, 816, 11, 26, 3, 26, 3, 26, 5, 26, 820, 10, 26, 3, 27, 3, 103 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 829, 10, 27, 3, 28, 3, 28, 104 3, 29, 3, 29, 5, 29, 835, 10, 29, 3, 29, 3, 29, 5, 29, 839, 10, 29, 5, 105 29, 841, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 7, 30, 847, 10, 30, 12, 30, 106 14, 30, 850, 11, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 107 31, 3, 31, 3, 31, 3, 31, 3, 31, 7, 31, 864, 10, 31, 12, 31, 14, 31, 867, 108 11, 31, 3, 31, 3, 31, 3, 31, 5, 31, 872, 10, 31, 3, 31, 3, 31, 3, 31, 3, 109 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 883, 10, 31, 3, 32, 3, 32, 110 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 891, 10, 33, 3, 33, 3, 33, 3, 33, 3, 111 33, 3, 33, 3, 33, 7, 33, 899, 10, 33, 12, 33, 14, 33, 902, 11, 33, 3, 34, 112 3, 34, 5, 34, 906, 10, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 113 35, 3, 35, 3, 35, 3, 35, 5, 35, 918, 10, 35, 3, 35, 3, 35, 3, 35, 3, 35, 114 3, 35, 3, 35, 5, 35, 926, 10, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 7, 115 35, 933, 10, 35, 12, 35, 14, 35, 936, 11, 35, 3, 35, 3, 35, 3, 35, 5, 35, 116 941, 10, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 949, 10, 117 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 955, 10, 35, 3, 35, 3, 35, 5, 35, 118 959, 10, 35, 3, 35, 3, 35, 3, 35, 5, 35, 964, 10, 35, 3, 35, 3, 35, 3, 119 35, 5, 35, 969, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 975, 10, 36, 120 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 121 36, 3, 36, 7, 36, 989, 10, 36, 12, 36, 14, 36, 992, 11, 36, 3, 37, 3, 37, 122 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 123 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 124 3, 37, 6, 37, 1018, 10, 37, 13, 37, 14, 37, 1019, 3, 37, 3, 37, 3, 37, 125 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 1029, 10, 37, 12, 37, 14, 37, 1032, 126 11, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 1041, 10, 127 37, 3, 37, 3, 37, 3, 37, 5, 37, 1046, 10, 37, 3, 37, 3, 37, 3, 37, 7, 37, 128 1051, 10, 37, 12, 37, 14, 37, 1054, 11, 37, 5, 37, 1056, 10, 37, 3, 37, 129 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 1063, 10, 37, 12, 37, 14, 37, 1066, 130 11, 37, 5, 37, 1068, 10, 37, 3, 37, 3, 37, 5, 37, 1072, 10, 37, 3, 37, 131 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 1082, 10, 37, 12, 132 37, 14, 37, 1085, 11, 37, 5, 37, 1087, 10, 37, 3, 37, 3, 37, 3, 37, 3, 133 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 134 3, 37, 6, 37, 1104, 10, 37, 13, 37, 14, 37, 1105, 3, 37, 3, 37, 5, 37, 135 1110, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 6, 37, 1116, 10, 37, 13, 37, 136 14, 37, 1117, 3, 37, 3, 37, 5, 37, 1122, 10, 37, 3, 37, 3, 37, 3, 37, 3, 137 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 138 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 1145, 10, 37, 12, 139 37, 14, 37, 1148, 11, 37, 5, 37, 1150, 10, 37, 3, 37, 3, 37, 3, 37, 3, 140 37, 3, 37, 3, 37, 3, 37, 5, 37, 1159, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 141 5, 37, 1165, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 1171, 10, 37, 3, 142 37, 3, 37, 3, 37, 3, 37, 5, 37, 1177, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 143 3, 37, 3, 37, 3, 37, 3, 37, 5, 37, 1187, 10, 37, 3, 37, 3, 37, 3, 37, 3, 144 37, 3, 37, 3, 37, 3, 37, 5, 37, 1196, 10, 37, 3, 37, 3, 37, 3, 37, 3, 37, 145 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 146 37, 3, 37, 3, 37, 3, 37, 7, 37, 1216, 10, 37, 12, 37, 14, 37, 1219, 11, 147 37, 5, 37, 1221, 10, 37, 3, 37, 5, 37, 1224, 10, 37, 3, 37, 3, 37, 3, 37, 148 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 7, 37, 1234, 10, 37, 12, 37, 14, 37, 149 1237, 11, 37, 3, 38, 3, 38, 3, 38, 3, 38, 5, 38, 1243, 10, 38, 5, 38, 1245, 150 10, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 5, 39, 1253, 10, 39, 151 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 5, 43, 1263, 10, 152 43, 3, 43, 3, 43, 3, 43, 3, 43, 5, 43, 1269, 10, 43, 3, 44, 3, 44, 3, 45, 153 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 154 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 155 3, 46, 7, 46, 1296, 10, 46, 12, 46, 14, 46, 1299, 11, 46, 3, 46, 3, 46, 156 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 7, 46, 1308, 10, 46, 12, 46, 14, 46, 157 1311, 11, 46, 3, 46, 3, 46, 5, 46, 1315, 10, 46, 3, 46, 3, 46, 3, 46, 3, 158 46, 3, 46, 5, 46, 1322, 10, 46, 3, 46, 3, 46, 7, 46, 1326, 10, 46, 12, 159 46, 14, 46, 1329, 11, 46, 3, 47, 3, 47, 5, 47, 1333, 10, 47, 3, 48, 3, 160 48, 3, 48, 3, 48, 5, 48, 1339, 10, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 161 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 5, 162 51, 1356, 10, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 5, 52, 1363, 10, 52, 163 3, 53, 3, 53, 3, 53, 3, 53, 5, 53, 1369, 10, 53, 3, 54, 3, 54, 3, 54, 7, 164 54, 1374, 10, 54, 12, 54, 14, 54, 1377, 11, 54, 3, 55, 3, 55, 3, 55, 3, 165 55, 3, 55, 5, 55, 1384, 10, 55, 3, 56, 3, 56, 3, 56, 5, 56, 1389, 10, 56, 166 3, 57, 3, 57, 3, 57, 2, 8, 24, 46, 64, 70, 72, 90, 58, 2, 4, 6, 8, 10, 167 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 168 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 169 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 2, 22, 170 4, 2, 26, 26, 138, 138, 4, 2, 69, 69, 80, 80, 4, 2, 67, 67, 114, 114, 4, 171 2, 13, 13, 205, 205, 4, 2, 58, 58, 81, 81, 4, 2, 57, 57, 175, 175, 4, 2, 172 20, 20, 49, 49, 4, 2, 65, 65, 91, 91, 4, 2, 13, 13, 51, 51, 4, 2, 22, 22, 173 159, 159, 3, 2, 196, 197, 3, 2, 198, 200, 3, 2, 190, 195, 5, 2, 13, 13, 174 17, 17, 155, 155, 4, 2, 63, 63, 169, 169, 7, 2, 46, 46, 78, 78, 101, 102, 175 147, 147, 188, 188, 3, 2, 104, 107, 4, 2, 74, 74, 163, 163, 5, 2, 52, 52, 176 99, 99, 179, 179, 45, 2, 12, 13, 15, 15, 17, 18, 20, 22, 25, 26, 29, 34, 177 39, 39, 44, 46, 49, 49, 52, 52, 58, 58, 61, 61, 64, 66, 68, 68, 71, 74, 178 78, 79, 81, 81, 83, 83, 85, 85, 87, 87, 91, 92, 94, 94, 96, 96, 99, 102, 179 104, 108, 112, 113, 115, 116, 119, 119, 121, 126, 128, 132, 134, 139, 141, 180 141, 143, 147, 149, 159, 161, 163, 165, 168, 170, 171, 173, 174, 177, 177, 181 179, 179, 181, 182, 186, 189, 220, 222, 2, 1611, 2, 114, 3, 2, 2, 2, 4, 182 117, 3, 2, 2, 2, 6, 507, 3, 2, 2, 2, 8, 510, 3, 2, 2, 2, 10, 514, 3, 2, 183 2, 2, 12, 528, 3, 2, 2, 2, 14, 530, 3, 2, 2, 2, 16, 536, 3, 2, 2, 2, 18, 184 542, 3, 2, 2, 2, 20, 553, 3, 2, 2, 2, 22, 557, 3, 2, 2, 2, 24, 574, 3, 185 2, 2, 2, 26, 610, 3, 2, 2, 2, 28, 612, 3, 2, 2, 2, 30, 620, 3, 2, 2, 2, 186 32, 657, 3, 2, 2, 2, 34, 707, 3, 2, 2, 2, 36, 722, 3, 2, 2, 2, 38, 737, 187 3, 2, 2, 2, 40, 739, 3, 2, 2, 2, 42, 748, 3, 2, 2, 2, 44, 762, 3, 2, 2, 188 2, 46, 764, 3, 2, 2, 2, 48, 803, 3, 2, 2, 2, 50, 819, 3, 2, 2, 2, 52, 821, 189 3, 2, 2, 2, 54, 830, 3, 2, 2, 2, 56, 832, 3, 2, 2, 2, 58, 842, 3, 2, 2, 190 2, 60, 882, 3, 2, 2, 2, 62, 884, 3, 2, 2, 2, 64, 890, 3, 2, 2, 2, 66, 903, 191 3, 2, 2, 2, 68, 968, 3, 2, 2, 2, 70, 974, 3, 2, 2, 2, 72, 1223, 3, 2, 2, 192 2, 74, 1244, 3, 2, 2, 2, 76, 1252, 3, 2, 2, 2, 78, 1254, 3, 2, 2, 2, 80, 193 1256, 3, 2, 2, 2, 82, 1258, 3, 2, 2, 2, 84, 1260, 3, 2, 2, 2, 86, 1270, 194 3, 2, 2, 2, 88, 1272, 3, 2, 2, 2, 90, 1321, 3, 2, 2, 2, 92, 1332, 3, 2, 195 2, 2, 94, 1338, 3, 2, 2, 2, 96, 1340, 3, 2, 2, 2, 98, 1345, 3, 2, 2, 2, 196 100, 1355, 3, 2, 2, 2, 102, 1362, 3, 2, 2, 2, 104, 1368, 3, 2, 2, 2, 106, 197 1370, 3, 2, 2, 2, 108, 1383, 3, 2, 2, 2, 110, 1388, 3, 2, 2, 2, 112, 1390, 198 3, 2, 2, 2, 114, 115, 5, 6, 4, 2, 115, 116, 7, 2, 2, 3, 116, 3, 3, 2, 2, 199 2, 117, 118, 5, 62, 32, 2, 118, 119, 7, 2, 2, 3, 119, 5, 3, 2, 2, 2, 120, 200 508, 5, 8, 5, 2, 121, 122, 7, 177, 2, 2, 122, 508, 5, 108, 55, 2, 123, 201 124, 7, 177, 2, 2, 124, 125, 5, 108, 55, 2, 125, 126, 7, 3, 2, 2, 126, 202 127, 5, 108, 55, 2, 127, 508, 3, 2, 2, 2, 128, 129, 7, 36, 2, 2, 129, 133, 203 7, 145, 2, 2, 130, 131, 7, 79, 2, 2, 131, 132, 7, 110, 2, 2, 132, 134, 204 7, 60, 2, 2, 133, 130, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 135, 3, 2, 205 2, 2, 135, 138, 5, 106, 54, 2, 136, 137, 7, 185, 2, 2, 137, 139, 5, 18, 206 10, 2, 138, 136, 3, 2, 2, 2, 138, 139, 3, 2, 2, 2, 139, 508, 3, 2, 2, 2, 207 140, 141, 7, 53, 2, 2, 141, 144, 7, 145, 2, 2, 142, 143, 7, 79, 2, 2, 143, 208 145, 7, 60, 2, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 146, 209 3, 2, 2, 2, 146, 148, 5, 106, 54, 2, 147, 149, 9, 2, 2, 2, 148, 147, 3, 210 2, 2, 2, 148, 149, 3, 2, 2, 2, 149, 508, 3, 2, 2, 2, 150, 151, 7, 14, 2, 211 2, 151, 152, 7, 145, 2, 2, 152, 153, 5, 106, 54, 2, 153, 154, 7, 134, 2, 212 2, 154, 155, 7, 168, 2, 2, 155, 156, 5, 108, 55, 2, 156, 508, 3, 2, 2, 213 2, 157, 158, 7, 36, 2, 2, 158, 162, 7, 160, 2, 2, 159, 160, 7, 79, 2, 2, 214 160, 161, 7, 110, 2, 2, 161, 163, 7, 60, 2, 2, 162, 159, 3, 2, 2, 2, 162, 215 163, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 166, 5, 106, 54, 2, 165, 167, 216 5, 58, 30, 2, 166, 165, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 170, 3, 217 2, 2, 2, 168, 169, 7, 33, 2, 2, 169, 171, 5, 74, 38, 2, 170, 168, 3, 2, 218 2, 2, 170, 171, 3, 2, 2, 2, 171, 174, 3, 2, 2, 2, 172, 173, 7, 185, 2, 219 2, 173, 175, 5, 18, 10, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 220 175, 176, 3, 2, 2, 2, 176, 182, 7, 19, 2, 2, 177, 183, 5, 8, 5, 2, 178, 221 179, 7, 4, 2, 2, 179, 180, 5, 8, 5, 2, 180, 181, 7, 5, 2, 2, 181, 183, 222 3, 2, 2, 2, 182, 177, 3, 2, 2, 2, 182, 178, 3, 2, 2, 2, 183, 189, 3, 2, 223 2, 2, 184, 186, 7, 185, 2, 2, 185, 187, 7, 108, 2, 2, 186, 185, 3, 2, 2, 224 2, 186, 187, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 190, 7, 44, 2, 2, 189, 225 184, 3, 2, 2, 2, 189, 190, 3, 2, 2, 2, 190, 508, 3, 2, 2, 2, 191, 192, 226 7, 36, 2, 2, 192, 196, 7, 160, 2, 2, 193, 194, 7, 79, 2, 2, 194, 195, 7, 227 110, 2, 2, 195, 197, 7, 60, 2, 2, 196, 193, 3, 2, 2, 2, 196, 197, 3, 2, 228 2, 2, 197, 198, 3, 2, 2, 2, 198, 199, 5, 106, 54, 2, 199, 200, 7, 4, 2, 229 2, 200, 205, 5, 12, 7, 2, 201, 202, 7, 6, 2, 2, 202, 204, 5, 12, 7, 2, 230 203, 201, 3, 2, 2, 2, 204, 207, 3, 2, 2, 2, 205, 203, 3, 2, 2, 2, 205, 231 206, 3, 2, 2, 2, 206, 208, 3, 2, 2, 2, 207, 205, 3, 2, 2, 2, 208, 211, 232 7, 5, 2, 2, 209, 210, 7, 33, 2, 2, 210, 212, 5, 74, 38, 2, 211, 209, 3, 233 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 215, 3, 2, 2, 2, 213, 214, 7, 185, 234 2, 2, 214, 216, 5, 18, 10, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 235 2, 216, 508, 3, 2, 2, 2, 217, 218, 7, 53, 2, 2, 218, 221, 7, 160, 2, 2, 236 219, 220, 7, 79, 2, 2, 220, 222, 7, 60, 2, 2, 221, 219, 3, 2, 2, 2, 221, 237 222, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 508, 5, 106, 54, 2, 224, 225, 238 7, 84, 2, 2, 225, 226, 7, 88, 2, 2, 226, 228, 5, 106, 54, 2, 227, 229, 239 5, 58, 30, 2, 228, 227, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 230, 3, 240 2, 2, 2, 230, 231, 5, 8, 5, 2, 231, 508, 3, 2, 2, 2, 232, 233, 7, 48, 2, 241 2, 233, 234, 7, 69, 2, 2, 234, 237, 5, 106, 54, 2, 235, 236, 7, 184, 2, 242 2, 236, 238, 5, 64, 33, 2, 237, 235, 3, 2, 2, 2, 237, 238, 3, 2, 2, 2, 243 238, 508, 3, 2, 2, 2, 239, 240, 7, 14, 2, 2, 240, 241, 7, 160, 2, 2, 241, 244 242, 5, 106, 54, 2, 242, 243, 7, 134, 2, 2, 243, 244, 7, 168, 2, 2, 244, 245 245, 5, 106, 54, 2, 245, 508, 3, 2, 2, 2, 246, 247, 7, 14, 2, 2, 247, 248, 246 7, 160, 2, 2, 248, 249, 5, 106, 54, 2, 249, 250, 7, 134, 2, 2, 250, 251, 247 7, 31, 2, 2, 251, 252, 5, 108, 55, 2, 252, 253, 7, 168, 2, 2, 253, 254, 248 5, 108, 55, 2, 254, 508, 3, 2, 2, 2, 255, 256, 7, 14, 2, 2, 256, 257, 7, 249 160, 2, 2, 257, 258, 5, 106, 54, 2, 258, 259, 7, 53, 2, 2, 259, 260, 7, 250 31, 2, 2, 260, 261, 5, 106, 54, 2, 261, 508, 3, 2, 2, 2, 262, 263, 7, 14, 251 2, 2, 263, 264, 7, 160, 2, 2, 264, 265, 5, 106, 54, 2, 265, 266, 7, 12, 252 2, 2, 266, 267, 7, 31, 2, 2, 267, 268, 5, 14, 8, 2, 268, 508, 3, 2, 2, 253 2, 269, 272, 7, 36, 2, 2, 270, 271, 7, 117, 2, 2, 271, 273, 7, 136, 2, 254 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 255 275, 7, 182, 2, 2, 275, 276, 5, 106, 54, 2, 276, 277, 7, 19, 2, 2, 277, 256 278, 5, 8, 5, 2, 278, 508, 3, 2, 2, 2, 279, 280, 7, 53, 2, 2, 280, 283, 257 7, 182, 2, 2, 281, 282, 7, 79, 2, 2, 282, 284, 7, 60, 2, 2, 283, 281, 3, 258 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 508, 5, 106, 259 54, 2, 286, 287, 7, 25, 2, 2, 287, 288, 5, 106, 54, 2, 288, 297, 7, 4, 260 2, 2, 289, 294, 5, 102, 52, 2, 290, 291, 7, 6, 2, 2, 291, 293, 5, 102, 261 52, 2, 292, 290, 3, 2, 2, 2, 293, 296, 3, 2, 2, 2, 294, 292, 3, 2, 2, 2, 262 294, 295, 3, 2, 2, 2, 295, 298, 3, 2, 2, 2, 296, 294, 3, 2, 2, 2, 297, 263 289, 3, 2, 2, 2, 297, 298, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 300, 264 7, 5, 2, 2, 300, 508, 3, 2, 2, 2, 301, 312, 7, 72, 2, 2, 302, 307, 5, 104, 265 53, 2, 303, 304, 7, 6, 2, 2, 304, 306, 5, 104, 53, 2, 305, 303, 3, 2, 2, 266 2, 306, 309, 3, 2, 2, 2, 307, 305, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308, 267 313, 3, 2, 2, 2, 309, 307, 3, 2, 2, 2, 310, 311, 7, 13, 2, 2, 311, 313, 268 7, 128, 2, 2, 312, 302, 3, 2, 2, 2, 312, 310, 3, 2, 2, 2, 313, 314, 3, 269 2, 2, 2, 314, 316, 7, 114, 2, 2, 315, 317, 7, 160, 2, 2, 316, 315, 3, 2, 270 2, 2, 316, 317, 3, 2, 2, 2, 317, 318, 3, 2, 2, 2, 318, 319, 5, 106, 54, 271 2, 319, 320, 7, 168, 2, 2, 320, 324, 5, 108, 55, 2, 321, 322, 7, 185, 2, 272 2, 322, 323, 7, 72, 2, 2, 323, 325, 7, 116, 2, 2, 324, 321, 3, 2, 2, 2, 273 324, 325, 3, 2, 2, 2, 325, 508, 3, 2, 2, 2, 326, 330, 7, 139, 2, 2, 327, 274 328, 7, 72, 2, 2, 328, 329, 7, 116, 2, 2, 329, 331, 7, 67, 2, 2, 330, 327, 275 3, 2, 2, 2, 330, 331, 3, 2, 2, 2, 331, 342, 3, 2, 2, 2, 332, 337, 5, 104, 276 53, 2, 333, 334, 7, 6, 2, 2, 334, 336, 5, 104, 53, 2, 335, 333, 3, 2, 2, 277 2, 336, 339, 3, 2, 2, 2, 337, 335, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 278 343, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 340, 341, 7, 13, 2, 2, 341, 343, 279 7, 128, 2, 2, 342, 332, 3, 2, 2, 2, 342, 340, 3, 2, 2, 2, 343, 344, 3, 280 2, 2, 2, 344, 346, 7, 114, 2, 2, 345, 347, 7, 160, 2, 2, 346, 345, 3, 2, 281 2, 2, 346, 347, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 349, 5, 106, 54, 282 2, 349, 350, 7, 69, 2, 2, 350, 351, 5, 108, 55, 2, 351, 508, 3, 2, 2, 2, 283 352, 353, 7, 153, 2, 2, 353, 359, 7, 73, 2, 2, 354, 356, 7, 114, 2, 2, 284 355, 357, 7, 160, 2, 2, 356, 355, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 285 358, 3, 2, 2, 2, 358, 360, 5, 106, 54, 2, 359, 354, 3, 2, 2, 2, 359, 360, 286 3, 2, 2, 2, 360, 508, 3, 2, 2, 2, 361, 363, 7, 61, 2, 2, 362, 364, 7, 15, 287 2, 2, 363, 362, 3, 2, 2, 2, 363, 364, 3, 2, 2, 2, 364, 366, 3, 2, 2, 2, 288 365, 367, 7, 181, 2, 2, 366, 365, 3, 2, 2, 2, 366, 367, 3, 2, 2, 2, 367, 289 379, 3, 2, 2, 2, 368, 369, 7, 4, 2, 2, 369, 374, 5, 100, 51, 2, 370, 371, 290 7, 6, 2, 2, 371, 373, 5, 100, 51, 2, 372, 370, 3, 2, 2, 2, 373, 376, 3, 291 2, 2, 2, 374, 372, 3, 2, 2, 2, 374, 375, 3, 2, 2, 2, 375, 377, 3, 2, 2, 292 2, 376, 374, 3, 2, 2, 2, 377, 378, 7, 5, 2, 2, 378, 380, 3, 2, 2, 2, 379, 293 368, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 508, 294 5, 6, 4, 2, 382, 383, 7, 153, 2, 2, 383, 384, 7, 36, 2, 2, 384, 385, 7, 295 160, 2, 2, 385, 508, 5, 106, 54, 2, 386, 387, 7, 153, 2, 2, 387, 388, 7, 296 36, 2, 2, 388, 389, 7, 182, 2, 2, 389, 508, 5, 106, 54, 2, 390, 391, 7, 297 153, 2, 2, 391, 394, 7, 161, 2, 2, 392, 393, 9, 3, 2, 2, 393, 395, 5, 106, 298 54, 2, 394, 392, 3, 2, 2, 2, 394, 395, 3, 2, 2, 2, 395, 402, 3, 2, 2, 2, 299 396, 397, 7, 95, 2, 2, 397, 400, 5, 74, 38, 2, 398, 399, 7, 56, 2, 2, 399, 300 401, 5, 74, 38, 2, 400, 398, 3, 2, 2, 2, 400, 401, 3, 2, 2, 2, 401, 403, 301 3, 2, 2, 2, 402, 396, 3, 2, 2, 2, 402, 403, 3, 2, 2, 2, 403, 508, 3, 2, 302 2, 2, 404, 405, 7, 153, 2, 2, 405, 408, 7, 146, 2, 2, 406, 407, 9, 3, 2, 303 2, 407, 409, 5, 108, 55, 2, 408, 406, 3, 2, 2, 2, 408, 409, 3, 2, 2, 2, 304 409, 416, 3, 2, 2, 2, 410, 411, 7, 95, 2, 2, 411, 414, 5, 74, 38, 2, 412, 305 413, 7, 56, 2, 2, 413, 415, 5, 74, 38, 2, 414, 412, 3, 2, 2, 2, 414, 415, 306 3, 2, 2, 2, 415, 417, 3, 2, 2, 2, 416, 410, 3, 2, 2, 2, 416, 417, 3, 2, 307 2, 2, 417, 508, 3, 2, 2, 2, 418, 419, 7, 153, 2, 2, 419, 422, 7, 29, 2, 308 2, 420, 421, 7, 95, 2, 2, 421, 423, 5, 74, 38, 2, 422, 420, 3, 2, 2, 2, 309 422, 423, 3, 2, 2, 2, 423, 508, 3, 2, 2, 2, 424, 425, 7, 153, 2, 2, 425, 310 426, 7, 32, 2, 2, 426, 427, 9, 3, 2, 2, 427, 508, 5, 106, 54, 2, 428, 429, 311 7, 153, 2, 2, 429, 430, 7, 157, 2, 2, 430, 431, 9, 4, 2, 2, 431, 508, 5, 312 106, 54, 2, 432, 433, 7, 153, 2, 2, 433, 434, 7, 157, 2, 2, 434, 435, 7, 313 67, 2, 2, 435, 436, 7, 4, 2, 2, 436, 437, 5, 30, 16, 2, 437, 438, 7, 5, 314 2, 2, 438, 508, 3, 2, 2, 2, 439, 440, 7, 50, 2, 2, 440, 508, 5, 106, 54, 315 2, 441, 442, 7, 49, 2, 2, 442, 508, 5, 106, 54, 2, 443, 444, 7, 153, 2, 316 2, 444, 508, 7, 71, 2, 2, 445, 446, 7, 153, 2, 2, 446, 508, 7, 150, 2, 317 2, 447, 448, 7, 151, 2, 2, 448, 449, 7, 150, 2, 2, 449, 450, 5, 106, 54, 318 2, 450, 451, 7, 190, 2, 2, 451, 452, 5, 62, 32, 2, 452, 508, 3, 2, 2, 2, 319 453, 454, 7, 137, 2, 2, 454, 455, 7, 150, 2, 2, 455, 508, 5, 106, 54, 2, 320 456, 457, 7, 153, 2, 2, 457, 458, 7, 124, 2, 2, 458, 459, 9, 3, 2, 2, 459, 321 462, 5, 106, 54, 2, 460, 461, 7, 184, 2, 2, 461, 463, 5, 64, 33, 2, 462, 322 460, 3, 2, 2, 2, 462, 463, 3, 2, 2, 2, 463, 474, 3, 2, 2, 2, 464, 465, 323 7, 118, 2, 2, 465, 466, 7, 24, 2, 2, 466, 471, 5, 28, 15, 2, 467, 468, 324 7, 6, 2, 2, 468, 470, 5, 28, 15, 2, 469, 467, 3, 2, 2, 2, 470, 473, 3, 325 2, 2, 2, 471, 469, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 475, 3, 2, 2, 326 2, 473, 471, 3, 2, 2, 2, 474, 464, 3, 2, 2, 2, 474, 475, 3, 2, 2, 2, 475, 327 478, 3, 2, 2, 2, 476, 477, 7, 96, 2, 2, 477, 479, 9, 5, 2, 2, 478, 476, 328 3, 2, 2, 2, 478, 479, 3, 2, 2, 2, 479, 508, 3, 2, 2, 2, 480, 481, 7, 127, 329 2, 2, 481, 482, 5, 108, 55, 2, 482, 483, 7, 69, 2, 2, 483, 484, 5, 6, 4, 330 2, 484, 508, 3, 2, 2, 2, 485, 486, 7, 47, 2, 2, 486, 487, 7, 127, 2, 2, 331 487, 508, 5, 108, 55, 2, 488, 489, 7, 59, 2, 2, 489, 499, 5, 108, 55, 2, 332 490, 491, 7, 178, 2, 2, 491, 496, 5, 62, 32, 2, 492, 493, 7, 6, 2, 2, 493, 333 495, 5, 62, 32, 2, 494, 492, 3, 2, 2, 2, 495, 498, 3, 2, 2, 2, 496, 494, 334 3, 2, 2, 2, 496, 497, 3, 2, 2, 2, 497, 500, 3, 2, 2, 2, 498, 496, 3, 2, 335 2, 2, 499, 490, 3, 2, 2, 2, 499, 500, 3, 2, 2, 2, 500, 508, 3, 2, 2, 2, 336 501, 502, 7, 50, 2, 2, 502, 503, 7, 83, 2, 2, 503, 508, 5, 108, 55, 2, 337 504, 505, 7, 50, 2, 2, 505, 506, 7, 121, 2, 2, 506, 508, 5, 108, 55, 2, 338 507, 120, 3, 2, 2, 2, 507, 121, 3, 2, 2, 2, 507, 123, 3, 2, 2, 2, 507, 339 128, 3, 2, 2, 2, 507, 140, 3, 2, 2, 2, 507, 150, 3, 2, 2, 2, 507, 157, 340 3, 2, 2, 2, 507, 191, 3, 2, 2, 2, 507, 217, 3, 2, 2, 2, 507, 224, 3, 2, 341 2, 2, 507, 232, 3, 2, 2, 2, 507, 239, 3, 2, 2, 2, 507, 246, 3, 2, 2, 2, 342 507, 255, 3, 2, 2, 2, 507, 262, 3, 2, 2, 2, 507, 269, 3, 2, 2, 2, 507, 343 279, 3, 2, 2, 2, 507, 286, 3, 2, 2, 2, 507, 301, 3, 2, 2, 2, 507, 326, 344 3, 2, 2, 2, 507, 352, 3, 2, 2, 2, 507, 361, 3, 2, 2, 2, 507, 382, 3, 2, 345 2, 2, 507, 386, 3, 2, 2, 2, 507, 390, 3, 2, 2, 2, 507, 404, 3, 2, 2, 2, 346 507, 418, 3, 2, 2, 2, 507, 424, 3, 2, 2, 2, 507, 428, 3, 2, 2, 2, 507, 347 432, 3, 2, 2, 2, 507, 439, 3, 2, 2, 2, 507, 441, 3, 2, 2, 2, 507, 443, 348 3, 2, 2, 2, 507, 445, 3, 2, 2, 2, 507, 447, 3, 2, 2, 2, 507, 453, 3, 2, 349 2, 2, 507, 456, 3, 2, 2, 2, 507, 480, 3, 2, 2, 2, 507, 485, 3, 2, 2, 2, 350 507, 488, 3, 2, 2, 2, 507, 501, 3, 2, 2, 2, 507, 504, 3, 2, 2, 2, 508, 351 7, 3, 2, 2, 2, 509, 511, 5, 10, 6, 2, 510, 509, 3, 2, 2, 2, 510, 511, 3, 352 2, 2, 2, 511, 512, 3, 2, 2, 2, 512, 513, 5, 22, 12, 2, 513, 9, 3, 2, 2, 353 2, 514, 516, 7, 185, 2, 2, 515, 517, 7, 133, 2, 2, 516, 515, 3, 2, 2, 2, 354 516, 517, 3, 2, 2, 2, 517, 518, 3, 2, 2, 2, 518, 523, 5, 40, 21, 2, 519, 355 520, 7, 6, 2, 2, 520, 522, 5, 40, 21, 2, 521, 519, 3, 2, 2, 2, 522, 525, 356 3, 2, 2, 2, 523, 521, 3, 2, 2, 2, 523, 524, 3, 2, 2, 2, 524, 11, 3, 2, 357 2, 2, 525, 523, 3, 2, 2, 2, 526, 529, 5, 14, 8, 2, 527, 529, 5, 16, 9, 358 2, 528, 526, 3, 2, 2, 2, 528, 527, 3, 2, 2, 2, 529, 13, 3, 2, 2, 2, 530, 359 531, 5, 108, 55, 2, 531, 534, 5, 90, 46, 2, 532, 533, 7, 33, 2, 2, 533, 360 535, 5, 74, 38, 2, 534, 532, 3, 2, 2, 2, 534, 535, 3, 2, 2, 2, 535, 15, 361 3, 2, 2, 2, 536, 537, 7, 95, 2, 2, 537, 540, 5, 106, 54, 2, 538, 539, 9, 362 6, 2, 2, 539, 541, 7, 129, 2, 2, 540, 538, 3, 2, 2, 2, 540, 541, 3, 2, 363 2, 2, 541, 17, 3, 2, 2, 2, 542, 543, 7, 4, 2, 2, 543, 548, 5, 20, 11, 2, 364 544, 545, 7, 6, 2, 2, 545, 547, 5, 20, 11, 2, 546, 544, 3, 2, 2, 2, 547, 365 550, 3, 2, 2, 2, 548, 546, 3, 2, 2, 2, 548, 549, 3, 2, 2, 2, 549, 551, 366 3, 2, 2, 2, 550, 548, 3, 2, 2, 2, 551, 552, 7, 5, 2, 2, 552, 19, 3, 2, 367 2, 2, 553, 554, 5, 108, 55, 2, 554, 555, 7, 190, 2, 2, 555, 556, 5, 62, 368 32, 2, 556, 21, 3, 2, 2, 2, 557, 568, 5, 24, 13, 2, 558, 559, 7, 118, 2, 369 2, 559, 560, 7, 24, 2, 2, 560, 565, 5, 28, 15, 2, 561, 562, 7, 6, 2, 2, 370 562, 564, 5, 28, 15, 2, 563, 561, 3, 2, 2, 2, 564, 567, 3, 2, 2, 2, 565, 371 563, 3, 2, 2, 2, 565, 566, 3, 2, 2, 2, 566, 569, 3, 2, 2, 2, 567, 565, 372 3, 2, 2, 2, 568, 558, 3, 2, 2, 2, 568, 569, 3, 2, 2, 2, 569, 572, 3, 2, 373 2, 2, 570, 571, 7, 96, 2, 2, 571, 573, 9, 5, 2, 2, 572, 570, 3, 2, 2, 2, 374 572, 573, 3, 2, 2, 2, 573, 23, 3, 2, 2, 2, 574, 575, 8, 13, 1, 2, 575, 375 576, 5, 26, 14, 2, 576, 591, 3, 2, 2, 2, 577, 578, 12, 4, 2, 2, 578, 580, 376 7, 86, 2, 2, 579, 581, 5, 42, 22, 2, 580, 579, 3, 2, 2, 2, 580, 581, 3, 377 2, 2, 2, 581, 582, 3, 2, 2, 2, 582, 590, 5, 24, 13, 5, 583, 584, 12, 3, 378 2, 2, 584, 586, 9, 7, 2, 2, 585, 587, 5, 42, 22, 2, 586, 585, 3, 2, 2, 379 2, 586, 587, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 590, 5, 24, 13, 4, 380 589, 577, 3, 2, 2, 2, 589, 583, 3, 2, 2, 2, 590, 593, 3, 2, 2, 2, 591, 381 589, 3, 2, 2, 2, 591, 592, 3, 2, 2, 2, 592, 25, 3, 2, 2, 2, 593, 591, 3, 382 2, 2, 2, 594, 611, 5, 30, 16, 2, 595, 596, 7, 160, 2, 2, 596, 611, 5, 106, 383 54, 2, 597, 598, 7, 180, 2, 2, 598, 603, 5, 62, 32, 2, 599, 600, 7, 6, 384 2, 2, 600, 602, 5, 62, 32, 2, 601, 599, 3, 2, 2, 2, 602, 605, 3, 2, 2, 385 2, 603, 601, 3, 2, 2, 2, 603, 604, 3, 2, 2, 2, 604, 611, 3, 2, 2, 2, 605, 386 603, 3, 2, 2, 2, 606, 607, 7, 4, 2, 2, 607, 608, 5, 22, 12, 2, 608, 609, 387 7, 5, 2, 2, 609, 611, 3, 2, 2, 2, 610, 594, 3, 2, 2, 2, 610, 595, 3, 2, 388 2, 2, 610, 597, 3, 2, 2, 2, 610, 606, 3, 2, 2, 2, 611, 27, 3, 2, 2, 2, 389 612, 614, 5, 62, 32, 2, 613, 615, 9, 8, 2, 2, 614, 613, 3, 2, 2, 2, 614, 390 615, 3, 2, 2, 2, 615, 618, 3, 2, 2, 2, 616, 617, 7, 113, 2, 2, 617, 619, 391 9, 9, 2, 2, 618, 616, 3, 2, 2, 2, 618, 619, 3, 2, 2, 2, 619, 29, 3, 2, 392 2, 2, 620, 622, 7, 148, 2, 2, 621, 623, 5, 42, 22, 2, 622, 621, 3, 2, 2, 393 2, 622, 623, 3, 2, 2, 2, 623, 624, 3, 2, 2, 2, 624, 629, 5, 44, 23, 2, 394 625, 626, 7, 6, 2, 2, 626, 628, 5, 44, 23, 2, 627, 625, 3, 2, 2, 2, 628, 395 631, 3, 2, 2, 2, 629, 627, 3, 2, 2, 2, 629, 630, 3, 2, 2, 2, 630, 641, 396 3, 2, 2, 2, 631, 629, 3, 2, 2, 2, 632, 633, 7, 69, 2, 2, 633, 638, 5, 46, 397 24, 2, 634, 635, 7, 6, 2, 2, 635, 637, 5, 46, 24, 2, 636, 634, 3, 2, 2, 398 2, 637, 640, 3, 2, 2, 2, 638, 636, 3, 2, 2, 2, 638, 639, 3, 2, 2, 2, 639, 399 642, 3, 2, 2, 2, 640, 638, 3, 2, 2, 2, 641, 632, 3, 2, 2, 2, 641, 642, 400 3, 2, 2, 2, 642, 645, 3, 2, 2, 2, 643, 644, 7, 184, 2, 2, 644, 646, 5, 401 64, 33, 2, 645, 643, 3, 2, 2, 2, 645, 646, 3, 2, 2, 2, 646, 650, 3, 2, 402 2, 2, 647, 648, 7, 75, 2, 2, 648, 649, 7, 24, 2, 2, 649, 651, 5, 32, 17, 403 2, 650, 647, 3, 2, 2, 2, 650, 651, 3, 2, 2, 2, 651, 654, 3, 2, 2, 2, 652, 404 653, 7, 77, 2, 2, 653, 655, 5, 64, 33, 2, 654, 652, 3, 2, 2, 2, 654, 655, 405 3, 2, 2, 2, 655, 31, 3, 2, 2, 2, 656, 658, 5, 42, 22, 2, 657, 656, 3, 2, 406 2, 2, 657, 658, 3, 2, 2, 2, 658, 659, 3, 2, 2, 2, 659, 664, 5, 34, 18, 407 2, 660, 661, 7, 6, 2, 2, 661, 663, 5, 34, 18, 2, 662, 660, 3, 2, 2, 2, 408 663, 666, 3, 2, 2, 2, 664, 662, 3, 2, 2, 2, 664, 665, 3, 2, 2, 2, 665, 409 33, 3, 2, 2, 2, 666, 664, 3, 2, 2, 2, 667, 708, 5, 36, 19, 2, 668, 669, 410 7, 142, 2, 2, 669, 678, 7, 4, 2, 2, 670, 675, 5, 106, 54, 2, 671, 672, 411 7, 6, 2, 2, 672, 674, 5, 106, 54, 2, 673, 671, 3, 2, 2, 2, 674, 677, 3, 412 2, 2, 2, 675, 673, 3, 2, 2, 2, 675, 676, 3, 2, 2, 2, 676, 679, 3, 2, 2, 413 2, 677, 675, 3, 2, 2, 2, 678, 670, 3, 2, 2, 2, 678, 679, 3, 2, 2, 2, 679, 414 680, 3, 2, 2, 2, 680, 708, 7, 5, 2, 2, 681, 682, 7, 38, 2, 2, 682, 691, 415 7, 4, 2, 2, 683, 688, 5, 106, 54, 2, 684, 685, 7, 6, 2, 2, 685, 687, 5, 416 106, 54, 2, 686, 684, 3, 2, 2, 2, 687, 690, 3, 2, 2, 2, 688, 686, 3, 2, 417 2, 2, 688, 689, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 418 691, 683, 3, 2, 2, 2, 691, 692, 3, 2, 2, 2, 692, 693, 3, 2, 2, 2, 693, 419 708, 7, 5, 2, 2, 694, 695, 7, 76, 2, 2, 695, 696, 7, 152, 2, 2, 696, 697, 420 7, 4, 2, 2, 697, 702, 5, 38, 20, 2, 698, 699, 7, 6, 2, 2, 699, 701, 5, 421 38, 20, 2, 700, 698, 3, 2, 2, 2, 701, 704, 3, 2, 2, 2, 702, 700, 3, 2, 422 2, 2, 702, 703, 3, 2, 2, 2, 703, 705, 3, 2, 2, 2, 704, 702, 3, 2, 2, 2, 423 705, 706, 7, 5, 2, 2, 706, 708, 3, 2, 2, 2, 707, 667, 3, 2, 2, 2, 707, 424 668, 3, 2, 2, 2, 707, 681, 3, 2, 2, 2, 707, 694, 3, 2, 2, 2, 708, 35, 3, 425 2, 2, 2, 709, 718, 7, 4, 2, 2, 710, 715, 5, 62, 32, 2, 711, 712, 7, 6, 426 2, 2, 712, 714, 5, 62, 32, 2, 713, 711, 3, 2, 2, 2, 714, 717, 3, 2, 2, 427 2, 715, 713, 3, 2, 2, 2, 715, 716, 3, 2, 2, 2, 716, 719, 3, 2, 2, 2, 717, 428 715, 3, 2, 2, 2, 718, 710, 3, 2, 2, 2, 718, 719, 3, 2, 2, 2, 719, 720, 429 3, 2, 2, 2, 720, 723, 7, 5, 2, 2, 721, 723, 5, 62, 32, 2, 722, 709, 3, 430 2, 2, 2, 722, 721, 3, 2, 2, 2, 723, 37, 3, 2, 2, 2, 724, 733, 7, 4, 2, 431 2, 725, 730, 5, 106, 54, 2, 726, 727, 7, 6, 2, 2, 727, 729, 5, 106, 54, 432 2, 728, 726, 3, 2, 2, 2, 729, 732, 3, 2, 2, 2, 730, 728, 3, 2, 2, 2, 730, 433 731, 3, 2, 2, 2, 731, 734, 3, 2, 2, 2, 732, 730, 3, 2, 2, 2, 733, 725, 434 3, 2, 2, 2, 733, 734, 3, 2, 2, 2, 734, 735, 3, 2, 2, 2, 735, 738, 7, 5, 435 2, 2, 736, 738, 5, 106, 54, 2, 737, 724, 3, 2, 2, 2, 737, 736, 3, 2, 2, 436 2, 738, 39, 3, 2, 2, 2, 739, 741, 5, 108, 55, 2, 740, 742, 5, 58, 30, 2, 437 741, 740, 3, 2, 2, 2, 741, 742, 3, 2, 2, 2, 742, 743, 3, 2, 2, 2, 743, 438 744, 7, 19, 2, 2, 744, 745, 7, 4, 2, 2, 745, 746, 5, 8, 5, 2, 746, 747, 439 7, 5, 2, 2, 747, 41, 3, 2, 2, 2, 748, 749, 9, 10, 2, 2, 749, 43, 3, 2, 440 2, 2, 750, 755, 5, 62, 32, 2, 751, 753, 7, 19, 2, 2, 752, 751, 3, 2, 2, 441 2, 752, 753, 3, 2, 2, 2, 753, 754, 3, 2, 2, 2, 754, 756, 5, 108, 55, 2, 442 755, 752, 3, 2, 2, 2, 755, 756, 3, 2, 2, 2, 756, 763, 3, 2, 2, 2, 757, 443 758, 5, 106, 54, 2, 758, 759, 7, 3, 2, 2, 759, 760, 7, 198, 2, 2, 760, 444 763, 3, 2, 2, 2, 761, 763, 7, 198, 2, 2, 762, 750, 3, 2, 2, 2, 762, 757, 445 3, 2, 2, 2, 762, 761, 3, 2, 2, 2, 763, 45, 3, 2, 2, 2, 764, 765, 8, 24, 446 1, 2, 765, 766, 5, 52, 27, 2, 766, 785, 3, 2, 2, 2, 767, 781, 12, 4, 2, 447 2, 768, 769, 7, 37, 2, 2, 769, 770, 7, 90, 2, 2, 770, 782, 5, 52, 27, 2, 448 771, 772, 5, 48, 25, 2, 772, 773, 7, 90, 2, 2, 773, 774, 5, 46, 24, 2, 449 774, 775, 5, 50, 26, 2, 775, 782, 3, 2, 2, 2, 776, 777, 7, 103, 2, 2, 777, 450 778, 5, 48, 25, 2, 778, 779, 7, 90, 2, 2, 779, 780, 5, 52, 27, 2, 780, 451 782, 3, 2, 2, 2, 781, 768, 3, 2, 2, 2, 781, 771, 3, 2, 2, 2, 781, 776, 452 3, 2, 2, 2, 782, 784, 3, 2, 2, 2, 783, 767, 3, 2, 2, 2, 784, 787, 3, 2, 453 2, 2, 785, 783, 3, 2, 2, 2, 785, 786, 3, 2, 2, 2, 786, 47, 3, 2, 2, 2, 454 787, 785, 3, 2, 2, 2, 788, 790, 7, 82, 2, 2, 789, 788, 3, 2, 2, 2, 789, 455 790, 3, 2, 2, 2, 790, 804, 3, 2, 2, 2, 791, 793, 7, 93, 2, 2, 792, 794, 456 7, 120, 2, 2, 793, 792, 3, 2, 2, 2, 793, 794, 3, 2, 2, 2, 794, 804, 3, 457 2, 2, 2, 795, 797, 7, 140, 2, 2, 796, 798, 7, 120, 2, 2, 797, 796, 3, 2, 458 2, 2, 797, 798, 3, 2, 2, 2, 798, 804, 3, 2, 2, 2, 799, 801, 7, 70, 2, 2, 459 800, 802, 7, 120, 2, 2, 801, 800, 3, 2, 2, 2, 801, 802, 3, 2, 2, 2, 802, 460 804, 3, 2, 2, 2, 803, 789, 3, 2, 2, 2, 803, 791, 3, 2, 2, 2, 803, 795, 461 3, 2, 2, 2, 803, 799, 3, 2, 2, 2, 804, 49, 3, 2, 2, 2, 805, 806, 7, 114, 462 2, 2, 806, 820, 5, 64, 33, 2, 807, 808, 7, 178, 2, 2, 808, 809, 7, 4, 2, 463 2, 809, 814, 5, 108, 55, 2, 810, 811, 7, 6, 2, 2, 811, 813, 5, 108, 55, 464 2, 812, 810, 3, 2, 2, 2, 813, 816, 3, 2, 2, 2, 814, 812, 3, 2, 2, 2, 814, 465 815, 3, 2, 2, 2, 815, 817, 3, 2, 2, 2, 816, 814, 3, 2, 2, 2, 817, 818, 466 7, 5, 2, 2, 818, 820, 3, 2, 2, 2, 819, 805, 3, 2, 2, 2, 819, 807, 3, 2, 467 2, 2, 820, 51, 3, 2, 2, 2, 821, 828, 5, 56, 29, 2, 822, 823, 7, 162, 2, 468 2, 823, 824, 5, 54, 28, 2, 824, 825, 7, 4, 2, 2, 825, 826, 5, 62, 32, 2, 469 826, 827, 7, 5, 2, 2, 827, 829, 3, 2, 2, 2, 828, 822, 3, 2, 2, 2, 828, 470 829, 3, 2, 2, 2, 829, 53, 3, 2, 2, 2, 830, 831, 9, 11, 2, 2, 831, 55, 3, 471 2, 2, 2, 832, 840, 5, 60, 31, 2, 833, 835, 7, 19, 2, 2, 834, 833, 3, 2, 472 2, 2, 834, 835, 3, 2, 2, 2, 835, 836, 3, 2, 2, 2, 836, 838, 5, 108, 55, 473 2, 837, 839, 5, 58, 30, 2, 838, 837, 3, 2, 2, 2, 838, 839, 3, 2, 2, 2, 474 839, 841, 3, 2, 2, 2, 840, 834, 3, 2, 2, 2, 840, 841, 3, 2, 2, 2, 841, 475 57, 3, 2, 2, 2, 842, 843, 7, 4, 2, 2, 843, 848, 5, 108, 55, 2, 844, 845, 476 7, 6, 2, 2, 845, 847, 5, 108, 55, 2, 846, 844, 3, 2, 2, 2, 847, 850, 3, 477 2, 2, 2, 848, 846, 3, 2, 2, 2, 848, 849, 3, 2, 2, 2, 849, 851, 3, 2, 2, 478 2, 850, 848, 3, 2, 2, 2, 851, 852, 7, 5, 2, 2, 852, 59, 3, 2, 2, 2, 853, 479 883, 5, 106, 54, 2, 854, 855, 7, 4, 2, 2, 855, 856, 5, 8, 5, 2, 856, 857, 480 7, 5, 2, 2, 857, 883, 3, 2, 2, 2, 858, 859, 7, 176, 2, 2, 859, 860, 7, 481 4, 2, 2, 860, 865, 5, 62, 32, 2, 861, 862, 7, 6, 2, 2, 862, 864, 5, 62, 482 32, 2, 863, 861, 3, 2, 2, 2, 864, 867, 3, 2, 2, 2, 865, 863, 3, 2, 2, 2, 483 865, 866, 3, 2, 2, 2, 866, 868, 3, 2, 2, 2, 867, 865, 3, 2, 2, 2, 868, 484 871, 7, 5, 2, 2, 869, 870, 7, 185, 2, 2, 870, 872, 7, 119, 2, 2, 871, 869, 485 3, 2, 2, 2, 871, 872, 3, 2, 2, 2, 872, 883, 3, 2, 2, 2, 873, 874, 7, 92, 486 2, 2, 874, 875, 7, 4, 2, 2, 875, 876, 5, 8, 5, 2, 876, 877, 7, 5, 2, 2, 487 877, 883, 3, 2, 2, 2, 878, 879, 7, 4, 2, 2, 879, 880, 5, 46, 24, 2, 880, 488 881, 7, 5, 2, 2, 881, 883, 3, 2, 2, 2, 882, 853, 3, 2, 2, 2, 882, 854, 489 3, 2, 2, 2, 882, 858, 3, 2, 2, 2, 882, 873, 3, 2, 2, 2, 882, 878, 3, 2, 490 2, 2, 883, 61, 3, 2, 2, 2, 884, 885, 5, 64, 33, 2, 885, 63, 3, 2, 2, 2, 491 886, 887, 8, 33, 1, 2, 887, 891, 5, 66, 34, 2, 888, 889, 7, 110, 2, 2, 492 889, 891, 5, 64, 33, 5, 890, 886, 3, 2, 2, 2, 890, 888, 3, 2, 2, 2, 891, 493 900, 3, 2, 2, 2, 892, 893, 12, 4, 2, 2, 893, 894, 7, 16, 2, 2, 894, 899, 494 5, 64, 33, 5, 895, 896, 12, 3, 2, 2, 896, 897, 7, 117, 2, 2, 897, 899, 495 5, 64, 33, 4, 898, 892, 3, 2, 2, 2, 898, 895, 3, 2, 2, 2, 899, 902, 3, 496 2, 2, 2, 900, 898, 3, 2, 2, 2, 900, 901, 3, 2, 2, 2, 901, 65, 3, 2, 2, 497 2, 902, 900, 3, 2, 2, 2, 903, 905, 5, 70, 36, 2, 904, 906, 5, 68, 35, 2, 498 905, 904, 3, 2, 2, 2, 905, 906, 3, 2, 2, 2, 906, 67, 3, 2, 2, 2, 907, 908, 499 5, 78, 40, 2, 908, 909, 5, 70, 36, 2, 909, 969, 3, 2, 2, 2, 910, 911, 5, 500 78, 40, 2, 911, 912, 5, 80, 41, 2, 912, 913, 7, 4, 2, 2, 913, 914, 5, 8, 501 5, 2, 914, 915, 7, 5, 2, 2, 915, 969, 3, 2, 2, 2, 916, 918, 7, 110, 2, 502 2, 917, 916, 3, 2, 2, 2, 917, 918, 3, 2, 2, 2, 918, 919, 3, 2, 2, 2, 919, 503 920, 7, 23, 2, 2, 920, 921, 5, 70, 36, 2, 921, 922, 7, 16, 2, 2, 922, 923, 504 5, 70, 36, 2, 923, 969, 3, 2, 2, 2, 924, 926, 7, 110, 2, 2, 925, 924, 3, 505 2, 2, 2, 925, 926, 3, 2, 2, 2, 926, 927, 3, 2, 2, 2, 927, 928, 7, 80, 2, 506 2, 928, 929, 7, 4, 2, 2, 929, 934, 5, 62, 32, 2, 930, 931, 7, 6, 2, 2, 507 931, 933, 5, 62, 32, 2, 932, 930, 3, 2, 2, 2, 933, 936, 3, 2, 2, 2, 934, 508 932, 3, 2, 2, 2, 934, 935, 3, 2, 2, 2, 935, 937, 3, 2, 2, 2, 936, 934, 509 3, 2, 2, 2, 937, 938, 7, 5, 2, 2, 938, 969, 3, 2, 2, 2, 939, 941, 7, 110, 510 2, 2, 940, 939, 3, 2, 2, 2, 940, 941, 3, 2, 2, 2, 941, 942, 3, 2, 2, 2, 511 942, 943, 7, 80, 2, 2, 943, 944, 7, 4, 2, 2, 944, 945, 5, 8, 5, 2, 945, 512 946, 7, 5, 2, 2, 946, 969, 3, 2, 2, 2, 947, 949, 7, 110, 2, 2, 948, 947, 513 3, 2, 2, 2, 948, 949, 3, 2, 2, 2, 949, 950, 3, 2, 2, 2, 950, 951, 7, 95, 514 2, 2, 951, 954, 5, 70, 36, 2, 952, 953, 7, 56, 2, 2, 953, 955, 5, 70, 36, 515 2, 954, 952, 3, 2, 2, 2, 954, 955, 3, 2, 2, 2, 955, 969, 3, 2, 2, 2, 956, 516 958, 7, 89, 2, 2, 957, 959, 7, 110, 2, 2, 958, 957, 3, 2, 2, 2, 958, 959, 517 3, 2, 2, 2, 959, 960, 3, 2, 2, 2, 960, 969, 7, 111, 2, 2, 961, 963, 7, 518 89, 2, 2, 962, 964, 7, 110, 2, 2, 963, 962, 3, 2, 2, 2, 963, 964, 3, 2, 519 2, 2, 964, 965, 3, 2, 2, 2, 965, 966, 7, 51, 2, 2, 966, 967, 7, 69, 2, 520 2, 967, 969, 5, 70, 36, 2, 968, 907, 3, 2, 2, 2, 968, 910, 3, 2, 2, 2, 521 968, 917, 3, 2, 2, 2, 968, 925, 3, 2, 2, 2, 968, 940, 3, 2, 2, 2, 968, 522 948, 3, 2, 2, 2, 968, 956, 3, 2, 2, 2, 968, 961, 3, 2, 2, 2, 969, 69, 3, 523 2, 2, 2, 970, 971, 8, 36, 1, 2, 971, 975, 5, 72, 37, 2, 972, 973, 9, 12, 524 2, 2, 973, 975, 5, 70, 36, 6, 974, 970, 3, 2, 2, 2, 974, 972, 3, 2, 2, 525 2, 975, 990, 3, 2, 2, 2, 976, 977, 12, 5, 2, 2, 977, 978, 9, 13, 2, 2, 526 978, 989, 5, 70, 36, 6, 979, 980, 12, 4, 2, 2, 980, 981, 9, 12, 2, 2, 981, 527 989, 5, 70, 36, 5, 982, 983, 12, 3, 2, 2, 983, 984, 7, 201, 2, 2, 984, 528 989, 5, 70, 36, 4, 985, 986, 12, 7, 2, 2, 986, 987, 7, 21, 2, 2, 987, 989, 529 5, 76, 39, 2, 988, 976, 3, 2, 2, 2, 988, 979, 3, 2, 2, 2, 988, 982, 3, 530 2, 2, 2, 988, 985, 3, 2, 2, 2, 989, 992, 3, 2, 2, 2, 990, 988, 3, 2, 2, 531 2, 990, 991, 3, 2, 2, 2, 991, 71, 3, 2, 2, 2, 992, 990, 3, 2, 2, 2, 993, 532 994, 8, 37, 1, 2, 994, 1224, 7, 111, 2, 2, 995, 1224, 5, 84, 43, 2, 996, 533 997, 5, 108, 55, 2, 997, 998, 5, 74, 38, 2, 998, 1224, 3, 2, 2, 2, 999, 534 1000, 7, 214, 2, 2, 1000, 1224, 5, 74, 38, 2, 1001, 1224, 5, 110, 56, 2, 535 1002, 1224, 5, 82, 42, 2, 1003, 1224, 5, 74, 38, 2, 1004, 1224, 7, 204, 536 2, 2, 1005, 1224, 7, 7, 2, 2, 1006, 1007, 7, 125, 2, 2, 1007, 1008, 7, 537 4, 2, 2, 1008, 1009, 5, 70, 36, 2, 1009, 1010, 7, 80, 2, 2, 1010, 1011, 538 5, 70, 36, 2, 1011, 1012, 7, 5, 2, 2, 1012, 1224, 3, 2, 2, 2, 1013, 1014, 539 7, 4, 2, 2, 1014, 1017, 5, 62, 32, 2, 1015, 1016, 7, 6, 2, 2, 1016, 1018, 540 5, 62, 32, 2, 1017, 1015, 3, 2, 2, 2, 1018, 1019, 3, 2, 2, 2, 1019, 1017, 541 3, 2, 2, 2, 1019, 1020, 3, 2, 2, 2, 1020, 1021, 3, 2, 2, 2, 1021, 1022, 542 7, 5, 2, 2, 1022, 1224, 3, 2, 2, 2, 1023, 1024, 7, 143, 2, 2, 1024, 1025, 543 7, 4, 2, 2, 1025, 1030, 5, 62, 32, 2, 1026, 1027, 7, 6, 2, 2, 1027, 1029, 544 5, 62, 32, 2, 1028, 1026, 3, 2, 2, 2, 1029, 1032, 3, 2, 2, 2, 1030, 1028, 545 3, 2, 2, 2, 1030, 1031, 3, 2, 2, 2, 1031, 1033, 3, 2, 2, 2, 1032, 1030, 546 3, 2, 2, 2, 1033, 1034, 7, 5, 2, 2, 1034, 1224, 3, 2, 2, 2, 1035, 1036, 547 5, 106, 54, 2, 1036, 1037, 7, 4, 2, 2, 1037, 1038, 7, 198, 2, 2, 1038, 548 1040, 7, 5, 2, 2, 1039, 1041, 5, 98, 50, 2, 1040, 1039, 3, 2, 2, 2, 1040, 549 1041, 3, 2, 2, 2, 1041, 1224, 3, 2, 2, 2, 1042, 1043, 5, 106, 54, 2, 1043, 550 1055, 7, 4, 2, 2, 1044, 1046, 5, 42, 22, 2, 1045, 1044, 3, 2, 2, 2, 1045, 551 1046, 3, 2, 2, 2, 1046, 1047, 3, 2, 2, 2, 1047, 1052, 5, 62, 32, 2, 1048, 552 1049, 7, 6, 2, 2, 1049, 1051, 5, 62, 32, 2, 1050, 1048, 3, 2, 2, 2, 1051, 553 1054, 3, 2, 2, 2, 1052, 1050, 3, 2, 2, 2, 1052, 1053, 3, 2, 2, 2, 1053, 554 1056, 3, 2, 2, 2, 1054, 1052, 3, 2, 2, 2, 1055, 1045, 3, 2, 2, 2, 1055, 555 1056, 3, 2, 2, 2, 1056, 1067, 3, 2, 2, 2, 1057, 1058, 7, 118, 2, 2, 1058, 556 1059, 7, 24, 2, 2, 1059, 1064, 5, 28, 15, 2, 1060, 1061, 7, 6, 2, 2, 1061, 557 1063, 5, 28, 15, 2, 1062, 1060, 3, 2, 2, 2, 1063, 1066, 3, 2, 2, 2, 1064, 558 1062, 3, 2, 2, 2, 1064, 1065, 3, 2, 2, 2, 1065, 1068, 3, 2, 2, 2, 1066, 559 1064, 3, 2, 2, 2, 1067, 1057, 3, 2, 2, 2, 1067, 1068, 3, 2, 2, 2, 1068, 560 1069, 3, 2, 2, 2, 1069, 1071, 7, 5, 2, 2, 1070, 1072, 5, 98, 50, 2, 1071, 561 1070, 3, 2, 2, 2, 1071, 1072, 3, 2, 2, 2, 1072, 1224, 3, 2, 2, 2, 1073, 562 1074, 5, 108, 55, 2, 1074, 1075, 7, 8, 2, 2, 1075, 1076, 5, 62, 32, 2, 563 1076, 1224, 3, 2, 2, 2, 1077, 1086, 7, 4, 2, 2, 1078, 1083, 5, 108, 55, 564 2, 1079, 1080, 7, 6, 2, 2, 1080, 1082, 5, 108, 55, 2, 1081, 1079, 3, 2, 565 2, 2, 1082, 1085, 3, 2, 2, 2, 1083, 1081, 3, 2, 2, 2, 1083, 1084, 3, 2, 566 2, 2, 1084, 1087, 3, 2, 2, 2, 1085, 1083, 3, 2, 2, 2, 1086, 1078, 3, 2, 567 2, 2, 1086, 1087, 3, 2, 2, 2, 1087, 1088, 3, 2, 2, 2, 1088, 1089, 7, 5, 568 2, 2, 1089, 1090, 7, 8, 2, 2, 1090, 1224, 5, 62, 32, 2, 1091, 1092, 7, 569 4, 2, 2, 1092, 1093, 5, 8, 5, 2, 1093, 1094, 7, 5, 2, 2, 1094, 1224, 3, 570 2, 2, 2, 1095, 1096, 7, 60, 2, 2, 1096, 1097, 7, 4, 2, 2, 1097, 1098, 5, 571 8, 5, 2, 1098, 1099, 7, 5, 2, 2, 1099, 1224, 3, 2, 2, 2, 1100, 1101, 7, 572 27, 2, 2, 1101, 1103, 5, 70, 36, 2, 1102, 1104, 5, 96, 49, 2, 1103, 1102, 573 3, 2, 2, 2, 1104, 1105, 3, 2, 2, 2, 1105, 1103, 3, 2, 2, 2, 1105, 1106, 574 3, 2, 2, 2, 1106, 1109, 3, 2, 2, 2, 1107, 1108, 7, 54, 2, 2, 1108, 1110, 575 5, 62, 32, 2, 1109, 1107, 3, 2, 2, 2, 1109, 1110, 3, 2, 2, 2, 1110, 1111, 576 3, 2, 2, 2, 1111, 1112, 7, 55, 2, 2, 1112, 1224, 3, 2, 2, 2, 1113, 1115, 577 7, 27, 2, 2, 1114, 1116, 5, 96, 49, 2, 1115, 1114, 3, 2, 2, 2, 1116, 1117, 578 3, 2, 2, 2, 1117, 1115, 3, 2, 2, 2, 1117, 1118, 3, 2, 2, 2, 1118, 1121, 579 3, 2, 2, 2, 1119, 1120, 7, 54, 2, 2, 1120, 1122, 5, 62, 32, 2, 1121, 1119, 580 3, 2, 2, 2, 1121, 1122, 3, 2, 2, 2, 1122, 1123, 3, 2, 2, 2, 1123, 1124, 581 7, 55, 2, 2, 1124, 1224, 3, 2, 2, 2, 1125, 1126, 7, 28, 2, 2, 1126, 1127, 582 7, 4, 2, 2, 1127, 1128, 5, 62, 32, 2, 1128, 1129, 7, 19, 2, 2, 1129, 1130, 583 5, 90, 46, 2, 1130, 1131, 7, 5, 2, 2, 1131, 1224, 3, 2, 2, 2, 1132, 1133, 584 7, 170, 2, 2, 1133, 1134, 7, 4, 2, 2, 1134, 1135, 5, 62, 32, 2, 1135, 1136, 585 7, 19, 2, 2, 1136, 1137, 5, 90, 46, 2, 1137, 1138, 7, 5, 2, 2, 1138, 1224, 586 3, 2, 2, 2, 1139, 1140, 7, 18, 2, 2, 1140, 1149, 7, 9, 2, 2, 1141, 1146, 587 5, 62, 32, 2, 1142, 1143, 7, 6, 2, 2, 1143, 1145, 5, 62, 32, 2, 1144, 1142, 588 3, 2, 2, 2, 1145, 1148, 3, 2, 2, 2, 1146, 1144, 3, 2, 2, 2, 1146, 1147, 589 3, 2, 2, 2, 1147, 1150, 3, 2, 2, 2, 1148, 1146, 3, 2, 2, 2, 1149, 1141, 590 3, 2, 2, 2, 1149, 1150, 3, 2, 2, 2, 1150, 1151, 3, 2, 2, 2, 1151, 1224, 591 7, 10, 2, 2, 1152, 1224, 5, 108, 55, 2, 1153, 1224, 7, 40, 2, 2, 1154, 592 1158, 7, 41, 2, 2, 1155, 1156, 7, 4, 2, 2, 1156, 1157, 7, 205, 2, 2, 1157, 593 1159, 7, 5, 2, 2, 1158, 1155, 3, 2, 2, 2, 1158, 1159, 3, 2, 2, 2, 1159, 594 1224, 3, 2, 2, 2, 1160, 1164, 7, 42, 2, 2, 1161, 1162, 7, 4, 2, 2, 1162, 595 1163, 7, 205, 2, 2, 1163, 1165, 7, 5, 2, 2, 1164, 1161, 3, 2, 2, 2, 1164, 596 1165, 3, 2, 2, 2, 1165, 1224, 3, 2, 2, 2, 1166, 1170, 7, 97, 2, 2, 1167, 597 1168, 7, 4, 2, 2, 1168, 1169, 7, 205, 2, 2, 1169, 1171, 7, 5, 2, 2, 1170, 598 1167, 3, 2, 2, 2, 1170, 1171, 3, 2, 2, 2, 1171, 1224, 3, 2, 2, 2, 1172, 599 1176, 7, 98, 2, 2, 1173, 1174, 7, 4, 2, 2, 1174, 1175, 7, 205, 2, 2, 1175, 600 1177, 7, 5, 2, 2, 1176, 1173, 3, 2, 2, 2, 1176, 1177, 3, 2, 2, 2, 1177, 601 1224, 3, 2, 2, 2, 1178, 1224, 7, 43, 2, 2, 1179, 1180, 7, 158, 2, 2, 1180, 602 1181, 7, 4, 2, 2, 1181, 1182, 5, 70, 36, 2, 1182, 1183, 7, 69, 2, 2, 1183, 603 1186, 5, 70, 36, 2, 1184, 1185, 7, 67, 2, 2, 1185, 1187, 5, 70, 36, 2, 604 1186, 1184, 3, 2, 2, 2, 1186, 1187, 3, 2, 2, 2, 1187, 1188, 3, 2, 2, 2, 605 1188, 1189, 7, 5, 2, 2, 1189, 1224, 3, 2, 2, 2, 1190, 1191, 7, 109, 2, 606 2, 1191, 1192, 7, 4, 2, 2, 1192, 1195, 5, 70, 36, 2, 1193, 1194, 7, 6, 607 2, 2, 1194, 1196, 5, 88, 45, 2, 1195, 1193, 3, 2, 2, 2, 1195, 1196, 3, 608 2, 2, 2, 1196, 1197, 3, 2, 2, 2, 1197, 1198, 7, 5, 2, 2, 1198, 1224, 3, 609 2, 2, 2, 1199, 1200, 7, 62, 2, 2, 1200, 1201, 7, 4, 2, 2, 1201, 1202, 5, 610 108, 55, 2, 1202, 1203, 7, 69, 2, 2, 1203, 1204, 5, 70, 36, 2, 1204, 1205, 611 7, 5, 2, 2, 1205, 1224, 3, 2, 2, 2, 1206, 1207, 7, 4, 2, 2, 1207, 1208, 612 5, 62, 32, 2, 1208, 1209, 7, 5, 2, 2, 1209, 1224, 3, 2, 2, 2, 1210, 1211, 613 7, 76, 2, 2, 1211, 1220, 7, 4, 2, 2, 1212, 1217, 5, 106, 54, 2, 1213, 1214, 614 7, 6, 2, 2, 1214, 1216, 5, 106, 54, 2, 1215, 1213, 3, 2, 2, 2, 1216, 1219, 615 3, 2, 2, 2, 1217, 1215, 3, 2, 2, 2, 1217, 1218, 3, 2, 2, 2, 1218, 1221, 616 3, 2, 2, 2, 1219, 1217, 3, 2, 2, 2, 1220, 1212, 3, 2, 2, 2, 1220, 1221, 617 3, 2, 2, 2, 1221, 1222, 3, 2, 2, 2, 1222, 1224, 7, 5, 2, 2, 1223, 993, 618 3, 2, 2, 2, 1223, 995, 3, 2, 2, 2, 1223, 996, 3, 2, 2, 2, 1223, 999, 3, 619 2, 2, 2, 1223, 1001, 3, 2, 2, 2, 1223, 1002, 3, 2, 2, 2, 1223, 1003, 3, 620 2, 2, 2, 1223, 1004, 3, 2, 2, 2, 1223, 1005, 3, 2, 2, 2, 1223, 1006, 3, 621 2, 2, 2, 1223, 1013, 3, 2, 2, 2, 1223, 1023, 3, 2, 2, 2, 1223, 1035, 3, 622 2, 2, 2, 1223, 1042, 3, 2, 2, 2, 1223, 1073, 3, 2, 2, 2, 1223, 1077, 3, 623 2, 2, 2, 1223, 1091, 3, 2, 2, 2, 1223, 1095, 3, 2, 2, 2, 1223, 1100, 3, 624 2, 2, 2, 1223, 1113, 3, 2, 2, 2, 1223, 1125, 3, 2, 2, 2, 1223, 1132, 3, 625 2, 2, 2, 1223, 1139, 3, 2, 2, 2, 1223, 1152, 3, 2, 2, 2, 1223, 1153, 3, 626 2, 2, 2, 1223, 1154, 3, 2, 2, 2, 1223, 1160, 3, 2, 2, 2, 1223, 1166, 3, 627 2, 2, 2, 1223, 1172, 3, 2, 2, 2, 1223, 1178, 3, 2, 2, 2, 1223, 1179, 3, 628 2, 2, 2, 1223, 1190, 3, 2, 2, 2, 1223, 1199, 3, 2, 2, 2, 1223, 1206, 3, 629 2, 2, 2, 1223, 1210, 3, 2, 2, 2, 1224, 1235, 3, 2, 2, 2, 1225, 1226, 12, 630 16, 2, 2, 1226, 1227, 7, 9, 2, 2, 1227, 1228, 5, 70, 36, 2, 1228, 1229, 631 7, 10, 2, 2, 1229, 1234, 3, 2, 2, 2, 1230, 1231, 12, 14, 2, 2, 1231, 1232, 632 7, 3, 2, 2, 1232, 1234, 5, 108, 55, 2, 1233, 1225, 3, 2, 2, 2, 1233, 1230, 633 3, 2, 2, 2, 1234, 1237, 3, 2, 2, 2, 1235, 1233, 3, 2, 2, 2, 1235, 1236, 634 3, 2, 2, 2, 1236, 73, 3, 2, 2, 2, 1237, 1235, 3, 2, 2, 2, 1238, 1245, 7, 635 202, 2, 2, 1239, 1242, 7, 203, 2, 2, 1240, 1241, 7, 172, 2, 2, 1241, 1243, 636 7, 202, 2, 2, 1242, 1240, 3, 2, 2, 2, 1242, 1243, 3, 2, 2, 2, 1243, 1245, 637 3, 2, 2, 2, 1244, 1238, 3, 2, 2, 2, 1244, 1239, 3, 2, 2, 2, 1245, 75, 3, 638 2, 2, 2, 1246, 1247, 7, 165, 2, 2, 1247, 1248, 7, 189, 2, 2, 1248, 1253, 639 5, 84, 43, 2, 1249, 1250, 7, 165, 2, 2, 1250, 1251, 7, 189, 2, 2, 1251, 640 1253, 5, 74, 38, 2, 1252, 1246, 3, 2, 2, 2, 1252, 1249, 3, 2, 2, 2, 1253, 641 77, 3, 2, 2, 2, 1254, 1255, 9, 14, 2, 2, 1255, 79, 3, 2, 2, 2, 1256, 1257, 642 9, 15, 2, 2, 1257, 81, 3, 2, 2, 2, 1258, 1259, 9, 16, 2, 2, 1259, 83, 3, 643 2, 2, 2, 1260, 1262, 7, 87, 2, 2, 1261, 1263, 9, 12, 2, 2, 1262, 1261, 644 3, 2, 2, 2, 1262, 1263, 3, 2, 2, 2, 1263, 1264, 3, 2, 2, 2, 1264, 1265, 645 5, 74, 38, 2, 1265, 1268, 5, 86, 44, 2, 1266, 1267, 7, 168, 2, 2, 1267, 646 1269, 5, 86, 44, 2, 1268, 1266, 3, 2, 2, 2, 1268, 1269, 3, 2, 2, 2, 1269, 647 85, 3, 2, 2, 2, 1270, 1271, 9, 17, 2, 2, 1271, 87, 3, 2, 2, 2, 1272, 1273, 648 9, 18, 2, 2, 1273, 89, 3, 2, 2, 2, 1274, 1275, 8, 46, 1, 2, 1275, 1276, 649 7, 18, 2, 2, 1276, 1277, 7, 192, 2, 2, 1277, 1278, 5, 90, 46, 2, 1278, 650 1279, 7, 194, 2, 2, 1279, 1322, 3, 2, 2, 2, 1280, 1281, 7, 100, 2, 2, 1281, 651 1282, 7, 192, 2, 2, 1282, 1283, 5, 90, 46, 2, 1283, 1284, 7, 6, 2, 2, 1284, 652 1285, 5, 90, 46, 2, 1285, 1286, 7, 194, 2, 2, 1286, 1322, 3, 2, 2, 2, 1287, 653 1288, 7, 143, 2, 2, 1288, 1289, 7, 4, 2, 2, 1289, 1290, 5, 108, 55, 2, 654 1290, 1297, 5, 90, 46, 2, 1291, 1292, 7, 6, 2, 2, 1292, 1293, 5, 108, 55, 655 2, 1293, 1294, 5, 90, 46, 2, 1294, 1296, 3, 2, 2, 2, 1295, 1291, 3, 2, 656 2, 2, 1296, 1299, 3, 2, 2, 2, 1297, 1295, 3, 2, 2, 2, 1297, 1298, 3, 2, 657 2, 2, 1298, 1300, 3, 2, 2, 2, 1299, 1297, 3, 2, 2, 2, 1300, 1301, 7, 5, 658 2, 2, 1301, 1322, 3, 2, 2, 2, 1302, 1314, 5, 94, 48, 2, 1303, 1304, 7, 659 4, 2, 2, 1304, 1309, 5, 92, 47, 2, 1305, 1306, 7, 6, 2, 2, 1306, 1308, 660 5, 92, 47, 2, 1307, 1305, 3, 2, 2, 2, 1308, 1311, 3, 2, 2, 2, 1309, 1307, 661 3, 2, 2, 2, 1309, 1310, 3, 2, 2, 2, 1310, 1312, 3, 2, 2, 2, 1311, 1309, 662 3, 2, 2, 2, 1312, 1313, 7, 5, 2, 2, 1313, 1315, 3, 2, 2, 2, 1314, 1303, 663 3, 2, 2, 2, 1314, 1315, 3, 2, 2, 2, 1315, 1322, 3, 2, 2, 2, 1316, 1317, 664 7, 87, 2, 2, 1317, 1318, 5, 86, 44, 2, 1318, 1319, 7, 168, 2, 2, 1319, 665 1320, 5, 86, 44, 2, 1320, 1322, 3, 2, 2, 2, 1321, 1274, 3, 2, 2, 2, 1321, 666 1280, 3, 2, 2, 2, 1321, 1287, 3, 2, 2, 2, 1321, 1302, 3, 2, 2, 2, 1321, 667 1316, 3, 2, 2, 2, 1322, 1327, 3, 2, 2, 2, 1323, 1324, 12, 8, 2, 2, 1324, 668 1326, 7, 18, 2, 2, 1325, 1323, 3, 2, 2, 2, 1326, 1329, 3, 2, 2, 2, 1327, 669 1325, 3, 2, 2, 2, 1327, 1328, 3, 2, 2, 2, 1328, 91, 3, 2, 2, 2, 1329, 1327, 670 3, 2, 2, 2, 1330, 1333, 7, 205, 2, 2, 1331, 1333, 5, 90, 46, 2, 1332, 1330, 671 3, 2, 2, 2, 1332, 1331, 3, 2, 2, 2, 1333, 93, 3, 2, 2, 2, 1334, 1339, 7, 672 212, 2, 2, 1335, 1339, 7, 213, 2, 2, 1336, 1339, 7, 214, 2, 2, 1337, 1339, 673 5, 108, 55, 2, 1338, 1334, 3, 2, 2, 2, 1338, 1335, 3, 2, 2, 2, 1338, 1336, 674 3, 2, 2, 2, 1338, 1337, 3, 2, 2, 2, 1339, 95, 3, 2, 2, 2, 1340, 1341, 7, 675 183, 2, 2, 1341, 1342, 5, 62, 32, 2, 1342, 1343, 7, 164, 2, 2, 1343, 1344, 676 5, 62, 32, 2, 1344, 97, 3, 2, 2, 2, 1345, 1346, 7, 64, 2, 2, 1346, 1347, 677 7, 4, 2, 2, 1347, 1348, 7, 184, 2, 2, 1348, 1349, 5, 64, 33, 2, 1349, 1350, 678 7, 5, 2, 2, 1350, 99, 3, 2, 2, 2, 1351, 1352, 7, 68, 2, 2, 1352, 1356, 679 9, 19, 2, 2, 1353, 1354, 7, 171, 2, 2, 1354, 1356, 9, 20, 2, 2, 1355, 1351, 680 3, 2, 2, 2, 1355, 1353, 3, 2, 2, 2, 1356, 101, 3, 2, 2, 2, 1357, 1363, 681 5, 62, 32, 2, 1358, 1359, 5, 108, 55, 2, 1359, 1360, 7, 11, 2, 2, 1360, 682 1361, 5, 62, 32, 2, 1361, 1363, 3, 2, 2, 2, 1362, 1357, 3, 2, 2, 2, 1362, 683 1358, 3, 2, 2, 2, 1363, 103, 3, 2, 2, 2, 1364, 1369, 7, 148, 2, 2, 1365, 684 1369, 7, 48, 2, 2, 1366, 1369, 7, 84, 2, 2, 1367, 1369, 5, 108, 55, 2, 685 1368, 1364, 3, 2, 2, 2, 1368, 1365, 3, 2, 2, 2, 1368, 1366, 3, 2, 2, 2, 686 1368, 1367, 3, 2, 2, 2, 1369, 105, 3, 2, 2, 2, 1370, 1375, 5, 108, 55, 687 2, 1371, 1372, 7, 3, 2, 2, 1372, 1374, 5, 108, 55, 2, 1373, 1371, 3, 2, 688 2, 2, 1374, 1377, 3, 2, 2, 2, 1375, 1373, 3, 2, 2, 2, 1375, 1376, 3, 2, 689 2, 2, 1376, 107, 3, 2, 2, 2, 1377, 1375, 3, 2, 2, 2, 1378, 1384, 7, 208, 690 2, 2, 1379, 1384, 7, 210, 2, 2, 1380, 1384, 5, 112, 57, 2, 1381, 1384, 691 7, 211, 2, 2, 1382, 1384, 7, 209, 2, 2, 1383, 1378, 3, 2, 2, 2, 1383, 1379, 692 3, 2, 2, 2, 1383, 1380, 3, 2, 2, 2, 1383, 1381, 3, 2, 2, 2, 1383, 1382, 693 3, 2, 2, 2, 1384, 109, 3, 2, 2, 2, 1385, 1389, 7, 206, 2, 2, 1386, 1389, 694 7, 207, 2, 2, 1387, 1389, 7, 205, 2, 2, 1388, 1385, 3, 2, 2, 2, 1388, 1386, 695 3, 2, 2, 2, 1388, 1387, 3, 2, 2, 2, 1389, 111, 3, 2, 2, 2, 1390, 1391, 696 9, 21, 2, 2, 1391, 113, 3, 2, 2, 2, 174, 133, 138, 144, 148, 162, 166, 697 170, 174, 182, 186, 189, 196, 205, 211, 215, 221, 228, 237, 272, 283, 294, 698 297, 307, 312, 316, 324, 330, 337, 342, 346, 356, 359, 363, 366, 374, 379, 699 394, 400, 402, 408, 414, 416, 422, 462, 471, 474, 478, 496, 499, 507, 510, 700 516, 523, 528, 534, 540, 548, 565, 568, 572, 580, 586, 589, 591, 603, 610, 701 614, 618, 622, 629, 638, 641, 645, 650, 654, 657, 664, 675, 678, 688, 691, 702 702, 707, 715, 718, 722, 730, 733, 737, 741, 752, 755, 762, 781, 785, 789, 703 793, 797, 801, 803, 814, 819, 828, 834, 838, 840, 848, 865, 871, 882, 890, 704 898, 900, 905, 917, 925, 934, 940, 948, 954, 958, 963, 968, 974, 988, 990, 705 1019, 1030, 1040, 1045, 1052, 1055, 1064, 1067, 1071, 1083, 1086, 1105, 706 1109, 1117, 1121, 1146, 1149, 1158, 1164, 1170, 1176, 1186, 1195, 1217, 707 1220, 1223, 1233, 1235, 1242, 1244, 1252, 1262, 1268, 1297, 1309, 1314, 708 1321, 1327, 1332, 1338, 1355, 1362, 1368, 1375, 1383, 1388, 709 } 710 var deserializer = antlr.NewATNDeserializer(nil) 711 var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) 712 713 var literalNames = []string{ 714 "", "'.'", "'('", "')'", "','", "'?'", "'->'", "'['", "']'", "'=>'", "'ADD'", 715 "'ALL'", "'ALTER'", "'ANALYZE'", "'AND'", "'ANY'", "'ARRAY'", "'AS'", "'ASC'", 716 "'AT'", "'BERNOULLI'", "'BETWEEN'", "'BY'", "'CALL'", "'CASCADE'", "'CASE'", 717 "'CAST'", "'CATALOGS'", "'COALESCE'", "'COLUMN'", "'COLUMNS'", "'COMMENT'", 718 "'COMMITTED'", "'CONSTRAINT'", "'CREATE'", "'CROSS'", "'CUBE'", "'CURRENT'", 719 "'CURRENT_DATE'", "'CURRENT_TIME'", "'CURRENT_TIMESTAMP'", "'CURRENT_USER'", 720 "'DATA'", "'DATE'", "'DAY'", "'DEALLOCATE'", "'DELETE'", "'DESC'", "'DESCRIBE'", 721 "'DISTINCT'", "'DISTRIBUTED'", "'DROP'", "'ELSE'", "'END'", "'ESCAPE'", 722 "'EXCEPT'", "'EXCLUDING'", "'EXECUTE'", "'EXISTS'", "'EXPLAIN'", "'EXTRACT'", 723 "'FALSE'", "'FILTER'", "'FIRST'", "'FOLLOWING'", "'FOR'", "'FORMAT'", "'FROM'", 724 "'FULL'", "'FUNCTIONS'", "'GRANT'", "'GRANTS'", "'GRAPHVIZ'", "'GROUP'", 725 "'GROUPING'", "'HAVING'", "'HOUR'", "'IF'", "'IN'", "'INCLUDING'", "'INNER'", 726 "'INPUT'", "'INSERT'", "'INTEGER'", "'INTERSECT'", "'INTERVAL'", "'INTO'", 727 "'IS'", "'JOIN'", "'LAST'", "'LATERAL'", "'LEFT'", "'LEVEL'", "'LIKE'", 728 "'LIMIT'", "'LOCALTIME'", "'LOCALTIMESTAMP'", "'LOGICAL'", "'MAP'", "'MINUTE'", 729 "'MONTH'", "'NATURAL'", "'NFC'", "'NFD'", "'NFKC'", "'NFKD'", "'NO'", "'NORMALIZE'", 730 "'NOT'", "'NULL'", "'NULLIF'", "'NULLS'", "'ON'", "'ONLY'", "'OPTION'", 731 "'OR'", "'ORDER'", "'ORDINALITY'", "'OUTER'", "'OUTPUT'", "'OVER'", "'PARTITION'", 732 "'PARTITIONS'", "'POSITION'", "'PRECEDING'", "'PREPARE'", "'PRIVILEGES'", 733 "'PROPERTIES'", "'PUBLIC'", "'RANGE'", "'READ'", "'RECURSIVE'", "'RENAME'", 734 "'REPEATABLE'", "'REPLACE'", "'RESET'", "'RESTRICT'", "'REVOKE'", "'RIGHT'", 735 "'ROLLBACK'", "'ROLLUP'", "'ROW'", "'ROWS'", "'SCHEMA'", "'SCHEMAS'", "'SECOND'", 736 "'SELECT'", "'SERIALIZABLE'", "'SESSION'", "'SET'", "'SETS'", "'SHOW'", 737 "'SMALLINT'", "'SOME'", "'START'", "'STATS'", "'SUBSTRING'", "'SYSTEM'", 738 "'TABLE'", "'TABLES'", "'TABLESAMPLE'", "'TEXT'", "'THEN'", "'TIME'", "'TIMESTAMP'", 739 "'TINYINT'", "'TO'", "'TRUE'", "'TRY_CAST'", "'TYPE'", "'UESCAPE'", "'UNBOUNDED'", 740 "'UNCOMMITTED'", "'UNION'", "'UNNEST'", "'USE'", "'USING'", "'VALIDATE'", 741 "'VALUES'", "'VERBOSE'", "'VIEW'", "'WHEN'", "'WHERE'", "'WITH'", "'WORK'", 742 "'WRITE'", "'YEAR'", "'ZONE'", "'='", "", "'<'", "'<='", "'>'", "'>='", 743 "'+'", "'-'", "'*'", "'/'", "'%'", "'||'", 744 } 745 var symbolicNames = []string{ 746 "", "", "", "", "", "", "", "", "", "", "ADD", "ALL", "ALTER", "ANALYZE", 747 "AND", "ANY", "ARRAY", "AS", "ASC", "AT", "BERNOULLI", "BETWEEN", "BY", 748 "CALL", "CASCADE", "CASE", "CAST", "CATALOGS", "COALESCE", "COLUMN", "COLUMNS", 749 "COMMENT", "COMMITTED", "CONSTRAINT", "CREATE", "CROSS", "CUBE", "CURRENT", 750 "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", "DATA", 751 "DATE", "DAY", "DEALLOCATE", "DELETE", "DESC", "DESCRIBE", "DISTINCT", 752 "DISTRIBUTED", "DROP", "ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUDING", 753 "EXECUTE", "EXISTS", "EXPLAIN", "EXTRACT", "FALSE", "FILTER", "FIRST", 754 "FOLLOWING", "FOR", "FORMAT", "FROM", "FULL", "FUNCTIONS", "GRANT", "GRANTS", 755 "GRAPHVIZ", "GROUP", "GROUPING", "HAVING", "HOUR", "IF", "IN", "INCLUDING", 756 "INNER", "INPUT", "INSERT", "INTEGER", "INTERSECT", "INTERVAL", "INTO", 757 "IS", "JOIN", "LAST", "LATERAL", "LEFT", "LEVEL", "LIKE", "LIMIT", "LOCALTIME", 758 "LOCALTIMESTAMP", "LOGICAL", "MAP", "MINUTE", "MONTH", "NATURAL", "NFC", 759 "NFD", "NFKC", "NFKD", "NO", "NORMALIZE", "NOT", "NULL", "NULLIF", "NULLS", 760 "ON", "ONLY", "OPTION", "OR", "ORDER", "ORDINALITY", "OUTER", "OUTPUT", 761 "OVER", "PARTITION", "PARTITIONS", "POSITION", "PRECEDING", "PREPARE", 762 "PRIVILEGES", "PROPERTIES", "PUBLIC", "RANGE", "READ", "RECURSIVE", "RENAME", 763 "REPEATABLE", "REPLACE", "RESET", "RESTRICT", "REVOKE", "RIGHT", "ROLLBACK", 764 "ROLLUP", "ROW", "ROWS", "SCHEMA", "SCHEMAS", "SECOND", "SELECT", "SERIALIZABLE", 765 "SESSION", "SET", "SETS", "SHOW", "SMALLINT", "SOME", "START", "STATS", 766 "SUBSTRING", "SYSTEM", "TABLE", "TABLES", "TABLESAMPLE", "TEXT", "THEN", 767 "TIME", "TIMESTAMP", "TINYINT", "TO", "TRUE", "TRY_CAST", "TYPE", "UESCAPE", 768 "UNBOUNDED", "UNCOMMITTED", "UNION", "UNNEST", "USE", "USING", "VALIDATE", 769 "VALUES", "VERBOSE", "VIEW", "WHEN", "WHERE", "WITH", "WORK", "WRITE", 770 "YEAR", "ZONE", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "PLUS", "MINUS", 771 "ASTERISK", "SLASH", "PERCENT", "CONCAT", "STRING", "UNICODE_STRING", "BINARY_LITERAL", 772 "INTEGER_VALUE", "DECIMAL_VALUE", "DOUBLE_VALUE", "IDENTIFIER", "DIGIT_IDENTIFIER", 773 "QUOTED_IDENTIFIER", "BACKQUOTED_IDENTIFIER", "TIME_WITH_TIME_ZONE", "TIMESTAMP_WITH_TIME_ZONE", 774 "DOUBLE_PRECISION", "SIMPLE_COMMENT", "BRACKETED_COMMENT", "WS", "UNRECOGNIZED", 775 "DELIMITER", "COMMIT", "ISOLATION", "TRANSACTION", 776 } 777 778 var ruleNames = []string{ 779 "singleStatement", "singleExpression", "statement", "query", "with", "tableElement", 780 "columnDefinition", "likeClause", "properties", "property", "queryNoWith", 781 "queryTerm", "queryPrimary", "sortItem", "querySpecification", "groupBy", 782 "groupingElement", "groupingExpressions", "groupingSet", "namedQuery", 783 "setQuantifier", "selectItem", "relation", "joinType", "joinCriteria", 784 "sampledRelation", "sampleType", "aliasedRelation", "columnAliases", "relationPrimary", 785 "expression", "booleanExpression", "predicated", "predicate", "valueExpression", 786 "primaryExpression", "sql_string", "timeZoneSpecifier", "comparisonOperator", 787 "comparisonQuantifier", "booleanValue", "interval", "intervalField", "normalForm", 788 "sqltype", "typeParameter", "baseType", "whenClause", "filter", "explainOption", 789 "callArgument", "privilege", "qualifiedName", "identifier", "number", "nonReserved", 790 } 791 var decisionToDFA = make([]*antlr.DFA, len(deserializedATN.DecisionToState)) 792 793 func init() { 794 for index, ds := range deserializedATN.DecisionToState { 795 decisionToDFA[index] = antlr.NewDFA(ds, index) 796 } 797 } 798 799 type SqlBaseParser struct { 800 *antlr.BaseParser 801 } 802 803 func NewSqlBaseParser(input antlr.TokenStream) *SqlBaseParser { 804 this := new(SqlBaseParser) 805 806 this.BaseParser = antlr.NewBaseParser(input) 807 808 this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) 809 this.RuleNames = ruleNames 810 this.LiteralNames = literalNames 811 this.SymbolicNames = symbolicNames 812 this.GrammarFileName = "SqlBase.g4" 813 814 return this 815 } 816 817 // SqlBaseParser tokens. 818 const ( 819 SqlBaseParserEOF = antlr.TokenEOF 820 SqlBaseParserT__0 = 1 821 SqlBaseParserT__1 = 2 822 SqlBaseParserT__2 = 3 823 SqlBaseParserT__3 = 4 824 SqlBaseParserT__4 = 5 825 SqlBaseParserT__5 = 6 826 SqlBaseParserT__6 = 7 827 SqlBaseParserT__7 = 8 828 SqlBaseParserT__8 = 9 829 SqlBaseParserADD = 10 830 SqlBaseParserALL = 11 831 SqlBaseParserALTER = 12 832 SqlBaseParserANALYZE = 13 833 SqlBaseParserAND = 14 834 SqlBaseParserANY = 15 835 SqlBaseParserARRAY = 16 836 SqlBaseParserAS = 17 837 SqlBaseParserASC = 18 838 SqlBaseParserAT = 19 839 SqlBaseParserBERNOULLI = 20 840 SqlBaseParserBETWEEN = 21 841 SqlBaseParserBY = 22 842 SqlBaseParserCALL = 23 843 SqlBaseParserCASCADE = 24 844 SqlBaseParserCASE = 25 845 SqlBaseParserCAST = 26 846 SqlBaseParserCATALOGS = 27 847 SqlBaseParserCOALESCE = 28 848 SqlBaseParserCOLUMN = 29 849 SqlBaseParserCOLUMNS = 30 850 SqlBaseParserCOMMENT = 31 851 SqlBaseParserCOMMITTED = 32 852 SqlBaseParserCONSTRAINT = 33 853 SqlBaseParserCREATE = 34 854 SqlBaseParserCROSS = 35 855 SqlBaseParserCUBE = 36 856 SqlBaseParserCURRENT = 37 857 SqlBaseParserCURRENT_DATE = 38 858 SqlBaseParserCURRENT_TIME = 39 859 SqlBaseParserCURRENT_TIMESTAMP = 40 860 SqlBaseParserCURRENT_USER = 41 861 SqlBaseParserDATA = 42 862 SqlBaseParserDATE = 43 863 SqlBaseParserDAY = 44 864 SqlBaseParserDEALLOCATE = 45 865 SqlBaseParserDELETE = 46 866 SqlBaseParserDESC = 47 867 SqlBaseParserDESCRIBE = 48 868 SqlBaseParserDISTINCT = 49 869 SqlBaseParserDISTRIBUTED = 50 870 SqlBaseParserDROP = 51 871 SqlBaseParserELSE = 52 872 SqlBaseParserEND = 53 873 SqlBaseParserESCAPE = 54 874 SqlBaseParserEXCEPT = 55 875 SqlBaseParserEXCLUDING = 56 876 SqlBaseParserEXECUTE = 57 877 SqlBaseParserEXISTS = 58 878 SqlBaseParserEXPLAIN = 59 879 SqlBaseParserEXTRACT = 60 880 SqlBaseParserFALSE = 61 881 SqlBaseParserFILTER = 62 882 SqlBaseParserFIRST = 63 883 SqlBaseParserFOLLOWING = 64 884 SqlBaseParserFOR = 65 885 SqlBaseParserFORMAT = 66 886 SqlBaseParserFROM = 67 887 SqlBaseParserFULL = 68 888 SqlBaseParserFUNCTIONS = 69 889 SqlBaseParserGRANT = 70 890 SqlBaseParserGRANTS = 71 891 SqlBaseParserGRAPHVIZ = 72 892 SqlBaseParserGROUP = 73 893 SqlBaseParserGROUPING = 74 894 SqlBaseParserHAVING = 75 895 SqlBaseParserHOUR = 76 896 SqlBaseParserIF = 77 897 SqlBaseParserIN = 78 898 SqlBaseParserINCLUDING = 79 899 SqlBaseParserINNER = 80 900 SqlBaseParserINPUT = 81 901 SqlBaseParserINSERT = 82 902 SqlBaseParserINTEGER = 83 903 SqlBaseParserINTERSECT = 84 904 SqlBaseParserINTERVAL = 85 905 SqlBaseParserINTO = 86 906 SqlBaseParserIS = 87 907 SqlBaseParserJOIN = 88 908 SqlBaseParserLAST = 89 909 SqlBaseParserLATERAL = 90 910 SqlBaseParserLEFT = 91 911 SqlBaseParserLEVEL = 92 912 SqlBaseParserLIKE = 93 913 SqlBaseParserLIMIT = 94 914 SqlBaseParserLOCALTIME = 95 915 SqlBaseParserLOCALTIMESTAMP = 96 916 SqlBaseParserLOGICAL = 97 917 SqlBaseParserMAP = 98 918 SqlBaseParserMINUTE = 99 919 SqlBaseParserMONTH = 100 920 SqlBaseParserNATURAL = 101 921 SqlBaseParserNFC = 102 922 SqlBaseParserNFD = 103 923 SqlBaseParserNFKC = 104 924 SqlBaseParserNFKD = 105 925 SqlBaseParserNO = 106 926 SqlBaseParserNORMALIZE = 107 927 SqlBaseParserNOT = 108 928 SqlBaseParserNULL = 109 929 SqlBaseParserNULLIF = 110 930 SqlBaseParserNULLS = 111 931 SqlBaseParserON = 112 932 SqlBaseParserONLY = 113 933 SqlBaseParserOPTION = 114 934 SqlBaseParserOR = 115 935 SqlBaseParserORDER = 116 936 SqlBaseParserORDINALITY = 117 937 SqlBaseParserOUTER = 118 938 SqlBaseParserOUTPUT = 119 939 SqlBaseParserOVER = 120 940 SqlBaseParserPARTITION = 121 941 SqlBaseParserPARTITIONS = 122 942 SqlBaseParserPOSITION = 123 943 SqlBaseParserPRECEDING = 124 944 SqlBaseParserPREPARE = 125 945 SqlBaseParserPRIVILEGES = 126 946 SqlBaseParserPROPERTIES = 127 947 SqlBaseParserPUBLIC = 128 948 SqlBaseParserRANGE = 129 949 SqlBaseParserREAD = 130 950 SqlBaseParserRECURSIVE = 131 951 SqlBaseParserRENAME = 132 952 SqlBaseParserREPEATABLE = 133 953 SqlBaseParserREPLACE = 134 954 SqlBaseParserRESET = 135 955 SqlBaseParserRESTRICT = 136 956 SqlBaseParserREVOKE = 137 957 SqlBaseParserRIGHT = 138 958 SqlBaseParserROLLBACK = 139 959 SqlBaseParserROLLUP = 140 960 SqlBaseParserROW = 141 961 SqlBaseParserROWS = 142 962 SqlBaseParserSCHEMA = 143 963 SqlBaseParserSCHEMAS = 144 964 SqlBaseParserSECOND = 145 965 SqlBaseParserSELECT = 146 966 SqlBaseParserSERIALIZABLE = 147 967 SqlBaseParserSESSION = 148 968 SqlBaseParserSET = 149 969 SqlBaseParserSETS = 150 970 SqlBaseParserSHOW = 151 971 SqlBaseParserSMALLINT = 152 972 SqlBaseParserSOME = 153 973 SqlBaseParserSTART = 154 974 SqlBaseParserSTATS = 155 975 SqlBaseParserSUBSTRING = 156 976 SqlBaseParserSYSTEM = 157 977 SqlBaseParserTABLE = 158 978 SqlBaseParserTABLES = 159 979 SqlBaseParserTABLESAMPLE = 160 980 SqlBaseParserTEXT = 161 981 SqlBaseParserTHEN = 162 982 SqlBaseParserTIME = 163 983 SqlBaseParserTIMESTAMP = 164 984 SqlBaseParserTINYINT = 165 985 SqlBaseParserTO = 166 986 SqlBaseParserTRUE = 167 987 SqlBaseParserTRY_CAST = 168 988 SqlBaseParserTYPE = 169 989 SqlBaseParserUESCAPE = 170 990 SqlBaseParserUNBOUNDED = 171 991 SqlBaseParserUNCOMMITTED = 172 992 SqlBaseParserUNION = 173 993 SqlBaseParserUNNEST = 174 994 SqlBaseParserUSE = 175 995 SqlBaseParserUSING = 176 996 SqlBaseParserVALIDATE = 177 997 SqlBaseParserVALUES = 178 998 SqlBaseParserVERBOSE = 179 999 SqlBaseParserVIEW = 180 1000 SqlBaseParserWHEN = 181 1001 SqlBaseParserWHERE = 182 1002 SqlBaseParserWITH = 183 1003 SqlBaseParserWORK = 184 1004 SqlBaseParserWRITE = 185 1005 SqlBaseParserYEAR = 186 1006 SqlBaseParserZONE = 187 1007 SqlBaseParserEQ = 188 1008 SqlBaseParserNEQ = 189 1009 SqlBaseParserLT = 190 1010 SqlBaseParserLTE = 191 1011 SqlBaseParserGT = 192 1012 SqlBaseParserGTE = 193 1013 SqlBaseParserPLUS = 194 1014 SqlBaseParserMINUS = 195 1015 SqlBaseParserASTERISK = 196 1016 SqlBaseParserSLASH = 197 1017 SqlBaseParserPERCENT = 198 1018 SqlBaseParserCONCAT = 199 1019 SqlBaseParserSTRING = 200 1020 SqlBaseParserUNICODE_STRING = 201 1021 SqlBaseParserBINARY_LITERAL = 202 1022 SqlBaseParserINTEGER_VALUE = 203 1023 SqlBaseParserDECIMAL_VALUE = 204 1024 SqlBaseParserDOUBLE_VALUE = 205 1025 SqlBaseParserIDENTIFIER = 206 1026 SqlBaseParserDIGIT_IDENTIFIER = 207 1027 SqlBaseParserQUOTED_IDENTIFIER = 208 1028 SqlBaseParserBACKQUOTED_IDENTIFIER = 209 1029 SqlBaseParserTIME_WITH_TIME_ZONE = 210 1030 SqlBaseParserTIMESTAMP_WITH_TIME_ZONE = 211 1031 SqlBaseParserDOUBLE_PRECISION = 212 1032 SqlBaseParserSIMPLE_COMMENT = 213 1033 SqlBaseParserBRACKETED_COMMENT = 214 1034 SqlBaseParserWS = 215 1035 SqlBaseParserUNRECOGNIZED = 216 1036 SqlBaseParserDELIMITER = 217 1037 SqlBaseParserCOMMIT = 218 1038 SqlBaseParserISOLATION = 219 1039 SqlBaseParserTRANSACTION = 220 1040 ) 1041 1042 // SqlBaseParser rules. 1043 const ( 1044 SqlBaseParserRULE_singleStatement = 0 1045 SqlBaseParserRULE_singleExpression = 1 1046 SqlBaseParserRULE_statement = 2 1047 SqlBaseParserRULE_query = 3 1048 SqlBaseParserRULE_with = 4 1049 SqlBaseParserRULE_tableElement = 5 1050 SqlBaseParserRULE_columnDefinition = 6 1051 SqlBaseParserRULE_likeClause = 7 1052 SqlBaseParserRULE_properties = 8 1053 SqlBaseParserRULE_property = 9 1054 SqlBaseParserRULE_queryNoWith = 10 1055 SqlBaseParserRULE_queryTerm = 11 1056 SqlBaseParserRULE_queryPrimary = 12 1057 SqlBaseParserRULE_sortItem = 13 1058 SqlBaseParserRULE_querySpecification = 14 1059 SqlBaseParserRULE_groupBy = 15 1060 SqlBaseParserRULE_groupingElement = 16 1061 SqlBaseParserRULE_groupingExpressions = 17 1062 SqlBaseParserRULE_groupingSet = 18 1063 SqlBaseParserRULE_namedQuery = 19 1064 SqlBaseParserRULE_setQuantifier = 20 1065 SqlBaseParserRULE_selectItem = 21 1066 SqlBaseParserRULE_relation = 22 1067 SqlBaseParserRULE_joinType = 23 1068 SqlBaseParserRULE_joinCriteria = 24 1069 SqlBaseParserRULE_sampledRelation = 25 1070 SqlBaseParserRULE_sampleType = 26 1071 SqlBaseParserRULE_aliasedRelation = 27 1072 SqlBaseParserRULE_columnAliases = 28 1073 SqlBaseParserRULE_relationPrimary = 29 1074 SqlBaseParserRULE_expression = 30 1075 SqlBaseParserRULE_booleanExpression = 31 1076 SqlBaseParserRULE_predicated = 32 1077 SqlBaseParserRULE_predicate = 33 1078 SqlBaseParserRULE_valueExpression = 34 1079 SqlBaseParserRULE_primaryExpression = 35 1080 SqlBaseParserRULE_sql_string = 36 1081 SqlBaseParserRULE_timeZoneSpecifier = 37 1082 SqlBaseParserRULE_comparisonOperator = 38 1083 SqlBaseParserRULE_comparisonQuantifier = 39 1084 SqlBaseParserRULE_booleanValue = 40 1085 SqlBaseParserRULE_interval = 41 1086 SqlBaseParserRULE_intervalField = 42 1087 SqlBaseParserRULE_normalForm = 43 1088 SqlBaseParserRULE_sqltype = 44 1089 SqlBaseParserRULE_typeParameter = 45 1090 SqlBaseParserRULE_baseType = 46 1091 SqlBaseParserRULE_whenClause = 47 1092 SqlBaseParserRULE_filter = 48 1093 SqlBaseParserRULE_explainOption = 49 1094 SqlBaseParserRULE_callArgument = 50 1095 SqlBaseParserRULE_privilege = 51 1096 SqlBaseParserRULE_qualifiedName = 52 1097 SqlBaseParserRULE_identifier = 53 1098 SqlBaseParserRULE_number = 54 1099 SqlBaseParserRULE_nonReserved = 55 1100 ) 1101 1102 // ISingleStatementContext is an interface to support dynamic dispatch. 1103 type ISingleStatementContext interface { 1104 antlr.ParserRuleContext 1105 1106 // GetParser returns the parser. 1107 GetParser() antlr.Parser 1108 1109 // IsSingleStatementContext differentiates from other interfaces. 1110 IsSingleStatementContext() 1111 } 1112 1113 type SingleStatementContext struct { 1114 *antlr.BaseParserRuleContext 1115 parser antlr.Parser 1116 } 1117 1118 func NewEmptySingleStatementContext() *SingleStatementContext { 1119 var p = new(SingleStatementContext) 1120 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 1121 p.RuleIndex = SqlBaseParserRULE_singleStatement 1122 return p 1123 } 1124 1125 func (*SingleStatementContext) IsSingleStatementContext() {} 1126 1127 func NewSingleStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SingleStatementContext { 1128 var p = new(SingleStatementContext) 1129 1130 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 1131 1132 p.parser = parser 1133 p.RuleIndex = SqlBaseParserRULE_singleStatement 1134 1135 return p 1136 } 1137 1138 func (s *SingleStatementContext) GetParser() antlr.Parser { return s.parser } 1139 1140 func (s *SingleStatementContext) Statement() IStatementContext { 1141 var t = s.GetTypedRuleContext(reflect.TypeOf((*IStatementContext)(nil)).Elem(), 0) 1142 1143 if t == nil { 1144 return nil 1145 } 1146 1147 return t.(IStatementContext) 1148 } 1149 1150 func (s *SingleStatementContext) EOF() antlr.TerminalNode { 1151 return s.GetToken(SqlBaseParserEOF, 0) 1152 } 1153 1154 func (s *SingleStatementContext) GetRuleContext() antlr.RuleContext { 1155 return s 1156 } 1157 1158 func (s *SingleStatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 1159 return antlr.TreesStringTree(s, ruleNames, recog) 1160 } 1161 1162 func (s *SingleStatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1163 switch t := visitor.(type) { 1164 case SqlBaseVisitor: 1165 return t.VisitSingleStatement(s) 1166 1167 default: 1168 return t.VisitChildren(s) 1169 } 1170 } 1171 1172 func (p *SqlBaseParser) SingleStatement() (localctx ISingleStatementContext) { 1173 localctx = NewSingleStatementContext(p, p.GetParserRuleContext(), p.GetState()) 1174 p.EnterRule(localctx, 0, SqlBaseParserRULE_singleStatement) 1175 1176 defer func() { 1177 p.ExitRule() 1178 }() 1179 1180 defer func() { 1181 if err := recover(); err != nil { 1182 if v, ok := err.(antlr.RecognitionException); ok { 1183 localctx.SetException(v) 1184 p.GetErrorHandler().ReportError(p, v) 1185 p.GetErrorHandler().Recover(p, v) 1186 } else { 1187 panic(err) 1188 } 1189 } 1190 }() 1191 1192 p.EnterOuterAlt(localctx, 1) 1193 { 1194 p.SetState(112) 1195 p.Statement() 1196 } 1197 { 1198 p.SetState(113) 1199 p.Match(SqlBaseParserEOF) 1200 } 1201 1202 return localctx 1203 } 1204 1205 // ISingleExpressionContext is an interface to support dynamic dispatch. 1206 type ISingleExpressionContext interface { 1207 antlr.ParserRuleContext 1208 1209 // GetParser returns the parser. 1210 GetParser() antlr.Parser 1211 1212 // IsSingleExpressionContext differentiates from other interfaces. 1213 IsSingleExpressionContext() 1214 } 1215 1216 type SingleExpressionContext struct { 1217 *antlr.BaseParserRuleContext 1218 parser antlr.Parser 1219 } 1220 1221 func NewEmptySingleExpressionContext() *SingleExpressionContext { 1222 var p = new(SingleExpressionContext) 1223 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 1224 p.RuleIndex = SqlBaseParserRULE_singleExpression 1225 return p 1226 } 1227 1228 func (*SingleExpressionContext) IsSingleExpressionContext() {} 1229 1230 func NewSingleExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SingleExpressionContext { 1231 var p = new(SingleExpressionContext) 1232 1233 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 1234 1235 p.parser = parser 1236 p.RuleIndex = SqlBaseParserRULE_singleExpression 1237 1238 return p 1239 } 1240 1241 func (s *SingleExpressionContext) GetParser() antlr.Parser { return s.parser } 1242 1243 func (s *SingleExpressionContext) Expression() IExpressionContext { 1244 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 1245 1246 if t == nil { 1247 return nil 1248 } 1249 1250 return t.(IExpressionContext) 1251 } 1252 1253 func (s *SingleExpressionContext) EOF() antlr.TerminalNode { 1254 return s.GetToken(SqlBaseParserEOF, 0) 1255 } 1256 1257 func (s *SingleExpressionContext) GetRuleContext() antlr.RuleContext { 1258 return s 1259 } 1260 1261 func (s *SingleExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 1262 return antlr.TreesStringTree(s, ruleNames, recog) 1263 } 1264 1265 func (s *SingleExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1266 switch t := visitor.(type) { 1267 case SqlBaseVisitor: 1268 return t.VisitSingleExpression(s) 1269 1270 default: 1271 return t.VisitChildren(s) 1272 } 1273 } 1274 1275 func (p *SqlBaseParser) SingleExpression() (localctx ISingleExpressionContext) { 1276 localctx = NewSingleExpressionContext(p, p.GetParserRuleContext(), p.GetState()) 1277 p.EnterRule(localctx, 2, SqlBaseParserRULE_singleExpression) 1278 1279 defer func() { 1280 p.ExitRule() 1281 }() 1282 1283 defer func() { 1284 if err := recover(); err != nil { 1285 if v, ok := err.(antlr.RecognitionException); ok { 1286 localctx.SetException(v) 1287 p.GetErrorHandler().ReportError(p, v) 1288 p.GetErrorHandler().Recover(p, v) 1289 } else { 1290 panic(err) 1291 } 1292 } 1293 }() 1294 1295 p.EnterOuterAlt(localctx, 1) 1296 { 1297 p.SetState(115) 1298 p.Expression() 1299 } 1300 { 1301 p.SetState(116) 1302 p.Match(SqlBaseParserEOF) 1303 } 1304 1305 return localctx 1306 } 1307 1308 // IStatementContext is an interface to support dynamic dispatch. 1309 type IStatementContext interface { 1310 antlr.ParserRuleContext 1311 1312 // GetParser returns the parser. 1313 GetParser() antlr.Parser 1314 1315 // IsStatementContext differentiates from other interfaces. 1316 IsStatementContext() 1317 } 1318 1319 type StatementContext struct { 1320 *antlr.BaseParserRuleContext 1321 parser antlr.Parser 1322 } 1323 1324 func NewEmptyStatementContext() *StatementContext { 1325 var p = new(StatementContext) 1326 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 1327 p.RuleIndex = SqlBaseParserRULE_statement 1328 return p 1329 } 1330 1331 func (*StatementContext) IsStatementContext() {} 1332 1333 func NewStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StatementContext { 1334 var p = new(StatementContext) 1335 1336 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 1337 1338 p.parser = parser 1339 p.RuleIndex = SqlBaseParserRULE_statement 1340 1341 return p 1342 } 1343 1344 func (s *StatementContext) GetParser() antlr.Parser { return s.parser } 1345 1346 func (s *StatementContext) CopyFrom(ctx *StatementContext) { 1347 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 1348 } 1349 1350 func (s *StatementContext) GetRuleContext() antlr.RuleContext { 1351 return s 1352 } 1353 1354 func (s *StatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 1355 return antlr.TreesStringTree(s, ruleNames, recog) 1356 } 1357 1358 type ExplainContext struct { 1359 *StatementContext 1360 } 1361 1362 func NewExplainContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExplainContext { 1363 var p = new(ExplainContext) 1364 1365 p.StatementContext = NewEmptyStatementContext() 1366 p.parser = parser 1367 p.CopyFrom(ctx.(*StatementContext)) 1368 1369 return p 1370 } 1371 1372 func (s *ExplainContext) GetRuleContext() antlr.RuleContext { 1373 return s 1374 } 1375 1376 func (s *ExplainContext) EXPLAIN() antlr.TerminalNode { 1377 return s.GetToken(SqlBaseParserEXPLAIN, 0) 1378 } 1379 1380 func (s *ExplainContext) Statement() IStatementContext { 1381 var t = s.GetTypedRuleContext(reflect.TypeOf((*IStatementContext)(nil)).Elem(), 0) 1382 1383 if t == nil { 1384 return nil 1385 } 1386 1387 return t.(IStatementContext) 1388 } 1389 1390 func (s *ExplainContext) ANALYZE() antlr.TerminalNode { 1391 return s.GetToken(SqlBaseParserANALYZE, 0) 1392 } 1393 1394 func (s *ExplainContext) VERBOSE() antlr.TerminalNode { 1395 return s.GetToken(SqlBaseParserVERBOSE, 0) 1396 } 1397 1398 func (s *ExplainContext) AllExplainOption() []IExplainOptionContext { 1399 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExplainOptionContext)(nil)).Elem()) 1400 var tst = make([]IExplainOptionContext, len(ts)) 1401 1402 for i, t := range ts { 1403 if t != nil { 1404 tst[i] = t.(IExplainOptionContext) 1405 } 1406 } 1407 1408 return tst 1409 } 1410 1411 func (s *ExplainContext) ExplainOption(i int) IExplainOptionContext { 1412 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExplainOptionContext)(nil)).Elem(), i) 1413 1414 if t == nil { 1415 return nil 1416 } 1417 1418 return t.(IExplainOptionContext) 1419 } 1420 1421 func (s *ExplainContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1422 switch t := visitor.(type) { 1423 case SqlBaseVisitor: 1424 return t.VisitExplain(s) 1425 1426 default: 1427 return t.VisitChildren(s) 1428 } 1429 } 1430 1431 type PrepareContext struct { 1432 *StatementContext 1433 } 1434 1435 func NewPrepareContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PrepareContext { 1436 var p = new(PrepareContext) 1437 1438 p.StatementContext = NewEmptyStatementContext() 1439 p.parser = parser 1440 p.CopyFrom(ctx.(*StatementContext)) 1441 1442 return p 1443 } 1444 1445 func (s *PrepareContext) GetRuleContext() antlr.RuleContext { 1446 return s 1447 } 1448 1449 func (s *PrepareContext) PREPARE() antlr.TerminalNode { 1450 return s.GetToken(SqlBaseParserPREPARE, 0) 1451 } 1452 1453 func (s *PrepareContext) Identifier() IIdentifierContext { 1454 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 1455 1456 if t == nil { 1457 return nil 1458 } 1459 1460 return t.(IIdentifierContext) 1461 } 1462 1463 func (s *PrepareContext) FROM() antlr.TerminalNode { 1464 return s.GetToken(SqlBaseParserFROM, 0) 1465 } 1466 1467 func (s *PrepareContext) Statement() IStatementContext { 1468 var t = s.GetTypedRuleContext(reflect.TypeOf((*IStatementContext)(nil)).Elem(), 0) 1469 1470 if t == nil { 1471 return nil 1472 } 1473 1474 return t.(IStatementContext) 1475 } 1476 1477 func (s *PrepareContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1478 switch t := visitor.(type) { 1479 case SqlBaseVisitor: 1480 return t.VisitPrepare(s) 1481 1482 default: 1483 return t.VisitChildren(s) 1484 } 1485 } 1486 1487 type CreateTableContext struct { 1488 *StatementContext 1489 } 1490 1491 func NewCreateTableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateTableContext { 1492 var p = new(CreateTableContext) 1493 1494 p.StatementContext = NewEmptyStatementContext() 1495 p.parser = parser 1496 p.CopyFrom(ctx.(*StatementContext)) 1497 1498 return p 1499 } 1500 1501 func (s *CreateTableContext) GetRuleContext() antlr.RuleContext { 1502 return s 1503 } 1504 1505 func (s *CreateTableContext) CREATE() antlr.TerminalNode { 1506 return s.GetToken(SqlBaseParserCREATE, 0) 1507 } 1508 1509 func (s *CreateTableContext) TABLE() antlr.TerminalNode { 1510 return s.GetToken(SqlBaseParserTABLE, 0) 1511 } 1512 1513 func (s *CreateTableContext) QualifiedName() IQualifiedNameContext { 1514 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 1515 1516 if t == nil { 1517 return nil 1518 } 1519 1520 return t.(IQualifiedNameContext) 1521 } 1522 1523 func (s *CreateTableContext) AllTableElement() []ITableElementContext { 1524 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITableElementContext)(nil)).Elem()) 1525 var tst = make([]ITableElementContext, len(ts)) 1526 1527 for i, t := range ts { 1528 if t != nil { 1529 tst[i] = t.(ITableElementContext) 1530 } 1531 } 1532 1533 return tst 1534 } 1535 1536 func (s *CreateTableContext) TableElement(i int) ITableElementContext { 1537 var t = s.GetTypedRuleContext(reflect.TypeOf((*ITableElementContext)(nil)).Elem(), i) 1538 1539 if t == nil { 1540 return nil 1541 } 1542 1543 return t.(ITableElementContext) 1544 } 1545 1546 func (s *CreateTableContext) IF() antlr.TerminalNode { 1547 return s.GetToken(SqlBaseParserIF, 0) 1548 } 1549 1550 func (s *CreateTableContext) NOT() antlr.TerminalNode { 1551 return s.GetToken(SqlBaseParserNOT, 0) 1552 } 1553 1554 func (s *CreateTableContext) EXISTS() antlr.TerminalNode { 1555 return s.GetToken(SqlBaseParserEXISTS, 0) 1556 } 1557 1558 func (s *CreateTableContext) COMMENT() antlr.TerminalNode { 1559 return s.GetToken(SqlBaseParserCOMMENT, 0) 1560 } 1561 1562 func (s *CreateTableContext) Sql_string() ISql_stringContext { 1563 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), 0) 1564 1565 if t == nil { 1566 return nil 1567 } 1568 1569 return t.(ISql_stringContext) 1570 } 1571 1572 func (s *CreateTableContext) WITH() antlr.TerminalNode { 1573 return s.GetToken(SqlBaseParserWITH, 0) 1574 } 1575 1576 func (s *CreateTableContext) Properties() IPropertiesContext { 1577 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertiesContext)(nil)).Elem(), 0) 1578 1579 if t == nil { 1580 return nil 1581 } 1582 1583 return t.(IPropertiesContext) 1584 } 1585 1586 func (s *CreateTableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1587 switch t := visitor.(type) { 1588 case SqlBaseVisitor: 1589 return t.VisitCreateTable(s) 1590 1591 default: 1592 return t.VisitChildren(s) 1593 } 1594 } 1595 1596 type CreateTableAsSelectContext struct { 1597 *StatementContext 1598 } 1599 1600 func NewCreateTableAsSelectContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateTableAsSelectContext { 1601 var p = new(CreateTableAsSelectContext) 1602 1603 p.StatementContext = NewEmptyStatementContext() 1604 p.parser = parser 1605 p.CopyFrom(ctx.(*StatementContext)) 1606 1607 return p 1608 } 1609 1610 func (s *CreateTableAsSelectContext) GetRuleContext() antlr.RuleContext { 1611 return s 1612 } 1613 1614 func (s *CreateTableAsSelectContext) CREATE() antlr.TerminalNode { 1615 return s.GetToken(SqlBaseParserCREATE, 0) 1616 } 1617 1618 func (s *CreateTableAsSelectContext) TABLE() antlr.TerminalNode { 1619 return s.GetToken(SqlBaseParserTABLE, 0) 1620 } 1621 1622 func (s *CreateTableAsSelectContext) QualifiedName() IQualifiedNameContext { 1623 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 1624 1625 if t == nil { 1626 return nil 1627 } 1628 1629 return t.(IQualifiedNameContext) 1630 } 1631 1632 func (s *CreateTableAsSelectContext) AS() antlr.TerminalNode { 1633 return s.GetToken(SqlBaseParserAS, 0) 1634 } 1635 1636 func (s *CreateTableAsSelectContext) Query() IQueryContext { 1637 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 1638 1639 if t == nil { 1640 return nil 1641 } 1642 1643 return t.(IQueryContext) 1644 } 1645 1646 func (s *CreateTableAsSelectContext) IF() antlr.TerminalNode { 1647 return s.GetToken(SqlBaseParserIF, 0) 1648 } 1649 1650 func (s *CreateTableAsSelectContext) NOT() antlr.TerminalNode { 1651 return s.GetToken(SqlBaseParserNOT, 0) 1652 } 1653 1654 func (s *CreateTableAsSelectContext) EXISTS() antlr.TerminalNode { 1655 return s.GetToken(SqlBaseParserEXISTS, 0) 1656 } 1657 1658 func (s *CreateTableAsSelectContext) ColumnAliases() IColumnAliasesContext { 1659 var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnAliasesContext)(nil)).Elem(), 0) 1660 1661 if t == nil { 1662 return nil 1663 } 1664 1665 return t.(IColumnAliasesContext) 1666 } 1667 1668 func (s *CreateTableAsSelectContext) COMMENT() antlr.TerminalNode { 1669 return s.GetToken(SqlBaseParserCOMMENT, 0) 1670 } 1671 1672 func (s *CreateTableAsSelectContext) Sql_string() ISql_stringContext { 1673 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), 0) 1674 1675 if t == nil { 1676 return nil 1677 } 1678 1679 return t.(ISql_stringContext) 1680 } 1681 1682 func (s *CreateTableAsSelectContext) AllWITH() []antlr.TerminalNode { 1683 return s.GetTokens(SqlBaseParserWITH) 1684 } 1685 1686 func (s *CreateTableAsSelectContext) WITH(i int) antlr.TerminalNode { 1687 return s.GetToken(SqlBaseParserWITH, i) 1688 } 1689 1690 func (s *CreateTableAsSelectContext) Properties() IPropertiesContext { 1691 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertiesContext)(nil)).Elem(), 0) 1692 1693 if t == nil { 1694 return nil 1695 } 1696 1697 return t.(IPropertiesContext) 1698 } 1699 1700 func (s *CreateTableAsSelectContext) DATA() antlr.TerminalNode { 1701 return s.GetToken(SqlBaseParserDATA, 0) 1702 } 1703 1704 func (s *CreateTableAsSelectContext) NO() antlr.TerminalNode { 1705 return s.GetToken(SqlBaseParserNO, 0) 1706 } 1707 1708 func (s *CreateTableAsSelectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1709 switch t := visitor.(type) { 1710 case SqlBaseVisitor: 1711 return t.VisitCreateTableAsSelect(s) 1712 1713 default: 1714 return t.VisitChildren(s) 1715 } 1716 } 1717 1718 type UseContext struct { 1719 *StatementContext 1720 schema IIdentifierContext 1721 catalog IIdentifierContext 1722 } 1723 1724 func NewUseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UseContext { 1725 var p = new(UseContext) 1726 1727 p.StatementContext = NewEmptyStatementContext() 1728 p.parser = parser 1729 p.CopyFrom(ctx.(*StatementContext)) 1730 1731 return p 1732 } 1733 1734 func (s *UseContext) GetSchema() IIdentifierContext { return s.schema } 1735 1736 func (s *UseContext) GetCatalog() IIdentifierContext { return s.catalog } 1737 1738 func (s *UseContext) SetSchema(v IIdentifierContext) { s.schema = v } 1739 1740 func (s *UseContext) SetCatalog(v IIdentifierContext) { s.catalog = v } 1741 1742 func (s *UseContext) GetRuleContext() antlr.RuleContext { 1743 return s 1744 } 1745 1746 func (s *UseContext) USE() antlr.TerminalNode { 1747 return s.GetToken(SqlBaseParserUSE, 0) 1748 } 1749 1750 func (s *UseContext) AllIdentifier() []IIdentifierContext { 1751 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIdentifierContext)(nil)).Elem()) 1752 var tst = make([]IIdentifierContext, len(ts)) 1753 1754 for i, t := range ts { 1755 if t != nil { 1756 tst[i] = t.(IIdentifierContext) 1757 } 1758 } 1759 1760 return tst 1761 } 1762 1763 func (s *UseContext) Identifier(i int) IIdentifierContext { 1764 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), i) 1765 1766 if t == nil { 1767 return nil 1768 } 1769 1770 return t.(IIdentifierContext) 1771 } 1772 1773 func (s *UseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1774 switch t := visitor.(type) { 1775 case SqlBaseVisitor: 1776 return t.VisitUse(s) 1777 1778 default: 1779 return t.VisitChildren(s) 1780 } 1781 } 1782 1783 type ShowStatsContext struct { 1784 *StatementContext 1785 } 1786 1787 func NewShowStatsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowStatsContext { 1788 var p = new(ShowStatsContext) 1789 1790 p.StatementContext = NewEmptyStatementContext() 1791 p.parser = parser 1792 p.CopyFrom(ctx.(*StatementContext)) 1793 1794 return p 1795 } 1796 1797 func (s *ShowStatsContext) GetRuleContext() antlr.RuleContext { 1798 return s 1799 } 1800 1801 func (s *ShowStatsContext) SHOW() antlr.TerminalNode { 1802 return s.GetToken(SqlBaseParserSHOW, 0) 1803 } 1804 1805 func (s *ShowStatsContext) STATS() antlr.TerminalNode { 1806 return s.GetToken(SqlBaseParserSTATS, 0) 1807 } 1808 1809 func (s *ShowStatsContext) QualifiedName() IQualifiedNameContext { 1810 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 1811 1812 if t == nil { 1813 return nil 1814 } 1815 1816 return t.(IQualifiedNameContext) 1817 } 1818 1819 func (s *ShowStatsContext) FOR() antlr.TerminalNode { 1820 return s.GetToken(SqlBaseParserFOR, 0) 1821 } 1822 1823 func (s *ShowStatsContext) ON() antlr.TerminalNode { 1824 return s.GetToken(SqlBaseParserON, 0) 1825 } 1826 1827 func (s *ShowStatsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1828 switch t := visitor.(type) { 1829 case SqlBaseVisitor: 1830 return t.VisitShowStats(s) 1831 1832 default: 1833 return t.VisitChildren(s) 1834 } 1835 } 1836 1837 type DeallocateContext struct { 1838 *StatementContext 1839 } 1840 1841 func NewDeallocateContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DeallocateContext { 1842 var p = new(DeallocateContext) 1843 1844 p.StatementContext = NewEmptyStatementContext() 1845 p.parser = parser 1846 p.CopyFrom(ctx.(*StatementContext)) 1847 1848 return p 1849 } 1850 1851 func (s *DeallocateContext) GetRuleContext() antlr.RuleContext { 1852 return s 1853 } 1854 1855 func (s *DeallocateContext) DEALLOCATE() antlr.TerminalNode { 1856 return s.GetToken(SqlBaseParserDEALLOCATE, 0) 1857 } 1858 1859 func (s *DeallocateContext) PREPARE() antlr.TerminalNode { 1860 return s.GetToken(SqlBaseParserPREPARE, 0) 1861 } 1862 1863 func (s *DeallocateContext) Identifier() IIdentifierContext { 1864 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 1865 1866 if t == nil { 1867 return nil 1868 } 1869 1870 return t.(IIdentifierContext) 1871 } 1872 1873 func (s *DeallocateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1874 switch t := visitor.(type) { 1875 case SqlBaseVisitor: 1876 return t.VisitDeallocate(s) 1877 1878 default: 1879 return t.VisitChildren(s) 1880 } 1881 } 1882 1883 type RenameTableContext struct { 1884 *StatementContext 1885 from IQualifiedNameContext 1886 to IQualifiedNameContext 1887 } 1888 1889 func NewRenameTableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RenameTableContext { 1890 var p = new(RenameTableContext) 1891 1892 p.StatementContext = NewEmptyStatementContext() 1893 p.parser = parser 1894 p.CopyFrom(ctx.(*StatementContext)) 1895 1896 return p 1897 } 1898 1899 func (s *RenameTableContext) GetFrom() IQualifiedNameContext { return s.from } 1900 1901 func (s *RenameTableContext) GetTo() IQualifiedNameContext { return s.to } 1902 1903 func (s *RenameTableContext) SetFrom(v IQualifiedNameContext) { s.from = v } 1904 1905 func (s *RenameTableContext) SetTo(v IQualifiedNameContext) { s.to = v } 1906 1907 func (s *RenameTableContext) GetRuleContext() antlr.RuleContext { 1908 return s 1909 } 1910 1911 func (s *RenameTableContext) ALTER() antlr.TerminalNode { 1912 return s.GetToken(SqlBaseParserALTER, 0) 1913 } 1914 1915 func (s *RenameTableContext) TABLE() antlr.TerminalNode { 1916 return s.GetToken(SqlBaseParserTABLE, 0) 1917 } 1918 1919 func (s *RenameTableContext) RENAME() antlr.TerminalNode { 1920 return s.GetToken(SqlBaseParserRENAME, 0) 1921 } 1922 1923 func (s *RenameTableContext) TO() antlr.TerminalNode { 1924 return s.GetToken(SqlBaseParserTO, 0) 1925 } 1926 1927 func (s *RenameTableContext) AllQualifiedName() []IQualifiedNameContext { 1928 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem()) 1929 var tst = make([]IQualifiedNameContext, len(ts)) 1930 1931 for i, t := range ts { 1932 if t != nil { 1933 tst[i] = t.(IQualifiedNameContext) 1934 } 1935 } 1936 1937 return tst 1938 } 1939 1940 func (s *RenameTableContext) QualifiedName(i int) IQualifiedNameContext { 1941 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), i) 1942 1943 if t == nil { 1944 return nil 1945 } 1946 1947 return t.(IQualifiedNameContext) 1948 } 1949 1950 func (s *RenameTableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 1951 switch t := visitor.(type) { 1952 case SqlBaseVisitor: 1953 return t.VisitRenameTable(s) 1954 1955 default: 1956 return t.VisitChildren(s) 1957 } 1958 } 1959 1960 type RevokeContext struct { 1961 *StatementContext 1962 grantee IIdentifierContext 1963 } 1964 1965 func NewRevokeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RevokeContext { 1966 var p = new(RevokeContext) 1967 1968 p.StatementContext = NewEmptyStatementContext() 1969 p.parser = parser 1970 p.CopyFrom(ctx.(*StatementContext)) 1971 1972 return p 1973 } 1974 1975 func (s *RevokeContext) GetGrantee() IIdentifierContext { return s.grantee } 1976 1977 func (s *RevokeContext) SetGrantee(v IIdentifierContext) { s.grantee = v } 1978 1979 func (s *RevokeContext) GetRuleContext() antlr.RuleContext { 1980 return s 1981 } 1982 1983 func (s *RevokeContext) REVOKE() antlr.TerminalNode { 1984 return s.GetToken(SqlBaseParserREVOKE, 0) 1985 } 1986 1987 func (s *RevokeContext) ON() antlr.TerminalNode { 1988 return s.GetToken(SqlBaseParserON, 0) 1989 } 1990 1991 func (s *RevokeContext) QualifiedName() IQualifiedNameContext { 1992 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 1993 1994 if t == nil { 1995 return nil 1996 } 1997 1998 return t.(IQualifiedNameContext) 1999 } 2000 2001 func (s *RevokeContext) FROM() antlr.TerminalNode { 2002 return s.GetToken(SqlBaseParserFROM, 0) 2003 } 2004 2005 func (s *RevokeContext) Identifier() IIdentifierContext { 2006 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 2007 2008 if t == nil { 2009 return nil 2010 } 2011 2012 return t.(IIdentifierContext) 2013 } 2014 2015 func (s *RevokeContext) AllPrivilege() []IPrivilegeContext { 2016 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IPrivilegeContext)(nil)).Elem()) 2017 var tst = make([]IPrivilegeContext, len(ts)) 2018 2019 for i, t := range ts { 2020 if t != nil { 2021 tst[i] = t.(IPrivilegeContext) 2022 } 2023 } 2024 2025 return tst 2026 } 2027 2028 func (s *RevokeContext) Privilege(i int) IPrivilegeContext { 2029 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPrivilegeContext)(nil)).Elem(), i) 2030 2031 if t == nil { 2032 return nil 2033 } 2034 2035 return t.(IPrivilegeContext) 2036 } 2037 2038 func (s *RevokeContext) ALL() antlr.TerminalNode { 2039 return s.GetToken(SqlBaseParserALL, 0) 2040 } 2041 2042 func (s *RevokeContext) PRIVILEGES() antlr.TerminalNode { 2043 return s.GetToken(SqlBaseParserPRIVILEGES, 0) 2044 } 2045 2046 func (s *RevokeContext) GRANT() antlr.TerminalNode { 2047 return s.GetToken(SqlBaseParserGRANT, 0) 2048 } 2049 2050 func (s *RevokeContext) OPTION() antlr.TerminalNode { 2051 return s.GetToken(SqlBaseParserOPTION, 0) 2052 } 2053 2054 func (s *RevokeContext) FOR() antlr.TerminalNode { 2055 return s.GetToken(SqlBaseParserFOR, 0) 2056 } 2057 2058 func (s *RevokeContext) TABLE() antlr.TerminalNode { 2059 return s.GetToken(SqlBaseParserTABLE, 0) 2060 } 2061 2062 func (s *RevokeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2063 switch t := visitor.(type) { 2064 case SqlBaseVisitor: 2065 return t.VisitRevoke(s) 2066 2067 default: 2068 return t.VisitChildren(s) 2069 } 2070 } 2071 2072 type ShowPartitionsContext struct { 2073 *StatementContext 2074 limit antlr.Token 2075 } 2076 2077 func NewShowPartitionsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowPartitionsContext { 2078 var p = new(ShowPartitionsContext) 2079 2080 p.StatementContext = NewEmptyStatementContext() 2081 p.parser = parser 2082 p.CopyFrom(ctx.(*StatementContext)) 2083 2084 return p 2085 } 2086 2087 func (s *ShowPartitionsContext) GetLimit() antlr.Token { return s.limit } 2088 2089 func (s *ShowPartitionsContext) SetLimit(v antlr.Token) { s.limit = v } 2090 2091 func (s *ShowPartitionsContext) GetRuleContext() antlr.RuleContext { 2092 return s 2093 } 2094 2095 func (s *ShowPartitionsContext) SHOW() antlr.TerminalNode { 2096 return s.GetToken(SqlBaseParserSHOW, 0) 2097 } 2098 2099 func (s *ShowPartitionsContext) PARTITIONS() antlr.TerminalNode { 2100 return s.GetToken(SqlBaseParserPARTITIONS, 0) 2101 } 2102 2103 func (s *ShowPartitionsContext) QualifiedName() IQualifiedNameContext { 2104 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 2105 2106 if t == nil { 2107 return nil 2108 } 2109 2110 return t.(IQualifiedNameContext) 2111 } 2112 2113 func (s *ShowPartitionsContext) FROM() antlr.TerminalNode { 2114 return s.GetToken(SqlBaseParserFROM, 0) 2115 } 2116 2117 func (s *ShowPartitionsContext) IN() antlr.TerminalNode { 2118 return s.GetToken(SqlBaseParserIN, 0) 2119 } 2120 2121 func (s *ShowPartitionsContext) WHERE() antlr.TerminalNode { 2122 return s.GetToken(SqlBaseParserWHERE, 0) 2123 } 2124 2125 func (s *ShowPartitionsContext) BooleanExpression() IBooleanExpressionContext { 2126 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) 2127 2128 if t == nil { 2129 return nil 2130 } 2131 2132 return t.(IBooleanExpressionContext) 2133 } 2134 2135 func (s *ShowPartitionsContext) ORDER() antlr.TerminalNode { 2136 return s.GetToken(SqlBaseParserORDER, 0) 2137 } 2138 2139 func (s *ShowPartitionsContext) BY() antlr.TerminalNode { 2140 return s.GetToken(SqlBaseParserBY, 0) 2141 } 2142 2143 func (s *ShowPartitionsContext) AllSortItem() []ISortItemContext { 2144 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISortItemContext)(nil)).Elem()) 2145 var tst = make([]ISortItemContext, len(ts)) 2146 2147 for i, t := range ts { 2148 if t != nil { 2149 tst[i] = t.(ISortItemContext) 2150 } 2151 } 2152 2153 return tst 2154 } 2155 2156 func (s *ShowPartitionsContext) SortItem(i int) ISortItemContext { 2157 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISortItemContext)(nil)).Elem(), i) 2158 2159 if t == nil { 2160 return nil 2161 } 2162 2163 return t.(ISortItemContext) 2164 } 2165 2166 func (s *ShowPartitionsContext) LIMIT() antlr.TerminalNode { 2167 return s.GetToken(SqlBaseParserLIMIT, 0) 2168 } 2169 2170 func (s *ShowPartitionsContext) INTEGER_VALUE() antlr.TerminalNode { 2171 return s.GetToken(SqlBaseParserINTEGER_VALUE, 0) 2172 } 2173 2174 func (s *ShowPartitionsContext) ALL() antlr.TerminalNode { 2175 return s.GetToken(SqlBaseParserALL, 0) 2176 } 2177 2178 func (s *ShowPartitionsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2179 switch t := visitor.(type) { 2180 case SqlBaseVisitor: 2181 return t.VisitShowPartitions(s) 2182 2183 default: 2184 return t.VisitChildren(s) 2185 } 2186 } 2187 2188 type DropColumnContext struct { 2189 *StatementContext 2190 tableName IQualifiedNameContext 2191 column IQualifiedNameContext 2192 } 2193 2194 func NewDropColumnContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DropColumnContext { 2195 var p = new(DropColumnContext) 2196 2197 p.StatementContext = NewEmptyStatementContext() 2198 p.parser = parser 2199 p.CopyFrom(ctx.(*StatementContext)) 2200 2201 return p 2202 } 2203 2204 func (s *DropColumnContext) GetTableName() IQualifiedNameContext { return s.tableName } 2205 2206 func (s *DropColumnContext) GetColumn() IQualifiedNameContext { return s.column } 2207 2208 func (s *DropColumnContext) SetTableName(v IQualifiedNameContext) { s.tableName = v } 2209 2210 func (s *DropColumnContext) SetColumn(v IQualifiedNameContext) { s.column = v } 2211 2212 func (s *DropColumnContext) GetRuleContext() antlr.RuleContext { 2213 return s 2214 } 2215 2216 func (s *DropColumnContext) ALTER() antlr.TerminalNode { 2217 return s.GetToken(SqlBaseParserALTER, 0) 2218 } 2219 2220 func (s *DropColumnContext) TABLE() antlr.TerminalNode { 2221 return s.GetToken(SqlBaseParserTABLE, 0) 2222 } 2223 2224 func (s *DropColumnContext) DROP() antlr.TerminalNode { 2225 return s.GetToken(SqlBaseParserDROP, 0) 2226 } 2227 2228 func (s *DropColumnContext) COLUMN() antlr.TerminalNode { 2229 return s.GetToken(SqlBaseParserCOLUMN, 0) 2230 } 2231 2232 func (s *DropColumnContext) AllQualifiedName() []IQualifiedNameContext { 2233 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem()) 2234 var tst = make([]IQualifiedNameContext, len(ts)) 2235 2236 for i, t := range ts { 2237 if t != nil { 2238 tst[i] = t.(IQualifiedNameContext) 2239 } 2240 } 2241 2242 return tst 2243 } 2244 2245 func (s *DropColumnContext) QualifiedName(i int) IQualifiedNameContext { 2246 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), i) 2247 2248 if t == nil { 2249 return nil 2250 } 2251 2252 return t.(IQualifiedNameContext) 2253 } 2254 2255 func (s *DropColumnContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2256 switch t := visitor.(type) { 2257 case SqlBaseVisitor: 2258 return t.VisitDropColumn(s) 2259 2260 default: 2261 return t.VisitChildren(s) 2262 } 2263 } 2264 2265 type DropViewContext struct { 2266 *StatementContext 2267 } 2268 2269 func NewDropViewContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DropViewContext { 2270 var p = new(DropViewContext) 2271 2272 p.StatementContext = NewEmptyStatementContext() 2273 p.parser = parser 2274 p.CopyFrom(ctx.(*StatementContext)) 2275 2276 return p 2277 } 2278 2279 func (s *DropViewContext) GetRuleContext() antlr.RuleContext { 2280 return s 2281 } 2282 2283 func (s *DropViewContext) DROP() antlr.TerminalNode { 2284 return s.GetToken(SqlBaseParserDROP, 0) 2285 } 2286 2287 func (s *DropViewContext) VIEW() antlr.TerminalNode { 2288 return s.GetToken(SqlBaseParserVIEW, 0) 2289 } 2290 2291 func (s *DropViewContext) QualifiedName() IQualifiedNameContext { 2292 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 2293 2294 if t == nil { 2295 return nil 2296 } 2297 2298 return t.(IQualifiedNameContext) 2299 } 2300 2301 func (s *DropViewContext) IF() antlr.TerminalNode { 2302 return s.GetToken(SqlBaseParserIF, 0) 2303 } 2304 2305 func (s *DropViewContext) EXISTS() antlr.TerminalNode { 2306 return s.GetToken(SqlBaseParserEXISTS, 0) 2307 } 2308 2309 func (s *DropViewContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2310 switch t := visitor.(type) { 2311 case SqlBaseVisitor: 2312 return t.VisitDropView(s) 2313 2314 default: 2315 return t.VisitChildren(s) 2316 } 2317 } 2318 2319 type DeleteContext struct { 2320 *StatementContext 2321 } 2322 2323 func NewDeleteContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DeleteContext { 2324 var p = new(DeleteContext) 2325 2326 p.StatementContext = NewEmptyStatementContext() 2327 p.parser = parser 2328 p.CopyFrom(ctx.(*StatementContext)) 2329 2330 return p 2331 } 2332 2333 func (s *DeleteContext) GetRuleContext() antlr.RuleContext { 2334 return s 2335 } 2336 2337 func (s *DeleteContext) DELETE() antlr.TerminalNode { 2338 return s.GetToken(SqlBaseParserDELETE, 0) 2339 } 2340 2341 func (s *DeleteContext) FROM() antlr.TerminalNode { 2342 return s.GetToken(SqlBaseParserFROM, 0) 2343 } 2344 2345 func (s *DeleteContext) QualifiedName() IQualifiedNameContext { 2346 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 2347 2348 if t == nil { 2349 return nil 2350 } 2351 2352 return t.(IQualifiedNameContext) 2353 } 2354 2355 func (s *DeleteContext) WHERE() antlr.TerminalNode { 2356 return s.GetToken(SqlBaseParserWHERE, 0) 2357 } 2358 2359 func (s *DeleteContext) BooleanExpression() IBooleanExpressionContext { 2360 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) 2361 2362 if t == nil { 2363 return nil 2364 } 2365 2366 return t.(IBooleanExpressionContext) 2367 } 2368 2369 func (s *DeleteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2370 switch t := visitor.(type) { 2371 case SqlBaseVisitor: 2372 return t.VisitDelete(s) 2373 2374 default: 2375 return t.VisitChildren(s) 2376 } 2377 } 2378 2379 type ShowTablesContext struct { 2380 *StatementContext 2381 pattern ISql_stringContext 2382 escape ISql_stringContext 2383 } 2384 2385 func NewShowTablesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowTablesContext { 2386 var p = new(ShowTablesContext) 2387 2388 p.StatementContext = NewEmptyStatementContext() 2389 p.parser = parser 2390 p.CopyFrom(ctx.(*StatementContext)) 2391 2392 return p 2393 } 2394 2395 func (s *ShowTablesContext) GetPattern() ISql_stringContext { return s.pattern } 2396 2397 func (s *ShowTablesContext) GetEscape() ISql_stringContext { return s.escape } 2398 2399 func (s *ShowTablesContext) SetPattern(v ISql_stringContext) { s.pattern = v } 2400 2401 func (s *ShowTablesContext) SetEscape(v ISql_stringContext) { s.escape = v } 2402 2403 func (s *ShowTablesContext) GetRuleContext() antlr.RuleContext { 2404 return s 2405 } 2406 2407 func (s *ShowTablesContext) SHOW() antlr.TerminalNode { 2408 return s.GetToken(SqlBaseParserSHOW, 0) 2409 } 2410 2411 func (s *ShowTablesContext) TABLES() antlr.TerminalNode { 2412 return s.GetToken(SqlBaseParserTABLES, 0) 2413 } 2414 2415 func (s *ShowTablesContext) QualifiedName() IQualifiedNameContext { 2416 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 2417 2418 if t == nil { 2419 return nil 2420 } 2421 2422 return t.(IQualifiedNameContext) 2423 } 2424 2425 func (s *ShowTablesContext) LIKE() antlr.TerminalNode { 2426 return s.GetToken(SqlBaseParserLIKE, 0) 2427 } 2428 2429 func (s *ShowTablesContext) FROM() antlr.TerminalNode { 2430 return s.GetToken(SqlBaseParserFROM, 0) 2431 } 2432 2433 func (s *ShowTablesContext) IN() antlr.TerminalNode { 2434 return s.GetToken(SqlBaseParserIN, 0) 2435 } 2436 2437 func (s *ShowTablesContext) AllSql_string() []ISql_stringContext { 2438 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISql_stringContext)(nil)).Elem()) 2439 var tst = make([]ISql_stringContext, len(ts)) 2440 2441 for i, t := range ts { 2442 if t != nil { 2443 tst[i] = t.(ISql_stringContext) 2444 } 2445 } 2446 2447 return tst 2448 } 2449 2450 func (s *ShowTablesContext) Sql_string(i int) ISql_stringContext { 2451 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), i) 2452 2453 if t == nil { 2454 return nil 2455 } 2456 2457 return t.(ISql_stringContext) 2458 } 2459 2460 func (s *ShowTablesContext) ESCAPE() antlr.TerminalNode { 2461 return s.GetToken(SqlBaseParserESCAPE, 0) 2462 } 2463 2464 func (s *ShowTablesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2465 switch t := visitor.(type) { 2466 case SqlBaseVisitor: 2467 return t.VisitShowTables(s) 2468 2469 default: 2470 return t.VisitChildren(s) 2471 } 2472 } 2473 2474 type DescribeInputContext struct { 2475 *StatementContext 2476 } 2477 2478 func NewDescribeInputContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DescribeInputContext { 2479 var p = new(DescribeInputContext) 2480 2481 p.StatementContext = NewEmptyStatementContext() 2482 p.parser = parser 2483 p.CopyFrom(ctx.(*StatementContext)) 2484 2485 return p 2486 } 2487 2488 func (s *DescribeInputContext) GetRuleContext() antlr.RuleContext { 2489 return s 2490 } 2491 2492 func (s *DescribeInputContext) DESCRIBE() antlr.TerminalNode { 2493 return s.GetToken(SqlBaseParserDESCRIBE, 0) 2494 } 2495 2496 func (s *DescribeInputContext) INPUT() antlr.TerminalNode { 2497 return s.GetToken(SqlBaseParserINPUT, 0) 2498 } 2499 2500 func (s *DescribeInputContext) Identifier() IIdentifierContext { 2501 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 2502 2503 if t == nil { 2504 return nil 2505 } 2506 2507 return t.(IIdentifierContext) 2508 } 2509 2510 func (s *DescribeInputContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2511 switch t := visitor.(type) { 2512 case SqlBaseVisitor: 2513 return t.VisitDescribeInput(s) 2514 2515 default: 2516 return t.VisitChildren(s) 2517 } 2518 } 2519 2520 type ShowStatsForQueryContext struct { 2521 *StatementContext 2522 } 2523 2524 func NewShowStatsForQueryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowStatsForQueryContext { 2525 var p = new(ShowStatsForQueryContext) 2526 2527 p.StatementContext = NewEmptyStatementContext() 2528 p.parser = parser 2529 p.CopyFrom(ctx.(*StatementContext)) 2530 2531 return p 2532 } 2533 2534 func (s *ShowStatsForQueryContext) GetRuleContext() antlr.RuleContext { 2535 return s 2536 } 2537 2538 func (s *ShowStatsForQueryContext) SHOW() antlr.TerminalNode { 2539 return s.GetToken(SqlBaseParserSHOW, 0) 2540 } 2541 2542 func (s *ShowStatsForQueryContext) STATS() antlr.TerminalNode { 2543 return s.GetToken(SqlBaseParserSTATS, 0) 2544 } 2545 2546 func (s *ShowStatsForQueryContext) FOR() antlr.TerminalNode { 2547 return s.GetToken(SqlBaseParserFOR, 0) 2548 } 2549 2550 func (s *ShowStatsForQueryContext) QuerySpecification() IQuerySpecificationContext { 2551 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQuerySpecificationContext)(nil)).Elem(), 0) 2552 2553 if t == nil { 2554 return nil 2555 } 2556 2557 return t.(IQuerySpecificationContext) 2558 } 2559 2560 func (s *ShowStatsForQueryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2561 switch t := visitor.(type) { 2562 case SqlBaseVisitor: 2563 return t.VisitShowStatsForQuery(s) 2564 2565 default: 2566 return t.VisitChildren(s) 2567 } 2568 } 2569 2570 type ShowCatalogsContext struct { 2571 *StatementContext 2572 pattern ISql_stringContext 2573 } 2574 2575 func NewShowCatalogsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowCatalogsContext { 2576 var p = new(ShowCatalogsContext) 2577 2578 p.StatementContext = NewEmptyStatementContext() 2579 p.parser = parser 2580 p.CopyFrom(ctx.(*StatementContext)) 2581 2582 return p 2583 } 2584 2585 func (s *ShowCatalogsContext) GetPattern() ISql_stringContext { return s.pattern } 2586 2587 func (s *ShowCatalogsContext) SetPattern(v ISql_stringContext) { s.pattern = v } 2588 2589 func (s *ShowCatalogsContext) GetRuleContext() antlr.RuleContext { 2590 return s 2591 } 2592 2593 func (s *ShowCatalogsContext) SHOW() antlr.TerminalNode { 2594 return s.GetToken(SqlBaseParserSHOW, 0) 2595 } 2596 2597 func (s *ShowCatalogsContext) CATALOGS() antlr.TerminalNode { 2598 return s.GetToken(SqlBaseParserCATALOGS, 0) 2599 } 2600 2601 func (s *ShowCatalogsContext) LIKE() antlr.TerminalNode { 2602 return s.GetToken(SqlBaseParserLIKE, 0) 2603 } 2604 2605 func (s *ShowCatalogsContext) Sql_string() ISql_stringContext { 2606 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), 0) 2607 2608 if t == nil { 2609 return nil 2610 } 2611 2612 return t.(ISql_stringContext) 2613 } 2614 2615 func (s *ShowCatalogsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2616 switch t := visitor.(type) { 2617 case SqlBaseVisitor: 2618 return t.VisitShowCatalogs(s) 2619 2620 default: 2621 return t.VisitChildren(s) 2622 } 2623 } 2624 2625 type StatementDefaultContext struct { 2626 *StatementContext 2627 } 2628 2629 func NewStatementDefaultContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StatementDefaultContext { 2630 var p = new(StatementDefaultContext) 2631 2632 p.StatementContext = NewEmptyStatementContext() 2633 p.parser = parser 2634 p.CopyFrom(ctx.(*StatementContext)) 2635 2636 return p 2637 } 2638 2639 func (s *StatementDefaultContext) GetRuleContext() antlr.RuleContext { 2640 return s 2641 } 2642 2643 func (s *StatementDefaultContext) Query() IQueryContext { 2644 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 2645 2646 if t == nil { 2647 return nil 2648 } 2649 2650 return t.(IQueryContext) 2651 } 2652 2653 func (s *StatementDefaultContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2654 switch t := visitor.(type) { 2655 case SqlBaseVisitor: 2656 return t.VisitStatementDefault(s) 2657 2658 default: 2659 return t.VisitChildren(s) 2660 } 2661 } 2662 2663 type RenameColumnContext struct { 2664 *StatementContext 2665 tableName IQualifiedNameContext 2666 from IIdentifierContext 2667 to IIdentifierContext 2668 } 2669 2670 func NewRenameColumnContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RenameColumnContext { 2671 var p = new(RenameColumnContext) 2672 2673 p.StatementContext = NewEmptyStatementContext() 2674 p.parser = parser 2675 p.CopyFrom(ctx.(*StatementContext)) 2676 2677 return p 2678 } 2679 2680 func (s *RenameColumnContext) GetTableName() IQualifiedNameContext { return s.tableName } 2681 2682 func (s *RenameColumnContext) GetFrom() IIdentifierContext { return s.from } 2683 2684 func (s *RenameColumnContext) GetTo() IIdentifierContext { return s.to } 2685 2686 func (s *RenameColumnContext) SetTableName(v IQualifiedNameContext) { s.tableName = v } 2687 2688 func (s *RenameColumnContext) SetFrom(v IIdentifierContext) { s.from = v } 2689 2690 func (s *RenameColumnContext) SetTo(v IIdentifierContext) { s.to = v } 2691 2692 func (s *RenameColumnContext) GetRuleContext() antlr.RuleContext { 2693 return s 2694 } 2695 2696 func (s *RenameColumnContext) ALTER() antlr.TerminalNode { 2697 return s.GetToken(SqlBaseParserALTER, 0) 2698 } 2699 2700 func (s *RenameColumnContext) TABLE() antlr.TerminalNode { 2701 return s.GetToken(SqlBaseParserTABLE, 0) 2702 } 2703 2704 func (s *RenameColumnContext) RENAME() antlr.TerminalNode { 2705 return s.GetToken(SqlBaseParserRENAME, 0) 2706 } 2707 2708 func (s *RenameColumnContext) COLUMN() antlr.TerminalNode { 2709 return s.GetToken(SqlBaseParserCOLUMN, 0) 2710 } 2711 2712 func (s *RenameColumnContext) TO() antlr.TerminalNode { 2713 return s.GetToken(SqlBaseParserTO, 0) 2714 } 2715 2716 func (s *RenameColumnContext) QualifiedName() IQualifiedNameContext { 2717 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 2718 2719 if t == nil { 2720 return nil 2721 } 2722 2723 return t.(IQualifiedNameContext) 2724 } 2725 2726 func (s *RenameColumnContext) AllIdentifier() []IIdentifierContext { 2727 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIdentifierContext)(nil)).Elem()) 2728 var tst = make([]IIdentifierContext, len(ts)) 2729 2730 for i, t := range ts { 2731 if t != nil { 2732 tst[i] = t.(IIdentifierContext) 2733 } 2734 } 2735 2736 return tst 2737 } 2738 2739 func (s *RenameColumnContext) Identifier(i int) IIdentifierContext { 2740 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), i) 2741 2742 if t == nil { 2743 return nil 2744 } 2745 2746 return t.(IIdentifierContext) 2747 } 2748 2749 func (s *RenameColumnContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2750 switch t := visitor.(type) { 2751 case SqlBaseVisitor: 2752 return t.VisitRenameColumn(s) 2753 2754 default: 2755 return t.VisitChildren(s) 2756 } 2757 } 2758 2759 type SetSessionContext struct { 2760 *StatementContext 2761 } 2762 2763 func NewSetSessionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SetSessionContext { 2764 var p = new(SetSessionContext) 2765 2766 p.StatementContext = NewEmptyStatementContext() 2767 p.parser = parser 2768 p.CopyFrom(ctx.(*StatementContext)) 2769 2770 return p 2771 } 2772 2773 func (s *SetSessionContext) GetRuleContext() antlr.RuleContext { 2774 return s 2775 } 2776 2777 func (s *SetSessionContext) SET() antlr.TerminalNode { 2778 return s.GetToken(SqlBaseParserSET, 0) 2779 } 2780 2781 func (s *SetSessionContext) SESSION() antlr.TerminalNode { 2782 return s.GetToken(SqlBaseParserSESSION, 0) 2783 } 2784 2785 func (s *SetSessionContext) QualifiedName() IQualifiedNameContext { 2786 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 2787 2788 if t == nil { 2789 return nil 2790 } 2791 2792 return t.(IQualifiedNameContext) 2793 } 2794 2795 func (s *SetSessionContext) EQ() antlr.TerminalNode { 2796 return s.GetToken(SqlBaseParserEQ, 0) 2797 } 2798 2799 func (s *SetSessionContext) Expression() IExpressionContext { 2800 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 2801 2802 if t == nil { 2803 return nil 2804 } 2805 2806 return t.(IExpressionContext) 2807 } 2808 2809 func (s *SetSessionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2810 switch t := visitor.(type) { 2811 case SqlBaseVisitor: 2812 return t.VisitSetSession(s) 2813 2814 default: 2815 return t.VisitChildren(s) 2816 } 2817 } 2818 2819 type CreateViewContext struct { 2820 *StatementContext 2821 } 2822 2823 func NewCreateViewContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateViewContext { 2824 var p = new(CreateViewContext) 2825 2826 p.StatementContext = NewEmptyStatementContext() 2827 p.parser = parser 2828 p.CopyFrom(ctx.(*StatementContext)) 2829 2830 return p 2831 } 2832 2833 func (s *CreateViewContext) GetRuleContext() antlr.RuleContext { 2834 return s 2835 } 2836 2837 func (s *CreateViewContext) CREATE() antlr.TerminalNode { 2838 return s.GetToken(SqlBaseParserCREATE, 0) 2839 } 2840 2841 func (s *CreateViewContext) VIEW() antlr.TerminalNode { 2842 return s.GetToken(SqlBaseParserVIEW, 0) 2843 } 2844 2845 func (s *CreateViewContext) QualifiedName() IQualifiedNameContext { 2846 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 2847 2848 if t == nil { 2849 return nil 2850 } 2851 2852 return t.(IQualifiedNameContext) 2853 } 2854 2855 func (s *CreateViewContext) AS() antlr.TerminalNode { 2856 return s.GetToken(SqlBaseParserAS, 0) 2857 } 2858 2859 func (s *CreateViewContext) Query() IQueryContext { 2860 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 2861 2862 if t == nil { 2863 return nil 2864 } 2865 2866 return t.(IQueryContext) 2867 } 2868 2869 func (s *CreateViewContext) OR() antlr.TerminalNode { 2870 return s.GetToken(SqlBaseParserOR, 0) 2871 } 2872 2873 func (s *CreateViewContext) REPLACE() antlr.TerminalNode { 2874 return s.GetToken(SqlBaseParserREPLACE, 0) 2875 } 2876 2877 func (s *CreateViewContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2878 switch t := visitor.(type) { 2879 case SqlBaseVisitor: 2880 return t.VisitCreateView(s) 2881 2882 default: 2883 return t.VisitChildren(s) 2884 } 2885 } 2886 2887 type ShowCreateTableContext struct { 2888 *StatementContext 2889 } 2890 2891 func NewShowCreateTableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowCreateTableContext { 2892 var p = new(ShowCreateTableContext) 2893 2894 p.StatementContext = NewEmptyStatementContext() 2895 p.parser = parser 2896 p.CopyFrom(ctx.(*StatementContext)) 2897 2898 return p 2899 } 2900 2901 func (s *ShowCreateTableContext) GetRuleContext() antlr.RuleContext { 2902 return s 2903 } 2904 2905 func (s *ShowCreateTableContext) SHOW() antlr.TerminalNode { 2906 return s.GetToken(SqlBaseParserSHOW, 0) 2907 } 2908 2909 func (s *ShowCreateTableContext) CREATE() antlr.TerminalNode { 2910 return s.GetToken(SqlBaseParserCREATE, 0) 2911 } 2912 2913 func (s *ShowCreateTableContext) TABLE() antlr.TerminalNode { 2914 return s.GetToken(SqlBaseParserTABLE, 0) 2915 } 2916 2917 func (s *ShowCreateTableContext) QualifiedName() IQualifiedNameContext { 2918 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 2919 2920 if t == nil { 2921 return nil 2922 } 2923 2924 return t.(IQualifiedNameContext) 2925 } 2926 2927 func (s *ShowCreateTableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 2928 switch t := visitor.(type) { 2929 case SqlBaseVisitor: 2930 return t.VisitShowCreateTable(s) 2931 2932 default: 2933 return t.VisitChildren(s) 2934 } 2935 } 2936 2937 type ShowSchemasContext struct { 2938 *StatementContext 2939 pattern ISql_stringContext 2940 escape ISql_stringContext 2941 } 2942 2943 func NewShowSchemasContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowSchemasContext { 2944 var p = new(ShowSchemasContext) 2945 2946 p.StatementContext = NewEmptyStatementContext() 2947 p.parser = parser 2948 p.CopyFrom(ctx.(*StatementContext)) 2949 2950 return p 2951 } 2952 2953 func (s *ShowSchemasContext) GetPattern() ISql_stringContext { return s.pattern } 2954 2955 func (s *ShowSchemasContext) GetEscape() ISql_stringContext { return s.escape } 2956 2957 func (s *ShowSchemasContext) SetPattern(v ISql_stringContext) { s.pattern = v } 2958 2959 func (s *ShowSchemasContext) SetEscape(v ISql_stringContext) { s.escape = v } 2960 2961 func (s *ShowSchemasContext) GetRuleContext() antlr.RuleContext { 2962 return s 2963 } 2964 2965 func (s *ShowSchemasContext) SHOW() antlr.TerminalNode { 2966 return s.GetToken(SqlBaseParserSHOW, 0) 2967 } 2968 2969 func (s *ShowSchemasContext) SCHEMAS() antlr.TerminalNode { 2970 return s.GetToken(SqlBaseParserSCHEMAS, 0) 2971 } 2972 2973 func (s *ShowSchemasContext) Identifier() IIdentifierContext { 2974 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 2975 2976 if t == nil { 2977 return nil 2978 } 2979 2980 return t.(IIdentifierContext) 2981 } 2982 2983 func (s *ShowSchemasContext) LIKE() antlr.TerminalNode { 2984 return s.GetToken(SqlBaseParserLIKE, 0) 2985 } 2986 2987 func (s *ShowSchemasContext) FROM() antlr.TerminalNode { 2988 return s.GetToken(SqlBaseParserFROM, 0) 2989 } 2990 2991 func (s *ShowSchemasContext) IN() antlr.TerminalNode { 2992 return s.GetToken(SqlBaseParserIN, 0) 2993 } 2994 2995 func (s *ShowSchemasContext) AllSql_string() []ISql_stringContext { 2996 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISql_stringContext)(nil)).Elem()) 2997 var tst = make([]ISql_stringContext, len(ts)) 2998 2999 for i, t := range ts { 3000 if t != nil { 3001 tst[i] = t.(ISql_stringContext) 3002 } 3003 } 3004 3005 return tst 3006 } 3007 3008 func (s *ShowSchemasContext) Sql_string(i int) ISql_stringContext { 3009 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), i) 3010 3011 if t == nil { 3012 return nil 3013 } 3014 3015 return t.(ISql_stringContext) 3016 } 3017 3018 func (s *ShowSchemasContext) ESCAPE() antlr.TerminalNode { 3019 return s.GetToken(SqlBaseParserESCAPE, 0) 3020 } 3021 3022 func (s *ShowSchemasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3023 switch t := visitor.(type) { 3024 case SqlBaseVisitor: 3025 return t.VisitShowSchemas(s) 3026 3027 default: 3028 return t.VisitChildren(s) 3029 } 3030 } 3031 3032 type DropTableContext struct { 3033 *StatementContext 3034 } 3035 3036 func NewDropTableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DropTableContext { 3037 var p = new(DropTableContext) 3038 3039 p.StatementContext = NewEmptyStatementContext() 3040 p.parser = parser 3041 p.CopyFrom(ctx.(*StatementContext)) 3042 3043 return p 3044 } 3045 3046 func (s *DropTableContext) GetRuleContext() antlr.RuleContext { 3047 return s 3048 } 3049 3050 func (s *DropTableContext) DROP() antlr.TerminalNode { 3051 return s.GetToken(SqlBaseParserDROP, 0) 3052 } 3053 3054 func (s *DropTableContext) TABLE() antlr.TerminalNode { 3055 return s.GetToken(SqlBaseParserTABLE, 0) 3056 } 3057 3058 func (s *DropTableContext) QualifiedName() IQualifiedNameContext { 3059 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3060 3061 if t == nil { 3062 return nil 3063 } 3064 3065 return t.(IQualifiedNameContext) 3066 } 3067 3068 func (s *DropTableContext) IF() antlr.TerminalNode { 3069 return s.GetToken(SqlBaseParserIF, 0) 3070 } 3071 3072 func (s *DropTableContext) EXISTS() antlr.TerminalNode { 3073 return s.GetToken(SqlBaseParserEXISTS, 0) 3074 } 3075 3076 func (s *DropTableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3077 switch t := visitor.(type) { 3078 case SqlBaseVisitor: 3079 return t.VisitDropTable(s) 3080 3081 default: 3082 return t.VisitChildren(s) 3083 } 3084 } 3085 3086 type ShowColumnsContext struct { 3087 *StatementContext 3088 } 3089 3090 func NewShowColumnsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowColumnsContext { 3091 var p = new(ShowColumnsContext) 3092 3093 p.StatementContext = NewEmptyStatementContext() 3094 p.parser = parser 3095 p.CopyFrom(ctx.(*StatementContext)) 3096 3097 return p 3098 } 3099 3100 func (s *ShowColumnsContext) GetRuleContext() antlr.RuleContext { 3101 return s 3102 } 3103 3104 func (s *ShowColumnsContext) SHOW() antlr.TerminalNode { 3105 return s.GetToken(SqlBaseParserSHOW, 0) 3106 } 3107 3108 func (s *ShowColumnsContext) COLUMNS() antlr.TerminalNode { 3109 return s.GetToken(SqlBaseParserCOLUMNS, 0) 3110 } 3111 3112 func (s *ShowColumnsContext) QualifiedName() IQualifiedNameContext { 3113 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3114 3115 if t == nil { 3116 return nil 3117 } 3118 3119 return t.(IQualifiedNameContext) 3120 } 3121 3122 func (s *ShowColumnsContext) FROM() antlr.TerminalNode { 3123 return s.GetToken(SqlBaseParserFROM, 0) 3124 } 3125 3126 func (s *ShowColumnsContext) IN() antlr.TerminalNode { 3127 return s.GetToken(SqlBaseParserIN, 0) 3128 } 3129 3130 func (s *ShowColumnsContext) DESCRIBE() antlr.TerminalNode { 3131 return s.GetToken(SqlBaseParserDESCRIBE, 0) 3132 } 3133 3134 func (s *ShowColumnsContext) DESC() antlr.TerminalNode { 3135 return s.GetToken(SqlBaseParserDESC, 0) 3136 } 3137 3138 func (s *ShowColumnsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3139 switch t := visitor.(type) { 3140 case SqlBaseVisitor: 3141 return t.VisitShowColumns(s) 3142 3143 default: 3144 return t.VisitChildren(s) 3145 } 3146 } 3147 3148 type AddColumnContext struct { 3149 *StatementContext 3150 tableName IQualifiedNameContext 3151 column IColumnDefinitionContext 3152 } 3153 3154 func NewAddColumnContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AddColumnContext { 3155 var p = new(AddColumnContext) 3156 3157 p.StatementContext = NewEmptyStatementContext() 3158 p.parser = parser 3159 p.CopyFrom(ctx.(*StatementContext)) 3160 3161 return p 3162 } 3163 3164 func (s *AddColumnContext) GetTableName() IQualifiedNameContext { return s.tableName } 3165 3166 func (s *AddColumnContext) GetColumn() IColumnDefinitionContext { return s.column } 3167 3168 func (s *AddColumnContext) SetTableName(v IQualifiedNameContext) { s.tableName = v } 3169 3170 func (s *AddColumnContext) SetColumn(v IColumnDefinitionContext) { s.column = v } 3171 3172 func (s *AddColumnContext) GetRuleContext() antlr.RuleContext { 3173 return s 3174 } 3175 3176 func (s *AddColumnContext) ALTER() antlr.TerminalNode { 3177 return s.GetToken(SqlBaseParserALTER, 0) 3178 } 3179 3180 func (s *AddColumnContext) TABLE() antlr.TerminalNode { 3181 return s.GetToken(SqlBaseParserTABLE, 0) 3182 } 3183 3184 func (s *AddColumnContext) ADD() antlr.TerminalNode { 3185 return s.GetToken(SqlBaseParserADD, 0) 3186 } 3187 3188 func (s *AddColumnContext) COLUMN() antlr.TerminalNode { 3189 return s.GetToken(SqlBaseParserCOLUMN, 0) 3190 } 3191 3192 func (s *AddColumnContext) QualifiedName() IQualifiedNameContext { 3193 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3194 3195 if t == nil { 3196 return nil 3197 } 3198 3199 return t.(IQualifiedNameContext) 3200 } 3201 3202 func (s *AddColumnContext) ColumnDefinition() IColumnDefinitionContext { 3203 var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnDefinitionContext)(nil)).Elem(), 0) 3204 3205 if t == nil { 3206 return nil 3207 } 3208 3209 return t.(IColumnDefinitionContext) 3210 } 3211 3212 func (s *AddColumnContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3213 switch t := visitor.(type) { 3214 case SqlBaseVisitor: 3215 return t.VisitAddColumn(s) 3216 3217 default: 3218 return t.VisitChildren(s) 3219 } 3220 } 3221 3222 type ResetSessionContext struct { 3223 *StatementContext 3224 } 3225 3226 func NewResetSessionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ResetSessionContext { 3227 var p = new(ResetSessionContext) 3228 3229 p.StatementContext = NewEmptyStatementContext() 3230 p.parser = parser 3231 p.CopyFrom(ctx.(*StatementContext)) 3232 3233 return p 3234 } 3235 3236 func (s *ResetSessionContext) GetRuleContext() antlr.RuleContext { 3237 return s 3238 } 3239 3240 func (s *ResetSessionContext) RESET() antlr.TerminalNode { 3241 return s.GetToken(SqlBaseParserRESET, 0) 3242 } 3243 3244 func (s *ResetSessionContext) SESSION() antlr.TerminalNode { 3245 return s.GetToken(SqlBaseParserSESSION, 0) 3246 } 3247 3248 func (s *ResetSessionContext) QualifiedName() IQualifiedNameContext { 3249 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3250 3251 if t == nil { 3252 return nil 3253 } 3254 3255 return t.(IQualifiedNameContext) 3256 } 3257 3258 func (s *ResetSessionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3259 switch t := visitor.(type) { 3260 case SqlBaseVisitor: 3261 return t.VisitResetSession(s) 3262 3263 default: 3264 return t.VisitChildren(s) 3265 } 3266 } 3267 3268 type InsertIntoContext struct { 3269 *StatementContext 3270 } 3271 3272 func NewInsertIntoContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InsertIntoContext { 3273 var p = new(InsertIntoContext) 3274 3275 p.StatementContext = NewEmptyStatementContext() 3276 p.parser = parser 3277 p.CopyFrom(ctx.(*StatementContext)) 3278 3279 return p 3280 } 3281 3282 func (s *InsertIntoContext) GetRuleContext() antlr.RuleContext { 3283 return s 3284 } 3285 3286 func (s *InsertIntoContext) INSERT() antlr.TerminalNode { 3287 return s.GetToken(SqlBaseParserINSERT, 0) 3288 } 3289 3290 func (s *InsertIntoContext) INTO() antlr.TerminalNode { 3291 return s.GetToken(SqlBaseParserINTO, 0) 3292 } 3293 3294 func (s *InsertIntoContext) QualifiedName() IQualifiedNameContext { 3295 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3296 3297 if t == nil { 3298 return nil 3299 } 3300 3301 return t.(IQualifiedNameContext) 3302 } 3303 3304 func (s *InsertIntoContext) Query() IQueryContext { 3305 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 3306 3307 if t == nil { 3308 return nil 3309 } 3310 3311 return t.(IQueryContext) 3312 } 3313 3314 func (s *InsertIntoContext) ColumnAliases() IColumnAliasesContext { 3315 var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnAliasesContext)(nil)).Elem(), 0) 3316 3317 if t == nil { 3318 return nil 3319 } 3320 3321 return t.(IColumnAliasesContext) 3322 } 3323 3324 func (s *InsertIntoContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3325 switch t := visitor.(type) { 3326 case SqlBaseVisitor: 3327 return t.VisitInsertInto(s) 3328 3329 default: 3330 return t.VisitChildren(s) 3331 } 3332 } 3333 3334 type ShowSessionContext struct { 3335 *StatementContext 3336 } 3337 3338 func NewShowSessionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowSessionContext { 3339 var p = new(ShowSessionContext) 3340 3341 p.StatementContext = NewEmptyStatementContext() 3342 p.parser = parser 3343 p.CopyFrom(ctx.(*StatementContext)) 3344 3345 return p 3346 } 3347 3348 func (s *ShowSessionContext) GetRuleContext() antlr.RuleContext { 3349 return s 3350 } 3351 3352 func (s *ShowSessionContext) SHOW() antlr.TerminalNode { 3353 return s.GetToken(SqlBaseParserSHOW, 0) 3354 } 3355 3356 func (s *ShowSessionContext) SESSION() antlr.TerminalNode { 3357 return s.GetToken(SqlBaseParserSESSION, 0) 3358 } 3359 3360 func (s *ShowSessionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3361 switch t := visitor.(type) { 3362 case SqlBaseVisitor: 3363 return t.VisitShowSession(s) 3364 3365 default: 3366 return t.VisitChildren(s) 3367 } 3368 } 3369 3370 type CreateSchemaContext struct { 3371 *StatementContext 3372 } 3373 3374 func NewCreateSchemaContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateSchemaContext { 3375 var p = new(CreateSchemaContext) 3376 3377 p.StatementContext = NewEmptyStatementContext() 3378 p.parser = parser 3379 p.CopyFrom(ctx.(*StatementContext)) 3380 3381 return p 3382 } 3383 3384 func (s *CreateSchemaContext) GetRuleContext() antlr.RuleContext { 3385 return s 3386 } 3387 3388 func (s *CreateSchemaContext) CREATE() antlr.TerminalNode { 3389 return s.GetToken(SqlBaseParserCREATE, 0) 3390 } 3391 3392 func (s *CreateSchemaContext) SCHEMA() antlr.TerminalNode { 3393 return s.GetToken(SqlBaseParserSCHEMA, 0) 3394 } 3395 3396 func (s *CreateSchemaContext) QualifiedName() IQualifiedNameContext { 3397 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3398 3399 if t == nil { 3400 return nil 3401 } 3402 3403 return t.(IQualifiedNameContext) 3404 } 3405 3406 func (s *CreateSchemaContext) IF() antlr.TerminalNode { 3407 return s.GetToken(SqlBaseParserIF, 0) 3408 } 3409 3410 func (s *CreateSchemaContext) NOT() antlr.TerminalNode { 3411 return s.GetToken(SqlBaseParserNOT, 0) 3412 } 3413 3414 func (s *CreateSchemaContext) EXISTS() antlr.TerminalNode { 3415 return s.GetToken(SqlBaseParserEXISTS, 0) 3416 } 3417 3418 func (s *CreateSchemaContext) WITH() antlr.TerminalNode { 3419 return s.GetToken(SqlBaseParserWITH, 0) 3420 } 3421 3422 func (s *CreateSchemaContext) Properties() IPropertiesContext { 3423 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertiesContext)(nil)).Elem(), 0) 3424 3425 if t == nil { 3426 return nil 3427 } 3428 3429 return t.(IPropertiesContext) 3430 } 3431 3432 func (s *CreateSchemaContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3433 switch t := visitor.(type) { 3434 case SqlBaseVisitor: 3435 return t.VisitCreateSchema(s) 3436 3437 default: 3438 return t.VisitChildren(s) 3439 } 3440 } 3441 3442 type ExecuteContext struct { 3443 *StatementContext 3444 } 3445 3446 func NewExecuteContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExecuteContext { 3447 var p = new(ExecuteContext) 3448 3449 p.StatementContext = NewEmptyStatementContext() 3450 p.parser = parser 3451 p.CopyFrom(ctx.(*StatementContext)) 3452 3453 return p 3454 } 3455 3456 func (s *ExecuteContext) GetRuleContext() antlr.RuleContext { 3457 return s 3458 } 3459 3460 func (s *ExecuteContext) EXECUTE() antlr.TerminalNode { 3461 return s.GetToken(SqlBaseParserEXECUTE, 0) 3462 } 3463 3464 func (s *ExecuteContext) Identifier() IIdentifierContext { 3465 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 3466 3467 if t == nil { 3468 return nil 3469 } 3470 3471 return t.(IIdentifierContext) 3472 } 3473 3474 func (s *ExecuteContext) USING() antlr.TerminalNode { 3475 return s.GetToken(SqlBaseParserUSING, 0) 3476 } 3477 3478 func (s *ExecuteContext) AllExpression() []IExpressionContext { 3479 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 3480 var tst = make([]IExpressionContext, len(ts)) 3481 3482 for i, t := range ts { 3483 if t != nil { 3484 tst[i] = t.(IExpressionContext) 3485 } 3486 } 3487 3488 return tst 3489 } 3490 3491 func (s *ExecuteContext) Expression(i int) IExpressionContext { 3492 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 3493 3494 if t == nil { 3495 return nil 3496 } 3497 3498 return t.(IExpressionContext) 3499 } 3500 3501 func (s *ExecuteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3502 switch t := visitor.(type) { 3503 case SqlBaseVisitor: 3504 return t.VisitExecute(s) 3505 3506 default: 3507 return t.VisitChildren(s) 3508 } 3509 } 3510 3511 type CallContext struct { 3512 *StatementContext 3513 } 3514 3515 func NewCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CallContext { 3516 var p = new(CallContext) 3517 3518 p.StatementContext = NewEmptyStatementContext() 3519 p.parser = parser 3520 p.CopyFrom(ctx.(*StatementContext)) 3521 3522 return p 3523 } 3524 3525 func (s *CallContext) GetRuleContext() antlr.RuleContext { 3526 return s 3527 } 3528 3529 func (s *CallContext) CALL() antlr.TerminalNode { 3530 return s.GetToken(SqlBaseParserCALL, 0) 3531 } 3532 3533 func (s *CallContext) QualifiedName() IQualifiedNameContext { 3534 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3535 3536 if t == nil { 3537 return nil 3538 } 3539 3540 return t.(IQualifiedNameContext) 3541 } 3542 3543 func (s *CallContext) AllCallArgument() []ICallArgumentContext { 3544 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ICallArgumentContext)(nil)).Elem()) 3545 var tst = make([]ICallArgumentContext, len(ts)) 3546 3547 for i, t := range ts { 3548 if t != nil { 3549 tst[i] = t.(ICallArgumentContext) 3550 } 3551 } 3552 3553 return tst 3554 } 3555 3556 func (s *CallContext) CallArgument(i int) ICallArgumentContext { 3557 var t = s.GetTypedRuleContext(reflect.TypeOf((*ICallArgumentContext)(nil)).Elem(), i) 3558 3559 if t == nil { 3560 return nil 3561 } 3562 3563 return t.(ICallArgumentContext) 3564 } 3565 3566 func (s *CallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3567 switch t := visitor.(type) { 3568 case SqlBaseVisitor: 3569 return t.VisitCall(s) 3570 3571 default: 3572 return t.VisitChildren(s) 3573 } 3574 } 3575 3576 type RenameSchemaContext struct { 3577 *StatementContext 3578 } 3579 3580 func NewRenameSchemaContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RenameSchemaContext { 3581 var p = new(RenameSchemaContext) 3582 3583 p.StatementContext = NewEmptyStatementContext() 3584 p.parser = parser 3585 p.CopyFrom(ctx.(*StatementContext)) 3586 3587 return p 3588 } 3589 3590 func (s *RenameSchemaContext) GetRuleContext() antlr.RuleContext { 3591 return s 3592 } 3593 3594 func (s *RenameSchemaContext) ALTER() antlr.TerminalNode { 3595 return s.GetToken(SqlBaseParserALTER, 0) 3596 } 3597 3598 func (s *RenameSchemaContext) SCHEMA() antlr.TerminalNode { 3599 return s.GetToken(SqlBaseParserSCHEMA, 0) 3600 } 3601 3602 func (s *RenameSchemaContext) QualifiedName() IQualifiedNameContext { 3603 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3604 3605 if t == nil { 3606 return nil 3607 } 3608 3609 return t.(IQualifiedNameContext) 3610 } 3611 3612 func (s *RenameSchemaContext) RENAME() antlr.TerminalNode { 3613 return s.GetToken(SqlBaseParserRENAME, 0) 3614 } 3615 3616 func (s *RenameSchemaContext) TO() antlr.TerminalNode { 3617 return s.GetToken(SqlBaseParserTO, 0) 3618 } 3619 3620 func (s *RenameSchemaContext) Identifier() IIdentifierContext { 3621 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 3622 3623 if t == nil { 3624 return nil 3625 } 3626 3627 return t.(IIdentifierContext) 3628 } 3629 3630 func (s *RenameSchemaContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3631 switch t := visitor.(type) { 3632 case SqlBaseVisitor: 3633 return t.VisitRenameSchema(s) 3634 3635 default: 3636 return t.VisitChildren(s) 3637 } 3638 } 3639 3640 type ShowGrantsContext struct { 3641 *StatementContext 3642 } 3643 3644 func NewShowGrantsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowGrantsContext { 3645 var p = new(ShowGrantsContext) 3646 3647 p.StatementContext = NewEmptyStatementContext() 3648 p.parser = parser 3649 p.CopyFrom(ctx.(*StatementContext)) 3650 3651 return p 3652 } 3653 3654 func (s *ShowGrantsContext) GetRuleContext() antlr.RuleContext { 3655 return s 3656 } 3657 3658 func (s *ShowGrantsContext) SHOW() antlr.TerminalNode { 3659 return s.GetToken(SqlBaseParserSHOW, 0) 3660 } 3661 3662 func (s *ShowGrantsContext) GRANTS() antlr.TerminalNode { 3663 return s.GetToken(SqlBaseParserGRANTS, 0) 3664 } 3665 3666 func (s *ShowGrantsContext) ON() antlr.TerminalNode { 3667 return s.GetToken(SqlBaseParserON, 0) 3668 } 3669 3670 func (s *ShowGrantsContext) QualifiedName() IQualifiedNameContext { 3671 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3672 3673 if t == nil { 3674 return nil 3675 } 3676 3677 return t.(IQualifiedNameContext) 3678 } 3679 3680 func (s *ShowGrantsContext) TABLE() antlr.TerminalNode { 3681 return s.GetToken(SqlBaseParserTABLE, 0) 3682 } 3683 3684 func (s *ShowGrantsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3685 switch t := visitor.(type) { 3686 case SqlBaseVisitor: 3687 return t.VisitShowGrants(s) 3688 3689 default: 3690 return t.VisitChildren(s) 3691 } 3692 } 3693 3694 type ShowFunctionsContext struct { 3695 *StatementContext 3696 } 3697 3698 func NewShowFunctionsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowFunctionsContext { 3699 var p = new(ShowFunctionsContext) 3700 3701 p.StatementContext = NewEmptyStatementContext() 3702 p.parser = parser 3703 p.CopyFrom(ctx.(*StatementContext)) 3704 3705 return p 3706 } 3707 3708 func (s *ShowFunctionsContext) GetRuleContext() antlr.RuleContext { 3709 return s 3710 } 3711 3712 func (s *ShowFunctionsContext) SHOW() antlr.TerminalNode { 3713 return s.GetToken(SqlBaseParserSHOW, 0) 3714 } 3715 3716 func (s *ShowFunctionsContext) FUNCTIONS() antlr.TerminalNode { 3717 return s.GetToken(SqlBaseParserFUNCTIONS, 0) 3718 } 3719 3720 func (s *ShowFunctionsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3721 switch t := visitor.(type) { 3722 case SqlBaseVisitor: 3723 return t.VisitShowFunctions(s) 3724 3725 default: 3726 return t.VisitChildren(s) 3727 } 3728 } 3729 3730 type DescribeOutputContext struct { 3731 *StatementContext 3732 } 3733 3734 func NewDescribeOutputContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DescribeOutputContext { 3735 var p = new(DescribeOutputContext) 3736 3737 p.StatementContext = NewEmptyStatementContext() 3738 p.parser = parser 3739 p.CopyFrom(ctx.(*StatementContext)) 3740 3741 return p 3742 } 3743 3744 func (s *DescribeOutputContext) GetRuleContext() antlr.RuleContext { 3745 return s 3746 } 3747 3748 func (s *DescribeOutputContext) DESCRIBE() antlr.TerminalNode { 3749 return s.GetToken(SqlBaseParserDESCRIBE, 0) 3750 } 3751 3752 func (s *DescribeOutputContext) OUTPUT() antlr.TerminalNode { 3753 return s.GetToken(SqlBaseParserOUTPUT, 0) 3754 } 3755 3756 func (s *DescribeOutputContext) Identifier() IIdentifierContext { 3757 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 3758 3759 if t == nil { 3760 return nil 3761 } 3762 3763 return t.(IIdentifierContext) 3764 } 3765 3766 func (s *DescribeOutputContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3767 switch t := visitor.(type) { 3768 case SqlBaseVisitor: 3769 return t.VisitDescribeOutput(s) 3770 3771 default: 3772 return t.VisitChildren(s) 3773 } 3774 } 3775 3776 type DropSchemaContext struct { 3777 *StatementContext 3778 } 3779 3780 func NewDropSchemaContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DropSchemaContext { 3781 var p = new(DropSchemaContext) 3782 3783 p.StatementContext = NewEmptyStatementContext() 3784 p.parser = parser 3785 p.CopyFrom(ctx.(*StatementContext)) 3786 3787 return p 3788 } 3789 3790 func (s *DropSchemaContext) GetRuleContext() antlr.RuleContext { 3791 return s 3792 } 3793 3794 func (s *DropSchemaContext) DROP() antlr.TerminalNode { 3795 return s.GetToken(SqlBaseParserDROP, 0) 3796 } 3797 3798 func (s *DropSchemaContext) SCHEMA() antlr.TerminalNode { 3799 return s.GetToken(SqlBaseParserSCHEMA, 0) 3800 } 3801 3802 func (s *DropSchemaContext) QualifiedName() IQualifiedNameContext { 3803 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3804 3805 if t == nil { 3806 return nil 3807 } 3808 3809 return t.(IQualifiedNameContext) 3810 } 3811 3812 func (s *DropSchemaContext) IF() antlr.TerminalNode { 3813 return s.GetToken(SqlBaseParserIF, 0) 3814 } 3815 3816 func (s *DropSchemaContext) EXISTS() antlr.TerminalNode { 3817 return s.GetToken(SqlBaseParserEXISTS, 0) 3818 } 3819 3820 func (s *DropSchemaContext) CASCADE() antlr.TerminalNode { 3821 return s.GetToken(SqlBaseParserCASCADE, 0) 3822 } 3823 3824 func (s *DropSchemaContext) RESTRICT() antlr.TerminalNode { 3825 return s.GetToken(SqlBaseParserRESTRICT, 0) 3826 } 3827 3828 func (s *DropSchemaContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3829 switch t := visitor.(type) { 3830 case SqlBaseVisitor: 3831 return t.VisitDropSchema(s) 3832 3833 default: 3834 return t.VisitChildren(s) 3835 } 3836 } 3837 3838 type GrantContext struct { 3839 *StatementContext 3840 grantee IIdentifierContext 3841 } 3842 3843 func NewGrantContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GrantContext { 3844 var p = new(GrantContext) 3845 3846 p.StatementContext = NewEmptyStatementContext() 3847 p.parser = parser 3848 p.CopyFrom(ctx.(*StatementContext)) 3849 3850 return p 3851 } 3852 3853 func (s *GrantContext) GetGrantee() IIdentifierContext { return s.grantee } 3854 3855 func (s *GrantContext) SetGrantee(v IIdentifierContext) { s.grantee = v } 3856 3857 func (s *GrantContext) GetRuleContext() antlr.RuleContext { 3858 return s 3859 } 3860 3861 func (s *GrantContext) AllGRANT() []antlr.TerminalNode { 3862 return s.GetTokens(SqlBaseParserGRANT) 3863 } 3864 3865 func (s *GrantContext) GRANT(i int) antlr.TerminalNode { 3866 return s.GetToken(SqlBaseParserGRANT, i) 3867 } 3868 3869 func (s *GrantContext) ON() antlr.TerminalNode { 3870 return s.GetToken(SqlBaseParserON, 0) 3871 } 3872 3873 func (s *GrantContext) QualifiedName() IQualifiedNameContext { 3874 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3875 3876 if t == nil { 3877 return nil 3878 } 3879 3880 return t.(IQualifiedNameContext) 3881 } 3882 3883 func (s *GrantContext) TO() antlr.TerminalNode { 3884 return s.GetToken(SqlBaseParserTO, 0) 3885 } 3886 3887 func (s *GrantContext) Identifier() IIdentifierContext { 3888 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 3889 3890 if t == nil { 3891 return nil 3892 } 3893 3894 return t.(IIdentifierContext) 3895 } 3896 3897 func (s *GrantContext) AllPrivilege() []IPrivilegeContext { 3898 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IPrivilegeContext)(nil)).Elem()) 3899 var tst = make([]IPrivilegeContext, len(ts)) 3900 3901 for i, t := range ts { 3902 if t != nil { 3903 tst[i] = t.(IPrivilegeContext) 3904 } 3905 } 3906 3907 return tst 3908 } 3909 3910 func (s *GrantContext) Privilege(i int) IPrivilegeContext { 3911 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPrivilegeContext)(nil)).Elem(), i) 3912 3913 if t == nil { 3914 return nil 3915 } 3916 3917 return t.(IPrivilegeContext) 3918 } 3919 3920 func (s *GrantContext) ALL() antlr.TerminalNode { 3921 return s.GetToken(SqlBaseParserALL, 0) 3922 } 3923 3924 func (s *GrantContext) PRIVILEGES() antlr.TerminalNode { 3925 return s.GetToken(SqlBaseParserPRIVILEGES, 0) 3926 } 3927 3928 func (s *GrantContext) TABLE() antlr.TerminalNode { 3929 return s.GetToken(SqlBaseParserTABLE, 0) 3930 } 3931 3932 func (s *GrantContext) WITH() antlr.TerminalNode { 3933 return s.GetToken(SqlBaseParserWITH, 0) 3934 } 3935 3936 func (s *GrantContext) OPTION() antlr.TerminalNode { 3937 return s.GetToken(SqlBaseParserOPTION, 0) 3938 } 3939 3940 func (s *GrantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3941 switch t := visitor.(type) { 3942 case SqlBaseVisitor: 3943 return t.VisitGrant(s) 3944 3945 default: 3946 return t.VisitChildren(s) 3947 } 3948 } 3949 3950 type ShowCreateViewContext struct { 3951 *StatementContext 3952 } 3953 3954 func NewShowCreateViewContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ShowCreateViewContext { 3955 var p = new(ShowCreateViewContext) 3956 3957 p.StatementContext = NewEmptyStatementContext() 3958 p.parser = parser 3959 p.CopyFrom(ctx.(*StatementContext)) 3960 3961 return p 3962 } 3963 3964 func (s *ShowCreateViewContext) GetRuleContext() antlr.RuleContext { 3965 return s 3966 } 3967 3968 func (s *ShowCreateViewContext) SHOW() antlr.TerminalNode { 3969 return s.GetToken(SqlBaseParserSHOW, 0) 3970 } 3971 3972 func (s *ShowCreateViewContext) CREATE() antlr.TerminalNode { 3973 return s.GetToken(SqlBaseParserCREATE, 0) 3974 } 3975 3976 func (s *ShowCreateViewContext) VIEW() antlr.TerminalNode { 3977 return s.GetToken(SqlBaseParserVIEW, 0) 3978 } 3979 3980 func (s *ShowCreateViewContext) QualifiedName() IQualifiedNameContext { 3981 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 3982 3983 if t == nil { 3984 return nil 3985 } 3986 3987 return t.(IQualifiedNameContext) 3988 } 3989 3990 func (s *ShowCreateViewContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 3991 switch t := visitor.(type) { 3992 case SqlBaseVisitor: 3993 return t.VisitShowCreateView(s) 3994 3995 default: 3996 return t.VisitChildren(s) 3997 } 3998 } 3999 4000 func (p *SqlBaseParser) Statement() (localctx IStatementContext) { 4001 localctx = NewStatementContext(p, p.GetParserRuleContext(), p.GetState()) 4002 p.EnterRule(localctx, 4, SqlBaseParserRULE_statement) 4003 var _la int 4004 4005 defer func() { 4006 p.ExitRule() 4007 }() 4008 4009 defer func() { 4010 if err := recover(); err != nil { 4011 if v, ok := err.(antlr.RecognitionException); ok { 4012 localctx.SetException(v) 4013 p.GetErrorHandler().ReportError(p, v) 4014 p.GetErrorHandler().Recover(p, v) 4015 } else { 4016 panic(err) 4017 } 4018 } 4019 }() 4020 4021 p.SetState(505) 4022 p.GetErrorHandler().Sync(p) 4023 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 49, p.GetParserRuleContext()) { 4024 case 1: 4025 localctx = NewStatementDefaultContext(p, localctx) 4026 p.EnterOuterAlt(localctx, 1) 4027 { 4028 p.SetState(118) 4029 p.Query() 4030 } 4031 4032 case 2: 4033 localctx = NewUseContext(p, localctx) 4034 p.EnterOuterAlt(localctx, 2) 4035 { 4036 p.SetState(119) 4037 p.Match(SqlBaseParserUSE) 4038 } 4039 { 4040 p.SetState(120) 4041 4042 var _x = p.Identifier() 4043 4044 localctx.(*UseContext).schema = _x 4045 } 4046 4047 case 3: 4048 localctx = NewUseContext(p, localctx) 4049 p.EnterOuterAlt(localctx, 3) 4050 { 4051 p.SetState(121) 4052 p.Match(SqlBaseParserUSE) 4053 } 4054 { 4055 p.SetState(122) 4056 4057 var _x = p.Identifier() 4058 4059 localctx.(*UseContext).catalog = _x 4060 } 4061 { 4062 p.SetState(123) 4063 p.Match(SqlBaseParserT__0) 4064 } 4065 { 4066 p.SetState(124) 4067 4068 var _x = p.Identifier() 4069 4070 localctx.(*UseContext).schema = _x 4071 } 4072 4073 case 4: 4074 localctx = NewCreateSchemaContext(p, localctx) 4075 p.EnterOuterAlt(localctx, 4) 4076 { 4077 p.SetState(126) 4078 p.Match(SqlBaseParserCREATE) 4079 } 4080 { 4081 p.SetState(127) 4082 p.Match(SqlBaseParserSCHEMA) 4083 } 4084 p.SetState(131) 4085 p.GetErrorHandler().Sync(p) 4086 4087 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 0, p.GetParserRuleContext()) == 1 { 4088 { 4089 p.SetState(128) 4090 p.Match(SqlBaseParserIF) 4091 } 4092 { 4093 p.SetState(129) 4094 p.Match(SqlBaseParserNOT) 4095 } 4096 { 4097 p.SetState(130) 4098 p.Match(SqlBaseParserEXISTS) 4099 } 4100 4101 } 4102 { 4103 p.SetState(133) 4104 p.QualifiedName() 4105 } 4106 p.SetState(136) 4107 p.GetErrorHandler().Sync(p) 4108 _la = p.GetTokenStream().LA(1) 4109 4110 if _la == SqlBaseParserWITH { 4111 { 4112 p.SetState(134) 4113 p.Match(SqlBaseParserWITH) 4114 } 4115 { 4116 p.SetState(135) 4117 p.Properties() 4118 } 4119 4120 } 4121 4122 case 5: 4123 localctx = NewDropSchemaContext(p, localctx) 4124 p.EnterOuterAlt(localctx, 5) 4125 { 4126 p.SetState(138) 4127 p.Match(SqlBaseParserDROP) 4128 } 4129 { 4130 p.SetState(139) 4131 p.Match(SqlBaseParserSCHEMA) 4132 } 4133 p.SetState(142) 4134 p.GetErrorHandler().Sync(p) 4135 4136 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 2, p.GetParserRuleContext()) == 1 { 4137 { 4138 p.SetState(140) 4139 p.Match(SqlBaseParserIF) 4140 } 4141 { 4142 p.SetState(141) 4143 p.Match(SqlBaseParserEXISTS) 4144 } 4145 4146 } 4147 { 4148 p.SetState(144) 4149 p.QualifiedName() 4150 } 4151 p.SetState(146) 4152 p.GetErrorHandler().Sync(p) 4153 _la = p.GetTokenStream().LA(1) 4154 4155 if _la == SqlBaseParserCASCADE || _la == SqlBaseParserRESTRICT { 4156 { 4157 p.SetState(145) 4158 _la = p.GetTokenStream().LA(1) 4159 4160 if !(_la == SqlBaseParserCASCADE || _la == SqlBaseParserRESTRICT) { 4161 p.GetErrorHandler().RecoverInline(p) 4162 } else { 4163 p.GetErrorHandler().ReportMatch(p) 4164 p.Consume() 4165 } 4166 } 4167 4168 } 4169 4170 case 6: 4171 localctx = NewRenameSchemaContext(p, localctx) 4172 p.EnterOuterAlt(localctx, 6) 4173 { 4174 p.SetState(148) 4175 p.Match(SqlBaseParserALTER) 4176 } 4177 { 4178 p.SetState(149) 4179 p.Match(SqlBaseParserSCHEMA) 4180 } 4181 { 4182 p.SetState(150) 4183 p.QualifiedName() 4184 } 4185 { 4186 p.SetState(151) 4187 p.Match(SqlBaseParserRENAME) 4188 } 4189 { 4190 p.SetState(152) 4191 p.Match(SqlBaseParserTO) 4192 } 4193 { 4194 p.SetState(153) 4195 p.Identifier() 4196 } 4197 4198 case 7: 4199 localctx = NewCreateTableAsSelectContext(p, localctx) 4200 p.EnterOuterAlt(localctx, 7) 4201 { 4202 p.SetState(155) 4203 p.Match(SqlBaseParserCREATE) 4204 } 4205 { 4206 p.SetState(156) 4207 p.Match(SqlBaseParserTABLE) 4208 } 4209 p.SetState(160) 4210 p.GetErrorHandler().Sync(p) 4211 4212 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 4, p.GetParserRuleContext()) == 1 { 4213 { 4214 p.SetState(157) 4215 p.Match(SqlBaseParserIF) 4216 } 4217 { 4218 p.SetState(158) 4219 p.Match(SqlBaseParserNOT) 4220 } 4221 { 4222 p.SetState(159) 4223 p.Match(SqlBaseParserEXISTS) 4224 } 4225 4226 } 4227 { 4228 p.SetState(162) 4229 p.QualifiedName() 4230 } 4231 p.SetState(164) 4232 p.GetErrorHandler().Sync(p) 4233 _la = p.GetTokenStream().LA(1) 4234 4235 if _la == SqlBaseParserT__1 { 4236 { 4237 p.SetState(163) 4238 p.ColumnAliases() 4239 } 4240 4241 } 4242 p.SetState(168) 4243 p.GetErrorHandler().Sync(p) 4244 _la = p.GetTokenStream().LA(1) 4245 4246 if _la == SqlBaseParserCOMMENT { 4247 { 4248 p.SetState(166) 4249 p.Match(SqlBaseParserCOMMENT) 4250 } 4251 { 4252 p.SetState(167) 4253 p.Sql_string() 4254 } 4255 4256 } 4257 p.SetState(172) 4258 p.GetErrorHandler().Sync(p) 4259 _la = p.GetTokenStream().LA(1) 4260 4261 if _la == SqlBaseParserWITH { 4262 { 4263 p.SetState(170) 4264 p.Match(SqlBaseParserWITH) 4265 } 4266 { 4267 p.SetState(171) 4268 p.Properties() 4269 } 4270 4271 } 4272 { 4273 p.SetState(174) 4274 p.Match(SqlBaseParserAS) 4275 } 4276 p.SetState(180) 4277 p.GetErrorHandler().Sync(p) 4278 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 8, p.GetParserRuleContext()) { 4279 case 1: 4280 { 4281 p.SetState(175) 4282 p.Query() 4283 } 4284 4285 case 2: 4286 { 4287 p.SetState(176) 4288 p.Match(SqlBaseParserT__1) 4289 } 4290 { 4291 p.SetState(177) 4292 p.Query() 4293 } 4294 { 4295 p.SetState(178) 4296 p.Match(SqlBaseParserT__2) 4297 } 4298 4299 } 4300 p.SetState(187) 4301 p.GetErrorHandler().Sync(p) 4302 _la = p.GetTokenStream().LA(1) 4303 4304 if _la == SqlBaseParserWITH { 4305 { 4306 p.SetState(182) 4307 p.Match(SqlBaseParserWITH) 4308 } 4309 p.SetState(184) 4310 p.GetErrorHandler().Sync(p) 4311 _la = p.GetTokenStream().LA(1) 4312 4313 if _la == SqlBaseParserNO { 4314 { 4315 p.SetState(183) 4316 p.Match(SqlBaseParserNO) 4317 } 4318 4319 } 4320 { 4321 p.SetState(186) 4322 p.Match(SqlBaseParserDATA) 4323 } 4324 4325 } 4326 4327 case 8: 4328 localctx = NewCreateTableContext(p, localctx) 4329 p.EnterOuterAlt(localctx, 8) 4330 { 4331 p.SetState(189) 4332 p.Match(SqlBaseParserCREATE) 4333 } 4334 { 4335 p.SetState(190) 4336 p.Match(SqlBaseParserTABLE) 4337 } 4338 p.SetState(194) 4339 p.GetErrorHandler().Sync(p) 4340 4341 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 11, p.GetParserRuleContext()) == 1 { 4342 { 4343 p.SetState(191) 4344 p.Match(SqlBaseParserIF) 4345 } 4346 { 4347 p.SetState(192) 4348 p.Match(SqlBaseParserNOT) 4349 } 4350 { 4351 p.SetState(193) 4352 p.Match(SqlBaseParserEXISTS) 4353 } 4354 4355 } 4356 { 4357 p.SetState(196) 4358 p.QualifiedName() 4359 } 4360 { 4361 p.SetState(197) 4362 p.Match(SqlBaseParserT__1) 4363 } 4364 { 4365 p.SetState(198) 4366 p.TableElement() 4367 } 4368 p.SetState(203) 4369 p.GetErrorHandler().Sync(p) 4370 _la = p.GetTokenStream().LA(1) 4371 4372 for _la == SqlBaseParserT__3 { 4373 { 4374 p.SetState(199) 4375 p.Match(SqlBaseParserT__3) 4376 } 4377 { 4378 p.SetState(200) 4379 p.TableElement() 4380 } 4381 4382 p.SetState(205) 4383 p.GetErrorHandler().Sync(p) 4384 _la = p.GetTokenStream().LA(1) 4385 } 4386 { 4387 p.SetState(206) 4388 p.Match(SqlBaseParserT__2) 4389 } 4390 p.SetState(209) 4391 p.GetErrorHandler().Sync(p) 4392 _la = p.GetTokenStream().LA(1) 4393 4394 if _la == SqlBaseParserCOMMENT { 4395 { 4396 p.SetState(207) 4397 p.Match(SqlBaseParserCOMMENT) 4398 } 4399 { 4400 p.SetState(208) 4401 p.Sql_string() 4402 } 4403 4404 } 4405 p.SetState(213) 4406 p.GetErrorHandler().Sync(p) 4407 _la = p.GetTokenStream().LA(1) 4408 4409 if _la == SqlBaseParserWITH { 4410 { 4411 p.SetState(211) 4412 p.Match(SqlBaseParserWITH) 4413 } 4414 { 4415 p.SetState(212) 4416 p.Properties() 4417 } 4418 4419 } 4420 4421 case 9: 4422 localctx = NewDropTableContext(p, localctx) 4423 p.EnterOuterAlt(localctx, 9) 4424 { 4425 p.SetState(215) 4426 p.Match(SqlBaseParserDROP) 4427 } 4428 { 4429 p.SetState(216) 4430 p.Match(SqlBaseParserTABLE) 4431 } 4432 p.SetState(219) 4433 p.GetErrorHandler().Sync(p) 4434 4435 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 15, p.GetParserRuleContext()) == 1 { 4436 { 4437 p.SetState(217) 4438 p.Match(SqlBaseParserIF) 4439 } 4440 { 4441 p.SetState(218) 4442 p.Match(SqlBaseParserEXISTS) 4443 } 4444 4445 } 4446 { 4447 p.SetState(221) 4448 p.QualifiedName() 4449 } 4450 4451 case 10: 4452 localctx = NewInsertIntoContext(p, localctx) 4453 p.EnterOuterAlt(localctx, 10) 4454 { 4455 p.SetState(222) 4456 p.Match(SqlBaseParserINSERT) 4457 } 4458 { 4459 p.SetState(223) 4460 p.Match(SqlBaseParserINTO) 4461 } 4462 { 4463 p.SetState(224) 4464 p.QualifiedName() 4465 } 4466 p.SetState(226) 4467 p.GetErrorHandler().Sync(p) 4468 4469 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 { 4470 { 4471 p.SetState(225) 4472 p.ColumnAliases() 4473 } 4474 4475 } 4476 { 4477 p.SetState(228) 4478 p.Query() 4479 } 4480 4481 case 11: 4482 localctx = NewDeleteContext(p, localctx) 4483 p.EnterOuterAlt(localctx, 11) 4484 { 4485 p.SetState(230) 4486 p.Match(SqlBaseParserDELETE) 4487 } 4488 { 4489 p.SetState(231) 4490 p.Match(SqlBaseParserFROM) 4491 } 4492 { 4493 p.SetState(232) 4494 p.QualifiedName() 4495 } 4496 p.SetState(235) 4497 p.GetErrorHandler().Sync(p) 4498 _la = p.GetTokenStream().LA(1) 4499 4500 if _la == SqlBaseParserWHERE { 4501 { 4502 p.SetState(233) 4503 p.Match(SqlBaseParserWHERE) 4504 } 4505 { 4506 p.SetState(234) 4507 p.booleanExpression(0) 4508 } 4509 4510 } 4511 4512 case 12: 4513 localctx = NewRenameTableContext(p, localctx) 4514 p.EnterOuterAlt(localctx, 12) 4515 { 4516 p.SetState(237) 4517 p.Match(SqlBaseParserALTER) 4518 } 4519 { 4520 p.SetState(238) 4521 p.Match(SqlBaseParserTABLE) 4522 } 4523 { 4524 p.SetState(239) 4525 4526 var _x = p.QualifiedName() 4527 4528 localctx.(*RenameTableContext).from = _x 4529 } 4530 { 4531 p.SetState(240) 4532 p.Match(SqlBaseParserRENAME) 4533 } 4534 { 4535 p.SetState(241) 4536 p.Match(SqlBaseParserTO) 4537 } 4538 { 4539 p.SetState(242) 4540 4541 var _x = p.QualifiedName() 4542 4543 localctx.(*RenameTableContext).to = _x 4544 } 4545 4546 case 13: 4547 localctx = NewRenameColumnContext(p, localctx) 4548 p.EnterOuterAlt(localctx, 13) 4549 { 4550 p.SetState(244) 4551 p.Match(SqlBaseParserALTER) 4552 } 4553 { 4554 p.SetState(245) 4555 p.Match(SqlBaseParserTABLE) 4556 } 4557 { 4558 p.SetState(246) 4559 4560 var _x = p.QualifiedName() 4561 4562 localctx.(*RenameColumnContext).tableName = _x 4563 } 4564 { 4565 p.SetState(247) 4566 p.Match(SqlBaseParserRENAME) 4567 } 4568 { 4569 p.SetState(248) 4570 p.Match(SqlBaseParserCOLUMN) 4571 } 4572 { 4573 p.SetState(249) 4574 4575 var _x = p.Identifier() 4576 4577 localctx.(*RenameColumnContext).from = _x 4578 } 4579 { 4580 p.SetState(250) 4581 p.Match(SqlBaseParserTO) 4582 } 4583 { 4584 p.SetState(251) 4585 4586 var _x = p.Identifier() 4587 4588 localctx.(*RenameColumnContext).to = _x 4589 } 4590 4591 case 14: 4592 localctx = NewDropColumnContext(p, localctx) 4593 p.EnterOuterAlt(localctx, 14) 4594 { 4595 p.SetState(253) 4596 p.Match(SqlBaseParserALTER) 4597 } 4598 { 4599 p.SetState(254) 4600 p.Match(SqlBaseParserTABLE) 4601 } 4602 { 4603 p.SetState(255) 4604 4605 var _x = p.QualifiedName() 4606 4607 localctx.(*DropColumnContext).tableName = _x 4608 } 4609 { 4610 p.SetState(256) 4611 p.Match(SqlBaseParserDROP) 4612 } 4613 { 4614 p.SetState(257) 4615 p.Match(SqlBaseParserCOLUMN) 4616 } 4617 { 4618 p.SetState(258) 4619 4620 var _x = p.QualifiedName() 4621 4622 localctx.(*DropColumnContext).column = _x 4623 } 4624 4625 case 15: 4626 localctx = NewAddColumnContext(p, localctx) 4627 p.EnterOuterAlt(localctx, 15) 4628 { 4629 p.SetState(260) 4630 p.Match(SqlBaseParserALTER) 4631 } 4632 { 4633 p.SetState(261) 4634 p.Match(SqlBaseParserTABLE) 4635 } 4636 { 4637 p.SetState(262) 4638 4639 var _x = p.QualifiedName() 4640 4641 localctx.(*AddColumnContext).tableName = _x 4642 } 4643 { 4644 p.SetState(263) 4645 p.Match(SqlBaseParserADD) 4646 } 4647 { 4648 p.SetState(264) 4649 p.Match(SqlBaseParserCOLUMN) 4650 } 4651 { 4652 p.SetState(265) 4653 4654 var _x = p.ColumnDefinition() 4655 4656 localctx.(*AddColumnContext).column = _x 4657 } 4658 4659 case 16: 4660 localctx = NewCreateViewContext(p, localctx) 4661 p.EnterOuterAlt(localctx, 16) 4662 { 4663 p.SetState(267) 4664 p.Match(SqlBaseParserCREATE) 4665 } 4666 p.SetState(270) 4667 p.GetErrorHandler().Sync(p) 4668 _la = p.GetTokenStream().LA(1) 4669 4670 if _la == SqlBaseParserOR { 4671 { 4672 p.SetState(268) 4673 p.Match(SqlBaseParserOR) 4674 } 4675 { 4676 p.SetState(269) 4677 p.Match(SqlBaseParserREPLACE) 4678 } 4679 4680 } 4681 { 4682 p.SetState(272) 4683 p.Match(SqlBaseParserVIEW) 4684 } 4685 { 4686 p.SetState(273) 4687 p.QualifiedName() 4688 } 4689 { 4690 p.SetState(274) 4691 p.Match(SqlBaseParserAS) 4692 } 4693 { 4694 p.SetState(275) 4695 p.Query() 4696 } 4697 4698 case 17: 4699 localctx = NewDropViewContext(p, localctx) 4700 p.EnterOuterAlt(localctx, 17) 4701 { 4702 p.SetState(277) 4703 p.Match(SqlBaseParserDROP) 4704 } 4705 { 4706 p.SetState(278) 4707 p.Match(SqlBaseParserVIEW) 4708 } 4709 p.SetState(281) 4710 p.GetErrorHandler().Sync(p) 4711 4712 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 19, p.GetParserRuleContext()) == 1 { 4713 { 4714 p.SetState(279) 4715 p.Match(SqlBaseParserIF) 4716 } 4717 { 4718 p.SetState(280) 4719 p.Match(SqlBaseParserEXISTS) 4720 } 4721 4722 } 4723 { 4724 p.SetState(283) 4725 p.QualifiedName() 4726 } 4727 4728 case 18: 4729 localctx = NewCallContext(p, localctx) 4730 p.EnterOuterAlt(localctx, 18) 4731 { 4732 p.SetState(284) 4733 p.Match(SqlBaseParserCALL) 4734 } 4735 { 4736 p.SetState(285) 4737 p.QualifiedName() 4738 } 4739 { 4740 p.SetState(286) 4741 p.Match(SqlBaseParserT__1) 4742 } 4743 p.SetState(295) 4744 p.GetErrorHandler().Sync(p) 4745 _la = p.GetTokenStream().LA(1) 4746 4747 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserT__1)|(1<<SqlBaseParserT__4)|(1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCASE)|(1<<SqlBaseParserCAST)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserCURRENT_DATE-32))|(1<<(SqlBaseParserCURRENT_TIME-32))|(1<<(SqlBaseParserCURRENT_TIMESTAMP-32))|(1<<(SqlBaseParserCURRENT_USER-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXISTS-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserEXTRACT-32))|(1<<(SqlBaseParserFALSE-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserGROUPING-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64))|(1<<(SqlBaseParserLOCALTIME-64)))) != 0) || (((_la-96)&-(0x1f+1)) == 0 && ((1<<uint((_la-96)))&((1<<(SqlBaseParserLOCALTIMESTAMP-96))|(1<<(SqlBaseParserLOGICAL-96))|(1<<(SqlBaseParserMAP-96))|(1<<(SqlBaseParserMINUTE-96))|(1<<(SqlBaseParserMONTH-96))|(1<<(SqlBaseParserNFC-96))|(1<<(SqlBaseParserNFD-96))|(1<<(SqlBaseParserNFKC-96))|(1<<(SqlBaseParserNFKD-96))|(1<<(SqlBaseParserNO-96))|(1<<(SqlBaseParserNORMALIZE-96))|(1<<(SqlBaseParserNOT-96))|(1<<(SqlBaseParserNULL-96))|(1<<(SqlBaseParserNULLIF-96))|(1<<(SqlBaseParserNULLS-96))|(1<<(SqlBaseParserONLY-96))|(1<<(SqlBaseParserOPTION-96))|(1<<(SqlBaseParserORDINALITY-96))|(1<<(SqlBaseParserOUTPUT-96))|(1<<(SqlBaseParserOVER-96))|(1<<(SqlBaseParserPARTITION-96))|(1<<(SqlBaseParserPARTITIONS-96))|(1<<(SqlBaseParserPOSITION-96))|(1<<(SqlBaseParserPRECEDING-96))|(1<<(SqlBaseParserPRIVILEGES-96))|(1<<(SqlBaseParserPROPERTIES-96)))) != 0) || (((_la-128)&-(0x1f+1)) == 0 && ((1<<uint((_la-128)))&((1<<(SqlBaseParserPUBLIC-128))|(1<<(SqlBaseParserRANGE-128))|(1<<(SqlBaseParserREAD-128))|(1<<(SqlBaseParserRENAME-128))|(1<<(SqlBaseParserREPEATABLE-128))|(1<<(SqlBaseParserREPLACE-128))|(1<<(SqlBaseParserRESET-128))|(1<<(SqlBaseParserRESTRICT-128))|(1<<(SqlBaseParserREVOKE-128))|(1<<(SqlBaseParserROLLBACK-128))|(1<<(SqlBaseParserROW-128))|(1<<(SqlBaseParserROWS-128))|(1<<(SqlBaseParserSCHEMA-128))|(1<<(SqlBaseParserSCHEMAS-128))|(1<<(SqlBaseParserSECOND-128))|(1<<(SqlBaseParserSERIALIZABLE-128))|(1<<(SqlBaseParserSESSION-128))|(1<<(SqlBaseParserSET-128))|(1<<(SqlBaseParserSETS-128))|(1<<(SqlBaseParserSHOW-128))|(1<<(SqlBaseParserSMALLINT-128))|(1<<(SqlBaseParserSOME-128))|(1<<(SqlBaseParserSTART-128))|(1<<(SqlBaseParserSTATS-128))|(1<<(SqlBaseParserSUBSTRING-128))|(1<<(SqlBaseParserSYSTEM-128))|(1<<(SqlBaseParserTABLES-128)))) != 0) || (((_la-160)&-(0x1f+1)) == 0 && ((1<<uint((_la-160)))&((1<<(SqlBaseParserTABLESAMPLE-160))|(1<<(SqlBaseParserTEXT-160))|(1<<(SqlBaseParserTIME-160))|(1<<(SqlBaseParserTIMESTAMP-160))|(1<<(SqlBaseParserTINYINT-160))|(1<<(SqlBaseParserTO-160))|(1<<(SqlBaseParserTRUE-160))|(1<<(SqlBaseParserTRY_CAST-160))|(1<<(SqlBaseParserTYPE-160))|(1<<(SqlBaseParserUNBOUNDED-160))|(1<<(SqlBaseParserUNCOMMITTED-160))|(1<<(SqlBaseParserUSE-160))|(1<<(SqlBaseParserVALIDATE-160))|(1<<(SqlBaseParserVERBOSE-160))|(1<<(SqlBaseParserVIEW-160))|(1<<(SqlBaseParserWORK-160))|(1<<(SqlBaseParserWRITE-160))|(1<<(SqlBaseParserYEAR-160))|(1<<(SqlBaseParserZONE-160)))) != 0) || (((_la-194)&-(0x1f+1)) == 0 && ((1<<uint((_la-194)))&((1<<(SqlBaseParserPLUS-194))|(1<<(SqlBaseParserMINUS-194))|(1<<(SqlBaseParserSTRING-194))|(1<<(SqlBaseParserUNICODE_STRING-194))|(1<<(SqlBaseParserBINARY_LITERAL-194))|(1<<(SqlBaseParserINTEGER_VALUE-194))|(1<<(SqlBaseParserDECIMAL_VALUE-194))|(1<<(SqlBaseParserDOUBLE_VALUE-194))|(1<<(SqlBaseParserIDENTIFIER-194))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-194))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-194))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-194))|(1<<(SqlBaseParserDOUBLE_PRECISION-194))|(1<<(SqlBaseParserCOMMIT-194))|(1<<(SqlBaseParserISOLATION-194))|(1<<(SqlBaseParserTRANSACTION-194)))) != 0) { 4748 { 4749 p.SetState(287) 4750 p.CallArgument() 4751 } 4752 p.SetState(292) 4753 p.GetErrorHandler().Sync(p) 4754 _la = p.GetTokenStream().LA(1) 4755 4756 for _la == SqlBaseParserT__3 { 4757 { 4758 p.SetState(288) 4759 p.Match(SqlBaseParserT__3) 4760 } 4761 { 4762 p.SetState(289) 4763 p.CallArgument() 4764 } 4765 4766 p.SetState(294) 4767 p.GetErrorHandler().Sync(p) 4768 _la = p.GetTokenStream().LA(1) 4769 } 4770 4771 } 4772 { 4773 p.SetState(297) 4774 p.Match(SqlBaseParserT__2) 4775 } 4776 4777 case 19: 4778 localctx = NewGrantContext(p, localctx) 4779 p.EnterOuterAlt(localctx, 19) 4780 { 4781 p.SetState(299) 4782 p.Match(SqlBaseParserGRANT) 4783 } 4784 p.SetState(310) 4785 p.GetErrorHandler().Sync(p) 4786 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 23, p.GetParserRuleContext()) { 4787 case 1: 4788 { 4789 p.SetState(300) 4790 p.Privilege() 4791 } 4792 p.SetState(305) 4793 p.GetErrorHandler().Sync(p) 4794 _la = p.GetTokenStream().LA(1) 4795 4796 for _la == SqlBaseParserT__3 { 4797 { 4798 p.SetState(301) 4799 p.Match(SqlBaseParserT__3) 4800 } 4801 { 4802 p.SetState(302) 4803 p.Privilege() 4804 } 4805 4806 p.SetState(307) 4807 p.GetErrorHandler().Sync(p) 4808 _la = p.GetTokenStream().LA(1) 4809 } 4810 4811 case 2: 4812 { 4813 p.SetState(308) 4814 p.Match(SqlBaseParserALL) 4815 } 4816 { 4817 p.SetState(309) 4818 p.Match(SqlBaseParserPRIVILEGES) 4819 } 4820 4821 } 4822 { 4823 p.SetState(312) 4824 p.Match(SqlBaseParserON) 4825 } 4826 p.SetState(314) 4827 p.GetErrorHandler().Sync(p) 4828 _la = p.GetTokenStream().LA(1) 4829 4830 if _la == SqlBaseParserTABLE { 4831 { 4832 p.SetState(313) 4833 p.Match(SqlBaseParserTABLE) 4834 } 4835 4836 } 4837 { 4838 p.SetState(316) 4839 p.QualifiedName() 4840 } 4841 { 4842 p.SetState(317) 4843 p.Match(SqlBaseParserTO) 4844 } 4845 { 4846 p.SetState(318) 4847 4848 var _x = p.Identifier() 4849 4850 localctx.(*GrantContext).grantee = _x 4851 } 4852 p.SetState(322) 4853 p.GetErrorHandler().Sync(p) 4854 _la = p.GetTokenStream().LA(1) 4855 4856 if _la == SqlBaseParserWITH { 4857 { 4858 p.SetState(319) 4859 p.Match(SqlBaseParserWITH) 4860 } 4861 { 4862 p.SetState(320) 4863 p.Match(SqlBaseParserGRANT) 4864 } 4865 { 4866 p.SetState(321) 4867 p.Match(SqlBaseParserOPTION) 4868 } 4869 4870 } 4871 4872 case 20: 4873 localctx = NewRevokeContext(p, localctx) 4874 p.EnterOuterAlt(localctx, 20) 4875 { 4876 p.SetState(324) 4877 p.Match(SqlBaseParserREVOKE) 4878 } 4879 p.SetState(328) 4880 p.GetErrorHandler().Sync(p) 4881 4882 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 26, p.GetParserRuleContext()) == 1 { 4883 { 4884 p.SetState(325) 4885 p.Match(SqlBaseParserGRANT) 4886 } 4887 { 4888 p.SetState(326) 4889 p.Match(SqlBaseParserOPTION) 4890 } 4891 { 4892 p.SetState(327) 4893 p.Match(SqlBaseParserFOR) 4894 } 4895 4896 } 4897 p.SetState(340) 4898 p.GetErrorHandler().Sync(p) 4899 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 28, p.GetParserRuleContext()) { 4900 case 1: 4901 { 4902 p.SetState(330) 4903 p.Privilege() 4904 } 4905 p.SetState(335) 4906 p.GetErrorHandler().Sync(p) 4907 _la = p.GetTokenStream().LA(1) 4908 4909 for _la == SqlBaseParserT__3 { 4910 { 4911 p.SetState(331) 4912 p.Match(SqlBaseParserT__3) 4913 } 4914 { 4915 p.SetState(332) 4916 p.Privilege() 4917 } 4918 4919 p.SetState(337) 4920 p.GetErrorHandler().Sync(p) 4921 _la = p.GetTokenStream().LA(1) 4922 } 4923 4924 case 2: 4925 { 4926 p.SetState(338) 4927 p.Match(SqlBaseParserALL) 4928 } 4929 { 4930 p.SetState(339) 4931 p.Match(SqlBaseParserPRIVILEGES) 4932 } 4933 4934 } 4935 { 4936 p.SetState(342) 4937 p.Match(SqlBaseParserON) 4938 } 4939 p.SetState(344) 4940 p.GetErrorHandler().Sync(p) 4941 _la = p.GetTokenStream().LA(1) 4942 4943 if _la == SqlBaseParserTABLE { 4944 { 4945 p.SetState(343) 4946 p.Match(SqlBaseParserTABLE) 4947 } 4948 4949 } 4950 { 4951 p.SetState(346) 4952 p.QualifiedName() 4953 } 4954 { 4955 p.SetState(347) 4956 p.Match(SqlBaseParserFROM) 4957 } 4958 { 4959 p.SetState(348) 4960 4961 var _x = p.Identifier() 4962 4963 localctx.(*RevokeContext).grantee = _x 4964 } 4965 4966 case 21: 4967 localctx = NewShowGrantsContext(p, localctx) 4968 p.EnterOuterAlt(localctx, 21) 4969 { 4970 p.SetState(350) 4971 p.Match(SqlBaseParserSHOW) 4972 } 4973 { 4974 p.SetState(351) 4975 p.Match(SqlBaseParserGRANTS) 4976 } 4977 p.SetState(357) 4978 p.GetErrorHandler().Sync(p) 4979 _la = p.GetTokenStream().LA(1) 4980 4981 if _la == SqlBaseParserON { 4982 { 4983 p.SetState(352) 4984 p.Match(SqlBaseParserON) 4985 } 4986 p.SetState(354) 4987 p.GetErrorHandler().Sync(p) 4988 _la = p.GetTokenStream().LA(1) 4989 4990 if _la == SqlBaseParserTABLE { 4991 { 4992 p.SetState(353) 4993 p.Match(SqlBaseParserTABLE) 4994 } 4995 4996 } 4997 { 4998 p.SetState(356) 4999 p.QualifiedName() 5000 } 5001 5002 } 5003 5004 case 22: 5005 localctx = NewExplainContext(p, localctx) 5006 p.EnterOuterAlt(localctx, 22) 5007 { 5008 p.SetState(359) 5009 p.Match(SqlBaseParserEXPLAIN) 5010 } 5011 p.SetState(361) 5012 p.GetErrorHandler().Sync(p) 5013 _la = p.GetTokenStream().LA(1) 5014 5015 if _la == SqlBaseParserANALYZE { 5016 { 5017 p.SetState(360) 5018 p.Match(SqlBaseParserANALYZE) 5019 } 5020 5021 } 5022 p.SetState(364) 5023 p.GetErrorHandler().Sync(p) 5024 _la = p.GetTokenStream().LA(1) 5025 5026 if _la == SqlBaseParserVERBOSE { 5027 { 5028 p.SetState(363) 5029 p.Match(SqlBaseParserVERBOSE) 5030 } 5031 5032 } 5033 p.SetState(377) 5034 p.GetErrorHandler().Sync(p) 5035 5036 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 35, p.GetParserRuleContext()) == 1 { 5037 { 5038 p.SetState(366) 5039 p.Match(SqlBaseParserT__1) 5040 } 5041 { 5042 p.SetState(367) 5043 p.ExplainOption() 5044 } 5045 p.SetState(372) 5046 p.GetErrorHandler().Sync(p) 5047 _la = p.GetTokenStream().LA(1) 5048 5049 for _la == SqlBaseParserT__3 { 5050 { 5051 p.SetState(368) 5052 p.Match(SqlBaseParserT__3) 5053 } 5054 { 5055 p.SetState(369) 5056 p.ExplainOption() 5057 } 5058 5059 p.SetState(374) 5060 p.GetErrorHandler().Sync(p) 5061 _la = p.GetTokenStream().LA(1) 5062 } 5063 { 5064 p.SetState(375) 5065 p.Match(SqlBaseParserT__2) 5066 } 5067 5068 } 5069 { 5070 p.SetState(379) 5071 p.Statement() 5072 } 5073 5074 case 23: 5075 localctx = NewShowCreateTableContext(p, localctx) 5076 p.EnterOuterAlt(localctx, 23) 5077 { 5078 p.SetState(380) 5079 p.Match(SqlBaseParserSHOW) 5080 } 5081 { 5082 p.SetState(381) 5083 p.Match(SqlBaseParserCREATE) 5084 } 5085 { 5086 p.SetState(382) 5087 p.Match(SqlBaseParserTABLE) 5088 } 5089 { 5090 p.SetState(383) 5091 p.QualifiedName() 5092 } 5093 5094 case 24: 5095 localctx = NewShowCreateViewContext(p, localctx) 5096 p.EnterOuterAlt(localctx, 24) 5097 { 5098 p.SetState(384) 5099 p.Match(SqlBaseParserSHOW) 5100 } 5101 { 5102 p.SetState(385) 5103 p.Match(SqlBaseParserCREATE) 5104 } 5105 { 5106 p.SetState(386) 5107 p.Match(SqlBaseParserVIEW) 5108 } 5109 { 5110 p.SetState(387) 5111 p.QualifiedName() 5112 } 5113 5114 case 25: 5115 localctx = NewShowTablesContext(p, localctx) 5116 p.EnterOuterAlt(localctx, 25) 5117 { 5118 p.SetState(388) 5119 p.Match(SqlBaseParserSHOW) 5120 } 5121 { 5122 p.SetState(389) 5123 p.Match(SqlBaseParserTABLES) 5124 } 5125 p.SetState(392) 5126 p.GetErrorHandler().Sync(p) 5127 _la = p.GetTokenStream().LA(1) 5128 5129 if _la == SqlBaseParserFROM || _la == SqlBaseParserIN { 5130 { 5131 p.SetState(390) 5132 _la = p.GetTokenStream().LA(1) 5133 5134 if !(_la == SqlBaseParserFROM || _la == SqlBaseParserIN) { 5135 p.GetErrorHandler().RecoverInline(p) 5136 } else { 5137 p.GetErrorHandler().ReportMatch(p) 5138 p.Consume() 5139 } 5140 } 5141 { 5142 p.SetState(391) 5143 p.QualifiedName() 5144 } 5145 5146 } 5147 p.SetState(400) 5148 p.GetErrorHandler().Sync(p) 5149 _la = p.GetTokenStream().LA(1) 5150 5151 if _la == SqlBaseParserLIKE { 5152 { 5153 p.SetState(394) 5154 p.Match(SqlBaseParserLIKE) 5155 } 5156 { 5157 p.SetState(395) 5158 5159 var _x = p.Sql_string() 5160 5161 localctx.(*ShowTablesContext).pattern = _x 5162 } 5163 p.SetState(398) 5164 p.GetErrorHandler().Sync(p) 5165 _la = p.GetTokenStream().LA(1) 5166 5167 if _la == SqlBaseParserESCAPE { 5168 { 5169 p.SetState(396) 5170 p.Match(SqlBaseParserESCAPE) 5171 } 5172 { 5173 p.SetState(397) 5174 5175 var _x = p.Sql_string() 5176 5177 localctx.(*ShowTablesContext).escape = _x 5178 } 5179 5180 } 5181 5182 } 5183 5184 case 26: 5185 localctx = NewShowSchemasContext(p, localctx) 5186 p.EnterOuterAlt(localctx, 26) 5187 { 5188 p.SetState(402) 5189 p.Match(SqlBaseParserSHOW) 5190 } 5191 { 5192 p.SetState(403) 5193 p.Match(SqlBaseParserSCHEMAS) 5194 } 5195 p.SetState(406) 5196 p.GetErrorHandler().Sync(p) 5197 _la = p.GetTokenStream().LA(1) 5198 5199 if _la == SqlBaseParserFROM || _la == SqlBaseParserIN { 5200 { 5201 p.SetState(404) 5202 _la = p.GetTokenStream().LA(1) 5203 5204 if !(_la == SqlBaseParserFROM || _la == SqlBaseParserIN) { 5205 p.GetErrorHandler().RecoverInline(p) 5206 } else { 5207 p.GetErrorHandler().ReportMatch(p) 5208 p.Consume() 5209 } 5210 } 5211 { 5212 p.SetState(405) 5213 p.Identifier() 5214 } 5215 5216 } 5217 p.SetState(414) 5218 p.GetErrorHandler().Sync(p) 5219 _la = p.GetTokenStream().LA(1) 5220 5221 if _la == SqlBaseParserLIKE { 5222 { 5223 p.SetState(408) 5224 p.Match(SqlBaseParserLIKE) 5225 } 5226 { 5227 p.SetState(409) 5228 5229 var _x = p.Sql_string() 5230 5231 localctx.(*ShowSchemasContext).pattern = _x 5232 } 5233 p.SetState(412) 5234 p.GetErrorHandler().Sync(p) 5235 _la = p.GetTokenStream().LA(1) 5236 5237 if _la == SqlBaseParserESCAPE { 5238 { 5239 p.SetState(410) 5240 p.Match(SqlBaseParserESCAPE) 5241 } 5242 { 5243 p.SetState(411) 5244 5245 var _x = p.Sql_string() 5246 5247 localctx.(*ShowSchemasContext).escape = _x 5248 } 5249 5250 } 5251 5252 } 5253 5254 case 27: 5255 localctx = NewShowCatalogsContext(p, localctx) 5256 p.EnterOuterAlt(localctx, 27) 5257 { 5258 p.SetState(416) 5259 p.Match(SqlBaseParserSHOW) 5260 } 5261 { 5262 p.SetState(417) 5263 p.Match(SqlBaseParserCATALOGS) 5264 } 5265 p.SetState(420) 5266 p.GetErrorHandler().Sync(p) 5267 _la = p.GetTokenStream().LA(1) 5268 5269 if _la == SqlBaseParserLIKE { 5270 { 5271 p.SetState(418) 5272 p.Match(SqlBaseParserLIKE) 5273 } 5274 { 5275 p.SetState(419) 5276 5277 var _x = p.Sql_string() 5278 5279 localctx.(*ShowCatalogsContext).pattern = _x 5280 } 5281 5282 } 5283 5284 case 28: 5285 localctx = NewShowColumnsContext(p, localctx) 5286 p.EnterOuterAlt(localctx, 28) 5287 { 5288 p.SetState(422) 5289 p.Match(SqlBaseParserSHOW) 5290 } 5291 { 5292 p.SetState(423) 5293 p.Match(SqlBaseParserCOLUMNS) 5294 } 5295 { 5296 p.SetState(424) 5297 _la = p.GetTokenStream().LA(1) 5298 5299 if !(_la == SqlBaseParserFROM || _la == SqlBaseParserIN) { 5300 p.GetErrorHandler().RecoverInline(p) 5301 } else { 5302 p.GetErrorHandler().ReportMatch(p) 5303 p.Consume() 5304 } 5305 } 5306 { 5307 p.SetState(425) 5308 p.QualifiedName() 5309 } 5310 5311 case 29: 5312 localctx = NewShowStatsContext(p, localctx) 5313 p.EnterOuterAlt(localctx, 29) 5314 { 5315 p.SetState(426) 5316 p.Match(SqlBaseParserSHOW) 5317 } 5318 { 5319 p.SetState(427) 5320 p.Match(SqlBaseParserSTATS) 5321 } 5322 { 5323 p.SetState(428) 5324 _la = p.GetTokenStream().LA(1) 5325 5326 if !(_la == SqlBaseParserFOR || _la == SqlBaseParserON) { 5327 p.GetErrorHandler().RecoverInline(p) 5328 } else { 5329 p.GetErrorHandler().ReportMatch(p) 5330 p.Consume() 5331 } 5332 } 5333 { 5334 p.SetState(429) 5335 p.QualifiedName() 5336 } 5337 5338 case 30: 5339 localctx = NewShowStatsForQueryContext(p, localctx) 5340 p.EnterOuterAlt(localctx, 30) 5341 { 5342 p.SetState(430) 5343 p.Match(SqlBaseParserSHOW) 5344 } 5345 { 5346 p.SetState(431) 5347 p.Match(SqlBaseParserSTATS) 5348 } 5349 { 5350 p.SetState(432) 5351 p.Match(SqlBaseParserFOR) 5352 } 5353 { 5354 p.SetState(433) 5355 p.Match(SqlBaseParserT__1) 5356 } 5357 { 5358 p.SetState(434) 5359 p.QuerySpecification() 5360 } 5361 { 5362 p.SetState(435) 5363 p.Match(SqlBaseParserT__2) 5364 } 5365 5366 case 31: 5367 localctx = NewShowColumnsContext(p, localctx) 5368 p.EnterOuterAlt(localctx, 31) 5369 { 5370 p.SetState(437) 5371 p.Match(SqlBaseParserDESCRIBE) 5372 } 5373 { 5374 p.SetState(438) 5375 p.QualifiedName() 5376 } 5377 5378 case 32: 5379 localctx = NewShowColumnsContext(p, localctx) 5380 p.EnterOuterAlt(localctx, 32) 5381 { 5382 p.SetState(439) 5383 p.Match(SqlBaseParserDESC) 5384 } 5385 { 5386 p.SetState(440) 5387 p.QualifiedName() 5388 } 5389 5390 case 33: 5391 localctx = NewShowFunctionsContext(p, localctx) 5392 p.EnterOuterAlt(localctx, 33) 5393 { 5394 p.SetState(441) 5395 p.Match(SqlBaseParserSHOW) 5396 } 5397 { 5398 p.SetState(442) 5399 p.Match(SqlBaseParserFUNCTIONS) 5400 } 5401 5402 case 34: 5403 localctx = NewShowSessionContext(p, localctx) 5404 p.EnterOuterAlt(localctx, 34) 5405 { 5406 p.SetState(443) 5407 p.Match(SqlBaseParserSHOW) 5408 } 5409 { 5410 p.SetState(444) 5411 p.Match(SqlBaseParserSESSION) 5412 } 5413 5414 case 35: 5415 localctx = NewSetSessionContext(p, localctx) 5416 p.EnterOuterAlt(localctx, 35) 5417 { 5418 p.SetState(445) 5419 p.Match(SqlBaseParserSET) 5420 } 5421 { 5422 p.SetState(446) 5423 p.Match(SqlBaseParserSESSION) 5424 } 5425 { 5426 p.SetState(447) 5427 p.QualifiedName() 5428 } 5429 { 5430 p.SetState(448) 5431 p.Match(SqlBaseParserEQ) 5432 } 5433 { 5434 p.SetState(449) 5435 p.Expression() 5436 } 5437 5438 case 36: 5439 localctx = NewResetSessionContext(p, localctx) 5440 p.EnterOuterAlt(localctx, 36) 5441 { 5442 p.SetState(451) 5443 p.Match(SqlBaseParserRESET) 5444 } 5445 { 5446 p.SetState(452) 5447 p.Match(SqlBaseParserSESSION) 5448 } 5449 { 5450 p.SetState(453) 5451 p.QualifiedName() 5452 } 5453 5454 case 37: 5455 localctx = NewShowPartitionsContext(p, localctx) 5456 p.EnterOuterAlt(localctx, 37) 5457 { 5458 p.SetState(454) 5459 p.Match(SqlBaseParserSHOW) 5460 } 5461 { 5462 p.SetState(455) 5463 p.Match(SqlBaseParserPARTITIONS) 5464 } 5465 { 5466 p.SetState(456) 5467 _la = p.GetTokenStream().LA(1) 5468 5469 if !(_la == SqlBaseParserFROM || _la == SqlBaseParserIN) { 5470 p.GetErrorHandler().RecoverInline(p) 5471 } else { 5472 p.GetErrorHandler().ReportMatch(p) 5473 p.Consume() 5474 } 5475 } 5476 { 5477 p.SetState(457) 5478 p.QualifiedName() 5479 } 5480 p.SetState(460) 5481 p.GetErrorHandler().Sync(p) 5482 _la = p.GetTokenStream().LA(1) 5483 5484 if _la == SqlBaseParserWHERE { 5485 { 5486 p.SetState(458) 5487 p.Match(SqlBaseParserWHERE) 5488 } 5489 { 5490 p.SetState(459) 5491 p.booleanExpression(0) 5492 } 5493 5494 } 5495 p.SetState(472) 5496 p.GetErrorHandler().Sync(p) 5497 _la = p.GetTokenStream().LA(1) 5498 5499 if _la == SqlBaseParserORDER { 5500 { 5501 p.SetState(462) 5502 p.Match(SqlBaseParserORDER) 5503 } 5504 { 5505 p.SetState(463) 5506 p.Match(SqlBaseParserBY) 5507 } 5508 { 5509 p.SetState(464) 5510 p.SortItem() 5511 } 5512 p.SetState(469) 5513 p.GetErrorHandler().Sync(p) 5514 _la = p.GetTokenStream().LA(1) 5515 5516 for _la == SqlBaseParserT__3 { 5517 { 5518 p.SetState(465) 5519 p.Match(SqlBaseParserT__3) 5520 } 5521 { 5522 p.SetState(466) 5523 p.SortItem() 5524 } 5525 5526 p.SetState(471) 5527 p.GetErrorHandler().Sync(p) 5528 _la = p.GetTokenStream().LA(1) 5529 } 5530 5531 } 5532 p.SetState(476) 5533 p.GetErrorHandler().Sync(p) 5534 _la = p.GetTokenStream().LA(1) 5535 5536 if _la == SqlBaseParserLIMIT { 5537 { 5538 p.SetState(474) 5539 p.Match(SqlBaseParserLIMIT) 5540 } 5541 { 5542 p.SetState(475) 5543 5544 var _lt = p.GetTokenStream().LT(1) 5545 5546 localctx.(*ShowPartitionsContext).limit = _lt 5547 5548 _la = p.GetTokenStream().LA(1) 5549 5550 if !(_la == SqlBaseParserALL || _la == SqlBaseParserINTEGER_VALUE) { 5551 var _ri = p.GetErrorHandler().RecoverInline(p) 5552 5553 localctx.(*ShowPartitionsContext).limit = _ri 5554 } else { 5555 p.GetErrorHandler().ReportMatch(p) 5556 p.Consume() 5557 } 5558 } 5559 5560 } 5561 5562 case 38: 5563 localctx = NewPrepareContext(p, localctx) 5564 p.EnterOuterAlt(localctx, 38) 5565 { 5566 p.SetState(478) 5567 p.Match(SqlBaseParserPREPARE) 5568 } 5569 { 5570 p.SetState(479) 5571 p.Identifier() 5572 } 5573 { 5574 p.SetState(480) 5575 p.Match(SqlBaseParserFROM) 5576 } 5577 { 5578 p.SetState(481) 5579 p.Statement() 5580 } 5581 5582 case 39: 5583 localctx = NewDeallocateContext(p, localctx) 5584 p.EnterOuterAlt(localctx, 39) 5585 { 5586 p.SetState(483) 5587 p.Match(SqlBaseParserDEALLOCATE) 5588 } 5589 { 5590 p.SetState(484) 5591 p.Match(SqlBaseParserPREPARE) 5592 } 5593 { 5594 p.SetState(485) 5595 p.Identifier() 5596 } 5597 5598 case 40: 5599 localctx = NewExecuteContext(p, localctx) 5600 p.EnterOuterAlt(localctx, 40) 5601 { 5602 p.SetState(486) 5603 p.Match(SqlBaseParserEXECUTE) 5604 } 5605 { 5606 p.SetState(487) 5607 p.Identifier() 5608 } 5609 p.SetState(497) 5610 p.GetErrorHandler().Sync(p) 5611 _la = p.GetTokenStream().LA(1) 5612 5613 if _la == SqlBaseParserUSING { 5614 { 5615 p.SetState(488) 5616 p.Match(SqlBaseParserUSING) 5617 } 5618 { 5619 p.SetState(489) 5620 p.Expression() 5621 } 5622 p.SetState(494) 5623 p.GetErrorHandler().Sync(p) 5624 _la = p.GetTokenStream().LA(1) 5625 5626 for _la == SqlBaseParserT__3 { 5627 { 5628 p.SetState(490) 5629 p.Match(SqlBaseParserT__3) 5630 } 5631 { 5632 p.SetState(491) 5633 p.Expression() 5634 } 5635 5636 p.SetState(496) 5637 p.GetErrorHandler().Sync(p) 5638 _la = p.GetTokenStream().LA(1) 5639 } 5640 5641 } 5642 5643 case 41: 5644 localctx = NewDescribeInputContext(p, localctx) 5645 p.EnterOuterAlt(localctx, 41) 5646 { 5647 p.SetState(499) 5648 p.Match(SqlBaseParserDESCRIBE) 5649 } 5650 { 5651 p.SetState(500) 5652 p.Match(SqlBaseParserINPUT) 5653 } 5654 { 5655 p.SetState(501) 5656 p.Identifier() 5657 } 5658 5659 case 42: 5660 localctx = NewDescribeOutputContext(p, localctx) 5661 p.EnterOuterAlt(localctx, 42) 5662 { 5663 p.SetState(502) 5664 p.Match(SqlBaseParserDESCRIBE) 5665 } 5666 { 5667 p.SetState(503) 5668 p.Match(SqlBaseParserOUTPUT) 5669 } 5670 { 5671 p.SetState(504) 5672 p.Identifier() 5673 } 5674 5675 } 5676 5677 return localctx 5678 } 5679 5680 // IQueryContext is an interface to support dynamic dispatch. 5681 type IQueryContext interface { 5682 antlr.ParserRuleContext 5683 5684 // GetParser returns the parser. 5685 GetParser() antlr.Parser 5686 5687 // IsQueryContext differentiates from other interfaces. 5688 IsQueryContext() 5689 } 5690 5691 type QueryContext struct { 5692 *antlr.BaseParserRuleContext 5693 parser antlr.Parser 5694 } 5695 5696 func NewEmptyQueryContext() *QueryContext { 5697 var p = new(QueryContext) 5698 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 5699 p.RuleIndex = SqlBaseParserRULE_query 5700 return p 5701 } 5702 5703 func (*QueryContext) IsQueryContext() {} 5704 5705 func NewQueryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *QueryContext { 5706 var p = new(QueryContext) 5707 5708 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 5709 5710 p.parser = parser 5711 p.RuleIndex = SqlBaseParserRULE_query 5712 5713 return p 5714 } 5715 5716 func (s *QueryContext) GetParser() antlr.Parser { return s.parser } 5717 5718 func (s *QueryContext) QueryNoWith() IQueryNoWithContext { 5719 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryNoWithContext)(nil)).Elem(), 0) 5720 5721 if t == nil { 5722 return nil 5723 } 5724 5725 return t.(IQueryNoWithContext) 5726 } 5727 5728 func (s *QueryContext) With() IWithContext { 5729 var t = s.GetTypedRuleContext(reflect.TypeOf((*IWithContext)(nil)).Elem(), 0) 5730 5731 if t == nil { 5732 return nil 5733 } 5734 5735 return t.(IWithContext) 5736 } 5737 5738 func (s *QueryContext) GetRuleContext() antlr.RuleContext { 5739 return s 5740 } 5741 5742 func (s *QueryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 5743 return antlr.TreesStringTree(s, ruleNames, recog) 5744 } 5745 5746 func (s *QueryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 5747 switch t := visitor.(type) { 5748 case SqlBaseVisitor: 5749 return t.VisitQuery(s) 5750 5751 default: 5752 return t.VisitChildren(s) 5753 } 5754 } 5755 5756 func (p *SqlBaseParser) Query() (localctx IQueryContext) { 5757 localctx = NewQueryContext(p, p.GetParserRuleContext(), p.GetState()) 5758 p.EnterRule(localctx, 6, SqlBaseParserRULE_query) 5759 var _la int 5760 5761 defer func() { 5762 p.ExitRule() 5763 }() 5764 5765 defer func() { 5766 if err := recover(); err != nil { 5767 if v, ok := err.(antlr.RecognitionException); ok { 5768 localctx.SetException(v) 5769 p.GetErrorHandler().ReportError(p, v) 5770 p.GetErrorHandler().Recover(p, v) 5771 } else { 5772 panic(err) 5773 } 5774 } 5775 }() 5776 5777 p.EnterOuterAlt(localctx, 1) 5778 p.SetState(508) 5779 p.GetErrorHandler().Sync(p) 5780 _la = p.GetTokenStream().LA(1) 5781 5782 if _la == SqlBaseParserWITH { 5783 { 5784 p.SetState(507) 5785 p.With() 5786 } 5787 5788 } 5789 { 5790 p.SetState(510) 5791 p.QueryNoWith() 5792 } 5793 5794 return localctx 5795 } 5796 5797 // IWithContext is an interface to support dynamic dispatch. 5798 type IWithContext interface { 5799 antlr.ParserRuleContext 5800 5801 // GetParser returns the parser. 5802 GetParser() antlr.Parser 5803 5804 // IsWithContext differentiates from other interfaces. 5805 IsWithContext() 5806 } 5807 5808 type WithContext struct { 5809 *antlr.BaseParserRuleContext 5810 parser antlr.Parser 5811 } 5812 5813 func NewEmptyWithContext() *WithContext { 5814 var p = new(WithContext) 5815 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 5816 p.RuleIndex = SqlBaseParserRULE_with 5817 return p 5818 } 5819 5820 func (*WithContext) IsWithContext() {} 5821 5822 func NewWithContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WithContext { 5823 var p = new(WithContext) 5824 5825 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 5826 5827 p.parser = parser 5828 p.RuleIndex = SqlBaseParserRULE_with 5829 5830 return p 5831 } 5832 5833 func (s *WithContext) GetParser() antlr.Parser { return s.parser } 5834 5835 func (s *WithContext) WITH() antlr.TerminalNode { 5836 return s.GetToken(SqlBaseParserWITH, 0) 5837 } 5838 5839 func (s *WithContext) AllNamedQuery() []INamedQueryContext { 5840 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*INamedQueryContext)(nil)).Elem()) 5841 var tst = make([]INamedQueryContext, len(ts)) 5842 5843 for i, t := range ts { 5844 if t != nil { 5845 tst[i] = t.(INamedQueryContext) 5846 } 5847 } 5848 5849 return tst 5850 } 5851 5852 func (s *WithContext) NamedQuery(i int) INamedQueryContext { 5853 var t = s.GetTypedRuleContext(reflect.TypeOf((*INamedQueryContext)(nil)).Elem(), i) 5854 5855 if t == nil { 5856 return nil 5857 } 5858 5859 return t.(INamedQueryContext) 5860 } 5861 5862 func (s *WithContext) RECURSIVE() antlr.TerminalNode { 5863 return s.GetToken(SqlBaseParserRECURSIVE, 0) 5864 } 5865 5866 func (s *WithContext) GetRuleContext() antlr.RuleContext { 5867 return s 5868 } 5869 5870 func (s *WithContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 5871 return antlr.TreesStringTree(s, ruleNames, recog) 5872 } 5873 5874 func (s *WithContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 5875 switch t := visitor.(type) { 5876 case SqlBaseVisitor: 5877 return t.VisitWith(s) 5878 5879 default: 5880 return t.VisitChildren(s) 5881 } 5882 } 5883 5884 func (p *SqlBaseParser) With() (localctx IWithContext) { 5885 localctx = NewWithContext(p, p.GetParserRuleContext(), p.GetState()) 5886 p.EnterRule(localctx, 8, SqlBaseParserRULE_with) 5887 var _la int 5888 5889 defer func() { 5890 p.ExitRule() 5891 }() 5892 5893 defer func() { 5894 if err := recover(); err != nil { 5895 if v, ok := err.(antlr.RecognitionException); ok { 5896 localctx.SetException(v) 5897 p.GetErrorHandler().ReportError(p, v) 5898 p.GetErrorHandler().Recover(p, v) 5899 } else { 5900 panic(err) 5901 } 5902 } 5903 }() 5904 5905 p.EnterOuterAlt(localctx, 1) 5906 { 5907 p.SetState(512) 5908 p.Match(SqlBaseParserWITH) 5909 } 5910 p.SetState(514) 5911 p.GetErrorHandler().Sync(p) 5912 _la = p.GetTokenStream().LA(1) 5913 5914 if _la == SqlBaseParserRECURSIVE { 5915 { 5916 p.SetState(513) 5917 p.Match(SqlBaseParserRECURSIVE) 5918 } 5919 5920 } 5921 { 5922 p.SetState(516) 5923 p.NamedQuery() 5924 } 5925 p.SetState(521) 5926 p.GetErrorHandler().Sync(p) 5927 _la = p.GetTokenStream().LA(1) 5928 5929 for _la == SqlBaseParserT__3 { 5930 { 5931 p.SetState(517) 5932 p.Match(SqlBaseParserT__3) 5933 } 5934 { 5935 p.SetState(518) 5936 p.NamedQuery() 5937 } 5938 5939 p.SetState(523) 5940 p.GetErrorHandler().Sync(p) 5941 _la = p.GetTokenStream().LA(1) 5942 } 5943 5944 return localctx 5945 } 5946 5947 // ITableElementContext is an interface to support dynamic dispatch. 5948 type ITableElementContext interface { 5949 antlr.ParserRuleContext 5950 5951 // GetParser returns the parser. 5952 GetParser() antlr.Parser 5953 5954 // IsTableElementContext differentiates from other interfaces. 5955 IsTableElementContext() 5956 } 5957 5958 type TableElementContext struct { 5959 *antlr.BaseParserRuleContext 5960 parser antlr.Parser 5961 } 5962 5963 func NewEmptyTableElementContext() *TableElementContext { 5964 var p = new(TableElementContext) 5965 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 5966 p.RuleIndex = SqlBaseParserRULE_tableElement 5967 return p 5968 } 5969 5970 func (*TableElementContext) IsTableElementContext() {} 5971 5972 func NewTableElementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TableElementContext { 5973 var p = new(TableElementContext) 5974 5975 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 5976 5977 p.parser = parser 5978 p.RuleIndex = SqlBaseParserRULE_tableElement 5979 5980 return p 5981 } 5982 5983 func (s *TableElementContext) GetParser() antlr.Parser { return s.parser } 5984 5985 func (s *TableElementContext) ColumnDefinition() IColumnDefinitionContext { 5986 var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnDefinitionContext)(nil)).Elem(), 0) 5987 5988 if t == nil { 5989 return nil 5990 } 5991 5992 return t.(IColumnDefinitionContext) 5993 } 5994 5995 func (s *TableElementContext) LikeClause() ILikeClauseContext { 5996 var t = s.GetTypedRuleContext(reflect.TypeOf((*ILikeClauseContext)(nil)).Elem(), 0) 5997 5998 if t == nil { 5999 return nil 6000 } 6001 6002 return t.(ILikeClauseContext) 6003 } 6004 6005 func (s *TableElementContext) GetRuleContext() antlr.RuleContext { 6006 return s 6007 } 6008 6009 func (s *TableElementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 6010 return antlr.TreesStringTree(s, ruleNames, recog) 6011 } 6012 6013 func (s *TableElementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 6014 switch t := visitor.(type) { 6015 case SqlBaseVisitor: 6016 return t.VisitTableElement(s) 6017 6018 default: 6019 return t.VisitChildren(s) 6020 } 6021 } 6022 6023 func (p *SqlBaseParser) TableElement() (localctx ITableElementContext) { 6024 localctx = NewTableElementContext(p, p.GetParserRuleContext(), p.GetState()) 6025 p.EnterRule(localctx, 10, SqlBaseParserRULE_tableElement) 6026 6027 defer func() { 6028 p.ExitRule() 6029 }() 6030 6031 defer func() { 6032 if err := recover(); err != nil { 6033 if v, ok := err.(antlr.RecognitionException); ok { 6034 localctx.SetException(v) 6035 p.GetErrorHandler().ReportError(p, v) 6036 p.GetErrorHandler().Recover(p, v) 6037 } else { 6038 panic(err) 6039 } 6040 } 6041 }() 6042 6043 p.SetState(526) 6044 p.GetErrorHandler().Sync(p) 6045 6046 switch p.GetTokenStream().LA(1) { 6047 case SqlBaseParserADD, SqlBaseParserALL, SqlBaseParserANALYZE, SqlBaseParserANY, SqlBaseParserARRAY, SqlBaseParserASC, SqlBaseParserAT, SqlBaseParserBERNOULLI, SqlBaseParserCALL, SqlBaseParserCASCADE, SqlBaseParserCATALOGS, SqlBaseParserCOALESCE, SqlBaseParserCOLUMN, SqlBaseParserCOLUMNS, SqlBaseParserCOMMENT, SqlBaseParserCOMMITTED, SqlBaseParserCURRENT, SqlBaseParserDATA, SqlBaseParserDATE, SqlBaseParserDAY, SqlBaseParserDESC, SqlBaseParserDISTRIBUTED, SqlBaseParserEXCLUDING, SqlBaseParserEXPLAIN, SqlBaseParserFILTER, SqlBaseParserFIRST, SqlBaseParserFOLLOWING, SqlBaseParserFORMAT, SqlBaseParserFUNCTIONS, SqlBaseParserGRANT, SqlBaseParserGRANTS, SqlBaseParserGRAPHVIZ, SqlBaseParserHOUR, SqlBaseParserIF, SqlBaseParserINCLUDING, SqlBaseParserINPUT, SqlBaseParserINTEGER, SqlBaseParserINTERVAL, SqlBaseParserLAST, SqlBaseParserLATERAL, SqlBaseParserLEVEL, SqlBaseParserLIMIT, SqlBaseParserLOGICAL, SqlBaseParserMAP, SqlBaseParserMINUTE, SqlBaseParserMONTH, SqlBaseParserNFC, SqlBaseParserNFD, SqlBaseParserNFKC, SqlBaseParserNFKD, SqlBaseParserNO, SqlBaseParserNULLIF, SqlBaseParserNULLS, SqlBaseParserONLY, SqlBaseParserOPTION, SqlBaseParserORDINALITY, SqlBaseParserOUTPUT, SqlBaseParserOVER, SqlBaseParserPARTITION, SqlBaseParserPARTITIONS, SqlBaseParserPOSITION, SqlBaseParserPRECEDING, SqlBaseParserPRIVILEGES, SqlBaseParserPROPERTIES, SqlBaseParserPUBLIC, SqlBaseParserRANGE, SqlBaseParserREAD, SqlBaseParserRENAME, SqlBaseParserREPEATABLE, SqlBaseParserREPLACE, SqlBaseParserRESET, SqlBaseParserRESTRICT, SqlBaseParserREVOKE, SqlBaseParserROLLBACK, SqlBaseParserROW, SqlBaseParserROWS, SqlBaseParserSCHEMA, SqlBaseParserSCHEMAS, SqlBaseParserSECOND, SqlBaseParserSERIALIZABLE, SqlBaseParserSESSION, SqlBaseParserSET, SqlBaseParserSETS, SqlBaseParserSHOW, SqlBaseParserSMALLINT, SqlBaseParserSOME, SqlBaseParserSTART, SqlBaseParserSTATS, SqlBaseParserSUBSTRING, SqlBaseParserSYSTEM, SqlBaseParserTABLES, SqlBaseParserTABLESAMPLE, SqlBaseParserTEXT, SqlBaseParserTIME, SqlBaseParserTIMESTAMP, SqlBaseParserTINYINT, SqlBaseParserTO, SqlBaseParserTRY_CAST, SqlBaseParserTYPE, SqlBaseParserUNBOUNDED, SqlBaseParserUNCOMMITTED, SqlBaseParserUSE, SqlBaseParserVALIDATE, SqlBaseParserVERBOSE, SqlBaseParserVIEW, SqlBaseParserWORK, SqlBaseParserWRITE, SqlBaseParserYEAR, SqlBaseParserZONE, SqlBaseParserIDENTIFIER, SqlBaseParserDIGIT_IDENTIFIER, SqlBaseParserQUOTED_IDENTIFIER, SqlBaseParserBACKQUOTED_IDENTIFIER, SqlBaseParserCOMMIT, SqlBaseParserISOLATION, SqlBaseParserTRANSACTION: 6048 p.EnterOuterAlt(localctx, 1) 6049 { 6050 p.SetState(524) 6051 p.ColumnDefinition() 6052 } 6053 6054 case SqlBaseParserLIKE: 6055 p.EnterOuterAlt(localctx, 2) 6056 { 6057 p.SetState(525) 6058 p.LikeClause() 6059 } 6060 6061 default: 6062 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 6063 } 6064 6065 return localctx 6066 } 6067 6068 // IColumnDefinitionContext is an interface to support dynamic dispatch. 6069 type IColumnDefinitionContext interface { 6070 antlr.ParserRuleContext 6071 6072 // GetParser returns the parser. 6073 GetParser() antlr.Parser 6074 6075 // IsColumnDefinitionContext differentiates from other interfaces. 6076 IsColumnDefinitionContext() 6077 } 6078 6079 type ColumnDefinitionContext struct { 6080 *antlr.BaseParserRuleContext 6081 parser antlr.Parser 6082 } 6083 6084 func NewEmptyColumnDefinitionContext() *ColumnDefinitionContext { 6085 var p = new(ColumnDefinitionContext) 6086 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 6087 p.RuleIndex = SqlBaseParserRULE_columnDefinition 6088 return p 6089 } 6090 6091 func (*ColumnDefinitionContext) IsColumnDefinitionContext() {} 6092 6093 func NewColumnDefinitionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ColumnDefinitionContext { 6094 var p = new(ColumnDefinitionContext) 6095 6096 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 6097 6098 p.parser = parser 6099 p.RuleIndex = SqlBaseParserRULE_columnDefinition 6100 6101 return p 6102 } 6103 6104 func (s *ColumnDefinitionContext) GetParser() antlr.Parser { return s.parser } 6105 6106 func (s *ColumnDefinitionContext) Identifier() IIdentifierContext { 6107 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 6108 6109 if t == nil { 6110 return nil 6111 } 6112 6113 return t.(IIdentifierContext) 6114 } 6115 6116 func (s *ColumnDefinitionContext) Sqltype() ISqltypeContext { 6117 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISqltypeContext)(nil)).Elem(), 0) 6118 6119 if t == nil { 6120 return nil 6121 } 6122 6123 return t.(ISqltypeContext) 6124 } 6125 6126 func (s *ColumnDefinitionContext) COMMENT() antlr.TerminalNode { 6127 return s.GetToken(SqlBaseParserCOMMENT, 0) 6128 } 6129 6130 func (s *ColumnDefinitionContext) Sql_string() ISql_stringContext { 6131 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), 0) 6132 6133 if t == nil { 6134 return nil 6135 } 6136 6137 return t.(ISql_stringContext) 6138 } 6139 6140 func (s *ColumnDefinitionContext) GetRuleContext() antlr.RuleContext { 6141 return s 6142 } 6143 6144 func (s *ColumnDefinitionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 6145 return antlr.TreesStringTree(s, ruleNames, recog) 6146 } 6147 6148 func (s *ColumnDefinitionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 6149 switch t := visitor.(type) { 6150 case SqlBaseVisitor: 6151 return t.VisitColumnDefinition(s) 6152 6153 default: 6154 return t.VisitChildren(s) 6155 } 6156 } 6157 6158 func (p *SqlBaseParser) ColumnDefinition() (localctx IColumnDefinitionContext) { 6159 localctx = NewColumnDefinitionContext(p, p.GetParserRuleContext(), p.GetState()) 6160 p.EnterRule(localctx, 12, SqlBaseParserRULE_columnDefinition) 6161 var _la int 6162 6163 defer func() { 6164 p.ExitRule() 6165 }() 6166 6167 defer func() { 6168 if err := recover(); err != nil { 6169 if v, ok := err.(antlr.RecognitionException); ok { 6170 localctx.SetException(v) 6171 p.GetErrorHandler().ReportError(p, v) 6172 p.GetErrorHandler().Recover(p, v) 6173 } else { 6174 panic(err) 6175 } 6176 } 6177 }() 6178 6179 p.EnterOuterAlt(localctx, 1) 6180 { 6181 p.SetState(528) 6182 p.Identifier() 6183 } 6184 { 6185 p.SetState(529) 6186 p.sqltype(0) 6187 } 6188 p.SetState(532) 6189 p.GetErrorHandler().Sync(p) 6190 _la = p.GetTokenStream().LA(1) 6191 6192 if _la == SqlBaseParserCOMMENT { 6193 { 6194 p.SetState(530) 6195 p.Match(SqlBaseParserCOMMENT) 6196 } 6197 { 6198 p.SetState(531) 6199 p.Sql_string() 6200 } 6201 6202 } 6203 6204 return localctx 6205 } 6206 6207 // ILikeClauseContext is an interface to support dynamic dispatch. 6208 type ILikeClauseContext interface { 6209 antlr.ParserRuleContext 6210 6211 // GetParser returns the parser. 6212 GetParser() antlr.Parser 6213 6214 // GetOptionType returns the optionType token. 6215 GetOptionType() antlr.Token 6216 6217 // SetOptionType sets the optionType token. 6218 SetOptionType(antlr.Token) 6219 6220 // IsLikeClauseContext differentiates from other interfaces. 6221 IsLikeClauseContext() 6222 } 6223 6224 type LikeClauseContext struct { 6225 *antlr.BaseParserRuleContext 6226 parser antlr.Parser 6227 optionType antlr.Token 6228 } 6229 6230 func NewEmptyLikeClauseContext() *LikeClauseContext { 6231 var p = new(LikeClauseContext) 6232 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 6233 p.RuleIndex = SqlBaseParserRULE_likeClause 6234 return p 6235 } 6236 6237 func (*LikeClauseContext) IsLikeClauseContext() {} 6238 6239 func NewLikeClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LikeClauseContext { 6240 var p = new(LikeClauseContext) 6241 6242 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 6243 6244 p.parser = parser 6245 p.RuleIndex = SqlBaseParserRULE_likeClause 6246 6247 return p 6248 } 6249 6250 func (s *LikeClauseContext) GetParser() antlr.Parser { return s.parser } 6251 6252 func (s *LikeClauseContext) GetOptionType() antlr.Token { return s.optionType } 6253 6254 func (s *LikeClauseContext) SetOptionType(v antlr.Token) { s.optionType = v } 6255 6256 func (s *LikeClauseContext) LIKE() antlr.TerminalNode { 6257 return s.GetToken(SqlBaseParserLIKE, 0) 6258 } 6259 6260 func (s *LikeClauseContext) QualifiedName() IQualifiedNameContext { 6261 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 6262 6263 if t == nil { 6264 return nil 6265 } 6266 6267 return t.(IQualifiedNameContext) 6268 } 6269 6270 func (s *LikeClauseContext) PROPERTIES() antlr.TerminalNode { 6271 return s.GetToken(SqlBaseParserPROPERTIES, 0) 6272 } 6273 6274 func (s *LikeClauseContext) INCLUDING() antlr.TerminalNode { 6275 return s.GetToken(SqlBaseParserINCLUDING, 0) 6276 } 6277 6278 func (s *LikeClauseContext) EXCLUDING() antlr.TerminalNode { 6279 return s.GetToken(SqlBaseParserEXCLUDING, 0) 6280 } 6281 6282 func (s *LikeClauseContext) GetRuleContext() antlr.RuleContext { 6283 return s 6284 } 6285 6286 func (s *LikeClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 6287 return antlr.TreesStringTree(s, ruleNames, recog) 6288 } 6289 6290 func (s *LikeClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 6291 switch t := visitor.(type) { 6292 case SqlBaseVisitor: 6293 return t.VisitLikeClause(s) 6294 6295 default: 6296 return t.VisitChildren(s) 6297 } 6298 } 6299 6300 func (p *SqlBaseParser) LikeClause() (localctx ILikeClauseContext) { 6301 localctx = NewLikeClauseContext(p, p.GetParserRuleContext(), p.GetState()) 6302 p.EnterRule(localctx, 14, SqlBaseParserRULE_likeClause) 6303 var _la int 6304 6305 defer func() { 6306 p.ExitRule() 6307 }() 6308 6309 defer func() { 6310 if err := recover(); err != nil { 6311 if v, ok := err.(antlr.RecognitionException); ok { 6312 localctx.SetException(v) 6313 p.GetErrorHandler().ReportError(p, v) 6314 p.GetErrorHandler().Recover(p, v) 6315 } else { 6316 panic(err) 6317 } 6318 } 6319 }() 6320 6321 p.EnterOuterAlt(localctx, 1) 6322 { 6323 p.SetState(534) 6324 p.Match(SqlBaseParserLIKE) 6325 } 6326 { 6327 p.SetState(535) 6328 p.QualifiedName() 6329 } 6330 p.SetState(538) 6331 p.GetErrorHandler().Sync(p) 6332 _la = p.GetTokenStream().LA(1) 6333 6334 if _la == SqlBaseParserEXCLUDING || _la == SqlBaseParserINCLUDING { 6335 { 6336 p.SetState(536) 6337 6338 var _lt = p.GetTokenStream().LT(1) 6339 6340 localctx.(*LikeClauseContext).optionType = _lt 6341 6342 _la = p.GetTokenStream().LA(1) 6343 6344 if !(_la == SqlBaseParserEXCLUDING || _la == SqlBaseParserINCLUDING) { 6345 var _ri = p.GetErrorHandler().RecoverInline(p) 6346 6347 localctx.(*LikeClauseContext).optionType = _ri 6348 } else { 6349 p.GetErrorHandler().ReportMatch(p) 6350 p.Consume() 6351 } 6352 } 6353 { 6354 p.SetState(537) 6355 p.Match(SqlBaseParserPROPERTIES) 6356 } 6357 6358 } 6359 6360 return localctx 6361 } 6362 6363 // IPropertiesContext is an interface to support dynamic dispatch. 6364 type IPropertiesContext interface { 6365 antlr.ParserRuleContext 6366 6367 // GetParser returns the parser. 6368 GetParser() antlr.Parser 6369 6370 // IsPropertiesContext differentiates from other interfaces. 6371 IsPropertiesContext() 6372 } 6373 6374 type PropertiesContext struct { 6375 *antlr.BaseParserRuleContext 6376 parser antlr.Parser 6377 } 6378 6379 func NewEmptyPropertiesContext() *PropertiesContext { 6380 var p = new(PropertiesContext) 6381 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 6382 p.RuleIndex = SqlBaseParserRULE_properties 6383 return p 6384 } 6385 6386 func (*PropertiesContext) IsPropertiesContext() {} 6387 6388 func NewPropertiesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PropertiesContext { 6389 var p = new(PropertiesContext) 6390 6391 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 6392 6393 p.parser = parser 6394 p.RuleIndex = SqlBaseParserRULE_properties 6395 6396 return p 6397 } 6398 6399 func (s *PropertiesContext) GetParser() antlr.Parser { return s.parser } 6400 6401 func (s *PropertiesContext) AllProperty() []IPropertyContext { 6402 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IPropertyContext)(nil)).Elem()) 6403 var tst = make([]IPropertyContext, len(ts)) 6404 6405 for i, t := range ts { 6406 if t != nil { 6407 tst[i] = t.(IPropertyContext) 6408 } 6409 } 6410 6411 return tst 6412 } 6413 6414 func (s *PropertiesContext) Property(i int) IPropertyContext { 6415 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertyContext)(nil)).Elem(), i) 6416 6417 if t == nil { 6418 return nil 6419 } 6420 6421 return t.(IPropertyContext) 6422 } 6423 6424 func (s *PropertiesContext) GetRuleContext() antlr.RuleContext { 6425 return s 6426 } 6427 6428 func (s *PropertiesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 6429 return antlr.TreesStringTree(s, ruleNames, recog) 6430 } 6431 6432 func (s *PropertiesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 6433 switch t := visitor.(type) { 6434 case SqlBaseVisitor: 6435 return t.VisitProperties(s) 6436 6437 default: 6438 return t.VisitChildren(s) 6439 } 6440 } 6441 6442 func (p *SqlBaseParser) Properties() (localctx IPropertiesContext) { 6443 localctx = NewPropertiesContext(p, p.GetParserRuleContext(), p.GetState()) 6444 p.EnterRule(localctx, 16, SqlBaseParserRULE_properties) 6445 var _la int 6446 6447 defer func() { 6448 p.ExitRule() 6449 }() 6450 6451 defer func() { 6452 if err := recover(); err != nil { 6453 if v, ok := err.(antlr.RecognitionException); ok { 6454 localctx.SetException(v) 6455 p.GetErrorHandler().ReportError(p, v) 6456 p.GetErrorHandler().Recover(p, v) 6457 } else { 6458 panic(err) 6459 } 6460 } 6461 }() 6462 6463 p.EnterOuterAlt(localctx, 1) 6464 { 6465 p.SetState(540) 6466 p.Match(SqlBaseParserT__1) 6467 } 6468 { 6469 p.SetState(541) 6470 p.Property() 6471 } 6472 p.SetState(546) 6473 p.GetErrorHandler().Sync(p) 6474 _la = p.GetTokenStream().LA(1) 6475 6476 for _la == SqlBaseParserT__3 { 6477 { 6478 p.SetState(542) 6479 p.Match(SqlBaseParserT__3) 6480 } 6481 { 6482 p.SetState(543) 6483 p.Property() 6484 } 6485 6486 p.SetState(548) 6487 p.GetErrorHandler().Sync(p) 6488 _la = p.GetTokenStream().LA(1) 6489 } 6490 { 6491 p.SetState(549) 6492 p.Match(SqlBaseParserT__2) 6493 } 6494 6495 return localctx 6496 } 6497 6498 // IPropertyContext is an interface to support dynamic dispatch. 6499 type IPropertyContext interface { 6500 antlr.ParserRuleContext 6501 6502 // GetParser returns the parser. 6503 GetParser() antlr.Parser 6504 6505 // IsPropertyContext differentiates from other interfaces. 6506 IsPropertyContext() 6507 } 6508 6509 type PropertyContext struct { 6510 *antlr.BaseParserRuleContext 6511 parser antlr.Parser 6512 } 6513 6514 func NewEmptyPropertyContext() *PropertyContext { 6515 var p = new(PropertyContext) 6516 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 6517 p.RuleIndex = SqlBaseParserRULE_property 6518 return p 6519 } 6520 6521 func (*PropertyContext) IsPropertyContext() {} 6522 6523 func NewPropertyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PropertyContext { 6524 var p = new(PropertyContext) 6525 6526 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 6527 6528 p.parser = parser 6529 p.RuleIndex = SqlBaseParserRULE_property 6530 6531 return p 6532 } 6533 6534 func (s *PropertyContext) GetParser() antlr.Parser { return s.parser } 6535 6536 func (s *PropertyContext) Identifier() IIdentifierContext { 6537 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 6538 6539 if t == nil { 6540 return nil 6541 } 6542 6543 return t.(IIdentifierContext) 6544 } 6545 6546 func (s *PropertyContext) EQ() antlr.TerminalNode { 6547 return s.GetToken(SqlBaseParserEQ, 0) 6548 } 6549 6550 func (s *PropertyContext) Expression() IExpressionContext { 6551 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 6552 6553 if t == nil { 6554 return nil 6555 } 6556 6557 return t.(IExpressionContext) 6558 } 6559 6560 func (s *PropertyContext) GetRuleContext() antlr.RuleContext { 6561 return s 6562 } 6563 6564 func (s *PropertyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 6565 return antlr.TreesStringTree(s, ruleNames, recog) 6566 } 6567 6568 func (s *PropertyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 6569 switch t := visitor.(type) { 6570 case SqlBaseVisitor: 6571 return t.VisitProperty(s) 6572 6573 default: 6574 return t.VisitChildren(s) 6575 } 6576 } 6577 6578 func (p *SqlBaseParser) Property() (localctx IPropertyContext) { 6579 localctx = NewPropertyContext(p, p.GetParserRuleContext(), p.GetState()) 6580 p.EnterRule(localctx, 18, SqlBaseParserRULE_property) 6581 6582 defer func() { 6583 p.ExitRule() 6584 }() 6585 6586 defer func() { 6587 if err := recover(); err != nil { 6588 if v, ok := err.(antlr.RecognitionException); ok { 6589 localctx.SetException(v) 6590 p.GetErrorHandler().ReportError(p, v) 6591 p.GetErrorHandler().Recover(p, v) 6592 } else { 6593 panic(err) 6594 } 6595 } 6596 }() 6597 6598 p.EnterOuterAlt(localctx, 1) 6599 { 6600 p.SetState(551) 6601 p.Identifier() 6602 } 6603 { 6604 p.SetState(552) 6605 p.Match(SqlBaseParserEQ) 6606 } 6607 { 6608 p.SetState(553) 6609 p.Expression() 6610 } 6611 6612 return localctx 6613 } 6614 6615 // IQueryNoWithContext is an interface to support dynamic dispatch. 6616 type IQueryNoWithContext interface { 6617 antlr.ParserRuleContext 6618 6619 // GetParser returns the parser. 6620 GetParser() antlr.Parser 6621 6622 // GetLimit returns the limit token. 6623 GetLimit() antlr.Token 6624 6625 // SetLimit sets the limit token. 6626 SetLimit(antlr.Token) 6627 6628 // IsQueryNoWithContext differentiates from other interfaces. 6629 IsQueryNoWithContext() 6630 } 6631 6632 type QueryNoWithContext struct { 6633 *antlr.BaseParserRuleContext 6634 parser antlr.Parser 6635 limit antlr.Token 6636 } 6637 6638 func NewEmptyQueryNoWithContext() *QueryNoWithContext { 6639 var p = new(QueryNoWithContext) 6640 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 6641 p.RuleIndex = SqlBaseParserRULE_queryNoWith 6642 return p 6643 } 6644 6645 func (*QueryNoWithContext) IsQueryNoWithContext() {} 6646 6647 func NewQueryNoWithContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *QueryNoWithContext { 6648 var p = new(QueryNoWithContext) 6649 6650 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 6651 6652 p.parser = parser 6653 p.RuleIndex = SqlBaseParserRULE_queryNoWith 6654 6655 return p 6656 } 6657 6658 func (s *QueryNoWithContext) GetParser() antlr.Parser { return s.parser } 6659 6660 func (s *QueryNoWithContext) GetLimit() antlr.Token { return s.limit } 6661 6662 func (s *QueryNoWithContext) SetLimit(v antlr.Token) { s.limit = v } 6663 6664 func (s *QueryNoWithContext) QueryTerm() IQueryTermContext { 6665 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryTermContext)(nil)).Elem(), 0) 6666 6667 if t == nil { 6668 return nil 6669 } 6670 6671 return t.(IQueryTermContext) 6672 } 6673 6674 func (s *QueryNoWithContext) ORDER() antlr.TerminalNode { 6675 return s.GetToken(SqlBaseParserORDER, 0) 6676 } 6677 6678 func (s *QueryNoWithContext) BY() antlr.TerminalNode { 6679 return s.GetToken(SqlBaseParserBY, 0) 6680 } 6681 6682 func (s *QueryNoWithContext) AllSortItem() []ISortItemContext { 6683 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISortItemContext)(nil)).Elem()) 6684 var tst = make([]ISortItemContext, len(ts)) 6685 6686 for i, t := range ts { 6687 if t != nil { 6688 tst[i] = t.(ISortItemContext) 6689 } 6690 } 6691 6692 return tst 6693 } 6694 6695 func (s *QueryNoWithContext) SortItem(i int) ISortItemContext { 6696 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISortItemContext)(nil)).Elem(), i) 6697 6698 if t == nil { 6699 return nil 6700 } 6701 6702 return t.(ISortItemContext) 6703 } 6704 6705 func (s *QueryNoWithContext) LIMIT() antlr.TerminalNode { 6706 return s.GetToken(SqlBaseParserLIMIT, 0) 6707 } 6708 6709 func (s *QueryNoWithContext) INTEGER_VALUE() antlr.TerminalNode { 6710 return s.GetToken(SqlBaseParserINTEGER_VALUE, 0) 6711 } 6712 6713 func (s *QueryNoWithContext) ALL() antlr.TerminalNode { 6714 return s.GetToken(SqlBaseParserALL, 0) 6715 } 6716 6717 func (s *QueryNoWithContext) GetRuleContext() antlr.RuleContext { 6718 return s 6719 } 6720 6721 func (s *QueryNoWithContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 6722 return antlr.TreesStringTree(s, ruleNames, recog) 6723 } 6724 6725 func (s *QueryNoWithContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 6726 switch t := visitor.(type) { 6727 case SqlBaseVisitor: 6728 return t.VisitQueryNoWith(s) 6729 6730 default: 6731 return t.VisitChildren(s) 6732 } 6733 } 6734 6735 func (p *SqlBaseParser) QueryNoWith() (localctx IQueryNoWithContext) { 6736 localctx = NewQueryNoWithContext(p, p.GetParserRuleContext(), p.GetState()) 6737 p.EnterRule(localctx, 20, SqlBaseParserRULE_queryNoWith) 6738 var _la int 6739 6740 defer func() { 6741 p.ExitRule() 6742 }() 6743 6744 defer func() { 6745 if err := recover(); err != nil { 6746 if v, ok := err.(antlr.RecognitionException); ok { 6747 localctx.SetException(v) 6748 p.GetErrorHandler().ReportError(p, v) 6749 p.GetErrorHandler().Recover(p, v) 6750 } else { 6751 panic(err) 6752 } 6753 } 6754 }() 6755 6756 p.EnterOuterAlt(localctx, 1) 6757 { 6758 p.SetState(555) 6759 p.queryTerm(0) 6760 } 6761 p.SetState(566) 6762 p.GetErrorHandler().Sync(p) 6763 _la = p.GetTokenStream().LA(1) 6764 6765 if _la == SqlBaseParserORDER { 6766 { 6767 p.SetState(556) 6768 p.Match(SqlBaseParserORDER) 6769 } 6770 { 6771 p.SetState(557) 6772 p.Match(SqlBaseParserBY) 6773 } 6774 { 6775 p.SetState(558) 6776 p.SortItem() 6777 } 6778 p.SetState(563) 6779 p.GetErrorHandler().Sync(p) 6780 _la = p.GetTokenStream().LA(1) 6781 6782 for _la == SqlBaseParserT__3 { 6783 { 6784 p.SetState(559) 6785 p.Match(SqlBaseParserT__3) 6786 } 6787 { 6788 p.SetState(560) 6789 p.SortItem() 6790 } 6791 6792 p.SetState(565) 6793 p.GetErrorHandler().Sync(p) 6794 _la = p.GetTokenStream().LA(1) 6795 } 6796 6797 } 6798 p.SetState(570) 6799 p.GetErrorHandler().Sync(p) 6800 _la = p.GetTokenStream().LA(1) 6801 6802 if _la == SqlBaseParserLIMIT { 6803 { 6804 p.SetState(568) 6805 p.Match(SqlBaseParserLIMIT) 6806 } 6807 { 6808 p.SetState(569) 6809 6810 var _lt = p.GetTokenStream().LT(1) 6811 6812 localctx.(*QueryNoWithContext).limit = _lt 6813 6814 _la = p.GetTokenStream().LA(1) 6815 6816 if !(_la == SqlBaseParserALL || _la == SqlBaseParserINTEGER_VALUE) { 6817 var _ri = p.GetErrorHandler().RecoverInline(p) 6818 6819 localctx.(*QueryNoWithContext).limit = _ri 6820 } else { 6821 p.GetErrorHandler().ReportMatch(p) 6822 p.Consume() 6823 } 6824 } 6825 6826 } 6827 6828 return localctx 6829 } 6830 6831 // IQueryTermContext is an interface to support dynamic dispatch. 6832 type IQueryTermContext interface { 6833 antlr.ParserRuleContext 6834 6835 // GetParser returns the parser. 6836 GetParser() antlr.Parser 6837 6838 // IsQueryTermContext differentiates from other interfaces. 6839 IsQueryTermContext() 6840 } 6841 6842 type QueryTermContext struct { 6843 *antlr.BaseParserRuleContext 6844 parser antlr.Parser 6845 } 6846 6847 func NewEmptyQueryTermContext() *QueryTermContext { 6848 var p = new(QueryTermContext) 6849 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 6850 p.RuleIndex = SqlBaseParserRULE_queryTerm 6851 return p 6852 } 6853 6854 func (*QueryTermContext) IsQueryTermContext() {} 6855 6856 func NewQueryTermContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *QueryTermContext { 6857 var p = new(QueryTermContext) 6858 6859 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 6860 6861 p.parser = parser 6862 p.RuleIndex = SqlBaseParserRULE_queryTerm 6863 6864 return p 6865 } 6866 6867 func (s *QueryTermContext) GetParser() antlr.Parser { return s.parser } 6868 6869 func (s *QueryTermContext) CopyFrom(ctx *QueryTermContext) { 6870 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 6871 } 6872 6873 func (s *QueryTermContext) GetRuleContext() antlr.RuleContext { 6874 return s 6875 } 6876 6877 func (s *QueryTermContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 6878 return antlr.TreesStringTree(s, ruleNames, recog) 6879 } 6880 6881 type QueryTermDefaultContext struct { 6882 *QueryTermContext 6883 } 6884 6885 func NewQueryTermDefaultContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QueryTermDefaultContext { 6886 var p = new(QueryTermDefaultContext) 6887 6888 p.QueryTermContext = NewEmptyQueryTermContext() 6889 p.parser = parser 6890 p.CopyFrom(ctx.(*QueryTermContext)) 6891 6892 return p 6893 } 6894 6895 func (s *QueryTermDefaultContext) GetRuleContext() antlr.RuleContext { 6896 return s 6897 } 6898 6899 func (s *QueryTermDefaultContext) QueryPrimary() IQueryPrimaryContext { 6900 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryPrimaryContext)(nil)).Elem(), 0) 6901 6902 if t == nil { 6903 return nil 6904 } 6905 6906 return t.(IQueryPrimaryContext) 6907 } 6908 6909 func (s *QueryTermDefaultContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 6910 switch t := visitor.(type) { 6911 case SqlBaseVisitor: 6912 return t.VisitQueryTermDefault(s) 6913 6914 default: 6915 return t.VisitChildren(s) 6916 } 6917 } 6918 6919 type SetOperationContext struct { 6920 *QueryTermContext 6921 left IQueryTermContext 6922 operator antlr.Token 6923 right IQueryTermContext 6924 } 6925 6926 func NewSetOperationContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SetOperationContext { 6927 var p = new(SetOperationContext) 6928 6929 p.QueryTermContext = NewEmptyQueryTermContext() 6930 p.parser = parser 6931 p.CopyFrom(ctx.(*QueryTermContext)) 6932 6933 return p 6934 } 6935 6936 func (s *SetOperationContext) GetOperator() antlr.Token { return s.operator } 6937 6938 func (s *SetOperationContext) SetOperator(v antlr.Token) { s.operator = v } 6939 6940 func (s *SetOperationContext) GetLeft() IQueryTermContext { return s.left } 6941 6942 func (s *SetOperationContext) GetRight() IQueryTermContext { return s.right } 6943 6944 func (s *SetOperationContext) SetLeft(v IQueryTermContext) { s.left = v } 6945 6946 func (s *SetOperationContext) SetRight(v IQueryTermContext) { s.right = v } 6947 6948 func (s *SetOperationContext) GetRuleContext() antlr.RuleContext { 6949 return s 6950 } 6951 6952 func (s *SetOperationContext) AllQueryTerm() []IQueryTermContext { 6953 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IQueryTermContext)(nil)).Elem()) 6954 var tst = make([]IQueryTermContext, len(ts)) 6955 6956 for i, t := range ts { 6957 if t != nil { 6958 tst[i] = t.(IQueryTermContext) 6959 } 6960 } 6961 6962 return tst 6963 } 6964 6965 func (s *SetOperationContext) QueryTerm(i int) IQueryTermContext { 6966 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryTermContext)(nil)).Elem(), i) 6967 6968 if t == nil { 6969 return nil 6970 } 6971 6972 return t.(IQueryTermContext) 6973 } 6974 6975 func (s *SetOperationContext) INTERSECT() antlr.TerminalNode { 6976 return s.GetToken(SqlBaseParserINTERSECT, 0) 6977 } 6978 6979 func (s *SetOperationContext) SetQuantifier() ISetQuantifierContext { 6980 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISetQuantifierContext)(nil)).Elem(), 0) 6981 6982 if t == nil { 6983 return nil 6984 } 6985 6986 return t.(ISetQuantifierContext) 6987 } 6988 6989 func (s *SetOperationContext) UNION() antlr.TerminalNode { 6990 return s.GetToken(SqlBaseParserUNION, 0) 6991 } 6992 6993 func (s *SetOperationContext) EXCEPT() antlr.TerminalNode { 6994 return s.GetToken(SqlBaseParserEXCEPT, 0) 6995 } 6996 6997 func (s *SetOperationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 6998 switch t := visitor.(type) { 6999 case SqlBaseVisitor: 7000 return t.VisitSetOperation(s) 7001 7002 default: 7003 return t.VisitChildren(s) 7004 } 7005 } 7006 7007 func (p *SqlBaseParser) QueryTerm() (localctx IQueryTermContext) { 7008 return p.queryTerm(0) 7009 } 7010 7011 func (p *SqlBaseParser) queryTerm(_p int) (localctx IQueryTermContext) { 7012 var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() 7013 _parentState := p.GetState() 7014 localctx = NewQueryTermContext(p, p.GetParserRuleContext(), _parentState) 7015 var _prevctx IQueryTermContext = localctx 7016 var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. 7017 _startState := 22 7018 p.EnterRecursionRule(localctx, 22, SqlBaseParserRULE_queryTerm, _p) 7019 var _la int 7020 7021 defer func() { 7022 p.UnrollRecursionContexts(_parentctx) 7023 }() 7024 7025 defer func() { 7026 if err := recover(); err != nil { 7027 if v, ok := err.(antlr.RecognitionException); ok { 7028 localctx.SetException(v) 7029 p.GetErrorHandler().ReportError(p, v) 7030 p.GetErrorHandler().Recover(p, v) 7031 } else { 7032 panic(err) 7033 } 7034 } 7035 }() 7036 7037 var _alt int 7038 7039 p.EnterOuterAlt(localctx, 1) 7040 localctx = NewQueryTermDefaultContext(p, localctx) 7041 p.SetParserRuleContext(localctx) 7042 _prevctx = localctx 7043 7044 { 7045 p.SetState(573) 7046 p.QueryPrimary() 7047 } 7048 7049 p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) 7050 p.SetState(589) 7051 p.GetErrorHandler().Sync(p) 7052 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 63, p.GetParserRuleContext()) 7053 7054 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 7055 if _alt == 1 { 7056 if p.GetParseListeners() != nil { 7057 p.TriggerExitRuleEvent() 7058 } 7059 _prevctx = localctx 7060 p.SetState(587) 7061 p.GetErrorHandler().Sync(p) 7062 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 62, p.GetParserRuleContext()) { 7063 case 1: 7064 localctx = NewSetOperationContext(p, NewQueryTermContext(p, _parentctx, _parentState)) 7065 localctx.(*SetOperationContext).left = _prevctx 7066 7067 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_queryTerm) 7068 p.SetState(575) 7069 7070 if !(p.Precpred(p.GetParserRuleContext(), 2)) { 7071 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) 7072 } 7073 { 7074 p.SetState(576) 7075 7076 var _m = p.Match(SqlBaseParserINTERSECT) 7077 7078 localctx.(*SetOperationContext).operator = _m 7079 } 7080 p.SetState(578) 7081 p.GetErrorHandler().Sync(p) 7082 _la = p.GetTokenStream().LA(1) 7083 7084 if _la == SqlBaseParserALL || _la == SqlBaseParserDISTINCT { 7085 { 7086 p.SetState(577) 7087 p.SetQuantifier() 7088 } 7089 7090 } 7091 { 7092 p.SetState(580) 7093 7094 var _x = p.queryTerm(3) 7095 7096 localctx.(*SetOperationContext).right = _x 7097 } 7098 7099 case 2: 7100 localctx = NewSetOperationContext(p, NewQueryTermContext(p, _parentctx, _parentState)) 7101 localctx.(*SetOperationContext).left = _prevctx 7102 7103 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_queryTerm) 7104 p.SetState(581) 7105 7106 if !(p.Precpred(p.GetParserRuleContext(), 1)) { 7107 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) 7108 } 7109 { 7110 p.SetState(582) 7111 7112 var _lt = p.GetTokenStream().LT(1) 7113 7114 localctx.(*SetOperationContext).operator = _lt 7115 7116 _la = p.GetTokenStream().LA(1) 7117 7118 if !(_la == SqlBaseParserEXCEPT || _la == SqlBaseParserUNION) { 7119 var _ri = p.GetErrorHandler().RecoverInline(p) 7120 7121 localctx.(*SetOperationContext).operator = _ri 7122 } else { 7123 p.GetErrorHandler().ReportMatch(p) 7124 p.Consume() 7125 } 7126 } 7127 p.SetState(584) 7128 p.GetErrorHandler().Sync(p) 7129 _la = p.GetTokenStream().LA(1) 7130 7131 if _la == SqlBaseParserALL || _la == SqlBaseParserDISTINCT { 7132 { 7133 p.SetState(583) 7134 p.SetQuantifier() 7135 } 7136 7137 } 7138 { 7139 p.SetState(586) 7140 7141 var _x = p.queryTerm(2) 7142 7143 localctx.(*SetOperationContext).right = _x 7144 } 7145 7146 } 7147 7148 } 7149 p.SetState(591) 7150 p.GetErrorHandler().Sync(p) 7151 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 63, p.GetParserRuleContext()) 7152 } 7153 7154 return localctx 7155 } 7156 7157 // IQueryPrimaryContext is an interface to support dynamic dispatch. 7158 type IQueryPrimaryContext interface { 7159 antlr.ParserRuleContext 7160 7161 // GetParser returns the parser. 7162 GetParser() antlr.Parser 7163 7164 // IsQueryPrimaryContext differentiates from other interfaces. 7165 IsQueryPrimaryContext() 7166 } 7167 7168 type QueryPrimaryContext struct { 7169 *antlr.BaseParserRuleContext 7170 parser antlr.Parser 7171 } 7172 7173 func NewEmptyQueryPrimaryContext() *QueryPrimaryContext { 7174 var p = new(QueryPrimaryContext) 7175 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 7176 p.RuleIndex = SqlBaseParserRULE_queryPrimary 7177 return p 7178 } 7179 7180 func (*QueryPrimaryContext) IsQueryPrimaryContext() {} 7181 7182 func NewQueryPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *QueryPrimaryContext { 7183 var p = new(QueryPrimaryContext) 7184 7185 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 7186 7187 p.parser = parser 7188 p.RuleIndex = SqlBaseParserRULE_queryPrimary 7189 7190 return p 7191 } 7192 7193 func (s *QueryPrimaryContext) GetParser() antlr.Parser { return s.parser } 7194 7195 func (s *QueryPrimaryContext) CopyFrom(ctx *QueryPrimaryContext) { 7196 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 7197 } 7198 7199 func (s *QueryPrimaryContext) GetRuleContext() antlr.RuleContext { 7200 return s 7201 } 7202 7203 func (s *QueryPrimaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 7204 return antlr.TreesStringTree(s, ruleNames, recog) 7205 } 7206 7207 type SubqueryContext struct { 7208 *QueryPrimaryContext 7209 } 7210 7211 func NewSubqueryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SubqueryContext { 7212 var p = new(SubqueryContext) 7213 7214 p.QueryPrimaryContext = NewEmptyQueryPrimaryContext() 7215 p.parser = parser 7216 p.CopyFrom(ctx.(*QueryPrimaryContext)) 7217 7218 return p 7219 } 7220 7221 func (s *SubqueryContext) GetRuleContext() antlr.RuleContext { 7222 return s 7223 } 7224 7225 func (s *SubqueryContext) QueryNoWith() IQueryNoWithContext { 7226 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryNoWithContext)(nil)).Elem(), 0) 7227 7228 if t == nil { 7229 return nil 7230 } 7231 7232 return t.(IQueryNoWithContext) 7233 } 7234 7235 func (s *SubqueryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 7236 switch t := visitor.(type) { 7237 case SqlBaseVisitor: 7238 return t.VisitSubquery(s) 7239 7240 default: 7241 return t.VisitChildren(s) 7242 } 7243 } 7244 7245 type QueryPrimaryDefaultContext struct { 7246 *QueryPrimaryContext 7247 } 7248 7249 func NewQueryPrimaryDefaultContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QueryPrimaryDefaultContext { 7250 var p = new(QueryPrimaryDefaultContext) 7251 7252 p.QueryPrimaryContext = NewEmptyQueryPrimaryContext() 7253 p.parser = parser 7254 p.CopyFrom(ctx.(*QueryPrimaryContext)) 7255 7256 return p 7257 } 7258 7259 func (s *QueryPrimaryDefaultContext) GetRuleContext() antlr.RuleContext { 7260 return s 7261 } 7262 7263 func (s *QueryPrimaryDefaultContext) QuerySpecification() IQuerySpecificationContext { 7264 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQuerySpecificationContext)(nil)).Elem(), 0) 7265 7266 if t == nil { 7267 return nil 7268 } 7269 7270 return t.(IQuerySpecificationContext) 7271 } 7272 7273 func (s *QueryPrimaryDefaultContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 7274 switch t := visitor.(type) { 7275 case SqlBaseVisitor: 7276 return t.VisitQueryPrimaryDefault(s) 7277 7278 default: 7279 return t.VisitChildren(s) 7280 } 7281 } 7282 7283 type TableContext struct { 7284 *QueryPrimaryContext 7285 } 7286 7287 func NewTableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableContext { 7288 var p = new(TableContext) 7289 7290 p.QueryPrimaryContext = NewEmptyQueryPrimaryContext() 7291 p.parser = parser 7292 p.CopyFrom(ctx.(*QueryPrimaryContext)) 7293 7294 return p 7295 } 7296 7297 func (s *TableContext) GetRuleContext() antlr.RuleContext { 7298 return s 7299 } 7300 7301 func (s *TableContext) TABLE() antlr.TerminalNode { 7302 return s.GetToken(SqlBaseParserTABLE, 0) 7303 } 7304 7305 func (s *TableContext) QualifiedName() IQualifiedNameContext { 7306 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 7307 7308 if t == nil { 7309 return nil 7310 } 7311 7312 return t.(IQualifiedNameContext) 7313 } 7314 7315 func (s *TableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 7316 switch t := visitor.(type) { 7317 case SqlBaseVisitor: 7318 return t.VisitTable(s) 7319 7320 default: 7321 return t.VisitChildren(s) 7322 } 7323 } 7324 7325 type InlineTableContext struct { 7326 *QueryPrimaryContext 7327 } 7328 7329 func NewInlineTableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InlineTableContext { 7330 var p = new(InlineTableContext) 7331 7332 p.QueryPrimaryContext = NewEmptyQueryPrimaryContext() 7333 p.parser = parser 7334 p.CopyFrom(ctx.(*QueryPrimaryContext)) 7335 7336 return p 7337 } 7338 7339 func (s *InlineTableContext) GetRuleContext() antlr.RuleContext { 7340 return s 7341 } 7342 7343 func (s *InlineTableContext) VALUES() antlr.TerminalNode { 7344 return s.GetToken(SqlBaseParserVALUES, 0) 7345 } 7346 7347 func (s *InlineTableContext) AllExpression() []IExpressionContext { 7348 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 7349 var tst = make([]IExpressionContext, len(ts)) 7350 7351 for i, t := range ts { 7352 if t != nil { 7353 tst[i] = t.(IExpressionContext) 7354 } 7355 } 7356 7357 return tst 7358 } 7359 7360 func (s *InlineTableContext) Expression(i int) IExpressionContext { 7361 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 7362 7363 if t == nil { 7364 return nil 7365 } 7366 7367 return t.(IExpressionContext) 7368 } 7369 7370 func (s *InlineTableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 7371 switch t := visitor.(type) { 7372 case SqlBaseVisitor: 7373 return t.VisitInlineTable(s) 7374 7375 default: 7376 return t.VisitChildren(s) 7377 } 7378 } 7379 7380 func (p *SqlBaseParser) QueryPrimary() (localctx IQueryPrimaryContext) { 7381 localctx = NewQueryPrimaryContext(p, p.GetParserRuleContext(), p.GetState()) 7382 p.EnterRule(localctx, 24, SqlBaseParserRULE_queryPrimary) 7383 7384 defer func() { 7385 p.ExitRule() 7386 }() 7387 7388 defer func() { 7389 if err := recover(); err != nil { 7390 if v, ok := err.(antlr.RecognitionException); ok { 7391 localctx.SetException(v) 7392 p.GetErrorHandler().ReportError(p, v) 7393 p.GetErrorHandler().Recover(p, v) 7394 } else { 7395 panic(err) 7396 } 7397 } 7398 }() 7399 7400 var _alt int 7401 7402 p.SetState(608) 7403 p.GetErrorHandler().Sync(p) 7404 7405 switch p.GetTokenStream().LA(1) { 7406 case SqlBaseParserSELECT: 7407 localctx = NewQueryPrimaryDefaultContext(p, localctx) 7408 p.EnterOuterAlt(localctx, 1) 7409 { 7410 p.SetState(592) 7411 p.QuerySpecification() 7412 } 7413 7414 case SqlBaseParserTABLE: 7415 localctx = NewTableContext(p, localctx) 7416 p.EnterOuterAlt(localctx, 2) 7417 { 7418 p.SetState(593) 7419 p.Match(SqlBaseParserTABLE) 7420 } 7421 { 7422 p.SetState(594) 7423 p.QualifiedName() 7424 } 7425 7426 case SqlBaseParserVALUES: 7427 localctx = NewInlineTableContext(p, localctx) 7428 p.EnterOuterAlt(localctx, 3) 7429 { 7430 p.SetState(595) 7431 p.Match(SqlBaseParserVALUES) 7432 } 7433 { 7434 p.SetState(596) 7435 p.Expression() 7436 } 7437 p.SetState(601) 7438 p.GetErrorHandler().Sync(p) 7439 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 64, p.GetParserRuleContext()) 7440 7441 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 7442 if _alt == 1 { 7443 { 7444 p.SetState(597) 7445 p.Match(SqlBaseParserT__3) 7446 } 7447 { 7448 p.SetState(598) 7449 p.Expression() 7450 } 7451 7452 } 7453 p.SetState(603) 7454 p.GetErrorHandler().Sync(p) 7455 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 64, p.GetParserRuleContext()) 7456 } 7457 7458 case SqlBaseParserT__1: 7459 localctx = NewSubqueryContext(p, localctx) 7460 p.EnterOuterAlt(localctx, 4) 7461 { 7462 p.SetState(604) 7463 p.Match(SqlBaseParserT__1) 7464 } 7465 { 7466 p.SetState(605) 7467 p.QueryNoWith() 7468 } 7469 { 7470 p.SetState(606) 7471 p.Match(SqlBaseParserT__2) 7472 } 7473 7474 default: 7475 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 7476 } 7477 7478 return localctx 7479 } 7480 7481 // ISortItemContext is an interface to support dynamic dispatch. 7482 type ISortItemContext interface { 7483 antlr.ParserRuleContext 7484 7485 // GetParser returns the parser. 7486 GetParser() antlr.Parser 7487 7488 // GetOrdering returns the ordering token. 7489 GetOrdering() antlr.Token 7490 7491 // GetNullOrdering returns the nullOrdering token. 7492 GetNullOrdering() antlr.Token 7493 7494 // SetOrdering sets the ordering token. 7495 SetOrdering(antlr.Token) 7496 7497 // SetNullOrdering sets the nullOrdering token. 7498 SetNullOrdering(antlr.Token) 7499 7500 // IsSortItemContext differentiates from other interfaces. 7501 IsSortItemContext() 7502 } 7503 7504 type SortItemContext struct { 7505 *antlr.BaseParserRuleContext 7506 parser antlr.Parser 7507 ordering antlr.Token 7508 nullOrdering antlr.Token 7509 } 7510 7511 func NewEmptySortItemContext() *SortItemContext { 7512 var p = new(SortItemContext) 7513 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 7514 p.RuleIndex = SqlBaseParserRULE_sortItem 7515 return p 7516 } 7517 7518 func (*SortItemContext) IsSortItemContext() {} 7519 7520 func NewSortItemContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SortItemContext { 7521 var p = new(SortItemContext) 7522 7523 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 7524 7525 p.parser = parser 7526 p.RuleIndex = SqlBaseParserRULE_sortItem 7527 7528 return p 7529 } 7530 7531 func (s *SortItemContext) GetParser() antlr.Parser { return s.parser } 7532 7533 func (s *SortItemContext) GetOrdering() antlr.Token { return s.ordering } 7534 7535 func (s *SortItemContext) GetNullOrdering() antlr.Token { return s.nullOrdering } 7536 7537 func (s *SortItemContext) SetOrdering(v antlr.Token) { s.ordering = v } 7538 7539 func (s *SortItemContext) SetNullOrdering(v antlr.Token) { s.nullOrdering = v } 7540 7541 func (s *SortItemContext) Expression() IExpressionContext { 7542 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 7543 7544 if t == nil { 7545 return nil 7546 } 7547 7548 return t.(IExpressionContext) 7549 } 7550 7551 func (s *SortItemContext) NULLS() antlr.TerminalNode { 7552 return s.GetToken(SqlBaseParserNULLS, 0) 7553 } 7554 7555 func (s *SortItemContext) ASC() antlr.TerminalNode { 7556 return s.GetToken(SqlBaseParserASC, 0) 7557 } 7558 7559 func (s *SortItemContext) DESC() antlr.TerminalNode { 7560 return s.GetToken(SqlBaseParserDESC, 0) 7561 } 7562 7563 func (s *SortItemContext) FIRST() antlr.TerminalNode { 7564 return s.GetToken(SqlBaseParserFIRST, 0) 7565 } 7566 7567 func (s *SortItemContext) LAST() antlr.TerminalNode { 7568 return s.GetToken(SqlBaseParserLAST, 0) 7569 } 7570 7571 func (s *SortItemContext) GetRuleContext() antlr.RuleContext { 7572 return s 7573 } 7574 7575 func (s *SortItemContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 7576 return antlr.TreesStringTree(s, ruleNames, recog) 7577 } 7578 7579 func (s *SortItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 7580 switch t := visitor.(type) { 7581 case SqlBaseVisitor: 7582 return t.VisitSortItem(s) 7583 7584 default: 7585 return t.VisitChildren(s) 7586 } 7587 } 7588 7589 func (p *SqlBaseParser) SortItem() (localctx ISortItemContext) { 7590 localctx = NewSortItemContext(p, p.GetParserRuleContext(), p.GetState()) 7591 p.EnterRule(localctx, 26, SqlBaseParserRULE_sortItem) 7592 var _la int 7593 7594 defer func() { 7595 p.ExitRule() 7596 }() 7597 7598 defer func() { 7599 if err := recover(); err != nil { 7600 if v, ok := err.(antlr.RecognitionException); ok { 7601 localctx.SetException(v) 7602 p.GetErrorHandler().ReportError(p, v) 7603 p.GetErrorHandler().Recover(p, v) 7604 } else { 7605 panic(err) 7606 } 7607 } 7608 }() 7609 7610 p.EnterOuterAlt(localctx, 1) 7611 { 7612 p.SetState(610) 7613 p.Expression() 7614 } 7615 p.SetState(612) 7616 p.GetErrorHandler().Sync(p) 7617 _la = p.GetTokenStream().LA(1) 7618 7619 if _la == SqlBaseParserASC || _la == SqlBaseParserDESC { 7620 { 7621 p.SetState(611) 7622 7623 var _lt = p.GetTokenStream().LT(1) 7624 7625 localctx.(*SortItemContext).ordering = _lt 7626 7627 _la = p.GetTokenStream().LA(1) 7628 7629 if !(_la == SqlBaseParserASC || _la == SqlBaseParserDESC) { 7630 var _ri = p.GetErrorHandler().RecoverInline(p) 7631 7632 localctx.(*SortItemContext).ordering = _ri 7633 } else { 7634 p.GetErrorHandler().ReportMatch(p) 7635 p.Consume() 7636 } 7637 } 7638 7639 } 7640 p.SetState(616) 7641 p.GetErrorHandler().Sync(p) 7642 _la = p.GetTokenStream().LA(1) 7643 7644 if _la == SqlBaseParserNULLS { 7645 { 7646 p.SetState(614) 7647 p.Match(SqlBaseParserNULLS) 7648 } 7649 { 7650 p.SetState(615) 7651 7652 var _lt = p.GetTokenStream().LT(1) 7653 7654 localctx.(*SortItemContext).nullOrdering = _lt 7655 7656 _la = p.GetTokenStream().LA(1) 7657 7658 if !(_la == SqlBaseParserFIRST || _la == SqlBaseParserLAST) { 7659 var _ri = p.GetErrorHandler().RecoverInline(p) 7660 7661 localctx.(*SortItemContext).nullOrdering = _ri 7662 } else { 7663 p.GetErrorHandler().ReportMatch(p) 7664 p.Consume() 7665 } 7666 } 7667 7668 } 7669 7670 return localctx 7671 } 7672 7673 // IQuerySpecificationContext is an interface to support dynamic dispatch. 7674 type IQuerySpecificationContext interface { 7675 antlr.ParserRuleContext 7676 7677 // GetParser returns the parser. 7678 GetParser() antlr.Parser 7679 7680 // GetWhere returns the where rule contexts. 7681 GetWhere() IBooleanExpressionContext 7682 7683 // GetHaving returns the having rule contexts. 7684 GetHaving() IBooleanExpressionContext 7685 7686 // SetWhere sets the where rule contexts. 7687 SetWhere(IBooleanExpressionContext) 7688 7689 // SetHaving sets the having rule contexts. 7690 SetHaving(IBooleanExpressionContext) 7691 7692 // IsQuerySpecificationContext differentiates from other interfaces. 7693 IsQuerySpecificationContext() 7694 } 7695 7696 type QuerySpecificationContext struct { 7697 *antlr.BaseParserRuleContext 7698 parser antlr.Parser 7699 where IBooleanExpressionContext 7700 having IBooleanExpressionContext 7701 } 7702 7703 func NewEmptyQuerySpecificationContext() *QuerySpecificationContext { 7704 var p = new(QuerySpecificationContext) 7705 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 7706 p.RuleIndex = SqlBaseParserRULE_querySpecification 7707 return p 7708 } 7709 7710 func (*QuerySpecificationContext) IsQuerySpecificationContext() {} 7711 7712 func NewQuerySpecificationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *QuerySpecificationContext { 7713 var p = new(QuerySpecificationContext) 7714 7715 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 7716 7717 p.parser = parser 7718 p.RuleIndex = SqlBaseParserRULE_querySpecification 7719 7720 return p 7721 } 7722 7723 func (s *QuerySpecificationContext) GetParser() antlr.Parser { return s.parser } 7724 7725 func (s *QuerySpecificationContext) GetWhere() IBooleanExpressionContext { return s.where } 7726 7727 func (s *QuerySpecificationContext) GetHaving() IBooleanExpressionContext { return s.having } 7728 7729 func (s *QuerySpecificationContext) SetWhere(v IBooleanExpressionContext) { s.where = v } 7730 7731 func (s *QuerySpecificationContext) SetHaving(v IBooleanExpressionContext) { s.having = v } 7732 7733 func (s *QuerySpecificationContext) SELECT() antlr.TerminalNode { 7734 return s.GetToken(SqlBaseParserSELECT, 0) 7735 } 7736 7737 func (s *QuerySpecificationContext) AllSelectItem() []ISelectItemContext { 7738 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISelectItemContext)(nil)).Elem()) 7739 var tst = make([]ISelectItemContext, len(ts)) 7740 7741 for i, t := range ts { 7742 if t != nil { 7743 tst[i] = t.(ISelectItemContext) 7744 } 7745 } 7746 7747 return tst 7748 } 7749 7750 func (s *QuerySpecificationContext) SelectItem(i int) ISelectItemContext { 7751 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISelectItemContext)(nil)).Elem(), i) 7752 7753 if t == nil { 7754 return nil 7755 } 7756 7757 return t.(ISelectItemContext) 7758 } 7759 7760 func (s *QuerySpecificationContext) SetQuantifier() ISetQuantifierContext { 7761 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISetQuantifierContext)(nil)).Elem(), 0) 7762 7763 if t == nil { 7764 return nil 7765 } 7766 7767 return t.(ISetQuantifierContext) 7768 } 7769 7770 func (s *QuerySpecificationContext) FROM() antlr.TerminalNode { 7771 return s.GetToken(SqlBaseParserFROM, 0) 7772 } 7773 7774 func (s *QuerySpecificationContext) AllRelation() []IRelationContext { 7775 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IRelationContext)(nil)).Elem()) 7776 var tst = make([]IRelationContext, len(ts)) 7777 7778 for i, t := range ts { 7779 if t != nil { 7780 tst[i] = t.(IRelationContext) 7781 } 7782 } 7783 7784 return tst 7785 } 7786 7787 func (s *QuerySpecificationContext) Relation(i int) IRelationContext { 7788 var t = s.GetTypedRuleContext(reflect.TypeOf((*IRelationContext)(nil)).Elem(), i) 7789 7790 if t == nil { 7791 return nil 7792 } 7793 7794 return t.(IRelationContext) 7795 } 7796 7797 func (s *QuerySpecificationContext) WHERE() antlr.TerminalNode { 7798 return s.GetToken(SqlBaseParserWHERE, 0) 7799 } 7800 7801 func (s *QuerySpecificationContext) GROUP() antlr.TerminalNode { 7802 return s.GetToken(SqlBaseParserGROUP, 0) 7803 } 7804 7805 func (s *QuerySpecificationContext) BY() antlr.TerminalNode { 7806 return s.GetToken(SqlBaseParserBY, 0) 7807 } 7808 7809 func (s *QuerySpecificationContext) GroupBy() IGroupByContext { 7810 var t = s.GetTypedRuleContext(reflect.TypeOf((*IGroupByContext)(nil)).Elem(), 0) 7811 7812 if t == nil { 7813 return nil 7814 } 7815 7816 return t.(IGroupByContext) 7817 } 7818 7819 func (s *QuerySpecificationContext) HAVING() antlr.TerminalNode { 7820 return s.GetToken(SqlBaseParserHAVING, 0) 7821 } 7822 7823 func (s *QuerySpecificationContext) AllBooleanExpression() []IBooleanExpressionContext { 7824 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem()) 7825 var tst = make([]IBooleanExpressionContext, len(ts)) 7826 7827 for i, t := range ts { 7828 if t != nil { 7829 tst[i] = t.(IBooleanExpressionContext) 7830 } 7831 } 7832 7833 return tst 7834 } 7835 7836 func (s *QuerySpecificationContext) BooleanExpression(i int) IBooleanExpressionContext { 7837 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), i) 7838 7839 if t == nil { 7840 return nil 7841 } 7842 7843 return t.(IBooleanExpressionContext) 7844 } 7845 7846 func (s *QuerySpecificationContext) GetRuleContext() antlr.RuleContext { 7847 return s 7848 } 7849 7850 func (s *QuerySpecificationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 7851 return antlr.TreesStringTree(s, ruleNames, recog) 7852 } 7853 7854 func (s *QuerySpecificationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 7855 switch t := visitor.(type) { 7856 case SqlBaseVisitor: 7857 return t.VisitQuerySpecification(s) 7858 7859 default: 7860 return t.VisitChildren(s) 7861 } 7862 } 7863 7864 func (p *SqlBaseParser) QuerySpecification() (localctx IQuerySpecificationContext) { 7865 localctx = NewQuerySpecificationContext(p, p.GetParserRuleContext(), p.GetState()) 7866 p.EnterRule(localctx, 28, SqlBaseParserRULE_querySpecification) 7867 7868 defer func() { 7869 p.ExitRule() 7870 }() 7871 7872 defer func() { 7873 if err := recover(); err != nil { 7874 if v, ok := err.(antlr.RecognitionException); ok { 7875 localctx.SetException(v) 7876 p.GetErrorHandler().ReportError(p, v) 7877 p.GetErrorHandler().Recover(p, v) 7878 } else { 7879 panic(err) 7880 } 7881 } 7882 }() 7883 7884 var _alt int 7885 7886 p.EnterOuterAlt(localctx, 1) 7887 { 7888 p.SetState(618) 7889 p.Match(SqlBaseParserSELECT) 7890 } 7891 p.SetState(620) 7892 p.GetErrorHandler().Sync(p) 7893 7894 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 68, p.GetParserRuleContext()) == 1 { 7895 { 7896 p.SetState(619) 7897 p.SetQuantifier() 7898 } 7899 7900 } 7901 { 7902 p.SetState(622) 7903 p.SelectItem() 7904 } 7905 p.SetState(627) 7906 p.GetErrorHandler().Sync(p) 7907 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 69, p.GetParserRuleContext()) 7908 7909 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 7910 if _alt == 1 { 7911 { 7912 p.SetState(623) 7913 p.Match(SqlBaseParserT__3) 7914 } 7915 { 7916 p.SetState(624) 7917 p.SelectItem() 7918 } 7919 7920 } 7921 p.SetState(629) 7922 p.GetErrorHandler().Sync(p) 7923 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 69, p.GetParserRuleContext()) 7924 } 7925 p.SetState(639) 7926 p.GetErrorHandler().Sync(p) 7927 7928 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 71, p.GetParserRuleContext()) == 1 { 7929 { 7930 p.SetState(630) 7931 p.Match(SqlBaseParserFROM) 7932 } 7933 { 7934 p.SetState(631) 7935 p.relation(0) 7936 } 7937 p.SetState(636) 7938 p.GetErrorHandler().Sync(p) 7939 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 70, p.GetParserRuleContext()) 7940 7941 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 7942 if _alt == 1 { 7943 { 7944 p.SetState(632) 7945 p.Match(SqlBaseParserT__3) 7946 } 7947 { 7948 p.SetState(633) 7949 p.relation(0) 7950 } 7951 7952 } 7953 p.SetState(638) 7954 p.GetErrorHandler().Sync(p) 7955 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 70, p.GetParserRuleContext()) 7956 } 7957 7958 } 7959 p.SetState(643) 7960 p.GetErrorHandler().Sync(p) 7961 7962 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 72, p.GetParserRuleContext()) == 1 { 7963 { 7964 p.SetState(641) 7965 p.Match(SqlBaseParserWHERE) 7966 } 7967 { 7968 p.SetState(642) 7969 7970 var _x = p.booleanExpression(0) 7971 7972 localctx.(*QuerySpecificationContext).where = _x 7973 } 7974 7975 } 7976 p.SetState(648) 7977 p.GetErrorHandler().Sync(p) 7978 7979 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 73, p.GetParserRuleContext()) == 1 { 7980 { 7981 p.SetState(645) 7982 p.Match(SqlBaseParserGROUP) 7983 } 7984 { 7985 p.SetState(646) 7986 p.Match(SqlBaseParserBY) 7987 } 7988 { 7989 p.SetState(647) 7990 p.GroupBy() 7991 } 7992 7993 } 7994 p.SetState(652) 7995 p.GetErrorHandler().Sync(p) 7996 7997 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 74, p.GetParserRuleContext()) == 1 { 7998 { 7999 p.SetState(650) 8000 p.Match(SqlBaseParserHAVING) 8001 } 8002 { 8003 p.SetState(651) 8004 8005 var _x = p.booleanExpression(0) 8006 8007 localctx.(*QuerySpecificationContext).having = _x 8008 } 8009 8010 } 8011 8012 return localctx 8013 } 8014 8015 // IGroupByContext is an interface to support dynamic dispatch. 8016 type IGroupByContext interface { 8017 antlr.ParserRuleContext 8018 8019 // GetParser returns the parser. 8020 GetParser() antlr.Parser 8021 8022 // IsGroupByContext differentiates from other interfaces. 8023 IsGroupByContext() 8024 } 8025 8026 type GroupByContext struct { 8027 *antlr.BaseParserRuleContext 8028 parser antlr.Parser 8029 } 8030 8031 func NewEmptyGroupByContext() *GroupByContext { 8032 var p = new(GroupByContext) 8033 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 8034 p.RuleIndex = SqlBaseParserRULE_groupBy 8035 return p 8036 } 8037 8038 func (*GroupByContext) IsGroupByContext() {} 8039 8040 func NewGroupByContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupByContext { 8041 var p = new(GroupByContext) 8042 8043 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 8044 8045 p.parser = parser 8046 p.RuleIndex = SqlBaseParserRULE_groupBy 8047 8048 return p 8049 } 8050 8051 func (s *GroupByContext) GetParser() antlr.Parser { return s.parser } 8052 8053 func (s *GroupByContext) AllGroupingElement() []IGroupingElementContext { 8054 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IGroupingElementContext)(nil)).Elem()) 8055 var tst = make([]IGroupingElementContext, len(ts)) 8056 8057 for i, t := range ts { 8058 if t != nil { 8059 tst[i] = t.(IGroupingElementContext) 8060 } 8061 } 8062 8063 return tst 8064 } 8065 8066 func (s *GroupByContext) GroupingElement(i int) IGroupingElementContext { 8067 var t = s.GetTypedRuleContext(reflect.TypeOf((*IGroupingElementContext)(nil)).Elem(), i) 8068 8069 if t == nil { 8070 return nil 8071 } 8072 8073 return t.(IGroupingElementContext) 8074 } 8075 8076 func (s *GroupByContext) SetQuantifier() ISetQuantifierContext { 8077 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISetQuantifierContext)(nil)).Elem(), 0) 8078 8079 if t == nil { 8080 return nil 8081 } 8082 8083 return t.(ISetQuantifierContext) 8084 } 8085 8086 func (s *GroupByContext) GetRuleContext() antlr.RuleContext { 8087 return s 8088 } 8089 8090 func (s *GroupByContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 8091 return antlr.TreesStringTree(s, ruleNames, recog) 8092 } 8093 8094 func (s *GroupByContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 8095 switch t := visitor.(type) { 8096 case SqlBaseVisitor: 8097 return t.VisitGroupBy(s) 8098 8099 default: 8100 return t.VisitChildren(s) 8101 } 8102 } 8103 8104 func (p *SqlBaseParser) GroupBy() (localctx IGroupByContext) { 8105 localctx = NewGroupByContext(p, p.GetParserRuleContext(), p.GetState()) 8106 p.EnterRule(localctx, 30, SqlBaseParserRULE_groupBy) 8107 8108 defer func() { 8109 p.ExitRule() 8110 }() 8111 8112 defer func() { 8113 if err := recover(); err != nil { 8114 if v, ok := err.(antlr.RecognitionException); ok { 8115 localctx.SetException(v) 8116 p.GetErrorHandler().ReportError(p, v) 8117 p.GetErrorHandler().Recover(p, v) 8118 } else { 8119 panic(err) 8120 } 8121 } 8122 }() 8123 8124 var _alt int 8125 8126 p.EnterOuterAlt(localctx, 1) 8127 p.SetState(655) 8128 p.GetErrorHandler().Sync(p) 8129 8130 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 75, p.GetParserRuleContext()) == 1 { 8131 { 8132 p.SetState(654) 8133 p.SetQuantifier() 8134 } 8135 8136 } 8137 { 8138 p.SetState(657) 8139 p.GroupingElement() 8140 } 8141 p.SetState(662) 8142 p.GetErrorHandler().Sync(p) 8143 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 76, p.GetParserRuleContext()) 8144 8145 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 8146 if _alt == 1 { 8147 { 8148 p.SetState(658) 8149 p.Match(SqlBaseParserT__3) 8150 } 8151 { 8152 p.SetState(659) 8153 p.GroupingElement() 8154 } 8155 8156 } 8157 p.SetState(664) 8158 p.GetErrorHandler().Sync(p) 8159 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 76, p.GetParserRuleContext()) 8160 } 8161 8162 return localctx 8163 } 8164 8165 // IGroupingElementContext is an interface to support dynamic dispatch. 8166 type IGroupingElementContext interface { 8167 antlr.ParserRuleContext 8168 8169 // GetParser returns the parser. 8170 GetParser() antlr.Parser 8171 8172 // IsGroupingElementContext differentiates from other interfaces. 8173 IsGroupingElementContext() 8174 } 8175 8176 type GroupingElementContext struct { 8177 *antlr.BaseParserRuleContext 8178 parser antlr.Parser 8179 } 8180 8181 func NewEmptyGroupingElementContext() *GroupingElementContext { 8182 var p = new(GroupingElementContext) 8183 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 8184 p.RuleIndex = SqlBaseParserRULE_groupingElement 8185 return p 8186 } 8187 8188 func (*GroupingElementContext) IsGroupingElementContext() {} 8189 8190 func NewGroupingElementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupingElementContext { 8191 var p = new(GroupingElementContext) 8192 8193 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 8194 8195 p.parser = parser 8196 p.RuleIndex = SqlBaseParserRULE_groupingElement 8197 8198 return p 8199 } 8200 8201 func (s *GroupingElementContext) GetParser() antlr.Parser { return s.parser } 8202 8203 func (s *GroupingElementContext) CopyFrom(ctx *GroupingElementContext) { 8204 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 8205 } 8206 8207 func (s *GroupingElementContext) GetRuleContext() antlr.RuleContext { 8208 return s 8209 } 8210 8211 func (s *GroupingElementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 8212 return antlr.TreesStringTree(s, ruleNames, recog) 8213 } 8214 8215 type MultipleGroupingSetsContext struct { 8216 *GroupingElementContext 8217 } 8218 8219 func NewMultipleGroupingSetsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MultipleGroupingSetsContext { 8220 var p = new(MultipleGroupingSetsContext) 8221 8222 p.GroupingElementContext = NewEmptyGroupingElementContext() 8223 p.parser = parser 8224 p.CopyFrom(ctx.(*GroupingElementContext)) 8225 8226 return p 8227 } 8228 8229 func (s *MultipleGroupingSetsContext) GetRuleContext() antlr.RuleContext { 8230 return s 8231 } 8232 8233 func (s *MultipleGroupingSetsContext) GROUPING() antlr.TerminalNode { 8234 return s.GetToken(SqlBaseParserGROUPING, 0) 8235 } 8236 8237 func (s *MultipleGroupingSetsContext) SETS() antlr.TerminalNode { 8238 return s.GetToken(SqlBaseParserSETS, 0) 8239 } 8240 8241 func (s *MultipleGroupingSetsContext) AllGroupingSet() []IGroupingSetContext { 8242 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IGroupingSetContext)(nil)).Elem()) 8243 var tst = make([]IGroupingSetContext, len(ts)) 8244 8245 for i, t := range ts { 8246 if t != nil { 8247 tst[i] = t.(IGroupingSetContext) 8248 } 8249 } 8250 8251 return tst 8252 } 8253 8254 func (s *MultipleGroupingSetsContext) GroupingSet(i int) IGroupingSetContext { 8255 var t = s.GetTypedRuleContext(reflect.TypeOf((*IGroupingSetContext)(nil)).Elem(), i) 8256 8257 if t == nil { 8258 return nil 8259 } 8260 8261 return t.(IGroupingSetContext) 8262 } 8263 8264 func (s *MultipleGroupingSetsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 8265 switch t := visitor.(type) { 8266 case SqlBaseVisitor: 8267 return t.VisitMultipleGroupingSets(s) 8268 8269 default: 8270 return t.VisitChildren(s) 8271 } 8272 } 8273 8274 type SingleGroupingSetContext struct { 8275 *GroupingElementContext 8276 } 8277 8278 func NewSingleGroupingSetContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SingleGroupingSetContext { 8279 var p = new(SingleGroupingSetContext) 8280 8281 p.GroupingElementContext = NewEmptyGroupingElementContext() 8282 p.parser = parser 8283 p.CopyFrom(ctx.(*GroupingElementContext)) 8284 8285 return p 8286 } 8287 8288 func (s *SingleGroupingSetContext) GetRuleContext() antlr.RuleContext { 8289 return s 8290 } 8291 8292 func (s *SingleGroupingSetContext) GroupingExpressions() IGroupingExpressionsContext { 8293 var t = s.GetTypedRuleContext(reflect.TypeOf((*IGroupingExpressionsContext)(nil)).Elem(), 0) 8294 8295 if t == nil { 8296 return nil 8297 } 8298 8299 return t.(IGroupingExpressionsContext) 8300 } 8301 8302 func (s *SingleGroupingSetContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 8303 switch t := visitor.(type) { 8304 case SqlBaseVisitor: 8305 return t.VisitSingleGroupingSet(s) 8306 8307 default: 8308 return t.VisitChildren(s) 8309 } 8310 } 8311 8312 type CubeContext struct { 8313 *GroupingElementContext 8314 } 8315 8316 func NewCubeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CubeContext { 8317 var p = new(CubeContext) 8318 8319 p.GroupingElementContext = NewEmptyGroupingElementContext() 8320 p.parser = parser 8321 p.CopyFrom(ctx.(*GroupingElementContext)) 8322 8323 return p 8324 } 8325 8326 func (s *CubeContext) GetRuleContext() antlr.RuleContext { 8327 return s 8328 } 8329 8330 func (s *CubeContext) CUBE() antlr.TerminalNode { 8331 return s.GetToken(SqlBaseParserCUBE, 0) 8332 } 8333 8334 func (s *CubeContext) AllQualifiedName() []IQualifiedNameContext { 8335 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem()) 8336 var tst = make([]IQualifiedNameContext, len(ts)) 8337 8338 for i, t := range ts { 8339 if t != nil { 8340 tst[i] = t.(IQualifiedNameContext) 8341 } 8342 } 8343 8344 return tst 8345 } 8346 8347 func (s *CubeContext) QualifiedName(i int) IQualifiedNameContext { 8348 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), i) 8349 8350 if t == nil { 8351 return nil 8352 } 8353 8354 return t.(IQualifiedNameContext) 8355 } 8356 8357 func (s *CubeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 8358 switch t := visitor.(type) { 8359 case SqlBaseVisitor: 8360 return t.VisitCube(s) 8361 8362 default: 8363 return t.VisitChildren(s) 8364 } 8365 } 8366 8367 type RollupContext struct { 8368 *GroupingElementContext 8369 } 8370 8371 func NewRollupContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RollupContext { 8372 var p = new(RollupContext) 8373 8374 p.GroupingElementContext = NewEmptyGroupingElementContext() 8375 p.parser = parser 8376 p.CopyFrom(ctx.(*GroupingElementContext)) 8377 8378 return p 8379 } 8380 8381 func (s *RollupContext) GetRuleContext() antlr.RuleContext { 8382 return s 8383 } 8384 8385 func (s *RollupContext) ROLLUP() antlr.TerminalNode { 8386 return s.GetToken(SqlBaseParserROLLUP, 0) 8387 } 8388 8389 func (s *RollupContext) AllQualifiedName() []IQualifiedNameContext { 8390 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem()) 8391 var tst = make([]IQualifiedNameContext, len(ts)) 8392 8393 for i, t := range ts { 8394 if t != nil { 8395 tst[i] = t.(IQualifiedNameContext) 8396 } 8397 } 8398 8399 return tst 8400 } 8401 8402 func (s *RollupContext) QualifiedName(i int) IQualifiedNameContext { 8403 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), i) 8404 8405 if t == nil { 8406 return nil 8407 } 8408 8409 return t.(IQualifiedNameContext) 8410 } 8411 8412 func (s *RollupContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 8413 switch t := visitor.(type) { 8414 case SqlBaseVisitor: 8415 return t.VisitRollup(s) 8416 8417 default: 8418 return t.VisitChildren(s) 8419 } 8420 } 8421 8422 func (p *SqlBaseParser) GroupingElement() (localctx IGroupingElementContext) { 8423 localctx = NewGroupingElementContext(p, p.GetParserRuleContext(), p.GetState()) 8424 p.EnterRule(localctx, 32, SqlBaseParserRULE_groupingElement) 8425 var _la int 8426 8427 defer func() { 8428 p.ExitRule() 8429 }() 8430 8431 defer func() { 8432 if err := recover(); err != nil { 8433 if v, ok := err.(antlr.RecognitionException); ok { 8434 localctx.SetException(v) 8435 p.GetErrorHandler().ReportError(p, v) 8436 p.GetErrorHandler().Recover(p, v) 8437 } else { 8438 panic(err) 8439 } 8440 } 8441 }() 8442 8443 p.SetState(705) 8444 p.GetErrorHandler().Sync(p) 8445 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 82, p.GetParserRuleContext()) { 8446 case 1: 8447 localctx = NewSingleGroupingSetContext(p, localctx) 8448 p.EnterOuterAlt(localctx, 1) 8449 { 8450 p.SetState(665) 8451 p.GroupingExpressions() 8452 } 8453 8454 case 2: 8455 localctx = NewRollupContext(p, localctx) 8456 p.EnterOuterAlt(localctx, 2) 8457 { 8458 p.SetState(666) 8459 p.Match(SqlBaseParserROLLUP) 8460 } 8461 { 8462 p.SetState(667) 8463 p.Match(SqlBaseParserT__1) 8464 } 8465 p.SetState(676) 8466 p.GetErrorHandler().Sync(p) 8467 _la = p.GetTokenStream().LA(1) 8468 8469 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64)))) != 0) || (((_la-97)&-(0x1f+1)) == 0 && ((1<<uint((_la-97)))&((1<<(SqlBaseParserLOGICAL-97))|(1<<(SqlBaseParserMAP-97))|(1<<(SqlBaseParserMINUTE-97))|(1<<(SqlBaseParserMONTH-97))|(1<<(SqlBaseParserNFC-97))|(1<<(SqlBaseParserNFD-97))|(1<<(SqlBaseParserNFKC-97))|(1<<(SqlBaseParserNFKD-97))|(1<<(SqlBaseParserNO-97))|(1<<(SqlBaseParserNULLIF-97))|(1<<(SqlBaseParserNULLS-97))|(1<<(SqlBaseParserONLY-97))|(1<<(SqlBaseParserOPTION-97))|(1<<(SqlBaseParserORDINALITY-97))|(1<<(SqlBaseParserOUTPUT-97))|(1<<(SqlBaseParserOVER-97))|(1<<(SqlBaseParserPARTITION-97))|(1<<(SqlBaseParserPARTITIONS-97))|(1<<(SqlBaseParserPOSITION-97))|(1<<(SqlBaseParserPRECEDING-97))|(1<<(SqlBaseParserPRIVILEGES-97))|(1<<(SqlBaseParserPROPERTIES-97))|(1<<(SqlBaseParserPUBLIC-97)))) != 0) || (((_la-129)&-(0x1f+1)) == 0 && ((1<<uint((_la-129)))&((1<<(SqlBaseParserRANGE-129))|(1<<(SqlBaseParserREAD-129))|(1<<(SqlBaseParserRENAME-129))|(1<<(SqlBaseParserREPEATABLE-129))|(1<<(SqlBaseParserREPLACE-129))|(1<<(SqlBaseParserRESET-129))|(1<<(SqlBaseParserRESTRICT-129))|(1<<(SqlBaseParserREVOKE-129))|(1<<(SqlBaseParserROLLBACK-129))|(1<<(SqlBaseParserROW-129))|(1<<(SqlBaseParserROWS-129))|(1<<(SqlBaseParserSCHEMA-129))|(1<<(SqlBaseParserSCHEMAS-129))|(1<<(SqlBaseParserSECOND-129))|(1<<(SqlBaseParserSERIALIZABLE-129))|(1<<(SqlBaseParserSESSION-129))|(1<<(SqlBaseParserSET-129))|(1<<(SqlBaseParserSETS-129))|(1<<(SqlBaseParserSHOW-129))|(1<<(SqlBaseParserSMALLINT-129))|(1<<(SqlBaseParserSOME-129))|(1<<(SqlBaseParserSTART-129))|(1<<(SqlBaseParserSTATS-129))|(1<<(SqlBaseParserSUBSTRING-129))|(1<<(SqlBaseParserSYSTEM-129))|(1<<(SqlBaseParserTABLES-129))|(1<<(SqlBaseParserTABLESAMPLE-129)))) != 0) || (((_la-161)&-(0x1f+1)) == 0 && ((1<<uint((_la-161)))&((1<<(SqlBaseParserTEXT-161))|(1<<(SqlBaseParserTIME-161))|(1<<(SqlBaseParserTIMESTAMP-161))|(1<<(SqlBaseParserTINYINT-161))|(1<<(SqlBaseParserTO-161))|(1<<(SqlBaseParserTRY_CAST-161))|(1<<(SqlBaseParserTYPE-161))|(1<<(SqlBaseParserUNBOUNDED-161))|(1<<(SqlBaseParserUNCOMMITTED-161))|(1<<(SqlBaseParserUSE-161))|(1<<(SqlBaseParserVALIDATE-161))|(1<<(SqlBaseParserVERBOSE-161))|(1<<(SqlBaseParserVIEW-161))|(1<<(SqlBaseParserWORK-161))|(1<<(SqlBaseParserWRITE-161))|(1<<(SqlBaseParserYEAR-161))|(1<<(SqlBaseParserZONE-161)))) != 0) || (((_la-206)&-(0x1f+1)) == 0 && ((1<<uint((_la-206)))&((1<<(SqlBaseParserIDENTIFIER-206))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-206))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserCOMMIT-206))|(1<<(SqlBaseParserISOLATION-206))|(1<<(SqlBaseParserTRANSACTION-206)))) != 0) { 8470 { 8471 p.SetState(668) 8472 p.QualifiedName() 8473 } 8474 p.SetState(673) 8475 p.GetErrorHandler().Sync(p) 8476 _la = p.GetTokenStream().LA(1) 8477 8478 for _la == SqlBaseParserT__3 { 8479 { 8480 p.SetState(669) 8481 p.Match(SqlBaseParserT__3) 8482 } 8483 { 8484 p.SetState(670) 8485 p.QualifiedName() 8486 } 8487 8488 p.SetState(675) 8489 p.GetErrorHandler().Sync(p) 8490 _la = p.GetTokenStream().LA(1) 8491 } 8492 8493 } 8494 { 8495 p.SetState(678) 8496 p.Match(SqlBaseParserT__2) 8497 } 8498 8499 case 3: 8500 localctx = NewCubeContext(p, localctx) 8501 p.EnterOuterAlt(localctx, 3) 8502 { 8503 p.SetState(679) 8504 p.Match(SqlBaseParserCUBE) 8505 } 8506 { 8507 p.SetState(680) 8508 p.Match(SqlBaseParserT__1) 8509 } 8510 p.SetState(689) 8511 p.GetErrorHandler().Sync(p) 8512 _la = p.GetTokenStream().LA(1) 8513 8514 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64)))) != 0) || (((_la-97)&-(0x1f+1)) == 0 && ((1<<uint((_la-97)))&((1<<(SqlBaseParserLOGICAL-97))|(1<<(SqlBaseParserMAP-97))|(1<<(SqlBaseParserMINUTE-97))|(1<<(SqlBaseParserMONTH-97))|(1<<(SqlBaseParserNFC-97))|(1<<(SqlBaseParserNFD-97))|(1<<(SqlBaseParserNFKC-97))|(1<<(SqlBaseParserNFKD-97))|(1<<(SqlBaseParserNO-97))|(1<<(SqlBaseParserNULLIF-97))|(1<<(SqlBaseParserNULLS-97))|(1<<(SqlBaseParserONLY-97))|(1<<(SqlBaseParserOPTION-97))|(1<<(SqlBaseParserORDINALITY-97))|(1<<(SqlBaseParserOUTPUT-97))|(1<<(SqlBaseParserOVER-97))|(1<<(SqlBaseParserPARTITION-97))|(1<<(SqlBaseParserPARTITIONS-97))|(1<<(SqlBaseParserPOSITION-97))|(1<<(SqlBaseParserPRECEDING-97))|(1<<(SqlBaseParserPRIVILEGES-97))|(1<<(SqlBaseParserPROPERTIES-97))|(1<<(SqlBaseParserPUBLIC-97)))) != 0) || (((_la-129)&-(0x1f+1)) == 0 && ((1<<uint((_la-129)))&((1<<(SqlBaseParserRANGE-129))|(1<<(SqlBaseParserREAD-129))|(1<<(SqlBaseParserRENAME-129))|(1<<(SqlBaseParserREPEATABLE-129))|(1<<(SqlBaseParserREPLACE-129))|(1<<(SqlBaseParserRESET-129))|(1<<(SqlBaseParserRESTRICT-129))|(1<<(SqlBaseParserREVOKE-129))|(1<<(SqlBaseParserROLLBACK-129))|(1<<(SqlBaseParserROW-129))|(1<<(SqlBaseParserROWS-129))|(1<<(SqlBaseParserSCHEMA-129))|(1<<(SqlBaseParserSCHEMAS-129))|(1<<(SqlBaseParserSECOND-129))|(1<<(SqlBaseParserSERIALIZABLE-129))|(1<<(SqlBaseParserSESSION-129))|(1<<(SqlBaseParserSET-129))|(1<<(SqlBaseParserSETS-129))|(1<<(SqlBaseParserSHOW-129))|(1<<(SqlBaseParserSMALLINT-129))|(1<<(SqlBaseParserSOME-129))|(1<<(SqlBaseParserSTART-129))|(1<<(SqlBaseParserSTATS-129))|(1<<(SqlBaseParserSUBSTRING-129))|(1<<(SqlBaseParserSYSTEM-129))|(1<<(SqlBaseParserTABLES-129))|(1<<(SqlBaseParserTABLESAMPLE-129)))) != 0) || (((_la-161)&-(0x1f+1)) == 0 && ((1<<uint((_la-161)))&((1<<(SqlBaseParserTEXT-161))|(1<<(SqlBaseParserTIME-161))|(1<<(SqlBaseParserTIMESTAMP-161))|(1<<(SqlBaseParserTINYINT-161))|(1<<(SqlBaseParserTO-161))|(1<<(SqlBaseParserTRY_CAST-161))|(1<<(SqlBaseParserTYPE-161))|(1<<(SqlBaseParserUNBOUNDED-161))|(1<<(SqlBaseParserUNCOMMITTED-161))|(1<<(SqlBaseParserUSE-161))|(1<<(SqlBaseParserVALIDATE-161))|(1<<(SqlBaseParserVERBOSE-161))|(1<<(SqlBaseParserVIEW-161))|(1<<(SqlBaseParserWORK-161))|(1<<(SqlBaseParserWRITE-161))|(1<<(SqlBaseParserYEAR-161))|(1<<(SqlBaseParserZONE-161)))) != 0) || (((_la-206)&-(0x1f+1)) == 0 && ((1<<uint((_la-206)))&((1<<(SqlBaseParserIDENTIFIER-206))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-206))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserCOMMIT-206))|(1<<(SqlBaseParserISOLATION-206))|(1<<(SqlBaseParserTRANSACTION-206)))) != 0) { 8515 { 8516 p.SetState(681) 8517 p.QualifiedName() 8518 } 8519 p.SetState(686) 8520 p.GetErrorHandler().Sync(p) 8521 _la = p.GetTokenStream().LA(1) 8522 8523 for _la == SqlBaseParserT__3 { 8524 { 8525 p.SetState(682) 8526 p.Match(SqlBaseParserT__3) 8527 } 8528 { 8529 p.SetState(683) 8530 p.QualifiedName() 8531 } 8532 8533 p.SetState(688) 8534 p.GetErrorHandler().Sync(p) 8535 _la = p.GetTokenStream().LA(1) 8536 } 8537 8538 } 8539 { 8540 p.SetState(691) 8541 p.Match(SqlBaseParserT__2) 8542 } 8543 8544 case 4: 8545 localctx = NewMultipleGroupingSetsContext(p, localctx) 8546 p.EnterOuterAlt(localctx, 4) 8547 { 8548 p.SetState(692) 8549 p.Match(SqlBaseParserGROUPING) 8550 } 8551 { 8552 p.SetState(693) 8553 p.Match(SqlBaseParserSETS) 8554 } 8555 { 8556 p.SetState(694) 8557 p.Match(SqlBaseParserT__1) 8558 } 8559 { 8560 p.SetState(695) 8561 p.GroupingSet() 8562 } 8563 p.SetState(700) 8564 p.GetErrorHandler().Sync(p) 8565 _la = p.GetTokenStream().LA(1) 8566 8567 for _la == SqlBaseParserT__3 { 8568 { 8569 p.SetState(696) 8570 p.Match(SqlBaseParserT__3) 8571 } 8572 { 8573 p.SetState(697) 8574 p.GroupingSet() 8575 } 8576 8577 p.SetState(702) 8578 p.GetErrorHandler().Sync(p) 8579 _la = p.GetTokenStream().LA(1) 8580 } 8581 { 8582 p.SetState(703) 8583 p.Match(SqlBaseParserT__2) 8584 } 8585 8586 } 8587 8588 return localctx 8589 } 8590 8591 // IGroupingExpressionsContext is an interface to support dynamic dispatch. 8592 type IGroupingExpressionsContext interface { 8593 antlr.ParserRuleContext 8594 8595 // GetParser returns the parser. 8596 GetParser() antlr.Parser 8597 8598 // IsGroupingExpressionsContext differentiates from other interfaces. 8599 IsGroupingExpressionsContext() 8600 } 8601 8602 type GroupingExpressionsContext struct { 8603 *antlr.BaseParserRuleContext 8604 parser antlr.Parser 8605 } 8606 8607 func NewEmptyGroupingExpressionsContext() *GroupingExpressionsContext { 8608 var p = new(GroupingExpressionsContext) 8609 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 8610 p.RuleIndex = SqlBaseParserRULE_groupingExpressions 8611 return p 8612 } 8613 8614 func (*GroupingExpressionsContext) IsGroupingExpressionsContext() {} 8615 8616 func NewGroupingExpressionsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupingExpressionsContext { 8617 var p = new(GroupingExpressionsContext) 8618 8619 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 8620 8621 p.parser = parser 8622 p.RuleIndex = SqlBaseParserRULE_groupingExpressions 8623 8624 return p 8625 } 8626 8627 func (s *GroupingExpressionsContext) GetParser() antlr.Parser { return s.parser } 8628 8629 func (s *GroupingExpressionsContext) AllExpression() []IExpressionContext { 8630 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 8631 var tst = make([]IExpressionContext, len(ts)) 8632 8633 for i, t := range ts { 8634 if t != nil { 8635 tst[i] = t.(IExpressionContext) 8636 } 8637 } 8638 8639 return tst 8640 } 8641 8642 func (s *GroupingExpressionsContext) Expression(i int) IExpressionContext { 8643 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 8644 8645 if t == nil { 8646 return nil 8647 } 8648 8649 return t.(IExpressionContext) 8650 } 8651 8652 func (s *GroupingExpressionsContext) GetRuleContext() antlr.RuleContext { 8653 return s 8654 } 8655 8656 func (s *GroupingExpressionsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 8657 return antlr.TreesStringTree(s, ruleNames, recog) 8658 } 8659 8660 func (s *GroupingExpressionsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 8661 switch t := visitor.(type) { 8662 case SqlBaseVisitor: 8663 return t.VisitGroupingExpressions(s) 8664 8665 default: 8666 return t.VisitChildren(s) 8667 } 8668 } 8669 8670 func (p *SqlBaseParser) GroupingExpressions() (localctx IGroupingExpressionsContext) { 8671 localctx = NewGroupingExpressionsContext(p, p.GetParserRuleContext(), p.GetState()) 8672 p.EnterRule(localctx, 34, SqlBaseParserRULE_groupingExpressions) 8673 var _la int 8674 8675 defer func() { 8676 p.ExitRule() 8677 }() 8678 8679 defer func() { 8680 if err := recover(); err != nil { 8681 if v, ok := err.(antlr.RecognitionException); ok { 8682 localctx.SetException(v) 8683 p.GetErrorHandler().ReportError(p, v) 8684 p.GetErrorHandler().Recover(p, v) 8685 } else { 8686 panic(err) 8687 } 8688 } 8689 }() 8690 8691 p.SetState(720) 8692 p.GetErrorHandler().Sync(p) 8693 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 85, p.GetParserRuleContext()) { 8694 case 1: 8695 p.EnterOuterAlt(localctx, 1) 8696 { 8697 p.SetState(707) 8698 p.Match(SqlBaseParserT__1) 8699 } 8700 p.SetState(716) 8701 p.GetErrorHandler().Sync(p) 8702 _la = p.GetTokenStream().LA(1) 8703 8704 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserT__1)|(1<<SqlBaseParserT__4)|(1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCASE)|(1<<SqlBaseParserCAST)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserCURRENT_DATE-32))|(1<<(SqlBaseParserCURRENT_TIME-32))|(1<<(SqlBaseParserCURRENT_TIMESTAMP-32))|(1<<(SqlBaseParserCURRENT_USER-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXISTS-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserEXTRACT-32))|(1<<(SqlBaseParserFALSE-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserGROUPING-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64))|(1<<(SqlBaseParserLOCALTIME-64)))) != 0) || (((_la-96)&-(0x1f+1)) == 0 && ((1<<uint((_la-96)))&((1<<(SqlBaseParserLOCALTIMESTAMP-96))|(1<<(SqlBaseParserLOGICAL-96))|(1<<(SqlBaseParserMAP-96))|(1<<(SqlBaseParserMINUTE-96))|(1<<(SqlBaseParserMONTH-96))|(1<<(SqlBaseParserNFC-96))|(1<<(SqlBaseParserNFD-96))|(1<<(SqlBaseParserNFKC-96))|(1<<(SqlBaseParserNFKD-96))|(1<<(SqlBaseParserNO-96))|(1<<(SqlBaseParserNORMALIZE-96))|(1<<(SqlBaseParserNOT-96))|(1<<(SqlBaseParserNULL-96))|(1<<(SqlBaseParserNULLIF-96))|(1<<(SqlBaseParserNULLS-96))|(1<<(SqlBaseParserONLY-96))|(1<<(SqlBaseParserOPTION-96))|(1<<(SqlBaseParserORDINALITY-96))|(1<<(SqlBaseParserOUTPUT-96))|(1<<(SqlBaseParserOVER-96))|(1<<(SqlBaseParserPARTITION-96))|(1<<(SqlBaseParserPARTITIONS-96))|(1<<(SqlBaseParserPOSITION-96))|(1<<(SqlBaseParserPRECEDING-96))|(1<<(SqlBaseParserPRIVILEGES-96))|(1<<(SqlBaseParserPROPERTIES-96)))) != 0) || (((_la-128)&-(0x1f+1)) == 0 && ((1<<uint((_la-128)))&((1<<(SqlBaseParserPUBLIC-128))|(1<<(SqlBaseParserRANGE-128))|(1<<(SqlBaseParserREAD-128))|(1<<(SqlBaseParserRENAME-128))|(1<<(SqlBaseParserREPEATABLE-128))|(1<<(SqlBaseParserREPLACE-128))|(1<<(SqlBaseParserRESET-128))|(1<<(SqlBaseParserRESTRICT-128))|(1<<(SqlBaseParserREVOKE-128))|(1<<(SqlBaseParserROLLBACK-128))|(1<<(SqlBaseParserROW-128))|(1<<(SqlBaseParserROWS-128))|(1<<(SqlBaseParserSCHEMA-128))|(1<<(SqlBaseParserSCHEMAS-128))|(1<<(SqlBaseParserSECOND-128))|(1<<(SqlBaseParserSERIALIZABLE-128))|(1<<(SqlBaseParserSESSION-128))|(1<<(SqlBaseParserSET-128))|(1<<(SqlBaseParserSETS-128))|(1<<(SqlBaseParserSHOW-128))|(1<<(SqlBaseParserSMALLINT-128))|(1<<(SqlBaseParserSOME-128))|(1<<(SqlBaseParserSTART-128))|(1<<(SqlBaseParserSTATS-128))|(1<<(SqlBaseParserSUBSTRING-128))|(1<<(SqlBaseParserSYSTEM-128))|(1<<(SqlBaseParserTABLES-128)))) != 0) || (((_la-160)&-(0x1f+1)) == 0 && ((1<<uint((_la-160)))&((1<<(SqlBaseParserTABLESAMPLE-160))|(1<<(SqlBaseParserTEXT-160))|(1<<(SqlBaseParserTIME-160))|(1<<(SqlBaseParserTIMESTAMP-160))|(1<<(SqlBaseParserTINYINT-160))|(1<<(SqlBaseParserTO-160))|(1<<(SqlBaseParserTRUE-160))|(1<<(SqlBaseParserTRY_CAST-160))|(1<<(SqlBaseParserTYPE-160))|(1<<(SqlBaseParserUNBOUNDED-160))|(1<<(SqlBaseParserUNCOMMITTED-160))|(1<<(SqlBaseParserUSE-160))|(1<<(SqlBaseParserVALIDATE-160))|(1<<(SqlBaseParserVERBOSE-160))|(1<<(SqlBaseParserVIEW-160))|(1<<(SqlBaseParserWORK-160))|(1<<(SqlBaseParserWRITE-160))|(1<<(SqlBaseParserYEAR-160))|(1<<(SqlBaseParserZONE-160)))) != 0) || (((_la-194)&-(0x1f+1)) == 0 && ((1<<uint((_la-194)))&((1<<(SqlBaseParserPLUS-194))|(1<<(SqlBaseParserMINUS-194))|(1<<(SqlBaseParserSTRING-194))|(1<<(SqlBaseParserUNICODE_STRING-194))|(1<<(SqlBaseParserBINARY_LITERAL-194))|(1<<(SqlBaseParserINTEGER_VALUE-194))|(1<<(SqlBaseParserDECIMAL_VALUE-194))|(1<<(SqlBaseParserDOUBLE_VALUE-194))|(1<<(SqlBaseParserIDENTIFIER-194))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-194))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-194))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-194))|(1<<(SqlBaseParserDOUBLE_PRECISION-194))|(1<<(SqlBaseParserCOMMIT-194))|(1<<(SqlBaseParserISOLATION-194))|(1<<(SqlBaseParserTRANSACTION-194)))) != 0) { 8705 { 8706 p.SetState(708) 8707 p.Expression() 8708 } 8709 p.SetState(713) 8710 p.GetErrorHandler().Sync(p) 8711 _la = p.GetTokenStream().LA(1) 8712 8713 for _la == SqlBaseParserT__3 { 8714 { 8715 p.SetState(709) 8716 p.Match(SqlBaseParserT__3) 8717 } 8718 { 8719 p.SetState(710) 8720 p.Expression() 8721 } 8722 8723 p.SetState(715) 8724 p.GetErrorHandler().Sync(p) 8725 _la = p.GetTokenStream().LA(1) 8726 } 8727 8728 } 8729 { 8730 p.SetState(718) 8731 p.Match(SqlBaseParserT__2) 8732 } 8733 8734 case 2: 8735 p.EnterOuterAlt(localctx, 2) 8736 { 8737 p.SetState(719) 8738 p.Expression() 8739 } 8740 8741 } 8742 8743 return localctx 8744 } 8745 8746 // IGroupingSetContext is an interface to support dynamic dispatch. 8747 type IGroupingSetContext interface { 8748 antlr.ParserRuleContext 8749 8750 // GetParser returns the parser. 8751 GetParser() antlr.Parser 8752 8753 // IsGroupingSetContext differentiates from other interfaces. 8754 IsGroupingSetContext() 8755 } 8756 8757 type GroupingSetContext struct { 8758 *antlr.BaseParserRuleContext 8759 parser antlr.Parser 8760 } 8761 8762 func NewEmptyGroupingSetContext() *GroupingSetContext { 8763 var p = new(GroupingSetContext) 8764 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 8765 p.RuleIndex = SqlBaseParserRULE_groupingSet 8766 return p 8767 } 8768 8769 func (*GroupingSetContext) IsGroupingSetContext() {} 8770 8771 func NewGroupingSetContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupingSetContext { 8772 var p = new(GroupingSetContext) 8773 8774 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 8775 8776 p.parser = parser 8777 p.RuleIndex = SqlBaseParserRULE_groupingSet 8778 8779 return p 8780 } 8781 8782 func (s *GroupingSetContext) GetParser() antlr.Parser { return s.parser } 8783 8784 func (s *GroupingSetContext) AllQualifiedName() []IQualifiedNameContext { 8785 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem()) 8786 var tst = make([]IQualifiedNameContext, len(ts)) 8787 8788 for i, t := range ts { 8789 if t != nil { 8790 tst[i] = t.(IQualifiedNameContext) 8791 } 8792 } 8793 8794 return tst 8795 } 8796 8797 func (s *GroupingSetContext) QualifiedName(i int) IQualifiedNameContext { 8798 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), i) 8799 8800 if t == nil { 8801 return nil 8802 } 8803 8804 return t.(IQualifiedNameContext) 8805 } 8806 8807 func (s *GroupingSetContext) GetRuleContext() antlr.RuleContext { 8808 return s 8809 } 8810 8811 func (s *GroupingSetContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 8812 return antlr.TreesStringTree(s, ruleNames, recog) 8813 } 8814 8815 func (s *GroupingSetContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 8816 switch t := visitor.(type) { 8817 case SqlBaseVisitor: 8818 return t.VisitGroupingSet(s) 8819 8820 default: 8821 return t.VisitChildren(s) 8822 } 8823 } 8824 8825 func (p *SqlBaseParser) GroupingSet() (localctx IGroupingSetContext) { 8826 localctx = NewGroupingSetContext(p, p.GetParserRuleContext(), p.GetState()) 8827 p.EnterRule(localctx, 36, SqlBaseParserRULE_groupingSet) 8828 var _la int 8829 8830 defer func() { 8831 p.ExitRule() 8832 }() 8833 8834 defer func() { 8835 if err := recover(); err != nil { 8836 if v, ok := err.(antlr.RecognitionException); ok { 8837 localctx.SetException(v) 8838 p.GetErrorHandler().ReportError(p, v) 8839 p.GetErrorHandler().Recover(p, v) 8840 } else { 8841 panic(err) 8842 } 8843 } 8844 }() 8845 8846 p.SetState(735) 8847 p.GetErrorHandler().Sync(p) 8848 8849 switch p.GetTokenStream().LA(1) { 8850 case SqlBaseParserT__1: 8851 p.EnterOuterAlt(localctx, 1) 8852 { 8853 p.SetState(722) 8854 p.Match(SqlBaseParserT__1) 8855 } 8856 p.SetState(731) 8857 p.GetErrorHandler().Sync(p) 8858 _la = p.GetTokenStream().LA(1) 8859 8860 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64)))) != 0) || (((_la-97)&-(0x1f+1)) == 0 && ((1<<uint((_la-97)))&((1<<(SqlBaseParserLOGICAL-97))|(1<<(SqlBaseParserMAP-97))|(1<<(SqlBaseParserMINUTE-97))|(1<<(SqlBaseParserMONTH-97))|(1<<(SqlBaseParserNFC-97))|(1<<(SqlBaseParserNFD-97))|(1<<(SqlBaseParserNFKC-97))|(1<<(SqlBaseParserNFKD-97))|(1<<(SqlBaseParserNO-97))|(1<<(SqlBaseParserNULLIF-97))|(1<<(SqlBaseParserNULLS-97))|(1<<(SqlBaseParserONLY-97))|(1<<(SqlBaseParserOPTION-97))|(1<<(SqlBaseParserORDINALITY-97))|(1<<(SqlBaseParserOUTPUT-97))|(1<<(SqlBaseParserOVER-97))|(1<<(SqlBaseParserPARTITION-97))|(1<<(SqlBaseParserPARTITIONS-97))|(1<<(SqlBaseParserPOSITION-97))|(1<<(SqlBaseParserPRECEDING-97))|(1<<(SqlBaseParserPRIVILEGES-97))|(1<<(SqlBaseParserPROPERTIES-97))|(1<<(SqlBaseParserPUBLIC-97)))) != 0) || (((_la-129)&-(0x1f+1)) == 0 && ((1<<uint((_la-129)))&((1<<(SqlBaseParserRANGE-129))|(1<<(SqlBaseParserREAD-129))|(1<<(SqlBaseParserRENAME-129))|(1<<(SqlBaseParserREPEATABLE-129))|(1<<(SqlBaseParserREPLACE-129))|(1<<(SqlBaseParserRESET-129))|(1<<(SqlBaseParserRESTRICT-129))|(1<<(SqlBaseParserREVOKE-129))|(1<<(SqlBaseParserROLLBACK-129))|(1<<(SqlBaseParserROW-129))|(1<<(SqlBaseParserROWS-129))|(1<<(SqlBaseParserSCHEMA-129))|(1<<(SqlBaseParserSCHEMAS-129))|(1<<(SqlBaseParserSECOND-129))|(1<<(SqlBaseParserSERIALIZABLE-129))|(1<<(SqlBaseParserSESSION-129))|(1<<(SqlBaseParserSET-129))|(1<<(SqlBaseParserSETS-129))|(1<<(SqlBaseParserSHOW-129))|(1<<(SqlBaseParserSMALLINT-129))|(1<<(SqlBaseParserSOME-129))|(1<<(SqlBaseParserSTART-129))|(1<<(SqlBaseParserSTATS-129))|(1<<(SqlBaseParserSUBSTRING-129))|(1<<(SqlBaseParserSYSTEM-129))|(1<<(SqlBaseParserTABLES-129))|(1<<(SqlBaseParserTABLESAMPLE-129)))) != 0) || (((_la-161)&-(0x1f+1)) == 0 && ((1<<uint((_la-161)))&((1<<(SqlBaseParserTEXT-161))|(1<<(SqlBaseParserTIME-161))|(1<<(SqlBaseParserTIMESTAMP-161))|(1<<(SqlBaseParserTINYINT-161))|(1<<(SqlBaseParserTO-161))|(1<<(SqlBaseParserTRY_CAST-161))|(1<<(SqlBaseParserTYPE-161))|(1<<(SqlBaseParserUNBOUNDED-161))|(1<<(SqlBaseParserUNCOMMITTED-161))|(1<<(SqlBaseParserUSE-161))|(1<<(SqlBaseParserVALIDATE-161))|(1<<(SqlBaseParserVERBOSE-161))|(1<<(SqlBaseParserVIEW-161))|(1<<(SqlBaseParserWORK-161))|(1<<(SqlBaseParserWRITE-161))|(1<<(SqlBaseParserYEAR-161))|(1<<(SqlBaseParserZONE-161)))) != 0) || (((_la-206)&-(0x1f+1)) == 0 && ((1<<uint((_la-206)))&((1<<(SqlBaseParserIDENTIFIER-206))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-206))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserCOMMIT-206))|(1<<(SqlBaseParserISOLATION-206))|(1<<(SqlBaseParserTRANSACTION-206)))) != 0) { 8861 { 8862 p.SetState(723) 8863 p.QualifiedName() 8864 } 8865 p.SetState(728) 8866 p.GetErrorHandler().Sync(p) 8867 _la = p.GetTokenStream().LA(1) 8868 8869 for _la == SqlBaseParserT__3 { 8870 { 8871 p.SetState(724) 8872 p.Match(SqlBaseParserT__3) 8873 } 8874 { 8875 p.SetState(725) 8876 p.QualifiedName() 8877 } 8878 8879 p.SetState(730) 8880 p.GetErrorHandler().Sync(p) 8881 _la = p.GetTokenStream().LA(1) 8882 } 8883 8884 } 8885 { 8886 p.SetState(733) 8887 p.Match(SqlBaseParserT__2) 8888 } 8889 8890 case SqlBaseParserADD, SqlBaseParserALL, SqlBaseParserANALYZE, SqlBaseParserANY, SqlBaseParserARRAY, SqlBaseParserASC, SqlBaseParserAT, SqlBaseParserBERNOULLI, SqlBaseParserCALL, SqlBaseParserCASCADE, SqlBaseParserCATALOGS, SqlBaseParserCOALESCE, SqlBaseParserCOLUMN, SqlBaseParserCOLUMNS, SqlBaseParserCOMMENT, SqlBaseParserCOMMITTED, SqlBaseParserCURRENT, SqlBaseParserDATA, SqlBaseParserDATE, SqlBaseParserDAY, SqlBaseParserDESC, SqlBaseParserDISTRIBUTED, SqlBaseParserEXCLUDING, SqlBaseParserEXPLAIN, SqlBaseParserFILTER, SqlBaseParserFIRST, SqlBaseParserFOLLOWING, SqlBaseParserFORMAT, SqlBaseParserFUNCTIONS, SqlBaseParserGRANT, SqlBaseParserGRANTS, SqlBaseParserGRAPHVIZ, SqlBaseParserHOUR, SqlBaseParserIF, SqlBaseParserINCLUDING, SqlBaseParserINPUT, SqlBaseParserINTEGER, SqlBaseParserINTERVAL, SqlBaseParserLAST, SqlBaseParserLATERAL, SqlBaseParserLEVEL, SqlBaseParserLIMIT, SqlBaseParserLOGICAL, SqlBaseParserMAP, SqlBaseParserMINUTE, SqlBaseParserMONTH, SqlBaseParserNFC, SqlBaseParserNFD, SqlBaseParserNFKC, SqlBaseParserNFKD, SqlBaseParserNO, SqlBaseParserNULLIF, SqlBaseParserNULLS, SqlBaseParserONLY, SqlBaseParserOPTION, SqlBaseParserORDINALITY, SqlBaseParserOUTPUT, SqlBaseParserOVER, SqlBaseParserPARTITION, SqlBaseParserPARTITIONS, SqlBaseParserPOSITION, SqlBaseParserPRECEDING, SqlBaseParserPRIVILEGES, SqlBaseParserPROPERTIES, SqlBaseParserPUBLIC, SqlBaseParserRANGE, SqlBaseParserREAD, SqlBaseParserRENAME, SqlBaseParserREPEATABLE, SqlBaseParserREPLACE, SqlBaseParserRESET, SqlBaseParserRESTRICT, SqlBaseParserREVOKE, SqlBaseParserROLLBACK, SqlBaseParserROW, SqlBaseParserROWS, SqlBaseParserSCHEMA, SqlBaseParserSCHEMAS, SqlBaseParserSECOND, SqlBaseParserSERIALIZABLE, SqlBaseParserSESSION, SqlBaseParserSET, SqlBaseParserSETS, SqlBaseParserSHOW, SqlBaseParserSMALLINT, SqlBaseParserSOME, SqlBaseParserSTART, SqlBaseParserSTATS, SqlBaseParserSUBSTRING, SqlBaseParserSYSTEM, SqlBaseParserTABLES, SqlBaseParserTABLESAMPLE, SqlBaseParserTEXT, SqlBaseParserTIME, SqlBaseParserTIMESTAMP, SqlBaseParserTINYINT, SqlBaseParserTO, SqlBaseParserTRY_CAST, SqlBaseParserTYPE, SqlBaseParserUNBOUNDED, SqlBaseParserUNCOMMITTED, SqlBaseParserUSE, SqlBaseParserVALIDATE, SqlBaseParserVERBOSE, SqlBaseParserVIEW, SqlBaseParserWORK, SqlBaseParserWRITE, SqlBaseParserYEAR, SqlBaseParserZONE, SqlBaseParserIDENTIFIER, SqlBaseParserDIGIT_IDENTIFIER, SqlBaseParserQUOTED_IDENTIFIER, SqlBaseParserBACKQUOTED_IDENTIFIER, SqlBaseParserCOMMIT, SqlBaseParserISOLATION, SqlBaseParserTRANSACTION: 8891 p.EnterOuterAlt(localctx, 2) 8892 { 8893 p.SetState(734) 8894 p.QualifiedName() 8895 } 8896 8897 default: 8898 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 8899 } 8900 8901 return localctx 8902 } 8903 8904 // INamedQueryContext is an interface to support dynamic dispatch. 8905 type INamedQueryContext interface { 8906 antlr.ParserRuleContext 8907 8908 // GetParser returns the parser. 8909 GetParser() antlr.Parser 8910 8911 // GetName returns the name rule contexts. 8912 GetName() IIdentifierContext 8913 8914 // SetName sets the name rule contexts. 8915 SetName(IIdentifierContext) 8916 8917 // IsNamedQueryContext differentiates from other interfaces. 8918 IsNamedQueryContext() 8919 } 8920 8921 type NamedQueryContext struct { 8922 *antlr.BaseParserRuleContext 8923 parser antlr.Parser 8924 name IIdentifierContext 8925 } 8926 8927 func NewEmptyNamedQueryContext() *NamedQueryContext { 8928 var p = new(NamedQueryContext) 8929 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 8930 p.RuleIndex = SqlBaseParserRULE_namedQuery 8931 return p 8932 } 8933 8934 func (*NamedQueryContext) IsNamedQueryContext() {} 8935 8936 func NewNamedQueryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NamedQueryContext { 8937 var p = new(NamedQueryContext) 8938 8939 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 8940 8941 p.parser = parser 8942 p.RuleIndex = SqlBaseParserRULE_namedQuery 8943 8944 return p 8945 } 8946 8947 func (s *NamedQueryContext) GetParser() antlr.Parser { return s.parser } 8948 8949 func (s *NamedQueryContext) GetName() IIdentifierContext { return s.name } 8950 8951 func (s *NamedQueryContext) SetName(v IIdentifierContext) { s.name = v } 8952 8953 func (s *NamedQueryContext) AS() antlr.TerminalNode { 8954 return s.GetToken(SqlBaseParserAS, 0) 8955 } 8956 8957 func (s *NamedQueryContext) Query() IQueryContext { 8958 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 8959 8960 if t == nil { 8961 return nil 8962 } 8963 8964 return t.(IQueryContext) 8965 } 8966 8967 func (s *NamedQueryContext) Identifier() IIdentifierContext { 8968 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 8969 8970 if t == nil { 8971 return nil 8972 } 8973 8974 return t.(IIdentifierContext) 8975 } 8976 8977 func (s *NamedQueryContext) ColumnAliases() IColumnAliasesContext { 8978 var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnAliasesContext)(nil)).Elem(), 0) 8979 8980 if t == nil { 8981 return nil 8982 } 8983 8984 return t.(IColumnAliasesContext) 8985 } 8986 8987 func (s *NamedQueryContext) GetRuleContext() antlr.RuleContext { 8988 return s 8989 } 8990 8991 func (s *NamedQueryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 8992 return antlr.TreesStringTree(s, ruleNames, recog) 8993 } 8994 8995 func (s *NamedQueryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 8996 switch t := visitor.(type) { 8997 case SqlBaseVisitor: 8998 return t.VisitNamedQuery(s) 8999 9000 default: 9001 return t.VisitChildren(s) 9002 } 9003 } 9004 9005 func (p *SqlBaseParser) NamedQuery() (localctx INamedQueryContext) { 9006 localctx = NewNamedQueryContext(p, p.GetParserRuleContext(), p.GetState()) 9007 p.EnterRule(localctx, 38, SqlBaseParserRULE_namedQuery) 9008 var _la int 9009 9010 defer func() { 9011 p.ExitRule() 9012 }() 9013 9014 defer func() { 9015 if err := recover(); err != nil { 9016 if v, ok := err.(antlr.RecognitionException); ok { 9017 localctx.SetException(v) 9018 p.GetErrorHandler().ReportError(p, v) 9019 p.GetErrorHandler().Recover(p, v) 9020 } else { 9021 panic(err) 9022 } 9023 } 9024 }() 9025 9026 p.EnterOuterAlt(localctx, 1) 9027 { 9028 p.SetState(737) 9029 9030 var _x = p.Identifier() 9031 9032 localctx.(*NamedQueryContext).name = _x 9033 } 9034 p.SetState(739) 9035 p.GetErrorHandler().Sync(p) 9036 _la = p.GetTokenStream().LA(1) 9037 9038 if _la == SqlBaseParserT__1 { 9039 { 9040 p.SetState(738) 9041 p.ColumnAliases() 9042 } 9043 9044 } 9045 { 9046 p.SetState(741) 9047 p.Match(SqlBaseParserAS) 9048 } 9049 { 9050 p.SetState(742) 9051 p.Match(SqlBaseParserT__1) 9052 } 9053 { 9054 p.SetState(743) 9055 p.Query() 9056 } 9057 { 9058 p.SetState(744) 9059 p.Match(SqlBaseParserT__2) 9060 } 9061 9062 return localctx 9063 } 9064 9065 // ISetQuantifierContext is an interface to support dynamic dispatch. 9066 type ISetQuantifierContext interface { 9067 antlr.ParserRuleContext 9068 9069 // GetParser returns the parser. 9070 GetParser() antlr.Parser 9071 9072 // IsSetQuantifierContext differentiates from other interfaces. 9073 IsSetQuantifierContext() 9074 } 9075 9076 type SetQuantifierContext struct { 9077 *antlr.BaseParserRuleContext 9078 parser antlr.Parser 9079 } 9080 9081 func NewEmptySetQuantifierContext() *SetQuantifierContext { 9082 var p = new(SetQuantifierContext) 9083 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 9084 p.RuleIndex = SqlBaseParserRULE_setQuantifier 9085 return p 9086 } 9087 9088 func (*SetQuantifierContext) IsSetQuantifierContext() {} 9089 9090 func NewSetQuantifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SetQuantifierContext { 9091 var p = new(SetQuantifierContext) 9092 9093 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 9094 9095 p.parser = parser 9096 p.RuleIndex = SqlBaseParserRULE_setQuantifier 9097 9098 return p 9099 } 9100 9101 func (s *SetQuantifierContext) GetParser() antlr.Parser { return s.parser } 9102 9103 func (s *SetQuantifierContext) DISTINCT() antlr.TerminalNode { 9104 return s.GetToken(SqlBaseParserDISTINCT, 0) 9105 } 9106 9107 func (s *SetQuantifierContext) ALL() antlr.TerminalNode { 9108 return s.GetToken(SqlBaseParserALL, 0) 9109 } 9110 9111 func (s *SetQuantifierContext) GetRuleContext() antlr.RuleContext { 9112 return s 9113 } 9114 9115 func (s *SetQuantifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 9116 return antlr.TreesStringTree(s, ruleNames, recog) 9117 } 9118 9119 func (s *SetQuantifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 9120 switch t := visitor.(type) { 9121 case SqlBaseVisitor: 9122 return t.VisitSetQuantifier(s) 9123 9124 default: 9125 return t.VisitChildren(s) 9126 } 9127 } 9128 9129 func (p *SqlBaseParser) SetQuantifier() (localctx ISetQuantifierContext) { 9130 localctx = NewSetQuantifierContext(p, p.GetParserRuleContext(), p.GetState()) 9131 p.EnterRule(localctx, 40, SqlBaseParserRULE_setQuantifier) 9132 var _la int 9133 9134 defer func() { 9135 p.ExitRule() 9136 }() 9137 9138 defer func() { 9139 if err := recover(); err != nil { 9140 if v, ok := err.(antlr.RecognitionException); ok { 9141 localctx.SetException(v) 9142 p.GetErrorHandler().ReportError(p, v) 9143 p.GetErrorHandler().Recover(p, v) 9144 } else { 9145 panic(err) 9146 } 9147 } 9148 }() 9149 9150 p.EnterOuterAlt(localctx, 1) 9151 { 9152 p.SetState(746) 9153 _la = p.GetTokenStream().LA(1) 9154 9155 if !(_la == SqlBaseParserALL || _la == SqlBaseParserDISTINCT) { 9156 p.GetErrorHandler().RecoverInline(p) 9157 } else { 9158 p.GetErrorHandler().ReportMatch(p) 9159 p.Consume() 9160 } 9161 } 9162 9163 return localctx 9164 } 9165 9166 // ISelectItemContext is an interface to support dynamic dispatch. 9167 type ISelectItemContext interface { 9168 antlr.ParserRuleContext 9169 9170 // GetParser returns the parser. 9171 GetParser() antlr.Parser 9172 9173 // IsSelectItemContext differentiates from other interfaces. 9174 IsSelectItemContext() 9175 } 9176 9177 type SelectItemContext struct { 9178 *antlr.BaseParserRuleContext 9179 parser antlr.Parser 9180 } 9181 9182 func NewEmptySelectItemContext() *SelectItemContext { 9183 var p = new(SelectItemContext) 9184 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 9185 p.RuleIndex = SqlBaseParserRULE_selectItem 9186 return p 9187 } 9188 9189 func (*SelectItemContext) IsSelectItemContext() {} 9190 9191 func NewSelectItemContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SelectItemContext { 9192 var p = new(SelectItemContext) 9193 9194 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 9195 9196 p.parser = parser 9197 p.RuleIndex = SqlBaseParserRULE_selectItem 9198 9199 return p 9200 } 9201 9202 func (s *SelectItemContext) GetParser() antlr.Parser { return s.parser } 9203 9204 func (s *SelectItemContext) CopyFrom(ctx *SelectItemContext) { 9205 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 9206 } 9207 9208 func (s *SelectItemContext) GetRuleContext() antlr.RuleContext { 9209 return s 9210 } 9211 9212 func (s *SelectItemContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 9213 return antlr.TreesStringTree(s, ruleNames, recog) 9214 } 9215 9216 type SelectAllContext struct { 9217 *SelectItemContext 9218 } 9219 9220 func NewSelectAllContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectAllContext { 9221 var p = new(SelectAllContext) 9222 9223 p.SelectItemContext = NewEmptySelectItemContext() 9224 p.parser = parser 9225 p.CopyFrom(ctx.(*SelectItemContext)) 9226 9227 return p 9228 } 9229 9230 func (s *SelectAllContext) GetRuleContext() antlr.RuleContext { 9231 return s 9232 } 9233 9234 func (s *SelectAllContext) QualifiedName() IQualifiedNameContext { 9235 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 9236 9237 if t == nil { 9238 return nil 9239 } 9240 9241 return t.(IQualifiedNameContext) 9242 } 9243 9244 func (s *SelectAllContext) ASTERISK() antlr.TerminalNode { 9245 return s.GetToken(SqlBaseParserASTERISK, 0) 9246 } 9247 9248 func (s *SelectAllContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 9249 switch t := visitor.(type) { 9250 case SqlBaseVisitor: 9251 return t.VisitSelectAll(s) 9252 9253 default: 9254 return t.VisitChildren(s) 9255 } 9256 } 9257 9258 type SelectSingleContext struct { 9259 *SelectItemContext 9260 } 9261 9262 func NewSelectSingleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectSingleContext { 9263 var p = new(SelectSingleContext) 9264 9265 p.SelectItemContext = NewEmptySelectItemContext() 9266 p.parser = parser 9267 p.CopyFrom(ctx.(*SelectItemContext)) 9268 9269 return p 9270 } 9271 9272 func (s *SelectSingleContext) GetRuleContext() antlr.RuleContext { 9273 return s 9274 } 9275 9276 func (s *SelectSingleContext) Expression() IExpressionContext { 9277 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 9278 9279 if t == nil { 9280 return nil 9281 } 9282 9283 return t.(IExpressionContext) 9284 } 9285 9286 func (s *SelectSingleContext) Identifier() IIdentifierContext { 9287 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 9288 9289 if t == nil { 9290 return nil 9291 } 9292 9293 return t.(IIdentifierContext) 9294 } 9295 9296 func (s *SelectSingleContext) AS() antlr.TerminalNode { 9297 return s.GetToken(SqlBaseParserAS, 0) 9298 } 9299 9300 func (s *SelectSingleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 9301 switch t := visitor.(type) { 9302 case SqlBaseVisitor: 9303 return t.VisitSelectSingle(s) 9304 9305 default: 9306 return t.VisitChildren(s) 9307 } 9308 } 9309 9310 func (p *SqlBaseParser) SelectItem() (localctx ISelectItemContext) { 9311 localctx = NewSelectItemContext(p, p.GetParserRuleContext(), p.GetState()) 9312 p.EnterRule(localctx, 42, SqlBaseParserRULE_selectItem) 9313 var _la int 9314 9315 defer func() { 9316 p.ExitRule() 9317 }() 9318 9319 defer func() { 9320 if err := recover(); err != nil { 9321 if v, ok := err.(antlr.RecognitionException); ok { 9322 localctx.SetException(v) 9323 p.GetErrorHandler().ReportError(p, v) 9324 p.GetErrorHandler().Recover(p, v) 9325 } else { 9326 panic(err) 9327 } 9328 } 9329 }() 9330 9331 p.SetState(760) 9332 p.GetErrorHandler().Sync(p) 9333 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 92, p.GetParserRuleContext()) { 9334 case 1: 9335 localctx = NewSelectSingleContext(p, localctx) 9336 p.EnterOuterAlt(localctx, 1) 9337 { 9338 p.SetState(748) 9339 p.Expression() 9340 } 9341 p.SetState(753) 9342 p.GetErrorHandler().Sync(p) 9343 9344 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 91, p.GetParserRuleContext()) == 1 { 9345 p.SetState(750) 9346 p.GetErrorHandler().Sync(p) 9347 _la = p.GetTokenStream().LA(1) 9348 9349 if _la == SqlBaseParserAS { 9350 { 9351 p.SetState(749) 9352 p.Match(SqlBaseParserAS) 9353 } 9354 9355 } 9356 { 9357 p.SetState(752) 9358 p.Identifier() 9359 } 9360 9361 } 9362 9363 case 2: 9364 localctx = NewSelectAllContext(p, localctx) 9365 p.EnterOuterAlt(localctx, 2) 9366 { 9367 p.SetState(755) 9368 p.QualifiedName() 9369 } 9370 { 9371 p.SetState(756) 9372 p.Match(SqlBaseParserT__0) 9373 } 9374 { 9375 p.SetState(757) 9376 p.Match(SqlBaseParserASTERISK) 9377 } 9378 9379 case 3: 9380 localctx = NewSelectAllContext(p, localctx) 9381 p.EnterOuterAlt(localctx, 3) 9382 { 9383 p.SetState(759) 9384 p.Match(SqlBaseParserASTERISK) 9385 } 9386 9387 } 9388 9389 return localctx 9390 } 9391 9392 // IRelationContext is an interface to support dynamic dispatch. 9393 type IRelationContext interface { 9394 antlr.ParserRuleContext 9395 9396 // GetParser returns the parser. 9397 GetParser() antlr.Parser 9398 9399 // IsRelationContext differentiates from other interfaces. 9400 IsRelationContext() 9401 } 9402 9403 type RelationContext struct { 9404 *antlr.BaseParserRuleContext 9405 parser antlr.Parser 9406 } 9407 9408 func NewEmptyRelationContext() *RelationContext { 9409 var p = new(RelationContext) 9410 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 9411 p.RuleIndex = SqlBaseParserRULE_relation 9412 return p 9413 } 9414 9415 func (*RelationContext) IsRelationContext() {} 9416 9417 func NewRelationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RelationContext { 9418 var p = new(RelationContext) 9419 9420 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 9421 9422 p.parser = parser 9423 p.RuleIndex = SqlBaseParserRULE_relation 9424 9425 return p 9426 } 9427 9428 func (s *RelationContext) GetParser() antlr.Parser { return s.parser } 9429 9430 func (s *RelationContext) CopyFrom(ctx *RelationContext) { 9431 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 9432 } 9433 9434 func (s *RelationContext) GetRuleContext() antlr.RuleContext { 9435 return s 9436 } 9437 9438 func (s *RelationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 9439 return antlr.TreesStringTree(s, ruleNames, recog) 9440 } 9441 9442 type RelationDefaultContext struct { 9443 *RelationContext 9444 } 9445 9446 func NewRelationDefaultContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RelationDefaultContext { 9447 var p = new(RelationDefaultContext) 9448 9449 p.RelationContext = NewEmptyRelationContext() 9450 p.parser = parser 9451 p.CopyFrom(ctx.(*RelationContext)) 9452 9453 return p 9454 } 9455 9456 func (s *RelationDefaultContext) GetRuleContext() antlr.RuleContext { 9457 return s 9458 } 9459 9460 func (s *RelationDefaultContext) SampledRelation() ISampledRelationContext { 9461 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISampledRelationContext)(nil)).Elem(), 0) 9462 9463 if t == nil { 9464 return nil 9465 } 9466 9467 return t.(ISampledRelationContext) 9468 } 9469 9470 func (s *RelationDefaultContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 9471 switch t := visitor.(type) { 9472 case SqlBaseVisitor: 9473 return t.VisitRelationDefault(s) 9474 9475 default: 9476 return t.VisitChildren(s) 9477 } 9478 } 9479 9480 type JoinRelationContext struct { 9481 *RelationContext 9482 left IRelationContext 9483 right ISampledRelationContext 9484 rightRelation IRelationContext 9485 } 9486 9487 func NewJoinRelationContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *JoinRelationContext { 9488 var p = new(JoinRelationContext) 9489 9490 p.RelationContext = NewEmptyRelationContext() 9491 p.parser = parser 9492 p.CopyFrom(ctx.(*RelationContext)) 9493 9494 return p 9495 } 9496 9497 func (s *JoinRelationContext) GetLeft() IRelationContext { return s.left } 9498 9499 func (s *JoinRelationContext) GetRight() ISampledRelationContext { return s.right } 9500 9501 func (s *JoinRelationContext) GetRightRelation() IRelationContext { return s.rightRelation } 9502 9503 func (s *JoinRelationContext) SetLeft(v IRelationContext) { s.left = v } 9504 9505 func (s *JoinRelationContext) SetRight(v ISampledRelationContext) { s.right = v } 9506 9507 func (s *JoinRelationContext) SetRightRelation(v IRelationContext) { s.rightRelation = v } 9508 9509 func (s *JoinRelationContext) GetRuleContext() antlr.RuleContext { 9510 return s 9511 } 9512 9513 func (s *JoinRelationContext) AllRelation() []IRelationContext { 9514 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IRelationContext)(nil)).Elem()) 9515 var tst = make([]IRelationContext, len(ts)) 9516 9517 for i, t := range ts { 9518 if t != nil { 9519 tst[i] = t.(IRelationContext) 9520 } 9521 } 9522 9523 return tst 9524 } 9525 9526 func (s *JoinRelationContext) Relation(i int) IRelationContext { 9527 var t = s.GetTypedRuleContext(reflect.TypeOf((*IRelationContext)(nil)).Elem(), i) 9528 9529 if t == nil { 9530 return nil 9531 } 9532 9533 return t.(IRelationContext) 9534 } 9535 9536 func (s *JoinRelationContext) CROSS() antlr.TerminalNode { 9537 return s.GetToken(SqlBaseParserCROSS, 0) 9538 } 9539 9540 func (s *JoinRelationContext) JOIN() antlr.TerminalNode { 9541 return s.GetToken(SqlBaseParserJOIN, 0) 9542 } 9543 9544 func (s *JoinRelationContext) JoinType() IJoinTypeContext { 9545 var t = s.GetTypedRuleContext(reflect.TypeOf((*IJoinTypeContext)(nil)).Elem(), 0) 9546 9547 if t == nil { 9548 return nil 9549 } 9550 9551 return t.(IJoinTypeContext) 9552 } 9553 9554 func (s *JoinRelationContext) JoinCriteria() IJoinCriteriaContext { 9555 var t = s.GetTypedRuleContext(reflect.TypeOf((*IJoinCriteriaContext)(nil)).Elem(), 0) 9556 9557 if t == nil { 9558 return nil 9559 } 9560 9561 return t.(IJoinCriteriaContext) 9562 } 9563 9564 func (s *JoinRelationContext) NATURAL() antlr.TerminalNode { 9565 return s.GetToken(SqlBaseParserNATURAL, 0) 9566 } 9567 9568 func (s *JoinRelationContext) SampledRelation() ISampledRelationContext { 9569 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISampledRelationContext)(nil)).Elem(), 0) 9570 9571 if t == nil { 9572 return nil 9573 } 9574 9575 return t.(ISampledRelationContext) 9576 } 9577 9578 func (s *JoinRelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 9579 switch t := visitor.(type) { 9580 case SqlBaseVisitor: 9581 return t.VisitJoinRelation(s) 9582 9583 default: 9584 return t.VisitChildren(s) 9585 } 9586 } 9587 9588 func (p *SqlBaseParser) Relation() (localctx IRelationContext) { 9589 return p.relation(0) 9590 } 9591 9592 func (p *SqlBaseParser) relation(_p int) (localctx IRelationContext) { 9593 var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() 9594 _parentState := p.GetState() 9595 localctx = NewRelationContext(p, p.GetParserRuleContext(), _parentState) 9596 var _prevctx IRelationContext = localctx 9597 var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. 9598 _startState := 44 9599 p.EnterRecursionRule(localctx, 44, SqlBaseParserRULE_relation, _p) 9600 9601 defer func() { 9602 p.UnrollRecursionContexts(_parentctx) 9603 }() 9604 9605 defer func() { 9606 if err := recover(); err != nil { 9607 if v, ok := err.(antlr.RecognitionException); ok { 9608 localctx.SetException(v) 9609 p.GetErrorHandler().ReportError(p, v) 9610 p.GetErrorHandler().Recover(p, v) 9611 } else { 9612 panic(err) 9613 } 9614 } 9615 }() 9616 9617 var _alt int 9618 9619 p.EnterOuterAlt(localctx, 1) 9620 localctx = NewRelationDefaultContext(p, localctx) 9621 p.SetParserRuleContext(localctx) 9622 _prevctx = localctx 9623 9624 { 9625 p.SetState(763) 9626 p.SampledRelation() 9627 } 9628 9629 p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) 9630 p.SetState(783) 9631 p.GetErrorHandler().Sync(p) 9632 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 94, p.GetParserRuleContext()) 9633 9634 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 9635 if _alt == 1 { 9636 if p.GetParseListeners() != nil { 9637 p.TriggerExitRuleEvent() 9638 } 9639 _prevctx = localctx 9640 localctx = NewJoinRelationContext(p, NewRelationContext(p, _parentctx, _parentState)) 9641 localctx.(*JoinRelationContext).left = _prevctx 9642 9643 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_relation) 9644 p.SetState(765) 9645 9646 if !(p.Precpred(p.GetParserRuleContext(), 2)) { 9647 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) 9648 } 9649 p.SetState(779) 9650 p.GetErrorHandler().Sync(p) 9651 9652 switch p.GetTokenStream().LA(1) { 9653 case SqlBaseParserCROSS: 9654 { 9655 p.SetState(766) 9656 p.Match(SqlBaseParserCROSS) 9657 } 9658 { 9659 p.SetState(767) 9660 p.Match(SqlBaseParserJOIN) 9661 } 9662 { 9663 p.SetState(768) 9664 9665 var _x = p.SampledRelation() 9666 9667 localctx.(*JoinRelationContext).right = _x 9668 } 9669 9670 case SqlBaseParserFULL, SqlBaseParserINNER, SqlBaseParserJOIN, SqlBaseParserLEFT, SqlBaseParserRIGHT: 9671 { 9672 p.SetState(769) 9673 p.JoinType() 9674 } 9675 { 9676 p.SetState(770) 9677 p.Match(SqlBaseParserJOIN) 9678 } 9679 { 9680 p.SetState(771) 9681 9682 var _x = p.relation(0) 9683 9684 localctx.(*JoinRelationContext).rightRelation = _x 9685 } 9686 { 9687 p.SetState(772) 9688 p.JoinCriteria() 9689 } 9690 9691 case SqlBaseParserNATURAL: 9692 { 9693 p.SetState(774) 9694 p.Match(SqlBaseParserNATURAL) 9695 } 9696 { 9697 p.SetState(775) 9698 p.JoinType() 9699 } 9700 { 9701 p.SetState(776) 9702 p.Match(SqlBaseParserJOIN) 9703 } 9704 { 9705 p.SetState(777) 9706 9707 var _x = p.SampledRelation() 9708 9709 localctx.(*JoinRelationContext).right = _x 9710 } 9711 9712 default: 9713 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 9714 } 9715 9716 } 9717 p.SetState(785) 9718 p.GetErrorHandler().Sync(p) 9719 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 94, p.GetParserRuleContext()) 9720 } 9721 9722 return localctx 9723 } 9724 9725 // IJoinTypeContext is an interface to support dynamic dispatch. 9726 type IJoinTypeContext interface { 9727 antlr.ParserRuleContext 9728 9729 // GetParser returns the parser. 9730 GetParser() antlr.Parser 9731 9732 // IsJoinTypeContext differentiates from other interfaces. 9733 IsJoinTypeContext() 9734 } 9735 9736 type JoinTypeContext struct { 9737 *antlr.BaseParserRuleContext 9738 parser antlr.Parser 9739 } 9740 9741 func NewEmptyJoinTypeContext() *JoinTypeContext { 9742 var p = new(JoinTypeContext) 9743 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 9744 p.RuleIndex = SqlBaseParserRULE_joinType 9745 return p 9746 } 9747 9748 func (*JoinTypeContext) IsJoinTypeContext() {} 9749 9750 func NewJoinTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *JoinTypeContext { 9751 var p = new(JoinTypeContext) 9752 9753 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 9754 9755 p.parser = parser 9756 p.RuleIndex = SqlBaseParserRULE_joinType 9757 9758 return p 9759 } 9760 9761 func (s *JoinTypeContext) GetParser() antlr.Parser { return s.parser } 9762 9763 func (s *JoinTypeContext) INNER() antlr.TerminalNode { 9764 return s.GetToken(SqlBaseParserINNER, 0) 9765 } 9766 9767 func (s *JoinTypeContext) LEFT() antlr.TerminalNode { 9768 return s.GetToken(SqlBaseParserLEFT, 0) 9769 } 9770 9771 func (s *JoinTypeContext) OUTER() antlr.TerminalNode { 9772 return s.GetToken(SqlBaseParserOUTER, 0) 9773 } 9774 9775 func (s *JoinTypeContext) RIGHT() antlr.TerminalNode { 9776 return s.GetToken(SqlBaseParserRIGHT, 0) 9777 } 9778 9779 func (s *JoinTypeContext) FULL() antlr.TerminalNode { 9780 return s.GetToken(SqlBaseParserFULL, 0) 9781 } 9782 9783 func (s *JoinTypeContext) GetRuleContext() antlr.RuleContext { 9784 return s 9785 } 9786 9787 func (s *JoinTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 9788 return antlr.TreesStringTree(s, ruleNames, recog) 9789 } 9790 9791 func (s *JoinTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 9792 switch t := visitor.(type) { 9793 case SqlBaseVisitor: 9794 return t.VisitJoinType(s) 9795 9796 default: 9797 return t.VisitChildren(s) 9798 } 9799 } 9800 9801 func (p *SqlBaseParser) JoinType() (localctx IJoinTypeContext) { 9802 localctx = NewJoinTypeContext(p, p.GetParserRuleContext(), p.GetState()) 9803 p.EnterRule(localctx, 46, SqlBaseParserRULE_joinType) 9804 var _la int 9805 9806 defer func() { 9807 p.ExitRule() 9808 }() 9809 9810 defer func() { 9811 if err := recover(); err != nil { 9812 if v, ok := err.(antlr.RecognitionException); ok { 9813 localctx.SetException(v) 9814 p.GetErrorHandler().ReportError(p, v) 9815 p.GetErrorHandler().Recover(p, v) 9816 } else { 9817 panic(err) 9818 } 9819 } 9820 }() 9821 9822 p.SetState(801) 9823 p.GetErrorHandler().Sync(p) 9824 9825 switch p.GetTokenStream().LA(1) { 9826 case SqlBaseParserINNER, SqlBaseParserJOIN: 9827 p.EnterOuterAlt(localctx, 1) 9828 p.SetState(787) 9829 p.GetErrorHandler().Sync(p) 9830 _la = p.GetTokenStream().LA(1) 9831 9832 if _la == SqlBaseParserINNER { 9833 { 9834 p.SetState(786) 9835 p.Match(SqlBaseParserINNER) 9836 } 9837 9838 } 9839 9840 case SqlBaseParserLEFT: 9841 p.EnterOuterAlt(localctx, 2) 9842 { 9843 p.SetState(789) 9844 p.Match(SqlBaseParserLEFT) 9845 } 9846 p.SetState(791) 9847 p.GetErrorHandler().Sync(p) 9848 _la = p.GetTokenStream().LA(1) 9849 9850 if _la == SqlBaseParserOUTER { 9851 { 9852 p.SetState(790) 9853 p.Match(SqlBaseParserOUTER) 9854 } 9855 9856 } 9857 9858 case SqlBaseParserRIGHT: 9859 p.EnterOuterAlt(localctx, 3) 9860 { 9861 p.SetState(793) 9862 p.Match(SqlBaseParserRIGHT) 9863 } 9864 p.SetState(795) 9865 p.GetErrorHandler().Sync(p) 9866 _la = p.GetTokenStream().LA(1) 9867 9868 if _la == SqlBaseParserOUTER { 9869 { 9870 p.SetState(794) 9871 p.Match(SqlBaseParserOUTER) 9872 } 9873 9874 } 9875 9876 case SqlBaseParserFULL: 9877 p.EnterOuterAlt(localctx, 4) 9878 { 9879 p.SetState(797) 9880 p.Match(SqlBaseParserFULL) 9881 } 9882 p.SetState(799) 9883 p.GetErrorHandler().Sync(p) 9884 _la = p.GetTokenStream().LA(1) 9885 9886 if _la == SqlBaseParserOUTER { 9887 { 9888 p.SetState(798) 9889 p.Match(SqlBaseParserOUTER) 9890 } 9891 9892 } 9893 9894 default: 9895 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 9896 } 9897 9898 return localctx 9899 } 9900 9901 // IJoinCriteriaContext is an interface to support dynamic dispatch. 9902 type IJoinCriteriaContext interface { 9903 antlr.ParserRuleContext 9904 9905 // GetParser returns the parser. 9906 GetParser() antlr.Parser 9907 9908 // IsJoinCriteriaContext differentiates from other interfaces. 9909 IsJoinCriteriaContext() 9910 } 9911 9912 type JoinCriteriaContext struct { 9913 *antlr.BaseParserRuleContext 9914 parser antlr.Parser 9915 } 9916 9917 func NewEmptyJoinCriteriaContext() *JoinCriteriaContext { 9918 var p = new(JoinCriteriaContext) 9919 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 9920 p.RuleIndex = SqlBaseParserRULE_joinCriteria 9921 return p 9922 } 9923 9924 func (*JoinCriteriaContext) IsJoinCriteriaContext() {} 9925 9926 func NewJoinCriteriaContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *JoinCriteriaContext { 9927 var p = new(JoinCriteriaContext) 9928 9929 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 9930 9931 p.parser = parser 9932 p.RuleIndex = SqlBaseParserRULE_joinCriteria 9933 9934 return p 9935 } 9936 9937 func (s *JoinCriteriaContext) GetParser() antlr.Parser { return s.parser } 9938 9939 func (s *JoinCriteriaContext) ON() antlr.TerminalNode { 9940 return s.GetToken(SqlBaseParserON, 0) 9941 } 9942 9943 func (s *JoinCriteriaContext) BooleanExpression() IBooleanExpressionContext { 9944 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) 9945 9946 if t == nil { 9947 return nil 9948 } 9949 9950 return t.(IBooleanExpressionContext) 9951 } 9952 9953 func (s *JoinCriteriaContext) USING() antlr.TerminalNode { 9954 return s.GetToken(SqlBaseParserUSING, 0) 9955 } 9956 9957 func (s *JoinCriteriaContext) AllIdentifier() []IIdentifierContext { 9958 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIdentifierContext)(nil)).Elem()) 9959 var tst = make([]IIdentifierContext, len(ts)) 9960 9961 for i, t := range ts { 9962 if t != nil { 9963 tst[i] = t.(IIdentifierContext) 9964 } 9965 } 9966 9967 return tst 9968 } 9969 9970 func (s *JoinCriteriaContext) Identifier(i int) IIdentifierContext { 9971 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), i) 9972 9973 if t == nil { 9974 return nil 9975 } 9976 9977 return t.(IIdentifierContext) 9978 } 9979 9980 func (s *JoinCriteriaContext) GetRuleContext() antlr.RuleContext { 9981 return s 9982 } 9983 9984 func (s *JoinCriteriaContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 9985 return antlr.TreesStringTree(s, ruleNames, recog) 9986 } 9987 9988 func (s *JoinCriteriaContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 9989 switch t := visitor.(type) { 9990 case SqlBaseVisitor: 9991 return t.VisitJoinCriteria(s) 9992 9993 default: 9994 return t.VisitChildren(s) 9995 } 9996 } 9997 9998 func (p *SqlBaseParser) JoinCriteria() (localctx IJoinCriteriaContext) { 9999 localctx = NewJoinCriteriaContext(p, p.GetParserRuleContext(), p.GetState()) 10000 p.EnterRule(localctx, 48, SqlBaseParserRULE_joinCriteria) 10001 var _la int 10002 10003 defer func() { 10004 p.ExitRule() 10005 }() 10006 10007 defer func() { 10008 if err := recover(); err != nil { 10009 if v, ok := err.(antlr.RecognitionException); ok { 10010 localctx.SetException(v) 10011 p.GetErrorHandler().ReportError(p, v) 10012 p.GetErrorHandler().Recover(p, v) 10013 } else { 10014 panic(err) 10015 } 10016 } 10017 }() 10018 10019 p.SetState(817) 10020 p.GetErrorHandler().Sync(p) 10021 10022 switch p.GetTokenStream().LA(1) { 10023 case SqlBaseParserON: 10024 p.EnterOuterAlt(localctx, 1) 10025 { 10026 p.SetState(803) 10027 p.Match(SqlBaseParserON) 10028 } 10029 { 10030 p.SetState(804) 10031 p.booleanExpression(0) 10032 } 10033 10034 case SqlBaseParserUSING: 10035 p.EnterOuterAlt(localctx, 2) 10036 { 10037 p.SetState(805) 10038 p.Match(SqlBaseParserUSING) 10039 } 10040 { 10041 p.SetState(806) 10042 p.Match(SqlBaseParserT__1) 10043 } 10044 { 10045 p.SetState(807) 10046 p.Identifier() 10047 } 10048 p.SetState(812) 10049 p.GetErrorHandler().Sync(p) 10050 _la = p.GetTokenStream().LA(1) 10051 10052 for _la == SqlBaseParserT__3 { 10053 { 10054 p.SetState(808) 10055 p.Match(SqlBaseParserT__3) 10056 } 10057 { 10058 p.SetState(809) 10059 p.Identifier() 10060 } 10061 10062 p.SetState(814) 10063 p.GetErrorHandler().Sync(p) 10064 _la = p.GetTokenStream().LA(1) 10065 } 10066 { 10067 p.SetState(815) 10068 p.Match(SqlBaseParserT__2) 10069 } 10070 10071 default: 10072 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 10073 } 10074 10075 return localctx 10076 } 10077 10078 // ISampledRelationContext is an interface to support dynamic dispatch. 10079 type ISampledRelationContext interface { 10080 antlr.ParserRuleContext 10081 10082 // GetParser returns the parser. 10083 GetParser() antlr.Parser 10084 10085 // GetPercentage returns the percentage rule contexts. 10086 GetPercentage() IExpressionContext 10087 10088 // SetPercentage sets the percentage rule contexts. 10089 SetPercentage(IExpressionContext) 10090 10091 // IsSampledRelationContext differentiates from other interfaces. 10092 IsSampledRelationContext() 10093 } 10094 10095 type SampledRelationContext struct { 10096 *antlr.BaseParserRuleContext 10097 parser antlr.Parser 10098 percentage IExpressionContext 10099 } 10100 10101 func NewEmptySampledRelationContext() *SampledRelationContext { 10102 var p = new(SampledRelationContext) 10103 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 10104 p.RuleIndex = SqlBaseParserRULE_sampledRelation 10105 return p 10106 } 10107 10108 func (*SampledRelationContext) IsSampledRelationContext() {} 10109 10110 func NewSampledRelationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SampledRelationContext { 10111 var p = new(SampledRelationContext) 10112 10113 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 10114 10115 p.parser = parser 10116 p.RuleIndex = SqlBaseParserRULE_sampledRelation 10117 10118 return p 10119 } 10120 10121 func (s *SampledRelationContext) GetParser() antlr.Parser { return s.parser } 10122 10123 func (s *SampledRelationContext) GetPercentage() IExpressionContext { return s.percentage } 10124 10125 func (s *SampledRelationContext) SetPercentage(v IExpressionContext) { s.percentage = v } 10126 10127 func (s *SampledRelationContext) AliasedRelation() IAliasedRelationContext { 10128 var t = s.GetTypedRuleContext(reflect.TypeOf((*IAliasedRelationContext)(nil)).Elem(), 0) 10129 10130 if t == nil { 10131 return nil 10132 } 10133 10134 return t.(IAliasedRelationContext) 10135 } 10136 10137 func (s *SampledRelationContext) TABLESAMPLE() antlr.TerminalNode { 10138 return s.GetToken(SqlBaseParserTABLESAMPLE, 0) 10139 } 10140 10141 func (s *SampledRelationContext) SampleType() ISampleTypeContext { 10142 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISampleTypeContext)(nil)).Elem(), 0) 10143 10144 if t == nil { 10145 return nil 10146 } 10147 10148 return t.(ISampleTypeContext) 10149 } 10150 10151 func (s *SampledRelationContext) Expression() IExpressionContext { 10152 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 10153 10154 if t == nil { 10155 return nil 10156 } 10157 10158 return t.(IExpressionContext) 10159 } 10160 10161 func (s *SampledRelationContext) GetRuleContext() antlr.RuleContext { 10162 return s 10163 } 10164 10165 func (s *SampledRelationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 10166 return antlr.TreesStringTree(s, ruleNames, recog) 10167 } 10168 10169 func (s *SampledRelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10170 switch t := visitor.(type) { 10171 case SqlBaseVisitor: 10172 return t.VisitSampledRelation(s) 10173 10174 default: 10175 return t.VisitChildren(s) 10176 } 10177 } 10178 10179 func (p *SqlBaseParser) SampledRelation() (localctx ISampledRelationContext) { 10180 localctx = NewSampledRelationContext(p, p.GetParserRuleContext(), p.GetState()) 10181 p.EnterRule(localctx, 50, SqlBaseParserRULE_sampledRelation) 10182 10183 defer func() { 10184 p.ExitRule() 10185 }() 10186 10187 defer func() { 10188 if err := recover(); err != nil { 10189 if v, ok := err.(antlr.RecognitionException); ok { 10190 localctx.SetException(v) 10191 p.GetErrorHandler().ReportError(p, v) 10192 p.GetErrorHandler().Recover(p, v) 10193 } else { 10194 panic(err) 10195 } 10196 } 10197 }() 10198 10199 p.EnterOuterAlt(localctx, 1) 10200 { 10201 p.SetState(819) 10202 p.AliasedRelation() 10203 } 10204 p.SetState(826) 10205 p.GetErrorHandler().Sync(p) 10206 10207 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 102, p.GetParserRuleContext()) == 1 { 10208 { 10209 p.SetState(820) 10210 p.Match(SqlBaseParserTABLESAMPLE) 10211 } 10212 { 10213 p.SetState(821) 10214 p.SampleType() 10215 } 10216 { 10217 p.SetState(822) 10218 p.Match(SqlBaseParserT__1) 10219 } 10220 { 10221 p.SetState(823) 10222 10223 var _x = p.Expression() 10224 10225 localctx.(*SampledRelationContext).percentage = _x 10226 } 10227 { 10228 p.SetState(824) 10229 p.Match(SqlBaseParserT__2) 10230 } 10231 10232 } 10233 10234 return localctx 10235 } 10236 10237 // ISampleTypeContext is an interface to support dynamic dispatch. 10238 type ISampleTypeContext interface { 10239 antlr.ParserRuleContext 10240 10241 // GetParser returns the parser. 10242 GetParser() antlr.Parser 10243 10244 // IsSampleTypeContext differentiates from other interfaces. 10245 IsSampleTypeContext() 10246 } 10247 10248 type SampleTypeContext struct { 10249 *antlr.BaseParserRuleContext 10250 parser antlr.Parser 10251 } 10252 10253 func NewEmptySampleTypeContext() *SampleTypeContext { 10254 var p = new(SampleTypeContext) 10255 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 10256 p.RuleIndex = SqlBaseParserRULE_sampleType 10257 return p 10258 } 10259 10260 func (*SampleTypeContext) IsSampleTypeContext() {} 10261 10262 func NewSampleTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SampleTypeContext { 10263 var p = new(SampleTypeContext) 10264 10265 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 10266 10267 p.parser = parser 10268 p.RuleIndex = SqlBaseParserRULE_sampleType 10269 10270 return p 10271 } 10272 10273 func (s *SampleTypeContext) GetParser() antlr.Parser { return s.parser } 10274 10275 func (s *SampleTypeContext) BERNOULLI() antlr.TerminalNode { 10276 return s.GetToken(SqlBaseParserBERNOULLI, 0) 10277 } 10278 10279 func (s *SampleTypeContext) SYSTEM() antlr.TerminalNode { 10280 return s.GetToken(SqlBaseParserSYSTEM, 0) 10281 } 10282 10283 func (s *SampleTypeContext) GetRuleContext() antlr.RuleContext { 10284 return s 10285 } 10286 10287 func (s *SampleTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 10288 return antlr.TreesStringTree(s, ruleNames, recog) 10289 } 10290 10291 func (s *SampleTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10292 switch t := visitor.(type) { 10293 case SqlBaseVisitor: 10294 return t.VisitSampleType(s) 10295 10296 default: 10297 return t.VisitChildren(s) 10298 } 10299 } 10300 10301 func (p *SqlBaseParser) SampleType() (localctx ISampleTypeContext) { 10302 localctx = NewSampleTypeContext(p, p.GetParserRuleContext(), p.GetState()) 10303 p.EnterRule(localctx, 52, SqlBaseParserRULE_sampleType) 10304 var _la int 10305 10306 defer func() { 10307 p.ExitRule() 10308 }() 10309 10310 defer func() { 10311 if err := recover(); err != nil { 10312 if v, ok := err.(antlr.RecognitionException); ok { 10313 localctx.SetException(v) 10314 p.GetErrorHandler().ReportError(p, v) 10315 p.GetErrorHandler().Recover(p, v) 10316 } else { 10317 panic(err) 10318 } 10319 } 10320 }() 10321 10322 p.EnterOuterAlt(localctx, 1) 10323 { 10324 p.SetState(828) 10325 _la = p.GetTokenStream().LA(1) 10326 10327 if !(_la == SqlBaseParserBERNOULLI || _la == SqlBaseParserSYSTEM) { 10328 p.GetErrorHandler().RecoverInline(p) 10329 } else { 10330 p.GetErrorHandler().ReportMatch(p) 10331 p.Consume() 10332 } 10333 } 10334 10335 return localctx 10336 } 10337 10338 // IAliasedRelationContext is an interface to support dynamic dispatch. 10339 type IAliasedRelationContext interface { 10340 antlr.ParserRuleContext 10341 10342 // GetParser returns the parser. 10343 GetParser() antlr.Parser 10344 10345 // IsAliasedRelationContext differentiates from other interfaces. 10346 IsAliasedRelationContext() 10347 } 10348 10349 type AliasedRelationContext struct { 10350 *antlr.BaseParserRuleContext 10351 parser antlr.Parser 10352 } 10353 10354 func NewEmptyAliasedRelationContext() *AliasedRelationContext { 10355 var p = new(AliasedRelationContext) 10356 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 10357 p.RuleIndex = SqlBaseParserRULE_aliasedRelation 10358 return p 10359 } 10360 10361 func (*AliasedRelationContext) IsAliasedRelationContext() {} 10362 10363 func NewAliasedRelationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AliasedRelationContext { 10364 var p = new(AliasedRelationContext) 10365 10366 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 10367 10368 p.parser = parser 10369 p.RuleIndex = SqlBaseParserRULE_aliasedRelation 10370 10371 return p 10372 } 10373 10374 func (s *AliasedRelationContext) GetParser() antlr.Parser { return s.parser } 10375 10376 func (s *AliasedRelationContext) RelationPrimary() IRelationPrimaryContext { 10377 var t = s.GetTypedRuleContext(reflect.TypeOf((*IRelationPrimaryContext)(nil)).Elem(), 0) 10378 10379 if t == nil { 10380 return nil 10381 } 10382 10383 return t.(IRelationPrimaryContext) 10384 } 10385 10386 func (s *AliasedRelationContext) Identifier() IIdentifierContext { 10387 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 10388 10389 if t == nil { 10390 return nil 10391 } 10392 10393 return t.(IIdentifierContext) 10394 } 10395 10396 func (s *AliasedRelationContext) AS() antlr.TerminalNode { 10397 return s.GetToken(SqlBaseParserAS, 0) 10398 } 10399 10400 func (s *AliasedRelationContext) ColumnAliases() IColumnAliasesContext { 10401 var t = s.GetTypedRuleContext(reflect.TypeOf((*IColumnAliasesContext)(nil)).Elem(), 0) 10402 10403 if t == nil { 10404 return nil 10405 } 10406 10407 return t.(IColumnAliasesContext) 10408 } 10409 10410 func (s *AliasedRelationContext) GetRuleContext() antlr.RuleContext { 10411 return s 10412 } 10413 10414 func (s *AliasedRelationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 10415 return antlr.TreesStringTree(s, ruleNames, recog) 10416 } 10417 10418 func (s *AliasedRelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10419 switch t := visitor.(type) { 10420 case SqlBaseVisitor: 10421 return t.VisitAliasedRelation(s) 10422 10423 default: 10424 return t.VisitChildren(s) 10425 } 10426 } 10427 10428 func (p *SqlBaseParser) AliasedRelation() (localctx IAliasedRelationContext) { 10429 localctx = NewAliasedRelationContext(p, p.GetParserRuleContext(), p.GetState()) 10430 p.EnterRule(localctx, 54, SqlBaseParserRULE_aliasedRelation) 10431 var _la int 10432 10433 defer func() { 10434 p.ExitRule() 10435 }() 10436 10437 defer func() { 10438 if err := recover(); err != nil { 10439 if v, ok := err.(antlr.RecognitionException); ok { 10440 localctx.SetException(v) 10441 p.GetErrorHandler().ReportError(p, v) 10442 p.GetErrorHandler().Recover(p, v) 10443 } else { 10444 panic(err) 10445 } 10446 } 10447 }() 10448 10449 p.EnterOuterAlt(localctx, 1) 10450 { 10451 p.SetState(830) 10452 p.RelationPrimary() 10453 } 10454 p.SetState(838) 10455 p.GetErrorHandler().Sync(p) 10456 10457 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 105, p.GetParserRuleContext()) == 1 { 10458 p.SetState(832) 10459 p.GetErrorHandler().Sync(p) 10460 _la = p.GetTokenStream().LA(1) 10461 10462 if _la == SqlBaseParserAS { 10463 { 10464 p.SetState(831) 10465 p.Match(SqlBaseParserAS) 10466 } 10467 10468 } 10469 { 10470 p.SetState(834) 10471 p.Identifier() 10472 } 10473 p.SetState(836) 10474 p.GetErrorHandler().Sync(p) 10475 10476 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 104, p.GetParserRuleContext()) == 1 { 10477 { 10478 p.SetState(835) 10479 p.ColumnAliases() 10480 } 10481 10482 } 10483 10484 } 10485 10486 return localctx 10487 } 10488 10489 // IColumnAliasesContext is an interface to support dynamic dispatch. 10490 type IColumnAliasesContext interface { 10491 antlr.ParserRuleContext 10492 10493 // GetParser returns the parser. 10494 GetParser() antlr.Parser 10495 10496 // IsColumnAliasesContext differentiates from other interfaces. 10497 IsColumnAliasesContext() 10498 } 10499 10500 type ColumnAliasesContext struct { 10501 *antlr.BaseParserRuleContext 10502 parser antlr.Parser 10503 } 10504 10505 func NewEmptyColumnAliasesContext() *ColumnAliasesContext { 10506 var p = new(ColumnAliasesContext) 10507 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 10508 p.RuleIndex = SqlBaseParserRULE_columnAliases 10509 return p 10510 } 10511 10512 func (*ColumnAliasesContext) IsColumnAliasesContext() {} 10513 10514 func NewColumnAliasesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ColumnAliasesContext { 10515 var p = new(ColumnAliasesContext) 10516 10517 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 10518 10519 p.parser = parser 10520 p.RuleIndex = SqlBaseParserRULE_columnAliases 10521 10522 return p 10523 } 10524 10525 func (s *ColumnAliasesContext) GetParser() antlr.Parser { return s.parser } 10526 10527 func (s *ColumnAliasesContext) AllIdentifier() []IIdentifierContext { 10528 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIdentifierContext)(nil)).Elem()) 10529 var tst = make([]IIdentifierContext, len(ts)) 10530 10531 for i, t := range ts { 10532 if t != nil { 10533 tst[i] = t.(IIdentifierContext) 10534 } 10535 } 10536 10537 return tst 10538 } 10539 10540 func (s *ColumnAliasesContext) Identifier(i int) IIdentifierContext { 10541 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), i) 10542 10543 if t == nil { 10544 return nil 10545 } 10546 10547 return t.(IIdentifierContext) 10548 } 10549 10550 func (s *ColumnAliasesContext) GetRuleContext() antlr.RuleContext { 10551 return s 10552 } 10553 10554 func (s *ColumnAliasesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 10555 return antlr.TreesStringTree(s, ruleNames, recog) 10556 } 10557 10558 func (s *ColumnAliasesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10559 switch t := visitor.(type) { 10560 case SqlBaseVisitor: 10561 return t.VisitColumnAliases(s) 10562 10563 default: 10564 return t.VisitChildren(s) 10565 } 10566 } 10567 10568 func (p *SqlBaseParser) ColumnAliases() (localctx IColumnAliasesContext) { 10569 localctx = NewColumnAliasesContext(p, p.GetParserRuleContext(), p.GetState()) 10570 p.EnterRule(localctx, 56, SqlBaseParserRULE_columnAliases) 10571 var _la int 10572 10573 defer func() { 10574 p.ExitRule() 10575 }() 10576 10577 defer func() { 10578 if err := recover(); err != nil { 10579 if v, ok := err.(antlr.RecognitionException); ok { 10580 localctx.SetException(v) 10581 p.GetErrorHandler().ReportError(p, v) 10582 p.GetErrorHandler().Recover(p, v) 10583 } else { 10584 panic(err) 10585 } 10586 } 10587 }() 10588 10589 p.EnterOuterAlt(localctx, 1) 10590 { 10591 p.SetState(840) 10592 p.Match(SqlBaseParserT__1) 10593 } 10594 { 10595 p.SetState(841) 10596 p.Identifier() 10597 } 10598 p.SetState(846) 10599 p.GetErrorHandler().Sync(p) 10600 _la = p.GetTokenStream().LA(1) 10601 10602 for _la == SqlBaseParserT__3 { 10603 { 10604 p.SetState(842) 10605 p.Match(SqlBaseParserT__3) 10606 } 10607 { 10608 p.SetState(843) 10609 p.Identifier() 10610 } 10611 10612 p.SetState(848) 10613 p.GetErrorHandler().Sync(p) 10614 _la = p.GetTokenStream().LA(1) 10615 } 10616 { 10617 p.SetState(849) 10618 p.Match(SqlBaseParserT__2) 10619 } 10620 10621 return localctx 10622 } 10623 10624 // IRelationPrimaryContext is an interface to support dynamic dispatch. 10625 type IRelationPrimaryContext interface { 10626 antlr.ParserRuleContext 10627 10628 // GetParser returns the parser. 10629 GetParser() antlr.Parser 10630 10631 // IsRelationPrimaryContext differentiates from other interfaces. 10632 IsRelationPrimaryContext() 10633 } 10634 10635 type RelationPrimaryContext struct { 10636 *antlr.BaseParserRuleContext 10637 parser antlr.Parser 10638 } 10639 10640 func NewEmptyRelationPrimaryContext() *RelationPrimaryContext { 10641 var p = new(RelationPrimaryContext) 10642 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 10643 p.RuleIndex = SqlBaseParserRULE_relationPrimary 10644 return p 10645 } 10646 10647 func (*RelationPrimaryContext) IsRelationPrimaryContext() {} 10648 10649 func NewRelationPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RelationPrimaryContext { 10650 var p = new(RelationPrimaryContext) 10651 10652 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 10653 10654 p.parser = parser 10655 p.RuleIndex = SqlBaseParserRULE_relationPrimary 10656 10657 return p 10658 } 10659 10660 func (s *RelationPrimaryContext) GetParser() antlr.Parser { return s.parser } 10661 10662 func (s *RelationPrimaryContext) CopyFrom(ctx *RelationPrimaryContext) { 10663 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 10664 } 10665 10666 func (s *RelationPrimaryContext) GetRuleContext() antlr.RuleContext { 10667 return s 10668 } 10669 10670 func (s *RelationPrimaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 10671 return antlr.TreesStringTree(s, ruleNames, recog) 10672 } 10673 10674 type SubqueryRelationContext struct { 10675 *RelationPrimaryContext 10676 } 10677 10678 func NewSubqueryRelationContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SubqueryRelationContext { 10679 var p = new(SubqueryRelationContext) 10680 10681 p.RelationPrimaryContext = NewEmptyRelationPrimaryContext() 10682 p.parser = parser 10683 p.CopyFrom(ctx.(*RelationPrimaryContext)) 10684 10685 return p 10686 } 10687 10688 func (s *SubqueryRelationContext) GetRuleContext() antlr.RuleContext { 10689 return s 10690 } 10691 10692 func (s *SubqueryRelationContext) Query() IQueryContext { 10693 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 10694 10695 if t == nil { 10696 return nil 10697 } 10698 10699 return t.(IQueryContext) 10700 } 10701 10702 func (s *SubqueryRelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10703 switch t := visitor.(type) { 10704 case SqlBaseVisitor: 10705 return t.VisitSubqueryRelation(s) 10706 10707 default: 10708 return t.VisitChildren(s) 10709 } 10710 } 10711 10712 type ParenthesizedRelationContext struct { 10713 *RelationPrimaryContext 10714 } 10715 10716 func NewParenthesizedRelationContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ParenthesizedRelationContext { 10717 var p = new(ParenthesizedRelationContext) 10718 10719 p.RelationPrimaryContext = NewEmptyRelationPrimaryContext() 10720 p.parser = parser 10721 p.CopyFrom(ctx.(*RelationPrimaryContext)) 10722 10723 return p 10724 } 10725 10726 func (s *ParenthesizedRelationContext) GetRuleContext() antlr.RuleContext { 10727 return s 10728 } 10729 10730 func (s *ParenthesizedRelationContext) Relation() IRelationContext { 10731 var t = s.GetTypedRuleContext(reflect.TypeOf((*IRelationContext)(nil)).Elem(), 0) 10732 10733 if t == nil { 10734 return nil 10735 } 10736 10737 return t.(IRelationContext) 10738 } 10739 10740 func (s *ParenthesizedRelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10741 switch t := visitor.(type) { 10742 case SqlBaseVisitor: 10743 return t.VisitParenthesizedRelation(s) 10744 10745 default: 10746 return t.VisitChildren(s) 10747 } 10748 } 10749 10750 type UnnestContext struct { 10751 *RelationPrimaryContext 10752 } 10753 10754 func NewUnnestContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UnnestContext { 10755 var p = new(UnnestContext) 10756 10757 p.RelationPrimaryContext = NewEmptyRelationPrimaryContext() 10758 p.parser = parser 10759 p.CopyFrom(ctx.(*RelationPrimaryContext)) 10760 10761 return p 10762 } 10763 10764 func (s *UnnestContext) GetRuleContext() antlr.RuleContext { 10765 return s 10766 } 10767 10768 func (s *UnnestContext) UNNEST() antlr.TerminalNode { 10769 return s.GetToken(SqlBaseParserUNNEST, 0) 10770 } 10771 10772 func (s *UnnestContext) AllExpression() []IExpressionContext { 10773 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 10774 var tst = make([]IExpressionContext, len(ts)) 10775 10776 for i, t := range ts { 10777 if t != nil { 10778 tst[i] = t.(IExpressionContext) 10779 } 10780 } 10781 10782 return tst 10783 } 10784 10785 func (s *UnnestContext) Expression(i int) IExpressionContext { 10786 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 10787 10788 if t == nil { 10789 return nil 10790 } 10791 10792 return t.(IExpressionContext) 10793 } 10794 10795 func (s *UnnestContext) WITH() antlr.TerminalNode { 10796 return s.GetToken(SqlBaseParserWITH, 0) 10797 } 10798 10799 func (s *UnnestContext) ORDINALITY() antlr.TerminalNode { 10800 return s.GetToken(SqlBaseParserORDINALITY, 0) 10801 } 10802 10803 func (s *UnnestContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10804 switch t := visitor.(type) { 10805 case SqlBaseVisitor: 10806 return t.VisitUnnest(s) 10807 10808 default: 10809 return t.VisitChildren(s) 10810 } 10811 } 10812 10813 type LateralContext struct { 10814 *RelationPrimaryContext 10815 } 10816 10817 func NewLateralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LateralContext { 10818 var p = new(LateralContext) 10819 10820 p.RelationPrimaryContext = NewEmptyRelationPrimaryContext() 10821 p.parser = parser 10822 p.CopyFrom(ctx.(*RelationPrimaryContext)) 10823 10824 return p 10825 } 10826 10827 func (s *LateralContext) GetRuleContext() antlr.RuleContext { 10828 return s 10829 } 10830 10831 func (s *LateralContext) LATERAL() antlr.TerminalNode { 10832 return s.GetToken(SqlBaseParserLATERAL, 0) 10833 } 10834 10835 func (s *LateralContext) Query() IQueryContext { 10836 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 10837 10838 if t == nil { 10839 return nil 10840 } 10841 10842 return t.(IQueryContext) 10843 } 10844 10845 func (s *LateralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10846 switch t := visitor.(type) { 10847 case SqlBaseVisitor: 10848 return t.VisitLateral(s) 10849 10850 default: 10851 return t.VisitChildren(s) 10852 } 10853 } 10854 10855 type TableNameContext struct { 10856 *RelationPrimaryContext 10857 } 10858 10859 func NewTableNameContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TableNameContext { 10860 var p = new(TableNameContext) 10861 10862 p.RelationPrimaryContext = NewEmptyRelationPrimaryContext() 10863 p.parser = parser 10864 p.CopyFrom(ctx.(*RelationPrimaryContext)) 10865 10866 return p 10867 } 10868 10869 func (s *TableNameContext) GetRuleContext() antlr.RuleContext { 10870 return s 10871 } 10872 10873 func (s *TableNameContext) QualifiedName() IQualifiedNameContext { 10874 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 10875 10876 if t == nil { 10877 return nil 10878 } 10879 10880 return t.(IQualifiedNameContext) 10881 } 10882 10883 func (s *TableNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 10884 switch t := visitor.(type) { 10885 case SqlBaseVisitor: 10886 return t.VisitTableName(s) 10887 10888 default: 10889 return t.VisitChildren(s) 10890 } 10891 } 10892 10893 func (p *SqlBaseParser) RelationPrimary() (localctx IRelationPrimaryContext) { 10894 localctx = NewRelationPrimaryContext(p, p.GetParserRuleContext(), p.GetState()) 10895 p.EnterRule(localctx, 58, SqlBaseParserRULE_relationPrimary) 10896 var _la int 10897 10898 defer func() { 10899 p.ExitRule() 10900 }() 10901 10902 defer func() { 10903 if err := recover(); err != nil { 10904 if v, ok := err.(antlr.RecognitionException); ok { 10905 localctx.SetException(v) 10906 p.GetErrorHandler().ReportError(p, v) 10907 p.GetErrorHandler().Recover(p, v) 10908 } else { 10909 panic(err) 10910 } 10911 } 10912 }() 10913 10914 p.SetState(880) 10915 p.GetErrorHandler().Sync(p) 10916 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 109, p.GetParserRuleContext()) { 10917 case 1: 10918 localctx = NewTableNameContext(p, localctx) 10919 p.EnterOuterAlt(localctx, 1) 10920 { 10921 p.SetState(851) 10922 p.QualifiedName() 10923 } 10924 10925 case 2: 10926 localctx = NewSubqueryRelationContext(p, localctx) 10927 p.EnterOuterAlt(localctx, 2) 10928 { 10929 p.SetState(852) 10930 p.Match(SqlBaseParserT__1) 10931 } 10932 { 10933 p.SetState(853) 10934 p.Query() 10935 } 10936 { 10937 p.SetState(854) 10938 p.Match(SqlBaseParserT__2) 10939 } 10940 10941 case 3: 10942 localctx = NewUnnestContext(p, localctx) 10943 p.EnterOuterAlt(localctx, 3) 10944 { 10945 p.SetState(856) 10946 p.Match(SqlBaseParserUNNEST) 10947 } 10948 { 10949 p.SetState(857) 10950 p.Match(SqlBaseParserT__1) 10951 } 10952 { 10953 p.SetState(858) 10954 p.Expression() 10955 } 10956 p.SetState(863) 10957 p.GetErrorHandler().Sync(p) 10958 _la = p.GetTokenStream().LA(1) 10959 10960 for _la == SqlBaseParserT__3 { 10961 { 10962 p.SetState(859) 10963 p.Match(SqlBaseParserT__3) 10964 } 10965 { 10966 p.SetState(860) 10967 p.Expression() 10968 } 10969 10970 p.SetState(865) 10971 p.GetErrorHandler().Sync(p) 10972 _la = p.GetTokenStream().LA(1) 10973 } 10974 { 10975 p.SetState(866) 10976 p.Match(SqlBaseParserT__2) 10977 } 10978 p.SetState(869) 10979 p.GetErrorHandler().Sync(p) 10980 10981 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 108, p.GetParserRuleContext()) == 1 { 10982 { 10983 p.SetState(867) 10984 p.Match(SqlBaseParserWITH) 10985 } 10986 { 10987 p.SetState(868) 10988 p.Match(SqlBaseParserORDINALITY) 10989 } 10990 10991 } 10992 10993 case 4: 10994 localctx = NewLateralContext(p, localctx) 10995 p.EnterOuterAlt(localctx, 4) 10996 { 10997 p.SetState(871) 10998 p.Match(SqlBaseParserLATERAL) 10999 } 11000 { 11001 p.SetState(872) 11002 p.Match(SqlBaseParserT__1) 11003 } 11004 { 11005 p.SetState(873) 11006 p.Query() 11007 } 11008 { 11009 p.SetState(874) 11010 p.Match(SqlBaseParserT__2) 11011 } 11012 11013 case 5: 11014 localctx = NewParenthesizedRelationContext(p, localctx) 11015 p.EnterOuterAlt(localctx, 5) 11016 { 11017 p.SetState(876) 11018 p.Match(SqlBaseParserT__1) 11019 } 11020 { 11021 p.SetState(877) 11022 p.relation(0) 11023 } 11024 { 11025 p.SetState(878) 11026 p.Match(SqlBaseParserT__2) 11027 } 11028 11029 } 11030 11031 return localctx 11032 } 11033 11034 // IExpressionContext is an interface to support dynamic dispatch. 11035 type IExpressionContext interface { 11036 antlr.ParserRuleContext 11037 11038 // GetParser returns the parser. 11039 GetParser() antlr.Parser 11040 11041 // IsExpressionContext differentiates from other interfaces. 11042 IsExpressionContext() 11043 } 11044 11045 type ExpressionContext struct { 11046 *antlr.BaseParserRuleContext 11047 parser antlr.Parser 11048 } 11049 11050 func NewEmptyExpressionContext() *ExpressionContext { 11051 var p = new(ExpressionContext) 11052 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 11053 p.RuleIndex = SqlBaseParserRULE_expression 11054 return p 11055 } 11056 11057 func (*ExpressionContext) IsExpressionContext() {} 11058 11059 func NewExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExpressionContext { 11060 var p = new(ExpressionContext) 11061 11062 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 11063 11064 p.parser = parser 11065 p.RuleIndex = SqlBaseParserRULE_expression 11066 11067 return p 11068 } 11069 11070 func (s *ExpressionContext) GetParser() antlr.Parser { return s.parser } 11071 11072 func (s *ExpressionContext) BooleanExpression() IBooleanExpressionContext { 11073 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) 11074 11075 if t == nil { 11076 return nil 11077 } 11078 11079 return t.(IBooleanExpressionContext) 11080 } 11081 11082 func (s *ExpressionContext) GetRuleContext() antlr.RuleContext { 11083 return s 11084 } 11085 11086 func (s *ExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 11087 return antlr.TreesStringTree(s, ruleNames, recog) 11088 } 11089 11090 func (s *ExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11091 switch t := visitor.(type) { 11092 case SqlBaseVisitor: 11093 return t.VisitExpression(s) 11094 11095 default: 11096 return t.VisitChildren(s) 11097 } 11098 } 11099 11100 func (p *SqlBaseParser) Expression() (localctx IExpressionContext) { 11101 localctx = NewExpressionContext(p, p.GetParserRuleContext(), p.GetState()) 11102 p.EnterRule(localctx, 60, SqlBaseParserRULE_expression) 11103 11104 defer func() { 11105 p.ExitRule() 11106 }() 11107 11108 defer func() { 11109 if err := recover(); err != nil { 11110 if v, ok := err.(antlr.RecognitionException); ok { 11111 localctx.SetException(v) 11112 p.GetErrorHandler().ReportError(p, v) 11113 p.GetErrorHandler().Recover(p, v) 11114 } else { 11115 panic(err) 11116 } 11117 } 11118 }() 11119 11120 p.EnterOuterAlt(localctx, 1) 11121 { 11122 p.SetState(882) 11123 p.booleanExpression(0) 11124 } 11125 11126 return localctx 11127 } 11128 11129 // IBooleanExpressionContext is an interface to support dynamic dispatch. 11130 type IBooleanExpressionContext interface { 11131 antlr.ParserRuleContext 11132 11133 // GetParser returns the parser. 11134 GetParser() antlr.Parser 11135 11136 // IsBooleanExpressionContext differentiates from other interfaces. 11137 IsBooleanExpressionContext() 11138 } 11139 11140 type BooleanExpressionContext struct { 11141 *antlr.BaseParserRuleContext 11142 parser antlr.Parser 11143 } 11144 11145 func NewEmptyBooleanExpressionContext() *BooleanExpressionContext { 11146 var p = new(BooleanExpressionContext) 11147 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 11148 p.RuleIndex = SqlBaseParserRULE_booleanExpression 11149 return p 11150 } 11151 11152 func (*BooleanExpressionContext) IsBooleanExpressionContext() {} 11153 11154 func NewBooleanExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BooleanExpressionContext { 11155 var p = new(BooleanExpressionContext) 11156 11157 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 11158 11159 p.parser = parser 11160 p.RuleIndex = SqlBaseParserRULE_booleanExpression 11161 11162 return p 11163 } 11164 11165 func (s *BooleanExpressionContext) GetParser() antlr.Parser { return s.parser } 11166 11167 func (s *BooleanExpressionContext) CopyFrom(ctx *BooleanExpressionContext) { 11168 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 11169 } 11170 11171 func (s *BooleanExpressionContext) GetRuleContext() antlr.RuleContext { 11172 return s 11173 } 11174 11175 func (s *BooleanExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 11176 return antlr.TreesStringTree(s, ruleNames, recog) 11177 } 11178 11179 type LogicalNotContext struct { 11180 *BooleanExpressionContext 11181 } 11182 11183 func NewLogicalNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LogicalNotContext { 11184 var p = new(LogicalNotContext) 11185 11186 p.BooleanExpressionContext = NewEmptyBooleanExpressionContext() 11187 p.parser = parser 11188 p.CopyFrom(ctx.(*BooleanExpressionContext)) 11189 11190 return p 11191 } 11192 11193 func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext { 11194 return s 11195 } 11196 11197 func (s *LogicalNotContext) NOT() antlr.TerminalNode { 11198 return s.GetToken(SqlBaseParserNOT, 0) 11199 } 11200 11201 func (s *LogicalNotContext) BooleanExpression() IBooleanExpressionContext { 11202 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) 11203 11204 if t == nil { 11205 return nil 11206 } 11207 11208 return t.(IBooleanExpressionContext) 11209 } 11210 11211 func (s *LogicalNotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11212 switch t := visitor.(type) { 11213 case SqlBaseVisitor: 11214 return t.VisitLogicalNot(s) 11215 11216 default: 11217 return t.VisitChildren(s) 11218 } 11219 } 11220 11221 type BooleanDefaultContext struct { 11222 *BooleanExpressionContext 11223 } 11224 11225 func NewBooleanDefaultContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BooleanDefaultContext { 11226 var p = new(BooleanDefaultContext) 11227 11228 p.BooleanExpressionContext = NewEmptyBooleanExpressionContext() 11229 p.parser = parser 11230 p.CopyFrom(ctx.(*BooleanExpressionContext)) 11231 11232 return p 11233 } 11234 11235 func (s *BooleanDefaultContext) GetRuleContext() antlr.RuleContext { 11236 return s 11237 } 11238 11239 func (s *BooleanDefaultContext) Predicated() IPredicatedContext { 11240 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPredicatedContext)(nil)).Elem(), 0) 11241 11242 if t == nil { 11243 return nil 11244 } 11245 11246 return t.(IPredicatedContext) 11247 } 11248 11249 func (s *BooleanDefaultContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11250 switch t := visitor.(type) { 11251 case SqlBaseVisitor: 11252 return t.VisitBooleanDefault(s) 11253 11254 default: 11255 return t.VisitChildren(s) 11256 } 11257 } 11258 11259 type LogicalBinaryContext struct { 11260 *BooleanExpressionContext 11261 left IBooleanExpressionContext 11262 operator antlr.Token 11263 right IBooleanExpressionContext 11264 } 11265 11266 func NewLogicalBinaryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LogicalBinaryContext { 11267 var p = new(LogicalBinaryContext) 11268 11269 p.BooleanExpressionContext = NewEmptyBooleanExpressionContext() 11270 p.parser = parser 11271 p.CopyFrom(ctx.(*BooleanExpressionContext)) 11272 11273 return p 11274 } 11275 11276 func (s *LogicalBinaryContext) GetOperator() antlr.Token { return s.operator } 11277 11278 func (s *LogicalBinaryContext) SetOperator(v antlr.Token) { s.operator = v } 11279 11280 func (s *LogicalBinaryContext) GetLeft() IBooleanExpressionContext { return s.left } 11281 11282 func (s *LogicalBinaryContext) GetRight() IBooleanExpressionContext { return s.right } 11283 11284 func (s *LogicalBinaryContext) SetLeft(v IBooleanExpressionContext) { s.left = v } 11285 11286 func (s *LogicalBinaryContext) SetRight(v IBooleanExpressionContext) { s.right = v } 11287 11288 func (s *LogicalBinaryContext) GetRuleContext() antlr.RuleContext { 11289 return s 11290 } 11291 11292 func (s *LogicalBinaryContext) AllBooleanExpression() []IBooleanExpressionContext { 11293 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem()) 11294 var tst = make([]IBooleanExpressionContext, len(ts)) 11295 11296 for i, t := range ts { 11297 if t != nil { 11298 tst[i] = t.(IBooleanExpressionContext) 11299 } 11300 } 11301 11302 return tst 11303 } 11304 11305 func (s *LogicalBinaryContext) BooleanExpression(i int) IBooleanExpressionContext { 11306 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), i) 11307 11308 if t == nil { 11309 return nil 11310 } 11311 11312 return t.(IBooleanExpressionContext) 11313 } 11314 11315 func (s *LogicalBinaryContext) AND() antlr.TerminalNode { 11316 return s.GetToken(SqlBaseParserAND, 0) 11317 } 11318 11319 func (s *LogicalBinaryContext) OR() antlr.TerminalNode { 11320 return s.GetToken(SqlBaseParserOR, 0) 11321 } 11322 11323 func (s *LogicalBinaryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11324 switch t := visitor.(type) { 11325 case SqlBaseVisitor: 11326 return t.VisitLogicalBinary(s) 11327 11328 default: 11329 return t.VisitChildren(s) 11330 } 11331 } 11332 11333 func (p *SqlBaseParser) BooleanExpression() (localctx IBooleanExpressionContext) { 11334 return p.booleanExpression(0) 11335 } 11336 11337 func (p *SqlBaseParser) booleanExpression(_p int) (localctx IBooleanExpressionContext) { 11338 var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() 11339 _parentState := p.GetState() 11340 localctx = NewBooleanExpressionContext(p, p.GetParserRuleContext(), _parentState) 11341 var _prevctx IBooleanExpressionContext = localctx 11342 var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. 11343 _startState := 62 11344 p.EnterRecursionRule(localctx, 62, SqlBaseParserRULE_booleanExpression, _p) 11345 11346 defer func() { 11347 p.UnrollRecursionContexts(_parentctx) 11348 }() 11349 11350 defer func() { 11351 if err := recover(); err != nil { 11352 if v, ok := err.(antlr.RecognitionException); ok { 11353 localctx.SetException(v) 11354 p.GetErrorHandler().ReportError(p, v) 11355 p.GetErrorHandler().Recover(p, v) 11356 } else { 11357 panic(err) 11358 } 11359 } 11360 }() 11361 11362 var _alt int 11363 11364 p.EnterOuterAlt(localctx, 1) 11365 p.SetState(888) 11366 p.GetErrorHandler().Sync(p) 11367 11368 switch p.GetTokenStream().LA(1) { 11369 case SqlBaseParserT__1, SqlBaseParserT__4, SqlBaseParserADD, SqlBaseParserALL, SqlBaseParserANALYZE, SqlBaseParserANY, SqlBaseParserARRAY, SqlBaseParserASC, SqlBaseParserAT, SqlBaseParserBERNOULLI, SqlBaseParserCALL, SqlBaseParserCASCADE, SqlBaseParserCASE, SqlBaseParserCAST, SqlBaseParserCATALOGS, SqlBaseParserCOALESCE, SqlBaseParserCOLUMN, SqlBaseParserCOLUMNS, SqlBaseParserCOMMENT, SqlBaseParserCOMMITTED, SqlBaseParserCURRENT, SqlBaseParserCURRENT_DATE, SqlBaseParserCURRENT_TIME, SqlBaseParserCURRENT_TIMESTAMP, SqlBaseParserCURRENT_USER, SqlBaseParserDATA, SqlBaseParserDATE, SqlBaseParserDAY, SqlBaseParserDESC, SqlBaseParserDISTRIBUTED, SqlBaseParserEXCLUDING, SqlBaseParserEXISTS, SqlBaseParserEXPLAIN, SqlBaseParserEXTRACT, SqlBaseParserFALSE, SqlBaseParserFILTER, SqlBaseParserFIRST, SqlBaseParserFOLLOWING, SqlBaseParserFORMAT, SqlBaseParserFUNCTIONS, SqlBaseParserGRANT, SqlBaseParserGRANTS, SqlBaseParserGRAPHVIZ, SqlBaseParserGROUPING, SqlBaseParserHOUR, SqlBaseParserIF, SqlBaseParserINCLUDING, SqlBaseParserINPUT, SqlBaseParserINTEGER, SqlBaseParserINTERVAL, SqlBaseParserLAST, SqlBaseParserLATERAL, SqlBaseParserLEVEL, SqlBaseParserLIMIT, SqlBaseParserLOCALTIME, SqlBaseParserLOCALTIMESTAMP, SqlBaseParserLOGICAL, SqlBaseParserMAP, SqlBaseParserMINUTE, SqlBaseParserMONTH, SqlBaseParserNFC, SqlBaseParserNFD, SqlBaseParserNFKC, SqlBaseParserNFKD, SqlBaseParserNO, SqlBaseParserNORMALIZE, SqlBaseParserNULL, SqlBaseParserNULLIF, SqlBaseParserNULLS, SqlBaseParserONLY, SqlBaseParserOPTION, SqlBaseParserORDINALITY, SqlBaseParserOUTPUT, SqlBaseParserOVER, SqlBaseParserPARTITION, SqlBaseParserPARTITIONS, SqlBaseParserPOSITION, SqlBaseParserPRECEDING, SqlBaseParserPRIVILEGES, SqlBaseParserPROPERTIES, SqlBaseParserPUBLIC, SqlBaseParserRANGE, SqlBaseParserREAD, SqlBaseParserRENAME, SqlBaseParserREPEATABLE, SqlBaseParserREPLACE, SqlBaseParserRESET, SqlBaseParserRESTRICT, SqlBaseParserREVOKE, SqlBaseParserROLLBACK, SqlBaseParserROW, SqlBaseParserROWS, SqlBaseParserSCHEMA, SqlBaseParserSCHEMAS, SqlBaseParserSECOND, SqlBaseParserSERIALIZABLE, SqlBaseParserSESSION, SqlBaseParserSET, SqlBaseParserSETS, SqlBaseParserSHOW, SqlBaseParserSMALLINT, SqlBaseParserSOME, SqlBaseParserSTART, SqlBaseParserSTATS, SqlBaseParserSUBSTRING, SqlBaseParserSYSTEM, SqlBaseParserTABLES, SqlBaseParserTABLESAMPLE, SqlBaseParserTEXT, SqlBaseParserTIME, SqlBaseParserTIMESTAMP, SqlBaseParserTINYINT, SqlBaseParserTO, SqlBaseParserTRUE, SqlBaseParserTRY_CAST, SqlBaseParserTYPE, SqlBaseParserUNBOUNDED, SqlBaseParserUNCOMMITTED, SqlBaseParserUSE, SqlBaseParserVALIDATE, SqlBaseParserVERBOSE, SqlBaseParserVIEW, SqlBaseParserWORK, SqlBaseParserWRITE, SqlBaseParserYEAR, SqlBaseParserZONE, SqlBaseParserPLUS, SqlBaseParserMINUS, SqlBaseParserSTRING, SqlBaseParserUNICODE_STRING, SqlBaseParserBINARY_LITERAL, SqlBaseParserINTEGER_VALUE, SqlBaseParserDECIMAL_VALUE, SqlBaseParserDOUBLE_VALUE, SqlBaseParserIDENTIFIER, SqlBaseParserDIGIT_IDENTIFIER, SqlBaseParserQUOTED_IDENTIFIER, SqlBaseParserBACKQUOTED_IDENTIFIER, SqlBaseParserDOUBLE_PRECISION, SqlBaseParserCOMMIT, SqlBaseParserISOLATION, SqlBaseParserTRANSACTION: 11370 localctx = NewBooleanDefaultContext(p, localctx) 11371 p.SetParserRuleContext(localctx) 11372 _prevctx = localctx 11373 11374 { 11375 p.SetState(885) 11376 p.Predicated() 11377 } 11378 11379 case SqlBaseParserNOT: 11380 localctx = NewLogicalNotContext(p, localctx) 11381 p.SetParserRuleContext(localctx) 11382 _prevctx = localctx 11383 { 11384 p.SetState(886) 11385 p.Match(SqlBaseParserNOT) 11386 } 11387 { 11388 p.SetState(887) 11389 p.booleanExpression(3) 11390 } 11391 11392 default: 11393 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 11394 } 11395 p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) 11396 p.SetState(898) 11397 p.GetErrorHandler().Sync(p) 11398 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 112, p.GetParserRuleContext()) 11399 11400 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 11401 if _alt == 1 { 11402 if p.GetParseListeners() != nil { 11403 p.TriggerExitRuleEvent() 11404 } 11405 _prevctx = localctx 11406 p.SetState(896) 11407 p.GetErrorHandler().Sync(p) 11408 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 111, p.GetParserRuleContext()) { 11409 case 1: 11410 localctx = NewLogicalBinaryContext(p, NewBooleanExpressionContext(p, _parentctx, _parentState)) 11411 localctx.(*LogicalBinaryContext).left = _prevctx 11412 11413 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_booleanExpression) 11414 p.SetState(890) 11415 11416 if !(p.Precpred(p.GetParserRuleContext(), 2)) { 11417 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) 11418 } 11419 { 11420 p.SetState(891) 11421 11422 var _m = p.Match(SqlBaseParserAND) 11423 11424 localctx.(*LogicalBinaryContext).operator = _m 11425 } 11426 { 11427 p.SetState(892) 11428 11429 var _x = p.booleanExpression(3) 11430 11431 localctx.(*LogicalBinaryContext).right = _x 11432 } 11433 11434 case 2: 11435 localctx = NewLogicalBinaryContext(p, NewBooleanExpressionContext(p, _parentctx, _parentState)) 11436 localctx.(*LogicalBinaryContext).left = _prevctx 11437 11438 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_booleanExpression) 11439 p.SetState(893) 11440 11441 if !(p.Precpred(p.GetParserRuleContext(), 1)) { 11442 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) 11443 } 11444 { 11445 p.SetState(894) 11446 11447 var _m = p.Match(SqlBaseParserOR) 11448 11449 localctx.(*LogicalBinaryContext).operator = _m 11450 } 11451 { 11452 p.SetState(895) 11453 11454 var _x = p.booleanExpression(2) 11455 11456 localctx.(*LogicalBinaryContext).right = _x 11457 } 11458 11459 } 11460 11461 } 11462 p.SetState(900) 11463 p.GetErrorHandler().Sync(p) 11464 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 112, p.GetParserRuleContext()) 11465 } 11466 11467 return localctx 11468 } 11469 11470 // IPredicatedContext is an interface to support dynamic dispatch. 11471 type IPredicatedContext interface { 11472 antlr.ParserRuleContext 11473 11474 // GetParser returns the parser. 11475 GetParser() antlr.Parser 11476 11477 // Get_valueExpression returns the _valueExpression rule contexts. 11478 Get_valueExpression() IValueExpressionContext 11479 11480 // Set_valueExpression sets the _valueExpression rule contexts. 11481 Set_valueExpression(IValueExpressionContext) 11482 11483 // IsPredicatedContext differentiates from other interfaces. 11484 IsPredicatedContext() 11485 } 11486 11487 type PredicatedContext struct { 11488 *antlr.BaseParserRuleContext 11489 parser antlr.Parser 11490 _valueExpression IValueExpressionContext 11491 } 11492 11493 func NewEmptyPredicatedContext() *PredicatedContext { 11494 var p = new(PredicatedContext) 11495 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 11496 p.RuleIndex = SqlBaseParserRULE_predicated 11497 return p 11498 } 11499 11500 func (*PredicatedContext) IsPredicatedContext() {} 11501 11502 func NewPredicatedContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PredicatedContext { 11503 var p = new(PredicatedContext) 11504 11505 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 11506 11507 p.parser = parser 11508 p.RuleIndex = SqlBaseParserRULE_predicated 11509 11510 return p 11511 } 11512 11513 func (s *PredicatedContext) GetParser() antlr.Parser { return s.parser } 11514 11515 func (s *PredicatedContext) Get_valueExpression() IValueExpressionContext { return s._valueExpression } 11516 11517 func (s *PredicatedContext) Set_valueExpression(v IValueExpressionContext) { s._valueExpression = v } 11518 11519 func (s *PredicatedContext) ValueExpression() IValueExpressionContext { 11520 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 11521 11522 if t == nil { 11523 return nil 11524 } 11525 11526 return t.(IValueExpressionContext) 11527 } 11528 11529 func (s *PredicatedContext) Predicate() IPredicateContext { 11530 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPredicateContext)(nil)).Elem(), 0) 11531 11532 if t == nil { 11533 return nil 11534 } 11535 11536 return t.(IPredicateContext) 11537 } 11538 11539 func (s *PredicatedContext) GetRuleContext() antlr.RuleContext { 11540 return s 11541 } 11542 11543 func (s *PredicatedContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 11544 return antlr.TreesStringTree(s, ruleNames, recog) 11545 } 11546 11547 func (s *PredicatedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11548 switch t := visitor.(type) { 11549 case SqlBaseVisitor: 11550 return t.VisitPredicated(s) 11551 11552 default: 11553 return t.VisitChildren(s) 11554 } 11555 } 11556 11557 func (p *SqlBaseParser) Predicated() (localctx IPredicatedContext) { 11558 localctx = NewPredicatedContext(p, p.GetParserRuleContext(), p.GetState()) 11559 p.EnterRule(localctx, 64, SqlBaseParserRULE_predicated) 11560 11561 defer func() { 11562 p.ExitRule() 11563 }() 11564 11565 defer func() { 11566 if err := recover(); err != nil { 11567 if v, ok := err.(antlr.RecognitionException); ok { 11568 localctx.SetException(v) 11569 p.GetErrorHandler().ReportError(p, v) 11570 p.GetErrorHandler().Recover(p, v) 11571 } else { 11572 panic(err) 11573 } 11574 } 11575 }() 11576 11577 p.EnterOuterAlt(localctx, 1) 11578 { 11579 p.SetState(901) 11580 11581 var _x = p.valueExpression(0) 11582 11583 localctx.(*PredicatedContext)._valueExpression = _x 11584 } 11585 p.SetState(903) 11586 p.GetErrorHandler().Sync(p) 11587 11588 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 113, p.GetParserRuleContext()) == 1 { 11589 { 11590 p.SetState(902) 11591 p.Predicate(localctx.(*PredicatedContext).Get_valueExpression()) 11592 } 11593 11594 } 11595 11596 return localctx 11597 } 11598 11599 // IPredicateContext is an interface to support dynamic dispatch. 11600 type IPredicateContext interface { 11601 antlr.ParserRuleContext 11602 11603 // GetParser returns the parser. 11604 GetParser() antlr.Parser 11605 11606 // GetValue returns the value attribute. 11607 GetValue() antlr.ParserRuleContext 11608 11609 // SetValue sets the value attribute. 11610 SetValue(antlr.ParserRuleContext) 11611 11612 // IsPredicateContext differentiates from other interfaces. 11613 IsPredicateContext() 11614 } 11615 11616 type PredicateContext struct { 11617 *antlr.BaseParserRuleContext 11618 parser antlr.Parser 11619 value antlr.ParserRuleContext 11620 } 11621 11622 func NewEmptyPredicateContext() *PredicateContext { 11623 var p = new(PredicateContext) 11624 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 11625 p.RuleIndex = SqlBaseParserRULE_predicate 11626 return p 11627 } 11628 11629 func (*PredicateContext) IsPredicateContext() {} 11630 11631 func NewPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int, value antlr.ParserRuleContext) *PredicateContext { 11632 var p = new(PredicateContext) 11633 11634 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 11635 11636 p.parser = parser 11637 p.RuleIndex = SqlBaseParserRULE_predicate 11638 11639 p.value = value 11640 11641 return p 11642 } 11643 11644 func (s *PredicateContext) GetParser() antlr.Parser { return s.parser } 11645 11646 func (s *PredicateContext) GetValue() antlr.ParserRuleContext { return s.value } 11647 11648 func (s *PredicateContext) SetValue(v antlr.ParserRuleContext) { s.value = v } 11649 11650 func (s *PredicateContext) CopyFrom(ctx *PredicateContext) { 11651 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 11652 s.value = ctx.value 11653 } 11654 11655 func (s *PredicateContext) GetRuleContext() antlr.RuleContext { 11656 return s 11657 } 11658 11659 func (s *PredicateContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 11660 return antlr.TreesStringTree(s, ruleNames, recog) 11661 } 11662 11663 type ComparisonContext struct { 11664 *PredicateContext 11665 right IValueExpressionContext 11666 } 11667 11668 func NewComparisonContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ComparisonContext { 11669 var p = new(ComparisonContext) 11670 11671 p.PredicateContext = NewEmptyPredicateContext() 11672 p.parser = parser 11673 p.CopyFrom(ctx.(*PredicateContext)) 11674 11675 return p 11676 } 11677 11678 func (s *ComparisonContext) GetRight() IValueExpressionContext { return s.right } 11679 11680 func (s *ComparisonContext) SetRight(v IValueExpressionContext) { s.right = v } 11681 11682 func (s *ComparisonContext) GetRuleContext() antlr.RuleContext { 11683 return s 11684 } 11685 11686 func (s *ComparisonContext) ComparisonOperator() IComparisonOperatorContext { 11687 var t = s.GetTypedRuleContext(reflect.TypeOf((*IComparisonOperatorContext)(nil)).Elem(), 0) 11688 11689 if t == nil { 11690 return nil 11691 } 11692 11693 return t.(IComparisonOperatorContext) 11694 } 11695 11696 func (s *ComparisonContext) ValueExpression() IValueExpressionContext { 11697 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 11698 11699 if t == nil { 11700 return nil 11701 } 11702 11703 return t.(IValueExpressionContext) 11704 } 11705 11706 func (s *ComparisonContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11707 switch t := visitor.(type) { 11708 case SqlBaseVisitor: 11709 return t.VisitComparison(s) 11710 11711 default: 11712 return t.VisitChildren(s) 11713 } 11714 } 11715 11716 type LikeContext struct { 11717 *PredicateContext 11718 pattern IValueExpressionContext 11719 escape IValueExpressionContext 11720 } 11721 11722 func NewLikeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LikeContext { 11723 var p = new(LikeContext) 11724 11725 p.PredicateContext = NewEmptyPredicateContext() 11726 p.parser = parser 11727 p.CopyFrom(ctx.(*PredicateContext)) 11728 11729 return p 11730 } 11731 11732 func (s *LikeContext) GetPattern() IValueExpressionContext { return s.pattern } 11733 11734 func (s *LikeContext) GetEscape() IValueExpressionContext { return s.escape } 11735 11736 func (s *LikeContext) SetPattern(v IValueExpressionContext) { s.pattern = v } 11737 11738 func (s *LikeContext) SetEscape(v IValueExpressionContext) { s.escape = v } 11739 11740 func (s *LikeContext) GetRuleContext() antlr.RuleContext { 11741 return s 11742 } 11743 11744 func (s *LikeContext) LIKE() antlr.TerminalNode { 11745 return s.GetToken(SqlBaseParserLIKE, 0) 11746 } 11747 11748 func (s *LikeContext) AllValueExpression() []IValueExpressionContext { 11749 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem()) 11750 var tst = make([]IValueExpressionContext, len(ts)) 11751 11752 for i, t := range ts { 11753 if t != nil { 11754 tst[i] = t.(IValueExpressionContext) 11755 } 11756 } 11757 11758 return tst 11759 } 11760 11761 func (s *LikeContext) ValueExpression(i int) IValueExpressionContext { 11762 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), i) 11763 11764 if t == nil { 11765 return nil 11766 } 11767 11768 return t.(IValueExpressionContext) 11769 } 11770 11771 func (s *LikeContext) NOT() antlr.TerminalNode { 11772 return s.GetToken(SqlBaseParserNOT, 0) 11773 } 11774 11775 func (s *LikeContext) ESCAPE() antlr.TerminalNode { 11776 return s.GetToken(SqlBaseParserESCAPE, 0) 11777 } 11778 11779 func (s *LikeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11780 switch t := visitor.(type) { 11781 case SqlBaseVisitor: 11782 return t.VisitLike(s) 11783 11784 default: 11785 return t.VisitChildren(s) 11786 } 11787 } 11788 11789 type InSubqueryContext struct { 11790 *PredicateContext 11791 } 11792 11793 func NewInSubqueryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InSubqueryContext { 11794 var p = new(InSubqueryContext) 11795 11796 p.PredicateContext = NewEmptyPredicateContext() 11797 p.parser = parser 11798 p.CopyFrom(ctx.(*PredicateContext)) 11799 11800 return p 11801 } 11802 11803 func (s *InSubqueryContext) GetRuleContext() antlr.RuleContext { 11804 return s 11805 } 11806 11807 func (s *InSubqueryContext) IN() antlr.TerminalNode { 11808 return s.GetToken(SqlBaseParserIN, 0) 11809 } 11810 11811 func (s *InSubqueryContext) Query() IQueryContext { 11812 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 11813 11814 if t == nil { 11815 return nil 11816 } 11817 11818 return t.(IQueryContext) 11819 } 11820 11821 func (s *InSubqueryContext) NOT() antlr.TerminalNode { 11822 return s.GetToken(SqlBaseParserNOT, 0) 11823 } 11824 11825 func (s *InSubqueryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11826 switch t := visitor.(type) { 11827 case SqlBaseVisitor: 11828 return t.VisitInSubquery(s) 11829 11830 default: 11831 return t.VisitChildren(s) 11832 } 11833 } 11834 11835 type DistinctFromContext struct { 11836 *PredicateContext 11837 right IValueExpressionContext 11838 } 11839 11840 func NewDistinctFromContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DistinctFromContext { 11841 var p = new(DistinctFromContext) 11842 11843 p.PredicateContext = NewEmptyPredicateContext() 11844 p.parser = parser 11845 p.CopyFrom(ctx.(*PredicateContext)) 11846 11847 return p 11848 } 11849 11850 func (s *DistinctFromContext) GetRight() IValueExpressionContext { return s.right } 11851 11852 func (s *DistinctFromContext) SetRight(v IValueExpressionContext) { s.right = v } 11853 11854 func (s *DistinctFromContext) GetRuleContext() antlr.RuleContext { 11855 return s 11856 } 11857 11858 func (s *DistinctFromContext) IS() antlr.TerminalNode { 11859 return s.GetToken(SqlBaseParserIS, 0) 11860 } 11861 11862 func (s *DistinctFromContext) DISTINCT() antlr.TerminalNode { 11863 return s.GetToken(SqlBaseParserDISTINCT, 0) 11864 } 11865 11866 func (s *DistinctFromContext) FROM() antlr.TerminalNode { 11867 return s.GetToken(SqlBaseParserFROM, 0) 11868 } 11869 11870 func (s *DistinctFromContext) ValueExpression() IValueExpressionContext { 11871 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 11872 11873 if t == nil { 11874 return nil 11875 } 11876 11877 return t.(IValueExpressionContext) 11878 } 11879 11880 func (s *DistinctFromContext) NOT() antlr.TerminalNode { 11881 return s.GetToken(SqlBaseParserNOT, 0) 11882 } 11883 11884 func (s *DistinctFromContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11885 switch t := visitor.(type) { 11886 case SqlBaseVisitor: 11887 return t.VisitDistinctFrom(s) 11888 11889 default: 11890 return t.VisitChildren(s) 11891 } 11892 } 11893 11894 type InListContext struct { 11895 *PredicateContext 11896 } 11897 11898 func NewInListContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *InListContext { 11899 var p = new(InListContext) 11900 11901 p.PredicateContext = NewEmptyPredicateContext() 11902 p.parser = parser 11903 p.CopyFrom(ctx.(*PredicateContext)) 11904 11905 return p 11906 } 11907 11908 func (s *InListContext) GetRuleContext() antlr.RuleContext { 11909 return s 11910 } 11911 11912 func (s *InListContext) IN() antlr.TerminalNode { 11913 return s.GetToken(SqlBaseParserIN, 0) 11914 } 11915 11916 func (s *InListContext) AllExpression() []IExpressionContext { 11917 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 11918 var tst = make([]IExpressionContext, len(ts)) 11919 11920 for i, t := range ts { 11921 if t != nil { 11922 tst[i] = t.(IExpressionContext) 11923 } 11924 } 11925 11926 return tst 11927 } 11928 11929 func (s *InListContext) Expression(i int) IExpressionContext { 11930 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 11931 11932 if t == nil { 11933 return nil 11934 } 11935 11936 return t.(IExpressionContext) 11937 } 11938 11939 func (s *InListContext) NOT() antlr.TerminalNode { 11940 return s.GetToken(SqlBaseParserNOT, 0) 11941 } 11942 11943 func (s *InListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11944 switch t := visitor.(type) { 11945 case SqlBaseVisitor: 11946 return t.VisitInList(s) 11947 11948 default: 11949 return t.VisitChildren(s) 11950 } 11951 } 11952 11953 type NullPredicateContext struct { 11954 *PredicateContext 11955 } 11956 11957 func NewNullPredicateContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullPredicateContext { 11958 var p = new(NullPredicateContext) 11959 11960 p.PredicateContext = NewEmptyPredicateContext() 11961 p.parser = parser 11962 p.CopyFrom(ctx.(*PredicateContext)) 11963 11964 return p 11965 } 11966 11967 func (s *NullPredicateContext) GetRuleContext() antlr.RuleContext { 11968 return s 11969 } 11970 11971 func (s *NullPredicateContext) IS() antlr.TerminalNode { 11972 return s.GetToken(SqlBaseParserIS, 0) 11973 } 11974 11975 func (s *NullPredicateContext) NULL() antlr.TerminalNode { 11976 return s.GetToken(SqlBaseParserNULL, 0) 11977 } 11978 11979 func (s *NullPredicateContext) NOT() antlr.TerminalNode { 11980 return s.GetToken(SqlBaseParserNOT, 0) 11981 } 11982 11983 func (s *NullPredicateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 11984 switch t := visitor.(type) { 11985 case SqlBaseVisitor: 11986 return t.VisitNullPredicate(s) 11987 11988 default: 11989 return t.VisitChildren(s) 11990 } 11991 } 11992 11993 type BetweenContext struct { 11994 *PredicateContext 11995 lower IValueExpressionContext 11996 upper IValueExpressionContext 11997 } 11998 11999 func NewBetweenContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BetweenContext { 12000 var p = new(BetweenContext) 12001 12002 p.PredicateContext = NewEmptyPredicateContext() 12003 p.parser = parser 12004 p.CopyFrom(ctx.(*PredicateContext)) 12005 12006 return p 12007 } 12008 12009 func (s *BetweenContext) GetLower() IValueExpressionContext { return s.lower } 12010 12011 func (s *BetweenContext) GetUpper() IValueExpressionContext { return s.upper } 12012 12013 func (s *BetweenContext) SetLower(v IValueExpressionContext) { s.lower = v } 12014 12015 func (s *BetweenContext) SetUpper(v IValueExpressionContext) { s.upper = v } 12016 12017 func (s *BetweenContext) GetRuleContext() antlr.RuleContext { 12018 return s 12019 } 12020 12021 func (s *BetweenContext) BETWEEN() antlr.TerminalNode { 12022 return s.GetToken(SqlBaseParserBETWEEN, 0) 12023 } 12024 12025 func (s *BetweenContext) AND() antlr.TerminalNode { 12026 return s.GetToken(SqlBaseParserAND, 0) 12027 } 12028 12029 func (s *BetweenContext) AllValueExpression() []IValueExpressionContext { 12030 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem()) 12031 var tst = make([]IValueExpressionContext, len(ts)) 12032 12033 for i, t := range ts { 12034 if t != nil { 12035 tst[i] = t.(IValueExpressionContext) 12036 } 12037 } 12038 12039 return tst 12040 } 12041 12042 func (s *BetweenContext) ValueExpression(i int) IValueExpressionContext { 12043 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), i) 12044 12045 if t == nil { 12046 return nil 12047 } 12048 12049 return t.(IValueExpressionContext) 12050 } 12051 12052 func (s *BetweenContext) NOT() antlr.TerminalNode { 12053 return s.GetToken(SqlBaseParserNOT, 0) 12054 } 12055 12056 func (s *BetweenContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 12057 switch t := visitor.(type) { 12058 case SqlBaseVisitor: 12059 return t.VisitBetween(s) 12060 12061 default: 12062 return t.VisitChildren(s) 12063 } 12064 } 12065 12066 type QuantifiedComparisonContext struct { 12067 *PredicateContext 12068 } 12069 12070 func NewQuantifiedComparisonContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QuantifiedComparisonContext { 12071 var p = new(QuantifiedComparisonContext) 12072 12073 p.PredicateContext = NewEmptyPredicateContext() 12074 p.parser = parser 12075 p.CopyFrom(ctx.(*PredicateContext)) 12076 12077 return p 12078 } 12079 12080 func (s *QuantifiedComparisonContext) GetRuleContext() antlr.RuleContext { 12081 return s 12082 } 12083 12084 func (s *QuantifiedComparisonContext) ComparisonOperator() IComparisonOperatorContext { 12085 var t = s.GetTypedRuleContext(reflect.TypeOf((*IComparisonOperatorContext)(nil)).Elem(), 0) 12086 12087 if t == nil { 12088 return nil 12089 } 12090 12091 return t.(IComparisonOperatorContext) 12092 } 12093 12094 func (s *QuantifiedComparisonContext) ComparisonQuantifier() IComparisonQuantifierContext { 12095 var t = s.GetTypedRuleContext(reflect.TypeOf((*IComparisonQuantifierContext)(nil)).Elem(), 0) 12096 12097 if t == nil { 12098 return nil 12099 } 12100 12101 return t.(IComparisonQuantifierContext) 12102 } 12103 12104 func (s *QuantifiedComparisonContext) Query() IQueryContext { 12105 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 12106 12107 if t == nil { 12108 return nil 12109 } 12110 12111 return t.(IQueryContext) 12112 } 12113 12114 func (s *QuantifiedComparisonContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 12115 switch t := visitor.(type) { 12116 case SqlBaseVisitor: 12117 return t.VisitQuantifiedComparison(s) 12118 12119 default: 12120 return t.VisitChildren(s) 12121 } 12122 } 12123 12124 func (p *SqlBaseParser) Predicate(value antlr.ParserRuleContext) (localctx IPredicateContext) { 12125 localctx = NewPredicateContext(p, p.GetParserRuleContext(), p.GetState(), value) 12126 p.EnterRule(localctx, 66, SqlBaseParserRULE_predicate) 12127 var _la int 12128 12129 defer func() { 12130 p.ExitRule() 12131 }() 12132 12133 defer func() { 12134 if err := recover(); err != nil { 12135 if v, ok := err.(antlr.RecognitionException); ok { 12136 localctx.SetException(v) 12137 p.GetErrorHandler().ReportError(p, v) 12138 p.GetErrorHandler().Recover(p, v) 12139 } else { 12140 panic(err) 12141 } 12142 } 12143 }() 12144 12145 p.SetState(966) 12146 p.GetErrorHandler().Sync(p) 12147 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 122, p.GetParserRuleContext()) { 12148 case 1: 12149 localctx = NewComparisonContext(p, localctx) 12150 p.EnterOuterAlt(localctx, 1) 12151 { 12152 p.SetState(905) 12153 p.ComparisonOperator() 12154 } 12155 { 12156 p.SetState(906) 12157 12158 var _x = p.valueExpression(0) 12159 12160 localctx.(*ComparisonContext).right = _x 12161 } 12162 12163 case 2: 12164 localctx = NewQuantifiedComparisonContext(p, localctx) 12165 p.EnterOuterAlt(localctx, 2) 12166 { 12167 p.SetState(908) 12168 p.ComparisonOperator() 12169 } 12170 { 12171 p.SetState(909) 12172 p.ComparisonQuantifier() 12173 } 12174 { 12175 p.SetState(910) 12176 p.Match(SqlBaseParserT__1) 12177 } 12178 { 12179 p.SetState(911) 12180 p.Query() 12181 } 12182 { 12183 p.SetState(912) 12184 p.Match(SqlBaseParserT__2) 12185 } 12186 12187 case 3: 12188 localctx = NewBetweenContext(p, localctx) 12189 p.EnterOuterAlt(localctx, 3) 12190 p.SetState(915) 12191 p.GetErrorHandler().Sync(p) 12192 _la = p.GetTokenStream().LA(1) 12193 12194 if _la == SqlBaseParserNOT { 12195 { 12196 p.SetState(914) 12197 p.Match(SqlBaseParserNOT) 12198 } 12199 12200 } 12201 { 12202 p.SetState(917) 12203 p.Match(SqlBaseParserBETWEEN) 12204 } 12205 { 12206 p.SetState(918) 12207 12208 var _x = p.valueExpression(0) 12209 12210 localctx.(*BetweenContext).lower = _x 12211 } 12212 { 12213 p.SetState(919) 12214 p.Match(SqlBaseParserAND) 12215 } 12216 { 12217 p.SetState(920) 12218 12219 var _x = p.valueExpression(0) 12220 12221 localctx.(*BetweenContext).upper = _x 12222 } 12223 12224 case 4: 12225 localctx = NewInListContext(p, localctx) 12226 p.EnterOuterAlt(localctx, 4) 12227 p.SetState(923) 12228 p.GetErrorHandler().Sync(p) 12229 _la = p.GetTokenStream().LA(1) 12230 12231 if _la == SqlBaseParserNOT { 12232 { 12233 p.SetState(922) 12234 p.Match(SqlBaseParserNOT) 12235 } 12236 12237 } 12238 { 12239 p.SetState(925) 12240 p.Match(SqlBaseParserIN) 12241 } 12242 { 12243 p.SetState(926) 12244 p.Match(SqlBaseParserT__1) 12245 } 12246 { 12247 p.SetState(927) 12248 p.Expression() 12249 } 12250 p.SetState(932) 12251 p.GetErrorHandler().Sync(p) 12252 _la = p.GetTokenStream().LA(1) 12253 12254 for _la == SqlBaseParserT__3 { 12255 { 12256 p.SetState(928) 12257 p.Match(SqlBaseParserT__3) 12258 } 12259 { 12260 p.SetState(929) 12261 p.Expression() 12262 } 12263 12264 p.SetState(934) 12265 p.GetErrorHandler().Sync(p) 12266 _la = p.GetTokenStream().LA(1) 12267 } 12268 { 12269 p.SetState(935) 12270 p.Match(SqlBaseParserT__2) 12271 } 12272 12273 case 5: 12274 localctx = NewInSubqueryContext(p, localctx) 12275 p.EnterOuterAlt(localctx, 5) 12276 p.SetState(938) 12277 p.GetErrorHandler().Sync(p) 12278 _la = p.GetTokenStream().LA(1) 12279 12280 if _la == SqlBaseParserNOT { 12281 { 12282 p.SetState(937) 12283 p.Match(SqlBaseParserNOT) 12284 } 12285 12286 } 12287 { 12288 p.SetState(940) 12289 p.Match(SqlBaseParserIN) 12290 } 12291 { 12292 p.SetState(941) 12293 p.Match(SqlBaseParserT__1) 12294 } 12295 { 12296 p.SetState(942) 12297 p.Query() 12298 } 12299 { 12300 p.SetState(943) 12301 p.Match(SqlBaseParserT__2) 12302 } 12303 12304 case 6: 12305 localctx = NewLikeContext(p, localctx) 12306 p.EnterOuterAlt(localctx, 6) 12307 p.SetState(946) 12308 p.GetErrorHandler().Sync(p) 12309 _la = p.GetTokenStream().LA(1) 12310 12311 if _la == SqlBaseParserNOT { 12312 { 12313 p.SetState(945) 12314 p.Match(SqlBaseParserNOT) 12315 } 12316 12317 } 12318 { 12319 p.SetState(948) 12320 p.Match(SqlBaseParserLIKE) 12321 } 12322 { 12323 p.SetState(949) 12324 12325 var _x = p.valueExpression(0) 12326 12327 localctx.(*LikeContext).pattern = _x 12328 } 12329 p.SetState(952) 12330 p.GetErrorHandler().Sync(p) 12331 12332 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 119, p.GetParserRuleContext()) == 1 { 12333 { 12334 p.SetState(950) 12335 p.Match(SqlBaseParserESCAPE) 12336 } 12337 { 12338 p.SetState(951) 12339 12340 var _x = p.valueExpression(0) 12341 12342 localctx.(*LikeContext).escape = _x 12343 } 12344 12345 } 12346 12347 case 7: 12348 localctx = NewNullPredicateContext(p, localctx) 12349 p.EnterOuterAlt(localctx, 7) 12350 { 12351 p.SetState(954) 12352 p.Match(SqlBaseParserIS) 12353 } 12354 p.SetState(956) 12355 p.GetErrorHandler().Sync(p) 12356 _la = p.GetTokenStream().LA(1) 12357 12358 if _la == SqlBaseParserNOT { 12359 { 12360 p.SetState(955) 12361 p.Match(SqlBaseParserNOT) 12362 } 12363 12364 } 12365 { 12366 p.SetState(958) 12367 p.Match(SqlBaseParserNULL) 12368 } 12369 12370 case 8: 12371 localctx = NewDistinctFromContext(p, localctx) 12372 p.EnterOuterAlt(localctx, 8) 12373 { 12374 p.SetState(959) 12375 p.Match(SqlBaseParserIS) 12376 } 12377 p.SetState(961) 12378 p.GetErrorHandler().Sync(p) 12379 _la = p.GetTokenStream().LA(1) 12380 12381 if _la == SqlBaseParserNOT { 12382 { 12383 p.SetState(960) 12384 p.Match(SqlBaseParserNOT) 12385 } 12386 12387 } 12388 { 12389 p.SetState(963) 12390 p.Match(SqlBaseParserDISTINCT) 12391 } 12392 { 12393 p.SetState(964) 12394 p.Match(SqlBaseParserFROM) 12395 } 12396 { 12397 p.SetState(965) 12398 12399 var _x = p.valueExpression(0) 12400 12401 localctx.(*DistinctFromContext).right = _x 12402 } 12403 12404 } 12405 12406 return localctx 12407 } 12408 12409 // IValueExpressionContext is an interface to support dynamic dispatch. 12410 type IValueExpressionContext interface { 12411 antlr.ParserRuleContext 12412 12413 // GetParser returns the parser. 12414 GetParser() antlr.Parser 12415 12416 // IsValueExpressionContext differentiates from other interfaces. 12417 IsValueExpressionContext() 12418 } 12419 12420 type ValueExpressionContext struct { 12421 *antlr.BaseParserRuleContext 12422 parser antlr.Parser 12423 } 12424 12425 func NewEmptyValueExpressionContext() *ValueExpressionContext { 12426 var p = new(ValueExpressionContext) 12427 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 12428 p.RuleIndex = SqlBaseParserRULE_valueExpression 12429 return p 12430 } 12431 12432 func (*ValueExpressionContext) IsValueExpressionContext() {} 12433 12434 func NewValueExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueExpressionContext { 12435 var p = new(ValueExpressionContext) 12436 12437 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 12438 12439 p.parser = parser 12440 p.RuleIndex = SqlBaseParserRULE_valueExpression 12441 12442 return p 12443 } 12444 12445 func (s *ValueExpressionContext) GetParser() antlr.Parser { return s.parser } 12446 12447 func (s *ValueExpressionContext) CopyFrom(ctx *ValueExpressionContext) { 12448 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 12449 } 12450 12451 func (s *ValueExpressionContext) GetRuleContext() antlr.RuleContext { 12452 return s 12453 } 12454 12455 func (s *ValueExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 12456 return antlr.TreesStringTree(s, ruleNames, recog) 12457 } 12458 12459 type ValueExpressionDefaultContext struct { 12460 *ValueExpressionContext 12461 } 12462 12463 func NewValueExpressionDefaultContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ValueExpressionDefaultContext { 12464 var p = new(ValueExpressionDefaultContext) 12465 12466 p.ValueExpressionContext = NewEmptyValueExpressionContext() 12467 p.parser = parser 12468 p.CopyFrom(ctx.(*ValueExpressionContext)) 12469 12470 return p 12471 } 12472 12473 func (s *ValueExpressionDefaultContext) GetRuleContext() antlr.RuleContext { 12474 return s 12475 } 12476 12477 func (s *ValueExpressionDefaultContext) PrimaryExpression() IPrimaryExpressionContext { 12478 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPrimaryExpressionContext)(nil)).Elem(), 0) 12479 12480 if t == nil { 12481 return nil 12482 } 12483 12484 return t.(IPrimaryExpressionContext) 12485 } 12486 12487 func (s *ValueExpressionDefaultContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 12488 switch t := visitor.(type) { 12489 case SqlBaseVisitor: 12490 return t.VisitValueExpressionDefault(s) 12491 12492 default: 12493 return t.VisitChildren(s) 12494 } 12495 } 12496 12497 type ConcatenationContext struct { 12498 *ValueExpressionContext 12499 left IValueExpressionContext 12500 right IValueExpressionContext 12501 } 12502 12503 func NewConcatenationContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConcatenationContext { 12504 var p = new(ConcatenationContext) 12505 12506 p.ValueExpressionContext = NewEmptyValueExpressionContext() 12507 p.parser = parser 12508 p.CopyFrom(ctx.(*ValueExpressionContext)) 12509 12510 return p 12511 } 12512 12513 func (s *ConcatenationContext) GetLeft() IValueExpressionContext { return s.left } 12514 12515 func (s *ConcatenationContext) GetRight() IValueExpressionContext { return s.right } 12516 12517 func (s *ConcatenationContext) SetLeft(v IValueExpressionContext) { s.left = v } 12518 12519 func (s *ConcatenationContext) SetRight(v IValueExpressionContext) { s.right = v } 12520 12521 func (s *ConcatenationContext) GetRuleContext() antlr.RuleContext { 12522 return s 12523 } 12524 12525 func (s *ConcatenationContext) CONCAT() antlr.TerminalNode { 12526 return s.GetToken(SqlBaseParserCONCAT, 0) 12527 } 12528 12529 func (s *ConcatenationContext) AllValueExpression() []IValueExpressionContext { 12530 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem()) 12531 var tst = make([]IValueExpressionContext, len(ts)) 12532 12533 for i, t := range ts { 12534 if t != nil { 12535 tst[i] = t.(IValueExpressionContext) 12536 } 12537 } 12538 12539 return tst 12540 } 12541 12542 func (s *ConcatenationContext) ValueExpression(i int) IValueExpressionContext { 12543 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), i) 12544 12545 if t == nil { 12546 return nil 12547 } 12548 12549 return t.(IValueExpressionContext) 12550 } 12551 12552 func (s *ConcatenationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 12553 switch t := visitor.(type) { 12554 case SqlBaseVisitor: 12555 return t.VisitConcatenation(s) 12556 12557 default: 12558 return t.VisitChildren(s) 12559 } 12560 } 12561 12562 type ArithmeticBinaryContext struct { 12563 *ValueExpressionContext 12564 left IValueExpressionContext 12565 operator antlr.Token 12566 right IValueExpressionContext 12567 } 12568 12569 func NewArithmeticBinaryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArithmeticBinaryContext { 12570 var p = new(ArithmeticBinaryContext) 12571 12572 p.ValueExpressionContext = NewEmptyValueExpressionContext() 12573 p.parser = parser 12574 p.CopyFrom(ctx.(*ValueExpressionContext)) 12575 12576 return p 12577 } 12578 12579 func (s *ArithmeticBinaryContext) GetOperator() antlr.Token { return s.operator } 12580 12581 func (s *ArithmeticBinaryContext) SetOperator(v antlr.Token) { s.operator = v } 12582 12583 func (s *ArithmeticBinaryContext) GetLeft() IValueExpressionContext { return s.left } 12584 12585 func (s *ArithmeticBinaryContext) GetRight() IValueExpressionContext { return s.right } 12586 12587 func (s *ArithmeticBinaryContext) SetLeft(v IValueExpressionContext) { s.left = v } 12588 12589 func (s *ArithmeticBinaryContext) SetRight(v IValueExpressionContext) { s.right = v } 12590 12591 func (s *ArithmeticBinaryContext) GetRuleContext() antlr.RuleContext { 12592 return s 12593 } 12594 12595 func (s *ArithmeticBinaryContext) AllValueExpression() []IValueExpressionContext { 12596 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem()) 12597 var tst = make([]IValueExpressionContext, len(ts)) 12598 12599 for i, t := range ts { 12600 if t != nil { 12601 tst[i] = t.(IValueExpressionContext) 12602 } 12603 } 12604 12605 return tst 12606 } 12607 12608 func (s *ArithmeticBinaryContext) ValueExpression(i int) IValueExpressionContext { 12609 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), i) 12610 12611 if t == nil { 12612 return nil 12613 } 12614 12615 return t.(IValueExpressionContext) 12616 } 12617 12618 func (s *ArithmeticBinaryContext) ASTERISK() antlr.TerminalNode { 12619 return s.GetToken(SqlBaseParserASTERISK, 0) 12620 } 12621 12622 func (s *ArithmeticBinaryContext) SLASH() antlr.TerminalNode { 12623 return s.GetToken(SqlBaseParserSLASH, 0) 12624 } 12625 12626 func (s *ArithmeticBinaryContext) PERCENT() antlr.TerminalNode { 12627 return s.GetToken(SqlBaseParserPERCENT, 0) 12628 } 12629 12630 func (s *ArithmeticBinaryContext) PLUS() antlr.TerminalNode { 12631 return s.GetToken(SqlBaseParserPLUS, 0) 12632 } 12633 12634 func (s *ArithmeticBinaryContext) MINUS() antlr.TerminalNode { 12635 return s.GetToken(SqlBaseParserMINUS, 0) 12636 } 12637 12638 func (s *ArithmeticBinaryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 12639 switch t := visitor.(type) { 12640 case SqlBaseVisitor: 12641 return t.VisitArithmeticBinary(s) 12642 12643 default: 12644 return t.VisitChildren(s) 12645 } 12646 } 12647 12648 type ArithmeticUnaryContext struct { 12649 *ValueExpressionContext 12650 operator antlr.Token 12651 } 12652 12653 func NewArithmeticUnaryContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArithmeticUnaryContext { 12654 var p = new(ArithmeticUnaryContext) 12655 12656 p.ValueExpressionContext = NewEmptyValueExpressionContext() 12657 p.parser = parser 12658 p.CopyFrom(ctx.(*ValueExpressionContext)) 12659 12660 return p 12661 } 12662 12663 func (s *ArithmeticUnaryContext) GetOperator() antlr.Token { return s.operator } 12664 12665 func (s *ArithmeticUnaryContext) SetOperator(v antlr.Token) { s.operator = v } 12666 12667 func (s *ArithmeticUnaryContext) GetRuleContext() antlr.RuleContext { 12668 return s 12669 } 12670 12671 func (s *ArithmeticUnaryContext) ValueExpression() IValueExpressionContext { 12672 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 12673 12674 if t == nil { 12675 return nil 12676 } 12677 12678 return t.(IValueExpressionContext) 12679 } 12680 12681 func (s *ArithmeticUnaryContext) MINUS() antlr.TerminalNode { 12682 return s.GetToken(SqlBaseParserMINUS, 0) 12683 } 12684 12685 func (s *ArithmeticUnaryContext) PLUS() antlr.TerminalNode { 12686 return s.GetToken(SqlBaseParserPLUS, 0) 12687 } 12688 12689 func (s *ArithmeticUnaryContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 12690 switch t := visitor.(type) { 12691 case SqlBaseVisitor: 12692 return t.VisitArithmeticUnary(s) 12693 12694 default: 12695 return t.VisitChildren(s) 12696 } 12697 } 12698 12699 type AtTimeZoneContext struct { 12700 *ValueExpressionContext 12701 } 12702 12703 func NewAtTimeZoneContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AtTimeZoneContext { 12704 var p = new(AtTimeZoneContext) 12705 12706 p.ValueExpressionContext = NewEmptyValueExpressionContext() 12707 p.parser = parser 12708 p.CopyFrom(ctx.(*ValueExpressionContext)) 12709 12710 return p 12711 } 12712 12713 func (s *AtTimeZoneContext) GetRuleContext() antlr.RuleContext { 12714 return s 12715 } 12716 12717 func (s *AtTimeZoneContext) ValueExpression() IValueExpressionContext { 12718 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 12719 12720 if t == nil { 12721 return nil 12722 } 12723 12724 return t.(IValueExpressionContext) 12725 } 12726 12727 func (s *AtTimeZoneContext) AT() antlr.TerminalNode { 12728 return s.GetToken(SqlBaseParserAT, 0) 12729 } 12730 12731 func (s *AtTimeZoneContext) TimeZoneSpecifier() ITimeZoneSpecifierContext { 12732 var t = s.GetTypedRuleContext(reflect.TypeOf((*ITimeZoneSpecifierContext)(nil)).Elem(), 0) 12733 12734 if t == nil { 12735 return nil 12736 } 12737 12738 return t.(ITimeZoneSpecifierContext) 12739 } 12740 12741 func (s *AtTimeZoneContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 12742 switch t := visitor.(type) { 12743 case SqlBaseVisitor: 12744 return t.VisitAtTimeZone(s) 12745 12746 default: 12747 return t.VisitChildren(s) 12748 } 12749 } 12750 12751 func (p *SqlBaseParser) ValueExpression() (localctx IValueExpressionContext) { 12752 return p.valueExpression(0) 12753 } 12754 12755 func (p *SqlBaseParser) valueExpression(_p int) (localctx IValueExpressionContext) { 12756 var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() 12757 _parentState := p.GetState() 12758 localctx = NewValueExpressionContext(p, p.GetParserRuleContext(), _parentState) 12759 var _prevctx IValueExpressionContext = localctx 12760 var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. 12761 _startState := 68 12762 p.EnterRecursionRule(localctx, 68, SqlBaseParserRULE_valueExpression, _p) 12763 var _la int 12764 12765 defer func() { 12766 p.UnrollRecursionContexts(_parentctx) 12767 }() 12768 12769 defer func() { 12770 if err := recover(); err != nil { 12771 if v, ok := err.(antlr.RecognitionException); ok { 12772 localctx.SetException(v) 12773 p.GetErrorHandler().ReportError(p, v) 12774 p.GetErrorHandler().Recover(p, v) 12775 } else { 12776 panic(err) 12777 } 12778 } 12779 }() 12780 12781 var _alt int 12782 12783 p.EnterOuterAlt(localctx, 1) 12784 p.SetState(972) 12785 p.GetErrorHandler().Sync(p) 12786 12787 switch p.GetTokenStream().LA(1) { 12788 case SqlBaseParserT__1, SqlBaseParserT__4, SqlBaseParserADD, SqlBaseParserALL, SqlBaseParserANALYZE, SqlBaseParserANY, SqlBaseParserARRAY, SqlBaseParserASC, SqlBaseParserAT, SqlBaseParserBERNOULLI, SqlBaseParserCALL, SqlBaseParserCASCADE, SqlBaseParserCASE, SqlBaseParserCAST, SqlBaseParserCATALOGS, SqlBaseParserCOALESCE, SqlBaseParserCOLUMN, SqlBaseParserCOLUMNS, SqlBaseParserCOMMENT, SqlBaseParserCOMMITTED, SqlBaseParserCURRENT, SqlBaseParserCURRENT_DATE, SqlBaseParserCURRENT_TIME, SqlBaseParserCURRENT_TIMESTAMP, SqlBaseParserCURRENT_USER, SqlBaseParserDATA, SqlBaseParserDATE, SqlBaseParserDAY, SqlBaseParserDESC, SqlBaseParserDISTRIBUTED, SqlBaseParserEXCLUDING, SqlBaseParserEXISTS, SqlBaseParserEXPLAIN, SqlBaseParserEXTRACT, SqlBaseParserFALSE, SqlBaseParserFILTER, SqlBaseParserFIRST, SqlBaseParserFOLLOWING, SqlBaseParserFORMAT, SqlBaseParserFUNCTIONS, SqlBaseParserGRANT, SqlBaseParserGRANTS, SqlBaseParserGRAPHVIZ, SqlBaseParserGROUPING, SqlBaseParserHOUR, SqlBaseParserIF, SqlBaseParserINCLUDING, SqlBaseParserINPUT, SqlBaseParserINTEGER, SqlBaseParserINTERVAL, SqlBaseParserLAST, SqlBaseParserLATERAL, SqlBaseParserLEVEL, SqlBaseParserLIMIT, SqlBaseParserLOCALTIME, SqlBaseParserLOCALTIMESTAMP, SqlBaseParserLOGICAL, SqlBaseParserMAP, SqlBaseParserMINUTE, SqlBaseParserMONTH, SqlBaseParserNFC, SqlBaseParserNFD, SqlBaseParserNFKC, SqlBaseParserNFKD, SqlBaseParserNO, SqlBaseParserNORMALIZE, SqlBaseParserNULL, SqlBaseParserNULLIF, SqlBaseParserNULLS, SqlBaseParserONLY, SqlBaseParserOPTION, SqlBaseParserORDINALITY, SqlBaseParserOUTPUT, SqlBaseParserOVER, SqlBaseParserPARTITION, SqlBaseParserPARTITIONS, SqlBaseParserPOSITION, SqlBaseParserPRECEDING, SqlBaseParserPRIVILEGES, SqlBaseParserPROPERTIES, SqlBaseParserPUBLIC, SqlBaseParserRANGE, SqlBaseParserREAD, SqlBaseParserRENAME, SqlBaseParserREPEATABLE, SqlBaseParserREPLACE, SqlBaseParserRESET, SqlBaseParserRESTRICT, SqlBaseParserREVOKE, SqlBaseParserROLLBACK, SqlBaseParserROW, SqlBaseParserROWS, SqlBaseParserSCHEMA, SqlBaseParserSCHEMAS, SqlBaseParserSECOND, SqlBaseParserSERIALIZABLE, SqlBaseParserSESSION, SqlBaseParserSET, SqlBaseParserSETS, SqlBaseParserSHOW, SqlBaseParserSMALLINT, SqlBaseParserSOME, SqlBaseParserSTART, SqlBaseParserSTATS, SqlBaseParserSUBSTRING, SqlBaseParserSYSTEM, SqlBaseParserTABLES, SqlBaseParserTABLESAMPLE, SqlBaseParserTEXT, SqlBaseParserTIME, SqlBaseParserTIMESTAMP, SqlBaseParserTINYINT, SqlBaseParserTO, SqlBaseParserTRUE, SqlBaseParserTRY_CAST, SqlBaseParserTYPE, SqlBaseParserUNBOUNDED, SqlBaseParserUNCOMMITTED, SqlBaseParserUSE, SqlBaseParserVALIDATE, SqlBaseParserVERBOSE, SqlBaseParserVIEW, SqlBaseParserWORK, SqlBaseParserWRITE, SqlBaseParserYEAR, SqlBaseParserZONE, SqlBaseParserSTRING, SqlBaseParserUNICODE_STRING, SqlBaseParserBINARY_LITERAL, SqlBaseParserINTEGER_VALUE, SqlBaseParserDECIMAL_VALUE, SqlBaseParserDOUBLE_VALUE, SqlBaseParserIDENTIFIER, SqlBaseParserDIGIT_IDENTIFIER, SqlBaseParserQUOTED_IDENTIFIER, SqlBaseParserBACKQUOTED_IDENTIFIER, SqlBaseParserDOUBLE_PRECISION, SqlBaseParserCOMMIT, SqlBaseParserISOLATION, SqlBaseParserTRANSACTION: 12789 localctx = NewValueExpressionDefaultContext(p, localctx) 12790 p.SetParserRuleContext(localctx) 12791 _prevctx = localctx 12792 12793 { 12794 p.SetState(969) 12795 p.primaryExpression(0) 12796 } 12797 12798 case SqlBaseParserPLUS, SqlBaseParserMINUS: 12799 localctx = NewArithmeticUnaryContext(p, localctx) 12800 p.SetParserRuleContext(localctx) 12801 _prevctx = localctx 12802 { 12803 p.SetState(970) 12804 12805 var _lt = p.GetTokenStream().LT(1) 12806 12807 localctx.(*ArithmeticUnaryContext).operator = _lt 12808 12809 _la = p.GetTokenStream().LA(1) 12810 12811 if !(_la == SqlBaseParserPLUS || _la == SqlBaseParserMINUS) { 12812 var _ri = p.GetErrorHandler().RecoverInline(p) 12813 12814 localctx.(*ArithmeticUnaryContext).operator = _ri 12815 } else { 12816 p.GetErrorHandler().ReportMatch(p) 12817 p.Consume() 12818 } 12819 } 12820 { 12821 p.SetState(971) 12822 p.valueExpression(4) 12823 } 12824 12825 default: 12826 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 12827 } 12828 p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) 12829 p.SetState(988) 12830 p.GetErrorHandler().Sync(p) 12831 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 125, p.GetParserRuleContext()) 12832 12833 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 12834 if _alt == 1 { 12835 if p.GetParseListeners() != nil { 12836 p.TriggerExitRuleEvent() 12837 } 12838 _prevctx = localctx 12839 p.SetState(986) 12840 p.GetErrorHandler().Sync(p) 12841 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 124, p.GetParserRuleContext()) { 12842 case 1: 12843 localctx = NewArithmeticBinaryContext(p, NewValueExpressionContext(p, _parentctx, _parentState)) 12844 localctx.(*ArithmeticBinaryContext).left = _prevctx 12845 12846 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_valueExpression) 12847 p.SetState(974) 12848 12849 if !(p.Precpred(p.GetParserRuleContext(), 3)) { 12850 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) 12851 } 12852 { 12853 p.SetState(975) 12854 12855 var _lt = p.GetTokenStream().LT(1) 12856 12857 localctx.(*ArithmeticBinaryContext).operator = _lt 12858 12859 _la = p.GetTokenStream().LA(1) 12860 12861 if !(((_la-196)&-(0x1f+1)) == 0 && ((1<<uint((_la-196)))&((1<<(SqlBaseParserASTERISK-196))|(1<<(SqlBaseParserSLASH-196))|(1<<(SqlBaseParserPERCENT-196)))) != 0) { 12862 var _ri = p.GetErrorHandler().RecoverInline(p) 12863 12864 localctx.(*ArithmeticBinaryContext).operator = _ri 12865 } else { 12866 p.GetErrorHandler().ReportMatch(p) 12867 p.Consume() 12868 } 12869 } 12870 { 12871 p.SetState(976) 12872 12873 var _x = p.valueExpression(4) 12874 12875 localctx.(*ArithmeticBinaryContext).right = _x 12876 } 12877 12878 case 2: 12879 localctx = NewArithmeticBinaryContext(p, NewValueExpressionContext(p, _parentctx, _parentState)) 12880 localctx.(*ArithmeticBinaryContext).left = _prevctx 12881 12882 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_valueExpression) 12883 p.SetState(977) 12884 12885 if !(p.Precpred(p.GetParserRuleContext(), 2)) { 12886 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) 12887 } 12888 { 12889 p.SetState(978) 12890 12891 var _lt = p.GetTokenStream().LT(1) 12892 12893 localctx.(*ArithmeticBinaryContext).operator = _lt 12894 12895 _la = p.GetTokenStream().LA(1) 12896 12897 if !(_la == SqlBaseParserPLUS || _la == SqlBaseParserMINUS) { 12898 var _ri = p.GetErrorHandler().RecoverInline(p) 12899 12900 localctx.(*ArithmeticBinaryContext).operator = _ri 12901 } else { 12902 p.GetErrorHandler().ReportMatch(p) 12903 p.Consume() 12904 } 12905 } 12906 { 12907 p.SetState(979) 12908 12909 var _x = p.valueExpression(3) 12910 12911 localctx.(*ArithmeticBinaryContext).right = _x 12912 } 12913 12914 case 3: 12915 localctx = NewConcatenationContext(p, NewValueExpressionContext(p, _parentctx, _parentState)) 12916 localctx.(*ConcatenationContext).left = _prevctx 12917 12918 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_valueExpression) 12919 p.SetState(980) 12920 12921 if !(p.Precpred(p.GetParserRuleContext(), 1)) { 12922 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) 12923 } 12924 { 12925 p.SetState(981) 12926 p.Match(SqlBaseParserCONCAT) 12927 } 12928 { 12929 p.SetState(982) 12930 12931 var _x = p.valueExpression(2) 12932 12933 localctx.(*ConcatenationContext).right = _x 12934 } 12935 12936 case 4: 12937 localctx = NewAtTimeZoneContext(p, NewValueExpressionContext(p, _parentctx, _parentState)) 12938 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_valueExpression) 12939 p.SetState(983) 12940 12941 if !(p.Precpred(p.GetParserRuleContext(), 5)) { 12942 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 5)", "")) 12943 } 12944 { 12945 p.SetState(984) 12946 p.Match(SqlBaseParserAT) 12947 } 12948 { 12949 p.SetState(985) 12950 p.TimeZoneSpecifier() 12951 } 12952 12953 } 12954 12955 } 12956 p.SetState(990) 12957 p.GetErrorHandler().Sync(p) 12958 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 125, p.GetParserRuleContext()) 12959 } 12960 12961 return localctx 12962 } 12963 12964 // IPrimaryExpressionContext is an interface to support dynamic dispatch. 12965 type IPrimaryExpressionContext interface { 12966 antlr.ParserRuleContext 12967 12968 // GetParser returns the parser. 12969 GetParser() antlr.Parser 12970 12971 // IsPrimaryExpressionContext differentiates from other interfaces. 12972 IsPrimaryExpressionContext() 12973 } 12974 12975 type PrimaryExpressionContext struct { 12976 *antlr.BaseParserRuleContext 12977 parser antlr.Parser 12978 } 12979 12980 func NewEmptyPrimaryExpressionContext() *PrimaryExpressionContext { 12981 var p = new(PrimaryExpressionContext) 12982 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 12983 p.RuleIndex = SqlBaseParserRULE_primaryExpression 12984 return p 12985 } 12986 12987 func (*PrimaryExpressionContext) IsPrimaryExpressionContext() {} 12988 12989 func NewPrimaryExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PrimaryExpressionContext { 12990 var p = new(PrimaryExpressionContext) 12991 12992 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 12993 12994 p.parser = parser 12995 p.RuleIndex = SqlBaseParserRULE_primaryExpression 12996 12997 return p 12998 } 12999 13000 func (s *PrimaryExpressionContext) GetParser() antlr.Parser { return s.parser } 13001 13002 func (s *PrimaryExpressionContext) CopyFrom(ctx *PrimaryExpressionContext) { 13003 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 13004 } 13005 13006 func (s *PrimaryExpressionContext) GetRuleContext() antlr.RuleContext { 13007 return s 13008 } 13009 13010 func (s *PrimaryExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 13011 return antlr.TreesStringTree(s, ruleNames, recog) 13012 } 13013 13014 type DereferenceContext struct { 13015 *PrimaryExpressionContext 13016 base IPrimaryExpressionContext 13017 fieldName IIdentifierContext 13018 } 13019 13020 func NewDereferenceContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DereferenceContext { 13021 var p = new(DereferenceContext) 13022 13023 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13024 p.parser = parser 13025 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13026 13027 return p 13028 } 13029 13030 func (s *DereferenceContext) GetBase() IPrimaryExpressionContext { return s.base } 13031 13032 func (s *DereferenceContext) GetFieldName() IIdentifierContext { return s.fieldName } 13033 13034 func (s *DereferenceContext) SetBase(v IPrimaryExpressionContext) { s.base = v } 13035 13036 func (s *DereferenceContext) SetFieldName(v IIdentifierContext) { s.fieldName = v } 13037 13038 func (s *DereferenceContext) GetRuleContext() antlr.RuleContext { 13039 return s 13040 } 13041 13042 func (s *DereferenceContext) PrimaryExpression() IPrimaryExpressionContext { 13043 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPrimaryExpressionContext)(nil)).Elem(), 0) 13044 13045 if t == nil { 13046 return nil 13047 } 13048 13049 return t.(IPrimaryExpressionContext) 13050 } 13051 13052 func (s *DereferenceContext) Identifier() IIdentifierContext { 13053 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 13054 13055 if t == nil { 13056 return nil 13057 } 13058 13059 return t.(IIdentifierContext) 13060 } 13061 13062 func (s *DereferenceContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13063 switch t := visitor.(type) { 13064 case SqlBaseVisitor: 13065 return t.VisitDereference(s) 13066 13067 default: 13068 return t.VisitChildren(s) 13069 } 13070 } 13071 13072 type TypeConstructorContext struct { 13073 *PrimaryExpressionContext 13074 } 13075 13076 func NewTypeConstructorContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TypeConstructorContext { 13077 var p = new(TypeConstructorContext) 13078 13079 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13080 p.parser = parser 13081 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13082 13083 return p 13084 } 13085 13086 func (s *TypeConstructorContext) GetRuleContext() antlr.RuleContext { 13087 return s 13088 } 13089 13090 func (s *TypeConstructorContext) Identifier() IIdentifierContext { 13091 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 13092 13093 if t == nil { 13094 return nil 13095 } 13096 13097 return t.(IIdentifierContext) 13098 } 13099 13100 func (s *TypeConstructorContext) Sql_string() ISql_stringContext { 13101 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), 0) 13102 13103 if t == nil { 13104 return nil 13105 } 13106 13107 return t.(ISql_stringContext) 13108 } 13109 13110 func (s *TypeConstructorContext) DOUBLE_PRECISION() antlr.TerminalNode { 13111 return s.GetToken(SqlBaseParserDOUBLE_PRECISION, 0) 13112 } 13113 13114 func (s *TypeConstructorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13115 switch t := visitor.(type) { 13116 case SqlBaseVisitor: 13117 return t.VisitTypeConstructor(s) 13118 13119 default: 13120 return t.VisitChildren(s) 13121 } 13122 } 13123 13124 type SpecialDateTimeFunctionContext struct { 13125 *PrimaryExpressionContext 13126 name antlr.Token 13127 precision antlr.Token 13128 } 13129 13130 func NewSpecialDateTimeFunctionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SpecialDateTimeFunctionContext { 13131 var p = new(SpecialDateTimeFunctionContext) 13132 13133 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13134 p.parser = parser 13135 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13136 13137 return p 13138 } 13139 13140 func (s *SpecialDateTimeFunctionContext) GetName() antlr.Token { return s.name } 13141 13142 func (s *SpecialDateTimeFunctionContext) GetPrecision() antlr.Token { return s.precision } 13143 13144 func (s *SpecialDateTimeFunctionContext) SetName(v antlr.Token) { s.name = v } 13145 13146 func (s *SpecialDateTimeFunctionContext) SetPrecision(v antlr.Token) { s.precision = v } 13147 13148 func (s *SpecialDateTimeFunctionContext) GetRuleContext() antlr.RuleContext { 13149 return s 13150 } 13151 13152 func (s *SpecialDateTimeFunctionContext) CURRENT_DATE() antlr.TerminalNode { 13153 return s.GetToken(SqlBaseParserCURRENT_DATE, 0) 13154 } 13155 13156 func (s *SpecialDateTimeFunctionContext) CURRENT_TIME() antlr.TerminalNode { 13157 return s.GetToken(SqlBaseParserCURRENT_TIME, 0) 13158 } 13159 13160 func (s *SpecialDateTimeFunctionContext) INTEGER_VALUE() antlr.TerminalNode { 13161 return s.GetToken(SqlBaseParserINTEGER_VALUE, 0) 13162 } 13163 13164 func (s *SpecialDateTimeFunctionContext) CURRENT_TIMESTAMP() antlr.TerminalNode { 13165 return s.GetToken(SqlBaseParserCURRENT_TIMESTAMP, 0) 13166 } 13167 13168 func (s *SpecialDateTimeFunctionContext) LOCALTIME() antlr.TerminalNode { 13169 return s.GetToken(SqlBaseParserLOCALTIME, 0) 13170 } 13171 13172 func (s *SpecialDateTimeFunctionContext) LOCALTIMESTAMP() antlr.TerminalNode { 13173 return s.GetToken(SqlBaseParserLOCALTIMESTAMP, 0) 13174 } 13175 13176 func (s *SpecialDateTimeFunctionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13177 switch t := visitor.(type) { 13178 case SqlBaseVisitor: 13179 return t.VisitSpecialDateTimeFunction(s) 13180 13181 default: 13182 return t.VisitChildren(s) 13183 } 13184 } 13185 13186 type SubstringContext struct { 13187 *PrimaryExpressionContext 13188 } 13189 13190 func NewSubstringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SubstringContext { 13191 var p = new(SubstringContext) 13192 13193 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13194 p.parser = parser 13195 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13196 13197 return p 13198 } 13199 13200 func (s *SubstringContext) GetRuleContext() antlr.RuleContext { 13201 return s 13202 } 13203 13204 func (s *SubstringContext) SUBSTRING() antlr.TerminalNode { 13205 return s.GetToken(SqlBaseParserSUBSTRING, 0) 13206 } 13207 13208 func (s *SubstringContext) AllValueExpression() []IValueExpressionContext { 13209 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem()) 13210 var tst = make([]IValueExpressionContext, len(ts)) 13211 13212 for i, t := range ts { 13213 if t != nil { 13214 tst[i] = t.(IValueExpressionContext) 13215 } 13216 } 13217 13218 return tst 13219 } 13220 13221 func (s *SubstringContext) ValueExpression(i int) IValueExpressionContext { 13222 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), i) 13223 13224 if t == nil { 13225 return nil 13226 } 13227 13228 return t.(IValueExpressionContext) 13229 } 13230 13231 func (s *SubstringContext) FROM() antlr.TerminalNode { 13232 return s.GetToken(SqlBaseParserFROM, 0) 13233 } 13234 13235 func (s *SubstringContext) FOR() antlr.TerminalNode { 13236 return s.GetToken(SqlBaseParserFOR, 0) 13237 } 13238 13239 func (s *SubstringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13240 switch t := visitor.(type) { 13241 case SqlBaseVisitor: 13242 return t.VisitSubstring(s) 13243 13244 default: 13245 return t.VisitChildren(s) 13246 } 13247 } 13248 13249 type CastContext struct { 13250 *PrimaryExpressionContext 13251 } 13252 13253 func NewCastContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CastContext { 13254 var p = new(CastContext) 13255 13256 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13257 p.parser = parser 13258 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13259 13260 return p 13261 } 13262 13263 func (s *CastContext) GetRuleContext() antlr.RuleContext { 13264 return s 13265 } 13266 13267 func (s *CastContext) CAST() antlr.TerminalNode { 13268 return s.GetToken(SqlBaseParserCAST, 0) 13269 } 13270 13271 func (s *CastContext) Expression() IExpressionContext { 13272 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 13273 13274 if t == nil { 13275 return nil 13276 } 13277 13278 return t.(IExpressionContext) 13279 } 13280 13281 func (s *CastContext) AS() antlr.TerminalNode { 13282 return s.GetToken(SqlBaseParserAS, 0) 13283 } 13284 13285 func (s *CastContext) Sqltype() ISqltypeContext { 13286 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISqltypeContext)(nil)).Elem(), 0) 13287 13288 if t == nil { 13289 return nil 13290 } 13291 13292 return t.(ISqltypeContext) 13293 } 13294 13295 func (s *CastContext) TRY_CAST() antlr.TerminalNode { 13296 return s.GetToken(SqlBaseParserTRY_CAST, 0) 13297 } 13298 13299 func (s *CastContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13300 switch t := visitor.(type) { 13301 case SqlBaseVisitor: 13302 return t.VisitCast(s) 13303 13304 default: 13305 return t.VisitChildren(s) 13306 } 13307 } 13308 13309 type LambdaContext struct { 13310 *PrimaryExpressionContext 13311 } 13312 13313 func NewLambdaContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LambdaContext { 13314 var p = new(LambdaContext) 13315 13316 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13317 p.parser = parser 13318 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13319 13320 return p 13321 } 13322 13323 func (s *LambdaContext) GetRuleContext() antlr.RuleContext { 13324 return s 13325 } 13326 13327 func (s *LambdaContext) AllIdentifier() []IIdentifierContext { 13328 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIdentifierContext)(nil)).Elem()) 13329 var tst = make([]IIdentifierContext, len(ts)) 13330 13331 for i, t := range ts { 13332 if t != nil { 13333 tst[i] = t.(IIdentifierContext) 13334 } 13335 } 13336 13337 return tst 13338 } 13339 13340 func (s *LambdaContext) Identifier(i int) IIdentifierContext { 13341 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), i) 13342 13343 if t == nil { 13344 return nil 13345 } 13346 13347 return t.(IIdentifierContext) 13348 } 13349 13350 func (s *LambdaContext) Expression() IExpressionContext { 13351 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 13352 13353 if t == nil { 13354 return nil 13355 } 13356 13357 return t.(IExpressionContext) 13358 } 13359 13360 func (s *LambdaContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13361 switch t := visitor.(type) { 13362 case SqlBaseVisitor: 13363 return t.VisitLambda(s) 13364 13365 default: 13366 return t.VisitChildren(s) 13367 } 13368 } 13369 13370 type ParenthesizedExpressionContext struct { 13371 *PrimaryExpressionContext 13372 } 13373 13374 func NewParenthesizedExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ParenthesizedExpressionContext { 13375 var p = new(ParenthesizedExpressionContext) 13376 13377 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13378 p.parser = parser 13379 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13380 13381 return p 13382 } 13383 13384 func (s *ParenthesizedExpressionContext) GetRuleContext() antlr.RuleContext { 13385 return s 13386 } 13387 13388 func (s *ParenthesizedExpressionContext) Expression() IExpressionContext { 13389 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 13390 13391 if t == nil { 13392 return nil 13393 } 13394 13395 return t.(IExpressionContext) 13396 } 13397 13398 func (s *ParenthesizedExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13399 switch t := visitor.(type) { 13400 case SqlBaseVisitor: 13401 return t.VisitParenthesizedExpression(s) 13402 13403 default: 13404 return t.VisitChildren(s) 13405 } 13406 } 13407 13408 type ParameterContext struct { 13409 *PrimaryExpressionContext 13410 } 13411 13412 func NewParameterContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ParameterContext { 13413 var p = new(ParameterContext) 13414 13415 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13416 p.parser = parser 13417 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13418 13419 return p 13420 } 13421 13422 func (s *ParameterContext) GetRuleContext() antlr.RuleContext { 13423 return s 13424 } 13425 13426 func (s *ParameterContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13427 switch t := visitor.(type) { 13428 case SqlBaseVisitor: 13429 return t.VisitParameter(s) 13430 13431 default: 13432 return t.VisitChildren(s) 13433 } 13434 } 13435 13436 type NormalizeContext struct { 13437 *PrimaryExpressionContext 13438 } 13439 13440 func NewNormalizeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NormalizeContext { 13441 var p = new(NormalizeContext) 13442 13443 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13444 p.parser = parser 13445 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13446 13447 return p 13448 } 13449 13450 func (s *NormalizeContext) GetRuleContext() antlr.RuleContext { 13451 return s 13452 } 13453 13454 func (s *NormalizeContext) NORMALIZE() antlr.TerminalNode { 13455 return s.GetToken(SqlBaseParserNORMALIZE, 0) 13456 } 13457 13458 func (s *NormalizeContext) ValueExpression() IValueExpressionContext { 13459 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 13460 13461 if t == nil { 13462 return nil 13463 } 13464 13465 return t.(IValueExpressionContext) 13466 } 13467 13468 func (s *NormalizeContext) NormalForm() INormalFormContext { 13469 var t = s.GetTypedRuleContext(reflect.TypeOf((*INormalFormContext)(nil)).Elem(), 0) 13470 13471 if t == nil { 13472 return nil 13473 } 13474 13475 return t.(INormalFormContext) 13476 } 13477 13478 func (s *NormalizeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13479 switch t := visitor.(type) { 13480 case SqlBaseVisitor: 13481 return t.VisitNormalize(s) 13482 13483 default: 13484 return t.VisitChildren(s) 13485 } 13486 } 13487 13488 type IntervalLiteralContext struct { 13489 *PrimaryExpressionContext 13490 } 13491 13492 func NewIntervalLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntervalLiteralContext { 13493 var p = new(IntervalLiteralContext) 13494 13495 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13496 p.parser = parser 13497 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13498 13499 return p 13500 } 13501 13502 func (s *IntervalLiteralContext) GetRuleContext() antlr.RuleContext { 13503 return s 13504 } 13505 13506 func (s *IntervalLiteralContext) Interval() IIntervalContext { 13507 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIntervalContext)(nil)).Elem(), 0) 13508 13509 if t == nil { 13510 return nil 13511 } 13512 13513 return t.(IIntervalContext) 13514 } 13515 13516 func (s *IntervalLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13517 switch t := visitor.(type) { 13518 case SqlBaseVisitor: 13519 return t.VisitIntervalLiteral(s) 13520 13521 default: 13522 return t.VisitChildren(s) 13523 } 13524 } 13525 13526 type NumericLiteralContext struct { 13527 *PrimaryExpressionContext 13528 } 13529 13530 func NewNumericLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NumericLiteralContext { 13531 var p = new(NumericLiteralContext) 13532 13533 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13534 p.parser = parser 13535 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13536 13537 return p 13538 } 13539 13540 func (s *NumericLiteralContext) GetRuleContext() antlr.RuleContext { 13541 return s 13542 } 13543 13544 func (s *NumericLiteralContext) Number() INumberContext { 13545 var t = s.GetTypedRuleContext(reflect.TypeOf((*INumberContext)(nil)).Elem(), 0) 13546 13547 if t == nil { 13548 return nil 13549 } 13550 13551 return t.(INumberContext) 13552 } 13553 13554 func (s *NumericLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13555 switch t := visitor.(type) { 13556 case SqlBaseVisitor: 13557 return t.VisitNumericLiteral(s) 13558 13559 default: 13560 return t.VisitChildren(s) 13561 } 13562 } 13563 13564 type BooleanLiteralContext struct { 13565 *PrimaryExpressionContext 13566 } 13567 13568 func NewBooleanLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BooleanLiteralContext { 13569 var p = new(BooleanLiteralContext) 13570 13571 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13572 p.parser = parser 13573 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13574 13575 return p 13576 } 13577 13578 func (s *BooleanLiteralContext) GetRuleContext() antlr.RuleContext { 13579 return s 13580 } 13581 13582 func (s *BooleanLiteralContext) BooleanValue() IBooleanValueContext { 13583 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanValueContext)(nil)).Elem(), 0) 13584 13585 if t == nil { 13586 return nil 13587 } 13588 13589 return t.(IBooleanValueContext) 13590 } 13591 13592 func (s *BooleanLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13593 switch t := visitor.(type) { 13594 case SqlBaseVisitor: 13595 return t.VisitBooleanLiteral(s) 13596 13597 default: 13598 return t.VisitChildren(s) 13599 } 13600 } 13601 13602 type SimpleCaseContext struct { 13603 *PrimaryExpressionContext 13604 elseExpression IExpressionContext 13605 } 13606 13607 func NewSimpleCaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SimpleCaseContext { 13608 var p = new(SimpleCaseContext) 13609 13610 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13611 p.parser = parser 13612 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13613 13614 return p 13615 } 13616 13617 func (s *SimpleCaseContext) GetElseExpression() IExpressionContext { return s.elseExpression } 13618 13619 func (s *SimpleCaseContext) SetElseExpression(v IExpressionContext) { s.elseExpression = v } 13620 13621 func (s *SimpleCaseContext) GetRuleContext() antlr.RuleContext { 13622 return s 13623 } 13624 13625 func (s *SimpleCaseContext) CASE() antlr.TerminalNode { 13626 return s.GetToken(SqlBaseParserCASE, 0) 13627 } 13628 13629 func (s *SimpleCaseContext) ValueExpression() IValueExpressionContext { 13630 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 13631 13632 if t == nil { 13633 return nil 13634 } 13635 13636 return t.(IValueExpressionContext) 13637 } 13638 13639 func (s *SimpleCaseContext) END() antlr.TerminalNode { 13640 return s.GetToken(SqlBaseParserEND, 0) 13641 } 13642 13643 func (s *SimpleCaseContext) AllWhenClause() []IWhenClauseContext { 13644 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IWhenClauseContext)(nil)).Elem()) 13645 var tst = make([]IWhenClauseContext, len(ts)) 13646 13647 for i, t := range ts { 13648 if t != nil { 13649 tst[i] = t.(IWhenClauseContext) 13650 } 13651 } 13652 13653 return tst 13654 } 13655 13656 func (s *SimpleCaseContext) WhenClause(i int) IWhenClauseContext { 13657 var t = s.GetTypedRuleContext(reflect.TypeOf((*IWhenClauseContext)(nil)).Elem(), i) 13658 13659 if t == nil { 13660 return nil 13661 } 13662 13663 return t.(IWhenClauseContext) 13664 } 13665 13666 func (s *SimpleCaseContext) ELSE() antlr.TerminalNode { 13667 return s.GetToken(SqlBaseParserELSE, 0) 13668 } 13669 13670 func (s *SimpleCaseContext) Expression() IExpressionContext { 13671 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 13672 13673 if t == nil { 13674 return nil 13675 } 13676 13677 return t.(IExpressionContext) 13678 } 13679 13680 func (s *SimpleCaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13681 switch t := visitor.(type) { 13682 case SqlBaseVisitor: 13683 return t.VisitSimpleCase(s) 13684 13685 default: 13686 return t.VisitChildren(s) 13687 } 13688 } 13689 13690 type ColumnReferenceContext struct { 13691 *PrimaryExpressionContext 13692 } 13693 13694 func NewColumnReferenceContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ColumnReferenceContext { 13695 var p = new(ColumnReferenceContext) 13696 13697 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13698 p.parser = parser 13699 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13700 13701 return p 13702 } 13703 13704 func (s *ColumnReferenceContext) GetRuleContext() antlr.RuleContext { 13705 return s 13706 } 13707 13708 func (s *ColumnReferenceContext) Identifier() IIdentifierContext { 13709 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 13710 13711 if t == nil { 13712 return nil 13713 } 13714 13715 return t.(IIdentifierContext) 13716 } 13717 13718 func (s *ColumnReferenceContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13719 switch t := visitor.(type) { 13720 case SqlBaseVisitor: 13721 return t.VisitColumnReference(s) 13722 13723 default: 13724 return t.VisitChildren(s) 13725 } 13726 } 13727 13728 type NullLiteralContext struct { 13729 *PrimaryExpressionContext 13730 } 13731 13732 func NewNullLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullLiteralContext { 13733 var p = new(NullLiteralContext) 13734 13735 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13736 p.parser = parser 13737 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13738 13739 return p 13740 } 13741 13742 func (s *NullLiteralContext) GetRuleContext() antlr.RuleContext { 13743 return s 13744 } 13745 13746 func (s *NullLiteralContext) NULL() antlr.TerminalNode { 13747 return s.GetToken(SqlBaseParserNULL, 0) 13748 } 13749 13750 func (s *NullLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13751 switch t := visitor.(type) { 13752 case SqlBaseVisitor: 13753 return t.VisitNullLiteral(s) 13754 13755 default: 13756 return t.VisitChildren(s) 13757 } 13758 } 13759 13760 type RowConstructorContext struct { 13761 *PrimaryExpressionContext 13762 } 13763 13764 func NewRowConstructorContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RowConstructorContext { 13765 var p = new(RowConstructorContext) 13766 13767 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13768 p.parser = parser 13769 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13770 13771 return p 13772 } 13773 13774 func (s *RowConstructorContext) GetRuleContext() antlr.RuleContext { 13775 return s 13776 } 13777 13778 func (s *RowConstructorContext) AllExpression() []IExpressionContext { 13779 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 13780 var tst = make([]IExpressionContext, len(ts)) 13781 13782 for i, t := range ts { 13783 if t != nil { 13784 tst[i] = t.(IExpressionContext) 13785 } 13786 } 13787 13788 return tst 13789 } 13790 13791 func (s *RowConstructorContext) Expression(i int) IExpressionContext { 13792 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 13793 13794 if t == nil { 13795 return nil 13796 } 13797 13798 return t.(IExpressionContext) 13799 } 13800 13801 func (s *RowConstructorContext) ROW() antlr.TerminalNode { 13802 return s.GetToken(SqlBaseParserROW, 0) 13803 } 13804 13805 func (s *RowConstructorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13806 switch t := visitor.(type) { 13807 case SqlBaseVisitor: 13808 return t.VisitRowConstructor(s) 13809 13810 default: 13811 return t.VisitChildren(s) 13812 } 13813 } 13814 13815 type SubscriptContext struct { 13816 *PrimaryExpressionContext 13817 value IPrimaryExpressionContext 13818 index IValueExpressionContext 13819 } 13820 13821 func NewSubscriptContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SubscriptContext { 13822 var p = new(SubscriptContext) 13823 13824 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13825 p.parser = parser 13826 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13827 13828 return p 13829 } 13830 13831 func (s *SubscriptContext) GetValue() IPrimaryExpressionContext { return s.value } 13832 13833 func (s *SubscriptContext) GetIndex() IValueExpressionContext { return s.index } 13834 13835 func (s *SubscriptContext) SetValue(v IPrimaryExpressionContext) { s.value = v } 13836 13837 func (s *SubscriptContext) SetIndex(v IValueExpressionContext) { s.index = v } 13838 13839 func (s *SubscriptContext) GetRuleContext() antlr.RuleContext { 13840 return s 13841 } 13842 13843 func (s *SubscriptContext) PrimaryExpression() IPrimaryExpressionContext { 13844 var t = s.GetTypedRuleContext(reflect.TypeOf((*IPrimaryExpressionContext)(nil)).Elem(), 0) 13845 13846 if t == nil { 13847 return nil 13848 } 13849 13850 return t.(IPrimaryExpressionContext) 13851 } 13852 13853 func (s *SubscriptContext) ValueExpression() IValueExpressionContext { 13854 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 13855 13856 if t == nil { 13857 return nil 13858 } 13859 13860 return t.(IValueExpressionContext) 13861 } 13862 13863 func (s *SubscriptContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13864 switch t := visitor.(type) { 13865 case SqlBaseVisitor: 13866 return t.VisitSubscript(s) 13867 13868 default: 13869 return t.VisitChildren(s) 13870 } 13871 } 13872 13873 type SubqueryExpressionContext struct { 13874 *PrimaryExpressionContext 13875 } 13876 13877 func NewSubqueryExpressionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SubqueryExpressionContext { 13878 var p = new(SubqueryExpressionContext) 13879 13880 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13881 p.parser = parser 13882 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13883 13884 return p 13885 } 13886 13887 func (s *SubqueryExpressionContext) GetRuleContext() antlr.RuleContext { 13888 return s 13889 } 13890 13891 func (s *SubqueryExpressionContext) Query() IQueryContext { 13892 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 13893 13894 if t == nil { 13895 return nil 13896 } 13897 13898 return t.(IQueryContext) 13899 } 13900 13901 func (s *SubqueryExpressionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13902 switch t := visitor.(type) { 13903 case SqlBaseVisitor: 13904 return t.VisitSubqueryExpression(s) 13905 13906 default: 13907 return t.VisitChildren(s) 13908 } 13909 } 13910 13911 type BinaryLiteralContext struct { 13912 *PrimaryExpressionContext 13913 } 13914 13915 func NewBinaryLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BinaryLiteralContext { 13916 var p = new(BinaryLiteralContext) 13917 13918 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13919 p.parser = parser 13920 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13921 13922 return p 13923 } 13924 13925 func (s *BinaryLiteralContext) GetRuleContext() antlr.RuleContext { 13926 return s 13927 } 13928 13929 func (s *BinaryLiteralContext) BINARY_LITERAL() antlr.TerminalNode { 13930 return s.GetToken(SqlBaseParserBINARY_LITERAL, 0) 13931 } 13932 13933 func (s *BinaryLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13934 switch t := visitor.(type) { 13935 case SqlBaseVisitor: 13936 return t.VisitBinaryLiteral(s) 13937 13938 default: 13939 return t.VisitChildren(s) 13940 } 13941 } 13942 13943 type CurrentUserContext struct { 13944 *PrimaryExpressionContext 13945 name antlr.Token 13946 } 13947 13948 func NewCurrentUserContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CurrentUserContext { 13949 var p = new(CurrentUserContext) 13950 13951 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13952 p.parser = parser 13953 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13954 13955 return p 13956 } 13957 13958 func (s *CurrentUserContext) GetName() antlr.Token { return s.name } 13959 13960 func (s *CurrentUserContext) SetName(v antlr.Token) { s.name = v } 13961 13962 func (s *CurrentUserContext) GetRuleContext() antlr.RuleContext { 13963 return s 13964 } 13965 13966 func (s *CurrentUserContext) CURRENT_USER() antlr.TerminalNode { 13967 return s.GetToken(SqlBaseParserCURRENT_USER, 0) 13968 } 13969 13970 func (s *CurrentUserContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 13971 switch t := visitor.(type) { 13972 case SqlBaseVisitor: 13973 return t.VisitCurrentUser(s) 13974 13975 default: 13976 return t.VisitChildren(s) 13977 } 13978 } 13979 13980 type ExtractContext struct { 13981 *PrimaryExpressionContext 13982 } 13983 13984 func NewExtractContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExtractContext { 13985 var p = new(ExtractContext) 13986 13987 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 13988 p.parser = parser 13989 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 13990 13991 return p 13992 } 13993 13994 func (s *ExtractContext) GetRuleContext() antlr.RuleContext { 13995 return s 13996 } 13997 13998 func (s *ExtractContext) EXTRACT() antlr.TerminalNode { 13999 return s.GetToken(SqlBaseParserEXTRACT, 0) 14000 } 14001 14002 func (s *ExtractContext) Identifier() IIdentifierContext { 14003 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 14004 14005 if t == nil { 14006 return nil 14007 } 14008 14009 return t.(IIdentifierContext) 14010 } 14011 14012 func (s *ExtractContext) FROM() antlr.TerminalNode { 14013 return s.GetToken(SqlBaseParserFROM, 0) 14014 } 14015 14016 func (s *ExtractContext) ValueExpression() IValueExpressionContext { 14017 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), 0) 14018 14019 if t == nil { 14020 return nil 14021 } 14022 14023 return t.(IValueExpressionContext) 14024 } 14025 14026 func (s *ExtractContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 14027 switch t := visitor.(type) { 14028 case SqlBaseVisitor: 14029 return t.VisitExtract(s) 14030 14031 default: 14032 return t.VisitChildren(s) 14033 } 14034 } 14035 14036 type StringLiteralContext struct { 14037 *PrimaryExpressionContext 14038 } 14039 14040 func NewStringLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringLiteralContext { 14041 var p = new(StringLiteralContext) 14042 14043 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 14044 p.parser = parser 14045 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 14046 14047 return p 14048 } 14049 14050 func (s *StringLiteralContext) GetRuleContext() antlr.RuleContext { 14051 return s 14052 } 14053 14054 func (s *StringLiteralContext) Sql_string() ISql_stringContext { 14055 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), 0) 14056 14057 if t == nil { 14058 return nil 14059 } 14060 14061 return t.(ISql_stringContext) 14062 } 14063 14064 func (s *StringLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 14065 switch t := visitor.(type) { 14066 case SqlBaseVisitor: 14067 return t.VisitStringLiteral(s) 14068 14069 default: 14070 return t.VisitChildren(s) 14071 } 14072 } 14073 14074 type ArrayConstructorContext struct { 14075 *PrimaryExpressionContext 14076 } 14077 14078 func NewArrayConstructorContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArrayConstructorContext { 14079 var p = new(ArrayConstructorContext) 14080 14081 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 14082 p.parser = parser 14083 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 14084 14085 return p 14086 } 14087 14088 func (s *ArrayConstructorContext) GetRuleContext() antlr.RuleContext { 14089 return s 14090 } 14091 14092 func (s *ArrayConstructorContext) ARRAY() antlr.TerminalNode { 14093 return s.GetToken(SqlBaseParserARRAY, 0) 14094 } 14095 14096 func (s *ArrayConstructorContext) AllExpression() []IExpressionContext { 14097 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 14098 var tst = make([]IExpressionContext, len(ts)) 14099 14100 for i, t := range ts { 14101 if t != nil { 14102 tst[i] = t.(IExpressionContext) 14103 } 14104 } 14105 14106 return tst 14107 } 14108 14109 func (s *ArrayConstructorContext) Expression(i int) IExpressionContext { 14110 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 14111 14112 if t == nil { 14113 return nil 14114 } 14115 14116 return t.(IExpressionContext) 14117 } 14118 14119 func (s *ArrayConstructorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 14120 switch t := visitor.(type) { 14121 case SqlBaseVisitor: 14122 return t.VisitArrayConstructor(s) 14123 14124 default: 14125 return t.VisitChildren(s) 14126 } 14127 } 14128 14129 type FunctionCallContext struct { 14130 *PrimaryExpressionContext 14131 } 14132 14133 func NewFunctionCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FunctionCallContext { 14134 var p = new(FunctionCallContext) 14135 14136 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 14137 p.parser = parser 14138 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 14139 14140 return p 14141 } 14142 14143 func (s *FunctionCallContext) GetRuleContext() antlr.RuleContext { 14144 return s 14145 } 14146 14147 func (s *FunctionCallContext) QualifiedName() IQualifiedNameContext { 14148 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), 0) 14149 14150 if t == nil { 14151 return nil 14152 } 14153 14154 return t.(IQualifiedNameContext) 14155 } 14156 14157 func (s *FunctionCallContext) ASTERISK() antlr.TerminalNode { 14158 return s.GetToken(SqlBaseParserASTERISK, 0) 14159 } 14160 14161 func (s *FunctionCallContext) Filter() IFilterContext { 14162 var t = s.GetTypedRuleContext(reflect.TypeOf((*IFilterContext)(nil)).Elem(), 0) 14163 14164 if t == nil { 14165 return nil 14166 } 14167 14168 return t.(IFilterContext) 14169 } 14170 14171 func (s *FunctionCallContext) AllExpression() []IExpressionContext { 14172 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 14173 var tst = make([]IExpressionContext, len(ts)) 14174 14175 for i, t := range ts { 14176 if t != nil { 14177 tst[i] = t.(IExpressionContext) 14178 } 14179 } 14180 14181 return tst 14182 } 14183 14184 func (s *FunctionCallContext) Expression(i int) IExpressionContext { 14185 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 14186 14187 if t == nil { 14188 return nil 14189 } 14190 14191 return t.(IExpressionContext) 14192 } 14193 14194 func (s *FunctionCallContext) ORDER() antlr.TerminalNode { 14195 return s.GetToken(SqlBaseParserORDER, 0) 14196 } 14197 14198 func (s *FunctionCallContext) BY() antlr.TerminalNode { 14199 return s.GetToken(SqlBaseParserBY, 0) 14200 } 14201 14202 func (s *FunctionCallContext) AllSortItem() []ISortItemContext { 14203 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISortItemContext)(nil)).Elem()) 14204 var tst = make([]ISortItemContext, len(ts)) 14205 14206 for i, t := range ts { 14207 if t != nil { 14208 tst[i] = t.(ISortItemContext) 14209 } 14210 } 14211 14212 return tst 14213 } 14214 14215 func (s *FunctionCallContext) SortItem(i int) ISortItemContext { 14216 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISortItemContext)(nil)).Elem(), i) 14217 14218 if t == nil { 14219 return nil 14220 } 14221 14222 return t.(ISortItemContext) 14223 } 14224 14225 func (s *FunctionCallContext) SetQuantifier() ISetQuantifierContext { 14226 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISetQuantifierContext)(nil)).Elem(), 0) 14227 14228 if t == nil { 14229 return nil 14230 } 14231 14232 return t.(ISetQuantifierContext) 14233 } 14234 14235 func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 14236 switch t := visitor.(type) { 14237 case SqlBaseVisitor: 14238 return t.VisitFunctionCall(s) 14239 14240 default: 14241 return t.VisitChildren(s) 14242 } 14243 } 14244 14245 type ExistsContext struct { 14246 *PrimaryExpressionContext 14247 } 14248 14249 func NewExistsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExistsContext { 14250 var p = new(ExistsContext) 14251 14252 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 14253 p.parser = parser 14254 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 14255 14256 return p 14257 } 14258 14259 func (s *ExistsContext) GetRuleContext() antlr.RuleContext { 14260 return s 14261 } 14262 14263 func (s *ExistsContext) EXISTS() antlr.TerminalNode { 14264 return s.GetToken(SqlBaseParserEXISTS, 0) 14265 } 14266 14267 func (s *ExistsContext) Query() IQueryContext { 14268 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQueryContext)(nil)).Elem(), 0) 14269 14270 if t == nil { 14271 return nil 14272 } 14273 14274 return t.(IQueryContext) 14275 } 14276 14277 func (s *ExistsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 14278 switch t := visitor.(type) { 14279 case SqlBaseVisitor: 14280 return t.VisitExists(s) 14281 14282 default: 14283 return t.VisitChildren(s) 14284 } 14285 } 14286 14287 type PositionContext struct { 14288 *PrimaryExpressionContext 14289 } 14290 14291 func NewPositionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PositionContext { 14292 var p = new(PositionContext) 14293 14294 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 14295 p.parser = parser 14296 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 14297 14298 return p 14299 } 14300 14301 func (s *PositionContext) GetRuleContext() antlr.RuleContext { 14302 return s 14303 } 14304 14305 func (s *PositionContext) POSITION() antlr.TerminalNode { 14306 return s.GetToken(SqlBaseParserPOSITION, 0) 14307 } 14308 14309 func (s *PositionContext) AllValueExpression() []IValueExpressionContext { 14310 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem()) 14311 var tst = make([]IValueExpressionContext, len(ts)) 14312 14313 for i, t := range ts { 14314 if t != nil { 14315 tst[i] = t.(IValueExpressionContext) 14316 } 14317 } 14318 14319 return tst 14320 } 14321 14322 func (s *PositionContext) ValueExpression(i int) IValueExpressionContext { 14323 var t = s.GetTypedRuleContext(reflect.TypeOf((*IValueExpressionContext)(nil)).Elem(), i) 14324 14325 if t == nil { 14326 return nil 14327 } 14328 14329 return t.(IValueExpressionContext) 14330 } 14331 14332 func (s *PositionContext) IN() antlr.TerminalNode { 14333 return s.GetToken(SqlBaseParserIN, 0) 14334 } 14335 14336 func (s *PositionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 14337 switch t := visitor.(type) { 14338 case SqlBaseVisitor: 14339 return t.VisitPosition(s) 14340 14341 default: 14342 return t.VisitChildren(s) 14343 } 14344 } 14345 14346 type SearchedCaseContext struct { 14347 *PrimaryExpressionContext 14348 elseExpression IExpressionContext 14349 } 14350 14351 func NewSearchedCaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SearchedCaseContext { 14352 var p = new(SearchedCaseContext) 14353 14354 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 14355 p.parser = parser 14356 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 14357 14358 return p 14359 } 14360 14361 func (s *SearchedCaseContext) GetElseExpression() IExpressionContext { return s.elseExpression } 14362 14363 func (s *SearchedCaseContext) SetElseExpression(v IExpressionContext) { s.elseExpression = v } 14364 14365 func (s *SearchedCaseContext) GetRuleContext() antlr.RuleContext { 14366 return s 14367 } 14368 14369 func (s *SearchedCaseContext) CASE() antlr.TerminalNode { 14370 return s.GetToken(SqlBaseParserCASE, 0) 14371 } 14372 14373 func (s *SearchedCaseContext) END() antlr.TerminalNode { 14374 return s.GetToken(SqlBaseParserEND, 0) 14375 } 14376 14377 func (s *SearchedCaseContext) AllWhenClause() []IWhenClauseContext { 14378 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IWhenClauseContext)(nil)).Elem()) 14379 var tst = make([]IWhenClauseContext, len(ts)) 14380 14381 for i, t := range ts { 14382 if t != nil { 14383 tst[i] = t.(IWhenClauseContext) 14384 } 14385 } 14386 14387 return tst 14388 } 14389 14390 func (s *SearchedCaseContext) WhenClause(i int) IWhenClauseContext { 14391 var t = s.GetTypedRuleContext(reflect.TypeOf((*IWhenClauseContext)(nil)).Elem(), i) 14392 14393 if t == nil { 14394 return nil 14395 } 14396 14397 return t.(IWhenClauseContext) 14398 } 14399 14400 func (s *SearchedCaseContext) ELSE() antlr.TerminalNode { 14401 return s.GetToken(SqlBaseParserELSE, 0) 14402 } 14403 14404 func (s *SearchedCaseContext) Expression() IExpressionContext { 14405 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 14406 14407 if t == nil { 14408 return nil 14409 } 14410 14411 return t.(IExpressionContext) 14412 } 14413 14414 func (s *SearchedCaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 14415 switch t := visitor.(type) { 14416 case SqlBaseVisitor: 14417 return t.VisitSearchedCase(s) 14418 14419 default: 14420 return t.VisitChildren(s) 14421 } 14422 } 14423 14424 type GroupingOperationContext struct { 14425 *PrimaryExpressionContext 14426 } 14427 14428 func NewGroupingOperationContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GroupingOperationContext { 14429 var p = new(GroupingOperationContext) 14430 14431 p.PrimaryExpressionContext = NewEmptyPrimaryExpressionContext() 14432 p.parser = parser 14433 p.CopyFrom(ctx.(*PrimaryExpressionContext)) 14434 14435 return p 14436 } 14437 14438 func (s *GroupingOperationContext) GetRuleContext() antlr.RuleContext { 14439 return s 14440 } 14441 14442 func (s *GroupingOperationContext) GROUPING() antlr.TerminalNode { 14443 return s.GetToken(SqlBaseParserGROUPING, 0) 14444 } 14445 14446 func (s *GroupingOperationContext) AllQualifiedName() []IQualifiedNameContext { 14447 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem()) 14448 var tst = make([]IQualifiedNameContext, len(ts)) 14449 14450 for i, t := range ts { 14451 if t != nil { 14452 tst[i] = t.(IQualifiedNameContext) 14453 } 14454 } 14455 14456 return tst 14457 } 14458 14459 func (s *GroupingOperationContext) QualifiedName(i int) IQualifiedNameContext { 14460 var t = s.GetTypedRuleContext(reflect.TypeOf((*IQualifiedNameContext)(nil)).Elem(), i) 14461 14462 if t == nil { 14463 return nil 14464 } 14465 14466 return t.(IQualifiedNameContext) 14467 } 14468 14469 func (s *GroupingOperationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 14470 switch t := visitor.(type) { 14471 case SqlBaseVisitor: 14472 return t.VisitGroupingOperation(s) 14473 14474 default: 14475 return t.VisitChildren(s) 14476 } 14477 } 14478 14479 func (p *SqlBaseParser) PrimaryExpression() (localctx IPrimaryExpressionContext) { 14480 return p.primaryExpression(0) 14481 } 14482 14483 func (p *SqlBaseParser) primaryExpression(_p int) (localctx IPrimaryExpressionContext) { 14484 var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() 14485 _parentState := p.GetState() 14486 localctx = NewPrimaryExpressionContext(p, p.GetParserRuleContext(), _parentState) 14487 var _prevctx IPrimaryExpressionContext = localctx 14488 var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. 14489 _startState := 70 14490 p.EnterRecursionRule(localctx, 70, SqlBaseParserRULE_primaryExpression, _p) 14491 var _la int 14492 14493 defer func() { 14494 p.UnrollRecursionContexts(_parentctx) 14495 }() 14496 14497 defer func() { 14498 if err := recover(); err != nil { 14499 if v, ok := err.(antlr.RecognitionException); ok { 14500 localctx.SetException(v) 14501 p.GetErrorHandler().ReportError(p, v) 14502 p.GetErrorHandler().Recover(p, v) 14503 } else { 14504 panic(err) 14505 } 14506 } 14507 }() 14508 14509 var _alt int 14510 14511 p.EnterOuterAlt(localctx, 1) 14512 p.SetState(1221) 14513 p.GetErrorHandler().Sync(p) 14514 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 151, p.GetParserRuleContext()) { 14515 case 1: 14516 localctx = NewNullLiteralContext(p, localctx) 14517 p.SetParserRuleContext(localctx) 14518 _prevctx = localctx 14519 14520 { 14521 p.SetState(992) 14522 p.Match(SqlBaseParserNULL) 14523 } 14524 14525 case 2: 14526 localctx = NewIntervalLiteralContext(p, localctx) 14527 p.SetParserRuleContext(localctx) 14528 _prevctx = localctx 14529 { 14530 p.SetState(993) 14531 p.Interval() 14532 } 14533 14534 case 3: 14535 localctx = NewTypeConstructorContext(p, localctx) 14536 p.SetParserRuleContext(localctx) 14537 _prevctx = localctx 14538 { 14539 p.SetState(994) 14540 p.Identifier() 14541 } 14542 { 14543 p.SetState(995) 14544 p.Sql_string() 14545 } 14546 14547 case 4: 14548 localctx = NewTypeConstructorContext(p, localctx) 14549 p.SetParserRuleContext(localctx) 14550 _prevctx = localctx 14551 { 14552 p.SetState(997) 14553 p.Match(SqlBaseParserDOUBLE_PRECISION) 14554 } 14555 { 14556 p.SetState(998) 14557 p.Sql_string() 14558 } 14559 14560 case 5: 14561 localctx = NewNumericLiteralContext(p, localctx) 14562 p.SetParserRuleContext(localctx) 14563 _prevctx = localctx 14564 { 14565 p.SetState(999) 14566 p.Number() 14567 } 14568 14569 case 6: 14570 localctx = NewBooleanLiteralContext(p, localctx) 14571 p.SetParserRuleContext(localctx) 14572 _prevctx = localctx 14573 { 14574 p.SetState(1000) 14575 p.BooleanValue() 14576 } 14577 14578 case 7: 14579 localctx = NewStringLiteralContext(p, localctx) 14580 p.SetParserRuleContext(localctx) 14581 _prevctx = localctx 14582 { 14583 p.SetState(1001) 14584 p.Sql_string() 14585 } 14586 14587 case 8: 14588 localctx = NewBinaryLiteralContext(p, localctx) 14589 p.SetParserRuleContext(localctx) 14590 _prevctx = localctx 14591 { 14592 p.SetState(1002) 14593 p.Match(SqlBaseParserBINARY_LITERAL) 14594 } 14595 14596 case 9: 14597 localctx = NewParameterContext(p, localctx) 14598 p.SetParserRuleContext(localctx) 14599 _prevctx = localctx 14600 { 14601 p.SetState(1003) 14602 p.Match(SqlBaseParserT__4) 14603 } 14604 14605 case 10: 14606 localctx = NewPositionContext(p, localctx) 14607 p.SetParserRuleContext(localctx) 14608 _prevctx = localctx 14609 { 14610 p.SetState(1004) 14611 p.Match(SqlBaseParserPOSITION) 14612 } 14613 { 14614 p.SetState(1005) 14615 p.Match(SqlBaseParserT__1) 14616 } 14617 { 14618 p.SetState(1006) 14619 p.valueExpression(0) 14620 } 14621 { 14622 p.SetState(1007) 14623 p.Match(SqlBaseParserIN) 14624 } 14625 { 14626 p.SetState(1008) 14627 p.valueExpression(0) 14628 } 14629 { 14630 p.SetState(1009) 14631 p.Match(SqlBaseParserT__2) 14632 } 14633 14634 case 11: 14635 localctx = NewRowConstructorContext(p, localctx) 14636 p.SetParserRuleContext(localctx) 14637 _prevctx = localctx 14638 { 14639 p.SetState(1011) 14640 p.Match(SqlBaseParserT__1) 14641 } 14642 { 14643 p.SetState(1012) 14644 p.Expression() 14645 } 14646 p.SetState(1015) 14647 p.GetErrorHandler().Sync(p) 14648 _la = p.GetTokenStream().LA(1) 14649 14650 for ok := true; ok; ok = _la == SqlBaseParserT__3 { 14651 { 14652 p.SetState(1013) 14653 p.Match(SqlBaseParserT__3) 14654 } 14655 { 14656 p.SetState(1014) 14657 p.Expression() 14658 } 14659 14660 p.SetState(1017) 14661 p.GetErrorHandler().Sync(p) 14662 _la = p.GetTokenStream().LA(1) 14663 } 14664 { 14665 p.SetState(1019) 14666 p.Match(SqlBaseParserT__2) 14667 } 14668 14669 case 12: 14670 localctx = NewRowConstructorContext(p, localctx) 14671 p.SetParserRuleContext(localctx) 14672 _prevctx = localctx 14673 { 14674 p.SetState(1021) 14675 p.Match(SqlBaseParserROW) 14676 } 14677 { 14678 p.SetState(1022) 14679 p.Match(SqlBaseParserT__1) 14680 } 14681 { 14682 p.SetState(1023) 14683 p.Expression() 14684 } 14685 p.SetState(1028) 14686 p.GetErrorHandler().Sync(p) 14687 _la = p.GetTokenStream().LA(1) 14688 14689 for _la == SqlBaseParserT__3 { 14690 { 14691 p.SetState(1024) 14692 p.Match(SqlBaseParserT__3) 14693 } 14694 { 14695 p.SetState(1025) 14696 p.Expression() 14697 } 14698 14699 p.SetState(1030) 14700 p.GetErrorHandler().Sync(p) 14701 _la = p.GetTokenStream().LA(1) 14702 } 14703 { 14704 p.SetState(1031) 14705 p.Match(SqlBaseParserT__2) 14706 } 14707 14708 case 13: 14709 localctx = NewFunctionCallContext(p, localctx) 14710 p.SetParserRuleContext(localctx) 14711 _prevctx = localctx 14712 { 14713 p.SetState(1033) 14714 p.QualifiedName() 14715 } 14716 { 14717 p.SetState(1034) 14718 p.Match(SqlBaseParserT__1) 14719 } 14720 { 14721 p.SetState(1035) 14722 p.Match(SqlBaseParserASTERISK) 14723 } 14724 { 14725 p.SetState(1036) 14726 p.Match(SqlBaseParserT__2) 14727 } 14728 p.SetState(1038) 14729 p.GetErrorHandler().Sync(p) 14730 14731 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 128, p.GetParserRuleContext()) == 1 { 14732 { 14733 p.SetState(1037) 14734 p.Filter() 14735 } 14736 14737 } 14738 14739 case 14: 14740 localctx = NewFunctionCallContext(p, localctx) 14741 p.SetParserRuleContext(localctx) 14742 _prevctx = localctx 14743 { 14744 p.SetState(1040) 14745 p.QualifiedName() 14746 } 14747 { 14748 p.SetState(1041) 14749 p.Match(SqlBaseParserT__1) 14750 } 14751 p.SetState(1053) 14752 p.GetErrorHandler().Sync(p) 14753 _la = p.GetTokenStream().LA(1) 14754 14755 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserT__1)|(1<<SqlBaseParserT__4)|(1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCASE)|(1<<SqlBaseParserCAST)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserCURRENT_DATE-32))|(1<<(SqlBaseParserCURRENT_TIME-32))|(1<<(SqlBaseParserCURRENT_TIMESTAMP-32))|(1<<(SqlBaseParserCURRENT_USER-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTINCT-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXISTS-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserEXTRACT-32))|(1<<(SqlBaseParserFALSE-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserGROUPING-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64))|(1<<(SqlBaseParserLOCALTIME-64)))) != 0) || (((_la-96)&-(0x1f+1)) == 0 && ((1<<uint((_la-96)))&((1<<(SqlBaseParserLOCALTIMESTAMP-96))|(1<<(SqlBaseParserLOGICAL-96))|(1<<(SqlBaseParserMAP-96))|(1<<(SqlBaseParserMINUTE-96))|(1<<(SqlBaseParserMONTH-96))|(1<<(SqlBaseParserNFC-96))|(1<<(SqlBaseParserNFD-96))|(1<<(SqlBaseParserNFKC-96))|(1<<(SqlBaseParserNFKD-96))|(1<<(SqlBaseParserNO-96))|(1<<(SqlBaseParserNORMALIZE-96))|(1<<(SqlBaseParserNOT-96))|(1<<(SqlBaseParserNULL-96))|(1<<(SqlBaseParserNULLIF-96))|(1<<(SqlBaseParserNULLS-96))|(1<<(SqlBaseParserONLY-96))|(1<<(SqlBaseParserOPTION-96))|(1<<(SqlBaseParserORDINALITY-96))|(1<<(SqlBaseParserOUTPUT-96))|(1<<(SqlBaseParserOVER-96))|(1<<(SqlBaseParserPARTITION-96))|(1<<(SqlBaseParserPARTITIONS-96))|(1<<(SqlBaseParserPOSITION-96))|(1<<(SqlBaseParserPRECEDING-96))|(1<<(SqlBaseParserPRIVILEGES-96))|(1<<(SqlBaseParserPROPERTIES-96)))) != 0) || (((_la-128)&-(0x1f+1)) == 0 && ((1<<uint((_la-128)))&((1<<(SqlBaseParserPUBLIC-128))|(1<<(SqlBaseParserRANGE-128))|(1<<(SqlBaseParserREAD-128))|(1<<(SqlBaseParserRENAME-128))|(1<<(SqlBaseParserREPEATABLE-128))|(1<<(SqlBaseParserREPLACE-128))|(1<<(SqlBaseParserRESET-128))|(1<<(SqlBaseParserRESTRICT-128))|(1<<(SqlBaseParserREVOKE-128))|(1<<(SqlBaseParserROLLBACK-128))|(1<<(SqlBaseParserROW-128))|(1<<(SqlBaseParserROWS-128))|(1<<(SqlBaseParserSCHEMA-128))|(1<<(SqlBaseParserSCHEMAS-128))|(1<<(SqlBaseParserSECOND-128))|(1<<(SqlBaseParserSERIALIZABLE-128))|(1<<(SqlBaseParserSESSION-128))|(1<<(SqlBaseParserSET-128))|(1<<(SqlBaseParserSETS-128))|(1<<(SqlBaseParserSHOW-128))|(1<<(SqlBaseParserSMALLINT-128))|(1<<(SqlBaseParserSOME-128))|(1<<(SqlBaseParserSTART-128))|(1<<(SqlBaseParserSTATS-128))|(1<<(SqlBaseParserSUBSTRING-128))|(1<<(SqlBaseParserSYSTEM-128))|(1<<(SqlBaseParserTABLES-128)))) != 0) || (((_la-160)&-(0x1f+1)) == 0 && ((1<<uint((_la-160)))&((1<<(SqlBaseParserTABLESAMPLE-160))|(1<<(SqlBaseParserTEXT-160))|(1<<(SqlBaseParserTIME-160))|(1<<(SqlBaseParserTIMESTAMP-160))|(1<<(SqlBaseParserTINYINT-160))|(1<<(SqlBaseParserTO-160))|(1<<(SqlBaseParserTRUE-160))|(1<<(SqlBaseParserTRY_CAST-160))|(1<<(SqlBaseParserTYPE-160))|(1<<(SqlBaseParserUNBOUNDED-160))|(1<<(SqlBaseParserUNCOMMITTED-160))|(1<<(SqlBaseParserUSE-160))|(1<<(SqlBaseParserVALIDATE-160))|(1<<(SqlBaseParserVERBOSE-160))|(1<<(SqlBaseParserVIEW-160))|(1<<(SqlBaseParserWORK-160))|(1<<(SqlBaseParserWRITE-160))|(1<<(SqlBaseParserYEAR-160))|(1<<(SqlBaseParserZONE-160)))) != 0) || (((_la-194)&-(0x1f+1)) == 0 && ((1<<uint((_la-194)))&((1<<(SqlBaseParserPLUS-194))|(1<<(SqlBaseParserMINUS-194))|(1<<(SqlBaseParserSTRING-194))|(1<<(SqlBaseParserUNICODE_STRING-194))|(1<<(SqlBaseParserBINARY_LITERAL-194))|(1<<(SqlBaseParserINTEGER_VALUE-194))|(1<<(SqlBaseParserDECIMAL_VALUE-194))|(1<<(SqlBaseParserDOUBLE_VALUE-194))|(1<<(SqlBaseParserIDENTIFIER-194))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-194))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-194))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-194))|(1<<(SqlBaseParserDOUBLE_PRECISION-194))|(1<<(SqlBaseParserCOMMIT-194))|(1<<(SqlBaseParserISOLATION-194))|(1<<(SqlBaseParserTRANSACTION-194)))) != 0) { 14756 p.SetState(1043) 14757 p.GetErrorHandler().Sync(p) 14758 14759 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 129, p.GetParserRuleContext()) == 1 { 14760 { 14761 p.SetState(1042) 14762 p.SetQuantifier() 14763 } 14764 14765 } 14766 { 14767 p.SetState(1045) 14768 p.Expression() 14769 } 14770 p.SetState(1050) 14771 p.GetErrorHandler().Sync(p) 14772 _la = p.GetTokenStream().LA(1) 14773 14774 for _la == SqlBaseParserT__3 { 14775 { 14776 p.SetState(1046) 14777 p.Match(SqlBaseParserT__3) 14778 } 14779 { 14780 p.SetState(1047) 14781 p.Expression() 14782 } 14783 14784 p.SetState(1052) 14785 p.GetErrorHandler().Sync(p) 14786 _la = p.GetTokenStream().LA(1) 14787 } 14788 14789 } 14790 p.SetState(1065) 14791 p.GetErrorHandler().Sync(p) 14792 _la = p.GetTokenStream().LA(1) 14793 14794 if _la == SqlBaseParserORDER { 14795 { 14796 p.SetState(1055) 14797 p.Match(SqlBaseParserORDER) 14798 } 14799 { 14800 p.SetState(1056) 14801 p.Match(SqlBaseParserBY) 14802 } 14803 { 14804 p.SetState(1057) 14805 p.SortItem() 14806 } 14807 p.SetState(1062) 14808 p.GetErrorHandler().Sync(p) 14809 _la = p.GetTokenStream().LA(1) 14810 14811 for _la == SqlBaseParserT__3 { 14812 { 14813 p.SetState(1058) 14814 p.Match(SqlBaseParserT__3) 14815 } 14816 { 14817 p.SetState(1059) 14818 p.SortItem() 14819 } 14820 14821 p.SetState(1064) 14822 p.GetErrorHandler().Sync(p) 14823 _la = p.GetTokenStream().LA(1) 14824 } 14825 14826 } 14827 { 14828 p.SetState(1067) 14829 p.Match(SqlBaseParserT__2) 14830 } 14831 p.SetState(1069) 14832 p.GetErrorHandler().Sync(p) 14833 14834 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 134, p.GetParserRuleContext()) == 1 { 14835 { 14836 p.SetState(1068) 14837 p.Filter() 14838 } 14839 14840 } 14841 14842 case 15: 14843 localctx = NewLambdaContext(p, localctx) 14844 p.SetParserRuleContext(localctx) 14845 _prevctx = localctx 14846 { 14847 p.SetState(1071) 14848 p.Identifier() 14849 } 14850 { 14851 p.SetState(1072) 14852 p.Match(SqlBaseParserT__5) 14853 } 14854 { 14855 p.SetState(1073) 14856 p.Expression() 14857 } 14858 14859 case 16: 14860 localctx = NewLambdaContext(p, localctx) 14861 p.SetParserRuleContext(localctx) 14862 _prevctx = localctx 14863 { 14864 p.SetState(1075) 14865 p.Match(SqlBaseParserT__1) 14866 } 14867 p.SetState(1084) 14868 p.GetErrorHandler().Sync(p) 14869 _la = p.GetTokenStream().LA(1) 14870 14871 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64)))) != 0) || (((_la-97)&-(0x1f+1)) == 0 && ((1<<uint((_la-97)))&((1<<(SqlBaseParserLOGICAL-97))|(1<<(SqlBaseParserMAP-97))|(1<<(SqlBaseParserMINUTE-97))|(1<<(SqlBaseParserMONTH-97))|(1<<(SqlBaseParserNFC-97))|(1<<(SqlBaseParserNFD-97))|(1<<(SqlBaseParserNFKC-97))|(1<<(SqlBaseParserNFKD-97))|(1<<(SqlBaseParserNO-97))|(1<<(SqlBaseParserNULLIF-97))|(1<<(SqlBaseParserNULLS-97))|(1<<(SqlBaseParserONLY-97))|(1<<(SqlBaseParserOPTION-97))|(1<<(SqlBaseParserORDINALITY-97))|(1<<(SqlBaseParserOUTPUT-97))|(1<<(SqlBaseParserOVER-97))|(1<<(SqlBaseParserPARTITION-97))|(1<<(SqlBaseParserPARTITIONS-97))|(1<<(SqlBaseParserPOSITION-97))|(1<<(SqlBaseParserPRECEDING-97))|(1<<(SqlBaseParserPRIVILEGES-97))|(1<<(SqlBaseParserPROPERTIES-97))|(1<<(SqlBaseParserPUBLIC-97)))) != 0) || (((_la-129)&-(0x1f+1)) == 0 && ((1<<uint((_la-129)))&((1<<(SqlBaseParserRANGE-129))|(1<<(SqlBaseParserREAD-129))|(1<<(SqlBaseParserRENAME-129))|(1<<(SqlBaseParserREPEATABLE-129))|(1<<(SqlBaseParserREPLACE-129))|(1<<(SqlBaseParserRESET-129))|(1<<(SqlBaseParserRESTRICT-129))|(1<<(SqlBaseParserREVOKE-129))|(1<<(SqlBaseParserROLLBACK-129))|(1<<(SqlBaseParserROW-129))|(1<<(SqlBaseParserROWS-129))|(1<<(SqlBaseParserSCHEMA-129))|(1<<(SqlBaseParserSCHEMAS-129))|(1<<(SqlBaseParserSECOND-129))|(1<<(SqlBaseParserSERIALIZABLE-129))|(1<<(SqlBaseParserSESSION-129))|(1<<(SqlBaseParserSET-129))|(1<<(SqlBaseParserSETS-129))|(1<<(SqlBaseParserSHOW-129))|(1<<(SqlBaseParserSMALLINT-129))|(1<<(SqlBaseParserSOME-129))|(1<<(SqlBaseParserSTART-129))|(1<<(SqlBaseParserSTATS-129))|(1<<(SqlBaseParserSUBSTRING-129))|(1<<(SqlBaseParserSYSTEM-129))|(1<<(SqlBaseParserTABLES-129))|(1<<(SqlBaseParserTABLESAMPLE-129)))) != 0) || (((_la-161)&-(0x1f+1)) == 0 && ((1<<uint((_la-161)))&((1<<(SqlBaseParserTEXT-161))|(1<<(SqlBaseParserTIME-161))|(1<<(SqlBaseParserTIMESTAMP-161))|(1<<(SqlBaseParserTINYINT-161))|(1<<(SqlBaseParserTO-161))|(1<<(SqlBaseParserTRY_CAST-161))|(1<<(SqlBaseParserTYPE-161))|(1<<(SqlBaseParserUNBOUNDED-161))|(1<<(SqlBaseParserUNCOMMITTED-161))|(1<<(SqlBaseParserUSE-161))|(1<<(SqlBaseParserVALIDATE-161))|(1<<(SqlBaseParserVERBOSE-161))|(1<<(SqlBaseParserVIEW-161))|(1<<(SqlBaseParserWORK-161))|(1<<(SqlBaseParserWRITE-161))|(1<<(SqlBaseParserYEAR-161))|(1<<(SqlBaseParserZONE-161)))) != 0) || (((_la-206)&-(0x1f+1)) == 0 && ((1<<uint((_la-206)))&((1<<(SqlBaseParserIDENTIFIER-206))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-206))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserCOMMIT-206))|(1<<(SqlBaseParserISOLATION-206))|(1<<(SqlBaseParserTRANSACTION-206)))) != 0) { 14872 { 14873 p.SetState(1076) 14874 p.Identifier() 14875 } 14876 p.SetState(1081) 14877 p.GetErrorHandler().Sync(p) 14878 _la = p.GetTokenStream().LA(1) 14879 14880 for _la == SqlBaseParserT__3 { 14881 { 14882 p.SetState(1077) 14883 p.Match(SqlBaseParserT__3) 14884 } 14885 { 14886 p.SetState(1078) 14887 p.Identifier() 14888 } 14889 14890 p.SetState(1083) 14891 p.GetErrorHandler().Sync(p) 14892 _la = p.GetTokenStream().LA(1) 14893 } 14894 14895 } 14896 { 14897 p.SetState(1086) 14898 p.Match(SqlBaseParserT__2) 14899 } 14900 { 14901 p.SetState(1087) 14902 p.Match(SqlBaseParserT__5) 14903 } 14904 { 14905 p.SetState(1088) 14906 p.Expression() 14907 } 14908 14909 case 17: 14910 localctx = NewSubqueryExpressionContext(p, localctx) 14911 p.SetParserRuleContext(localctx) 14912 _prevctx = localctx 14913 { 14914 p.SetState(1089) 14915 p.Match(SqlBaseParserT__1) 14916 } 14917 { 14918 p.SetState(1090) 14919 p.Query() 14920 } 14921 { 14922 p.SetState(1091) 14923 p.Match(SqlBaseParserT__2) 14924 } 14925 14926 case 18: 14927 localctx = NewExistsContext(p, localctx) 14928 p.SetParserRuleContext(localctx) 14929 _prevctx = localctx 14930 { 14931 p.SetState(1093) 14932 p.Match(SqlBaseParserEXISTS) 14933 } 14934 { 14935 p.SetState(1094) 14936 p.Match(SqlBaseParserT__1) 14937 } 14938 { 14939 p.SetState(1095) 14940 p.Query() 14941 } 14942 { 14943 p.SetState(1096) 14944 p.Match(SqlBaseParserT__2) 14945 } 14946 14947 case 19: 14948 localctx = NewSimpleCaseContext(p, localctx) 14949 p.SetParserRuleContext(localctx) 14950 _prevctx = localctx 14951 { 14952 p.SetState(1098) 14953 p.Match(SqlBaseParserCASE) 14954 } 14955 { 14956 p.SetState(1099) 14957 p.valueExpression(0) 14958 } 14959 p.SetState(1101) 14960 p.GetErrorHandler().Sync(p) 14961 _la = p.GetTokenStream().LA(1) 14962 14963 for ok := true; ok; ok = _la == SqlBaseParserWHEN { 14964 { 14965 p.SetState(1100) 14966 p.WhenClause() 14967 } 14968 14969 p.SetState(1103) 14970 p.GetErrorHandler().Sync(p) 14971 _la = p.GetTokenStream().LA(1) 14972 } 14973 p.SetState(1107) 14974 p.GetErrorHandler().Sync(p) 14975 _la = p.GetTokenStream().LA(1) 14976 14977 if _la == SqlBaseParserELSE { 14978 { 14979 p.SetState(1105) 14980 p.Match(SqlBaseParserELSE) 14981 } 14982 { 14983 p.SetState(1106) 14984 14985 var _x = p.Expression() 14986 14987 localctx.(*SimpleCaseContext).elseExpression = _x 14988 } 14989 14990 } 14991 { 14992 p.SetState(1109) 14993 p.Match(SqlBaseParserEND) 14994 } 14995 14996 case 20: 14997 localctx = NewSearchedCaseContext(p, localctx) 14998 p.SetParserRuleContext(localctx) 14999 _prevctx = localctx 15000 { 15001 p.SetState(1111) 15002 p.Match(SqlBaseParserCASE) 15003 } 15004 p.SetState(1113) 15005 p.GetErrorHandler().Sync(p) 15006 _la = p.GetTokenStream().LA(1) 15007 15008 for ok := true; ok; ok = _la == SqlBaseParserWHEN { 15009 { 15010 p.SetState(1112) 15011 p.WhenClause() 15012 } 15013 15014 p.SetState(1115) 15015 p.GetErrorHandler().Sync(p) 15016 _la = p.GetTokenStream().LA(1) 15017 } 15018 p.SetState(1119) 15019 p.GetErrorHandler().Sync(p) 15020 _la = p.GetTokenStream().LA(1) 15021 15022 if _la == SqlBaseParserELSE { 15023 { 15024 p.SetState(1117) 15025 p.Match(SqlBaseParserELSE) 15026 } 15027 { 15028 p.SetState(1118) 15029 15030 var _x = p.Expression() 15031 15032 localctx.(*SearchedCaseContext).elseExpression = _x 15033 } 15034 15035 } 15036 { 15037 p.SetState(1121) 15038 p.Match(SqlBaseParserEND) 15039 } 15040 15041 case 21: 15042 localctx = NewCastContext(p, localctx) 15043 p.SetParserRuleContext(localctx) 15044 _prevctx = localctx 15045 { 15046 p.SetState(1123) 15047 p.Match(SqlBaseParserCAST) 15048 } 15049 { 15050 p.SetState(1124) 15051 p.Match(SqlBaseParserT__1) 15052 } 15053 { 15054 p.SetState(1125) 15055 p.Expression() 15056 } 15057 { 15058 p.SetState(1126) 15059 p.Match(SqlBaseParserAS) 15060 } 15061 { 15062 p.SetState(1127) 15063 p.sqltype(0) 15064 } 15065 { 15066 p.SetState(1128) 15067 p.Match(SqlBaseParserT__2) 15068 } 15069 15070 case 22: 15071 localctx = NewCastContext(p, localctx) 15072 p.SetParserRuleContext(localctx) 15073 _prevctx = localctx 15074 { 15075 p.SetState(1130) 15076 p.Match(SqlBaseParserTRY_CAST) 15077 } 15078 { 15079 p.SetState(1131) 15080 p.Match(SqlBaseParserT__1) 15081 } 15082 { 15083 p.SetState(1132) 15084 p.Expression() 15085 } 15086 { 15087 p.SetState(1133) 15088 p.Match(SqlBaseParserAS) 15089 } 15090 { 15091 p.SetState(1134) 15092 p.sqltype(0) 15093 } 15094 { 15095 p.SetState(1135) 15096 p.Match(SqlBaseParserT__2) 15097 } 15098 15099 case 23: 15100 localctx = NewArrayConstructorContext(p, localctx) 15101 p.SetParserRuleContext(localctx) 15102 _prevctx = localctx 15103 { 15104 p.SetState(1137) 15105 p.Match(SqlBaseParserARRAY) 15106 } 15107 { 15108 p.SetState(1138) 15109 p.Match(SqlBaseParserT__6) 15110 } 15111 p.SetState(1147) 15112 p.GetErrorHandler().Sync(p) 15113 _la = p.GetTokenStream().LA(1) 15114 15115 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserT__1)|(1<<SqlBaseParserT__4)|(1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCASE)|(1<<SqlBaseParserCAST)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserCURRENT_DATE-32))|(1<<(SqlBaseParserCURRENT_TIME-32))|(1<<(SqlBaseParserCURRENT_TIMESTAMP-32))|(1<<(SqlBaseParserCURRENT_USER-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXISTS-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserEXTRACT-32))|(1<<(SqlBaseParserFALSE-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserGROUPING-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64))|(1<<(SqlBaseParserLOCALTIME-64)))) != 0) || (((_la-96)&-(0x1f+1)) == 0 && ((1<<uint((_la-96)))&((1<<(SqlBaseParserLOCALTIMESTAMP-96))|(1<<(SqlBaseParserLOGICAL-96))|(1<<(SqlBaseParserMAP-96))|(1<<(SqlBaseParserMINUTE-96))|(1<<(SqlBaseParserMONTH-96))|(1<<(SqlBaseParserNFC-96))|(1<<(SqlBaseParserNFD-96))|(1<<(SqlBaseParserNFKC-96))|(1<<(SqlBaseParserNFKD-96))|(1<<(SqlBaseParserNO-96))|(1<<(SqlBaseParserNORMALIZE-96))|(1<<(SqlBaseParserNOT-96))|(1<<(SqlBaseParserNULL-96))|(1<<(SqlBaseParserNULLIF-96))|(1<<(SqlBaseParserNULLS-96))|(1<<(SqlBaseParserONLY-96))|(1<<(SqlBaseParserOPTION-96))|(1<<(SqlBaseParserORDINALITY-96))|(1<<(SqlBaseParserOUTPUT-96))|(1<<(SqlBaseParserOVER-96))|(1<<(SqlBaseParserPARTITION-96))|(1<<(SqlBaseParserPARTITIONS-96))|(1<<(SqlBaseParserPOSITION-96))|(1<<(SqlBaseParserPRECEDING-96))|(1<<(SqlBaseParserPRIVILEGES-96))|(1<<(SqlBaseParserPROPERTIES-96)))) != 0) || (((_la-128)&-(0x1f+1)) == 0 && ((1<<uint((_la-128)))&((1<<(SqlBaseParserPUBLIC-128))|(1<<(SqlBaseParserRANGE-128))|(1<<(SqlBaseParserREAD-128))|(1<<(SqlBaseParserRENAME-128))|(1<<(SqlBaseParserREPEATABLE-128))|(1<<(SqlBaseParserREPLACE-128))|(1<<(SqlBaseParserRESET-128))|(1<<(SqlBaseParserRESTRICT-128))|(1<<(SqlBaseParserREVOKE-128))|(1<<(SqlBaseParserROLLBACK-128))|(1<<(SqlBaseParserROW-128))|(1<<(SqlBaseParserROWS-128))|(1<<(SqlBaseParserSCHEMA-128))|(1<<(SqlBaseParserSCHEMAS-128))|(1<<(SqlBaseParserSECOND-128))|(1<<(SqlBaseParserSERIALIZABLE-128))|(1<<(SqlBaseParserSESSION-128))|(1<<(SqlBaseParserSET-128))|(1<<(SqlBaseParserSETS-128))|(1<<(SqlBaseParserSHOW-128))|(1<<(SqlBaseParserSMALLINT-128))|(1<<(SqlBaseParserSOME-128))|(1<<(SqlBaseParserSTART-128))|(1<<(SqlBaseParserSTATS-128))|(1<<(SqlBaseParserSUBSTRING-128))|(1<<(SqlBaseParserSYSTEM-128))|(1<<(SqlBaseParserTABLES-128)))) != 0) || (((_la-160)&-(0x1f+1)) == 0 && ((1<<uint((_la-160)))&((1<<(SqlBaseParserTABLESAMPLE-160))|(1<<(SqlBaseParserTEXT-160))|(1<<(SqlBaseParserTIME-160))|(1<<(SqlBaseParserTIMESTAMP-160))|(1<<(SqlBaseParserTINYINT-160))|(1<<(SqlBaseParserTO-160))|(1<<(SqlBaseParserTRUE-160))|(1<<(SqlBaseParserTRY_CAST-160))|(1<<(SqlBaseParserTYPE-160))|(1<<(SqlBaseParserUNBOUNDED-160))|(1<<(SqlBaseParserUNCOMMITTED-160))|(1<<(SqlBaseParserUSE-160))|(1<<(SqlBaseParserVALIDATE-160))|(1<<(SqlBaseParserVERBOSE-160))|(1<<(SqlBaseParserVIEW-160))|(1<<(SqlBaseParserWORK-160))|(1<<(SqlBaseParserWRITE-160))|(1<<(SqlBaseParserYEAR-160))|(1<<(SqlBaseParserZONE-160)))) != 0) || (((_la-194)&-(0x1f+1)) == 0 && ((1<<uint((_la-194)))&((1<<(SqlBaseParserPLUS-194))|(1<<(SqlBaseParserMINUS-194))|(1<<(SqlBaseParserSTRING-194))|(1<<(SqlBaseParserUNICODE_STRING-194))|(1<<(SqlBaseParserBINARY_LITERAL-194))|(1<<(SqlBaseParserINTEGER_VALUE-194))|(1<<(SqlBaseParserDECIMAL_VALUE-194))|(1<<(SqlBaseParserDOUBLE_VALUE-194))|(1<<(SqlBaseParserIDENTIFIER-194))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-194))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-194))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-194))|(1<<(SqlBaseParserDOUBLE_PRECISION-194))|(1<<(SqlBaseParserCOMMIT-194))|(1<<(SqlBaseParserISOLATION-194))|(1<<(SqlBaseParserTRANSACTION-194)))) != 0) { 15116 { 15117 p.SetState(1139) 15118 p.Expression() 15119 } 15120 p.SetState(1144) 15121 p.GetErrorHandler().Sync(p) 15122 _la = p.GetTokenStream().LA(1) 15123 15124 for _la == SqlBaseParserT__3 { 15125 { 15126 p.SetState(1140) 15127 p.Match(SqlBaseParserT__3) 15128 } 15129 { 15130 p.SetState(1141) 15131 p.Expression() 15132 } 15133 15134 p.SetState(1146) 15135 p.GetErrorHandler().Sync(p) 15136 _la = p.GetTokenStream().LA(1) 15137 } 15138 15139 } 15140 { 15141 p.SetState(1149) 15142 p.Match(SqlBaseParserT__7) 15143 } 15144 15145 case 24: 15146 localctx = NewColumnReferenceContext(p, localctx) 15147 p.SetParserRuleContext(localctx) 15148 _prevctx = localctx 15149 { 15150 p.SetState(1150) 15151 p.Identifier() 15152 } 15153 15154 case 25: 15155 localctx = NewSpecialDateTimeFunctionContext(p, localctx) 15156 p.SetParserRuleContext(localctx) 15157 _prevctx = localctx 15158 { 15159 p.SetState(1151) 15160 15161 var _m = p.Match(SqlBaseParserCURRENT_DATE) 15162 15163 localctx.(*SpecialDateTimeFunctionContext).name = _m 15164 } 15165 15166 case 26: 15167 localctx = NewSpecialDateTimeFunctionContext(p, localctx) 15168 p.SetParserRuleContext(localctx) 15169 _prevctx = localctx 15170 { 15171 p.SetState(1152) 15172 15173 var _m = p.Match(SqlBaseParserCURRENT_TIME) 15174 15175 localctx.(*SpecialDateTimeFunctionContext).name = _m 15176 } 15177 p.SetState(1156) 15178 p.GetErrorHandler().Sync(p) 15179 15180 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 143, p.GetParserRuleContext()) == 1 { 15181 { 15182 p.SetState(1153) 15183 p.Match(SqlBaseParserT__1) 15184 } 15185 { 15186 p.SetState(1154) 15187 15188 var _m = p.Match(SqlBaseParserINTEGER_VALUE) 15189 15190 localctx.(*SpecialDateTimeFunctionContext).precision = _m 15191 } 15192 { 15193 p.SetState(1155) 15194 p.Match(SqlBaseParserT__2) 15195 } 15196 15197 } 15198 15199 case 27: 15200 localctx = NewSpecialDateTimeFunctionContext(p, localctx) 15201 p.SetParserRuleContext(localctx) 15202 _prevctx = localctx 15203 { 15204 p.SetState(1158) 15205 15206 var _m = p.Match(SqlBaseParserCURRENT_TIMESTAMP) 15207 15208 localctx.(*SpecialDateTimeFunctionContext).name = _m 15209 } 15210 p.SetState(1162) 15211 p.GetErrorHandler().Sync(p) 15212 15213 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 144, p.GetParserRuleContext()) == 1 { 15214 { 15215 p.SetState(1159) 15216 p.Match(SqlBaseParserT__1) 15217 } 15218 { 15219 p.SetState(1160) 15220 15221 var _m = p.Match(SqlBaseParserINTEGER_VALUE) 15222 15223 localctx.(*SpecialDateTimeFunctionContext).precision = _m 15224 } 15225 { 15226 p.SetState(1161) 15227 p.Match(SqlBaseParserT__2) 15228 } 15229 15230 } 15231 15232 case 28: 15233 localctx = NewSpecialDateTimeFunctionContext(p, localctx) 15234 p.SetParserRuleContext(localctx) 15235 _prevctx = localctx 15236 { 15237 p.SetState(1164) 15238 15239 var _m = p.Match(SqlBaseParserLOCALTIME) 15240 15241 localctx.(*SpecialDateTimeFunctionContext).name = _m 15242 } 15243 p.SetState(1168) 15244 p.GetErrorHandler().Sync(p) 15245 15246 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 145, p.GetParserRuleContext()) == 1 { 15247 { 15248 p.SetState(1165) 15249 p.Match(SqlBaseParserT__1) 15250 } 15251 { 15252 p.SetState(1166) 15253 15254 var _m = p.Match(SqlBaseParserINTEGER_VALUE) 15255 15256 localctx.(*SpecialDateTimeFunctionContext).precision = _m 15257 } 15258 { 15259 p.SetState(1167) 15260 p.Match(SqlBaseParserT__2) 15261 } 15262 15263 } 15264 15265 case 29: 15266 localctx = NewSpecialDateTimeFunctionContext(p, localctx) 15267 p.SetParserRuleContext(localctx) 15268 _prevctx = localctx 15269 { 15270 p.SetState(1170) 15271 15272 var _m = p.Match(SqlBaseParserLOCALTIMESTAMP) 15273 15274 localctx.(*SpecialDateTimeFunctionContext).name = _m 15275 } 15276 p.SetState(1174) 15277 p.GetErrorHandler().Sync(p) 15278 15279 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 146, p.GetParserRuleContext()) == 1 { 15280 { 15281 p.SetState(1171) 15282 p.Match(SqlBaseParserT__1) 15283 } 15284 { 15285 p.SetState(1172) 15286 15287 var _m = p.Match(SqlBaseParserINTEGER_VALUE) 15288 15289 localctx.(*SpecialDateTimeFunctionContext).precision = _m 15290 } 15291 { 15292 p.SetState(1173) 15293 p.Match(SqlBaseParserT__2) 15294 } 15295 15296 } 15297 15298 case 30: 15299 localctx = NewCurrentUserContext(p, localctx) 15300 p.SetParserRuleContext(localctx) 15301 _prevctx = localctx 15302 { 15303 p.SetState(1176) 15304 15305 var _m = p.Match(SqlBaseParserCURRENT_USER) 15306 15307 localctx.(*CurrentUserContext).name = _m 15308 } 15309 15310 case 31: 15311 localctx = NewSubstringContext(p, localctx) 15312 p.SetParserRuleContext(localctx) 15313 _prevctx = localctx 15314 { 15315 p.SetState(1177) 15316 p.Match(SqlBaseParserSUBSTRING) 15317 } 15318 { 15319 p.SetState(1178) 15320 p.Match(SqlBaseParserT__1) 15321 } 15322 { 15323 p.SetState(1179) 15324 p.valueExpression(0) 15325 } 15326 { 15327 p.SetState(1180) 15328 p.Match(SqlBaseParserFROM) 15329 } 15330 { 15331 p.SetState(1181) 15332 p.valueExpression(0) 15333 } 15334 p.SetState(1184) 15335 p.GetErrorHandler().Sync(p) 15336 _la = p.GetTokenStream().LA(1) 15337 15338 if _la == SqlBaseParserFOR { 15339 { 15340 p.SetState(1182) 15341 p.Match(SqlBaseParserFOR) 15342 } 15343 { 15344 p.SetState(1183) 15345 p.valueExpression(0) 15346 } 15347 15348 } 15349 { 15350 p.SetState(1186) 15351 p.Match(SqlBaseParserT__2) 15352 } 15353 15354 case 32: 15355 localctx = NewNormalizeContext(p, localctx) 15356 p.SetParserRuleContext(localctx) 15357 _prevctx = localctx 15358 { 15359 p.SetState(1188) 15360 p.Match(SqlBaseParserNORMALIZE) 15361 } 15362 { 15363 p.SetState(1189) 15364 p.Match(SqlBaseParserT__1) 15365 } 15366 { 15367 p.SetState(1190) 15368 p.valueExpression(0) 15369 } 15370 p.SetState(1193) 15371 p.GetErrorHandler().Sync(p) 15372 _la = p.GetTokenStream().LA(1) 15373 15374 if _la == SqlBaseParserT__3 { 15375 { 15376 p.SetState(1191) 15377 p.Match(SqlBaseParserT__3) 15378 } 15379 { 15380 p.SetState(1192) 15381 p.NormalForm() 15382 } 15383 15384 } 15385 { 15386 p.SetState(1195) 15387 p.Match(SqlBaseParserT__2) 15388 } 15389 15390 case 33: 15391 localctx = NewExtractContext(p, localctx) 15392 p.SetParserRuleContext(localctx) 15393 _prevctx = localctx 15394 { 15395 p.SetState(1197) 15396 p.Match(SqlBaseParserEXTRACT) 15397 } 15398 { 15399 p.SetState(1198) 15400 p.Match(SqlBaseParserT__1) 15401 } 15402 { 15403 p.SetState(1199) 15404 p.Identifier() 15405 } 15406 { 15407 p.SetState(1200) 15408 p.Match(SqlBaseParserFROM) 15409 } 15410 { 15411 p.SetState(1201) 15412 p.valueExpression(0) 15413 } 15414 { 15415 p.SetState(1202) 15416 p.Match(SqlBaseParserT__2) 15417 } 15418 15419 case 34: 15420 localctx = NewParenthesizedExpressionContext(p, localctx) 15421 p.SetParserRuleContext(localctx) 15422 _prevctx = localctx 15423 { 15424 p.SetState(1204) 15425 p.Match(SqlBaseParserT__1) 15426 } 15427 { 15428 p.SetState(1205) 15429 p.Expression() 15430 } 15431 { 15432 p.SetState(1206) 15433 p.Match(SqlBaseParserT__2) 15434 } 15435 15436 case 35: 15437 localctx = NewGroupingOperationContext(p, localctx) 15438 p.SetParserRuleContext(localctx) 15439 _prevctx = localctx 15440 { 15441 p.SetState(1208) 15442 p.Match(SqlBaseParserGROUPING) 15443 } 15444 { 15445 p.SetState(1209) 15446 p.Match(SqlBaseParserT__1) 15447 } 15448 p.SetState(1218) 15449 p.GetErrorHandler().Sync(p) 15450 _la = p.GetTokenStream().LA(1) 15451 15452 if (((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64)))) != 0) || (((_la-97)&-(0x1f+1)) == 0 && ((1<<uint((_la-97)))&((1<<(SqlBaseParserLOGICAL-97))|(1<<(SqlBaseParserMAP-97))|(1<<(SqlBaseParserMINUTE-97))|(1<<(SqlBaseParserMONTH-97))|(1<<(SqlBaseParserNFC-97))|(1<<(SqlBaseParserNFD-97))|(1<<(SqlBaseParserNFKC-97))|(1<<(SqlBaseParserNFKD-97))|(1<<(SqlBaseParserNO-97))|(1<<(SqlBaseParserNULLIF-97))|(1<<(SqlBaseParserNULLS-97))|(1<<(SqlBaseParserONLY-97))|(1<<(SqlBaseParserOPTION-97))|(1<<(SqlBaseParserORDINALITY-97))|(1<<(SqlBaseParserOUTPUT-97))|(1<<(SqlBaseParserOVER-97))|(1<<(SqlBaseParserPARTITION-97))|(1<<(SqlBaseParserPARTITIONS-97))|(1<<(SqlBaseParserPOSITION-97))|(1<<(SqlBaseParserPRECEDING-97))|(1<<(SqlBaseParserPRIVILEGES-97))|(1<<(SqlBaseParserPROPERTIES-97))|(1<<(SqlBaseParserPUBLIC-97)))) != 0) || (((_la-129)&-(0x1f+1)) == 0 && ((1<<uint((_la-129)))&((1<<(SqlBaseParserRANGE-129))|(1<<(SqlBaseParserREAD-129))|(1<<(SqlBaseParserRENAME-129))|(1<<(SqlBaseParserREPEATABLE-129))|(1<<(SqlBaseParserREPLACE-129))|(1<<(SqlBaseParserRESET-129))|(1<<(SqlBaseParserRESTRICT-129))|(1<<(SqlBaseParserREVOKE-129))|(1<<(SqlBaseParserROLLBACK-129))|(1<<(SqlBaseParserROW-129))|(1<<(SqlBaseParserROWS-129))|(1<<(SqlBaseParserSCHEMA-129))|(1<<(SqlBaseParserSCHEMAS-129))|(1<<(SqlBaseParserSECOND-129))|(1<<(SqlBaseParserSERIALIZABLE-129))|(1<<(SqlBaseParserSESSION-129))|(1<<(SqlBaseParserSET-129))|(1<<(SqlBaseParserSETS-129))|(1<<(SqlBaseParserSHOW-129))|(1<<(SqlBaseParserSMALLINT-129))|(1<<(SqlBaseParserSOME-129))|(1<<(SqlBaseParserSTART-129))|(1<<(SqlBaseParserSTATS-129))|(1<<(SqlBaseParserSUBSTRING-129))|(1<<(SqlBaseParserSYSTEM-129))|(1<<(SqlBaseParserTABLES-129))|(1<<(SqlBaseParserTABLESAMPLE-129)))) != 0) || (((_la-161)&-(0x1f+1)) == 0 && ((1<<uint((_la-161)))&((1<<(SqlBaseParserTEXT-161))|(1<<(SqlBaseParserTIME-161))|(1<<(SqlBaseParserTIMESTAMP-161))|(1<<(SqlBaseParserTINYINT-161))|(1<<(SqlBaseParserTO-161))|(1<<(SqlBaseParserTRY_CAST-161))|(1<<(SqlBaseParserTYPE-161))|(1<<(SqlBaseParserUNBOUNDED-161))|(1<<(SqlBaseParserUNCOMMITTED-161))|(1<<(SqlBaseParserUSE-161))|(1<<(SqlBaseParserVALIDATE-161))|(1<<(SqlBaseParserVERBOSE-161))|(1<<(SqlBaseParserVIEW-161))|(1<<(SqlBaseParserWORK-161))|(1<<(SqlBaseParserWRITE-161))|(1<<(SqlBaseParserYEAR-161))|(1<<(SqlBaseParserZONE-161)))) != 0) || (((_la-206)&-(0x1f+1)) == 0 && ((1<<uint((_la-206)))&((1<<(SqlBaseParserIDENTIFIER-206))|(1<<(SqlBaseParserDIGIT_IDENTIFIER-206))|(1<<(SqlBaseParserQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserBACKQUOTED_IDENTIFIER-206))|(1<<(SqlBaseParserCOMMIT-206))|(1<<(SqlBaseParserISOLATION-206))|(1<<(SqlBaseParserTRANSACTION-206)))) != 0) { 15453 { 15454 p.SetState(1210) 15455 p.QualifiedName() 15456 } 15457 p.SetState(1215) 15458 p.GetErrorHandler().Sync(p) 15459 _la = p.GetTokenStream().LA(1) 15460 15461 for _la == SqlBaseParserT__3 { 15462 { 15463 p.SetState(1211) 15464 p.Match(SqlBaseParserT__3) 15465 } 15466 { 15467 p.SetState(1212) 15468 p.QualifiedName() 15469 } 15470 15471 p.SetState(1217) 15472 p.GetErrorHandler().Sync(p) 15473 _la = p.GetTokenStream().LA(1) 15474 } 15475 15476 } 15477 { 15478 p.SetState(1220) 15479 p.Match(SqlBaseParserT__2) 15480 } 15481 15482 } 15483 p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) 15484 p.SetState(1233) 15485 p.GetErrorHandler().Sync(p) 15486 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 153, p.GetParserRuleContext()) 15487 15488 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 15489 if _alt == 1 { 15490 if p.GetParseListeners() != nil { 15491 p.TriggerExitRuleEvent() 15492 } 15493 _prevctx = localctx 15494 p.SetState(1231) 15495 p.GetErrorHandler().Sync(p) 15496 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 152, p.GetParserRuleContext()) { 15497 case 1: 15498 localctx = NewSubscriptContext(p, NewPrimaryExpressionContext(p, _parentctx, _parentState)) 15499 localctx.(*SubscriptContext).value = _prevctx 15500 15501 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_primaryExpression) 15502 p.SetState(1223) 15503 15504 if !(p.Precpred(p.GetParserRuleContext(), 14)) { 15505 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 14)", "")) 15506 } 15507 { 15508 p.SetState(1224) 15509 p.Match(SqlBaseParserT__6) 15510 } 15511 { 15512 p.SetState(1225) 15513 15514 var _x = p.valueExpression(0) 15515 15516 localctx.(*SubscriptContext).index = _x 15517 } 15518 { 15519 p.SetState(1226) 15520 p.Match(SqlBaseParserT__7) 15521 } 15522 15523 case 2: 15524 localctx = NewDereferenceContext(p, NewPrimaryExpressionContext(p, _parentctx, _parentState)) 15525 localctx.(*DereferenceContext).base = _prevctx 15526 15527 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_primaryExpression) 15528 p.SetState(1228) 15529 15530 if !(p.Precpred(p.GetParserRuleContext(), 12)) { 15531 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 12)", "")) 15532 } 15533 { 15534 p.SetState(1229) 15535 p.Match(SqlBaseParserT__0) 15536 } 15537 { 15538 p.SetState(1230) 15539 15540 var _x = p.Identifier() 15541 15542 localctx.(*DereferenceContext).fieldName = _x 15543 } 15544 15545 } 15546 15547 } 15548 p.SetState(1235) 15549 p.GetErrorHandler().Sync(p) 15550 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 153, p.GetParserRuleContext()) 15551 } 15552 15553 return localctx 15554 } 15555 15556 // ISql_stringContext is an interface to support dynamic dispatch. 15557 type ISql_stringContext interface { 15558 antlr.ParserRuleContext 15559 15560 // GetParser returns the parser. 15561 GetParser() antlr.Parser 15562 15563 // IsSql_stringContext differentiates from other interfaces. 15564 IsSql_stringContext() 15565 } 15566 15567 type Sql_stringContext struct { 15568 *antlr.BaseParserRuleContext 15569 parser antlr.Parser 15570 } 15571 15572 func NewEmptySql_stringContext() *Sql_stringContext { 15573 var p = new(Sql_stringContext) 15574 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 15575 p.RuleIndex = SqlBaseParserRULE_sql_string 15576 return p 15577 } 15578 15579 func (*Sql_stringContext) IsSql_stringContext() {} 15580 15581 func NewSql_stringContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Sql_stringContext { 15582 var p = new(Sql_stringContext) 15583 15584 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 15585 15586 p.parser = parser 15587 p.RuleIndex = SqlBaseParserRULE_sql_string 15588 15589 return p 15590 } 15591 15592 func (s *Sql_stringContext) GetParser() antlr.Parser { return s.parser } 15593 15594 func (s *Sql_stringContext) CopyFrom(ctx *Sql_stringContext) { 15595 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 15596 } 15597 15598 func (s *Sql_stringContext) GetRuleContext() antlr.RuleContext { 15599 return s 15600 } 15601 15602 func (s *Sql_stringContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 15603 return antlr.TreesStringTree(s, ruleNames, recog) 15604 } 15605 15606 type UnicodeStringLiteralContext struct { 15607 *Sql_stringContext 15608 } 15609 15610 func NewUnicodeStringLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UnicodeStringLiteralContext { 15611 var p = new(UnicodeStringLiteralContext) 15612 15613 p.Sql_stringContext = NewEmptySql_stringContext() 15614 p.parser = parser 15615 p.CopyFrom(ctx.(*Sql_stringContext)) 15616 15617 return p 15618 } 15619 15620 func (s *UnicodeStringLiteralContext) GetRuleContext() antlr.RuleContext { 15621 return s 15622 } 15623 15624 func (s *UnicodeStringLiteralContext) UNICODE_STRING() antlr.TerminalNode { 15625 return s.GetToken(SqlBaseParserUNICODE_STRING, 0) 15626 } 15627 15628 func (s *UnicodeStringLiteralContext) UESCAPE() antlr.TerminalNode { 15629 return s.GetToken(SqlBaseParserUESCAPE, 0) 15630 } 15631 15632 func (s *UnicodeStringLiteralContext) STRING() antlr.TerminalNode { 15633 return s.GetToken(SqlBaseParserSTRING, 0) 15634 } 15635 15636 func (s *UnicodeStringLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 15637 switch t := visitor.(type) { 15638 case SqlBaseVisitor: 15639 return t.VisitUnicodeStringLiteral(s) 15640 15641 default: 15642 return t.VisitChildren(s) 15643 } 15644 } 15645 15646 type BasicStringLiteralContext struct { 15647 *Sql_stringContext 15648 } 15649 15650 func NewBasicStringLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BasicStringLiteralContext { 15651 var p = new(BasicStringLiteralContext) 15652 15653 p.Sql_stringContext = NewEmptySql_stringContext() 15654 p.parser = parser 15655 p.CopyFrom(ctx.(*Sql_stringContext)) 15656 15657 return p 15658 } 15659 15660 func (s *BasicStringLiteralContext) GetRuleContext() antlr.RuleContext { 15661 return s 15662 } 15663 15664 func (s *BasicStringLiteralContext) STRING() antlr.TerminalNode { 15665 return s.GetToken(SqlBaseParserSTRING, 0) 15666 } 15667 15668 func (s *BasicStringLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 15669 switch t := visitor.(type) { 15670 case SqlBaseVisitor: 15671 return t.VisitBasicStringLiteral(s) 15672 15673 default: 15674 return t.VisitChildren(s) 15675 } 15676 } 15677 15678 func (p *SqlBaseParser) Sql_string() (localctx ISql_stringContext) { 15679 localctx = NewSql_stringContext(p, p.GetParserRuleContext(), p.GetState()) 15680 p.EnterRule(localctx, 72, SqlBaseParserRULE_sql_string) 15681 15682 defer func() { 15683 p.ExitRule() 15684 }() 15685 15686 defer func() { 15687 if err := recover(); err != nil { 15688 if v, ok := err.(antlr.RecognitionException); ok { 15689 localctx.SetException(v) 15690 p.GetErrorHandler().ReportError(p, v) 15691 p.GetErrorHandler().Recover(p, v) 15692 } else { 15693 panic(err) 15694 } 15695 } 15696 }() 15697 15698 p.SetState(1242) 15699 p.GetErrorHandler().Sync(p) 15700 15701 switch p.GetTokenStream().LA(1) { 15702 case SqlBaseParserSTRING: 15703 localctx = NewBasicStringLiteralContext(p, localctx) 15704 p.EnterOuterAlt(localctx, 1) 15705 { 15706 p.SetState(1236) 15707 p.Match(SqlBaseParserSTRING) 15708 } 15709 15710 case SqlBaseParserUNICODE_STRING: 15711 localctx = NewUnicodeStringLiteralContext(p, localctx) 15712 p.EnterOuterAlt(localctx, 2) 15713 { 15714 p.SetState(1237) 15715 p.Match(SqlBaseParserUNICODE_STRING) 15716 } 15717 p.SetState(1240) 15718 p.GetErrorHandler().Sync(p) 15719 15720 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 154, p.GetParserRuleContext()) == 1 { 15721 { 15722 p.SetState(1238) 15723 p.Match(SqlBaseParserUESCAPE) 15724 } 15725 { 15726 p.SetState(1239) 15727 p.Match(SqlBaseParserSTRING) 15728 } 15729 15730 } 15731 15732 default: 15733 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 15734 } 15735 15736 return localctx 15737 } 15738 15739 // ITimeZoneSpecifierContext is an interface to support dynamic dispatch. 15740 type ITimeZoneSpecifierContext interface { 15741 antlr.ParserRuleContext 15742 15743 // GetParser returns the parser. 15744 GetParser() antlr.Parser 15745 15746 // IsTimeZoneSpecifierContext differentiates from other interfaces. 15747 IsTimeZoneSpecifierContext() 15748 } 15749 15750 type TimeZoneSpecifierContext struct { 15751 *antlr.BaseParserRuleContext 15752 parser antlr.Parser 15753 } 15754 15755 func NewEmptyTimeZoneSpecifierContext() *TimeZoneSpecifierContext { 15756 var p = new(TimeZoneSpecifierContext) 15757 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 15758 p.RuleIndex = SqlBaseParserRULE_timeZoneSpecifier 15759 return p 15760 } 15761 15762 func (*TimeZoneSpecifierContext) IsTimeZoneSpecifierContext() {} 15763 15764 func NewTimeZoneSpecifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TimeZoneSpecifierContext { 15765 var p = new(TimeZoneSpecifierContext) 15766 15767 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 15768 15769 p.parser = parser 15770 p.RuleIndex = SqlBaseParserRULE_timeZoneSpecifier 15771 15772 return p 15773 } 15774 15775 func (s *TimeZoneSpecifierContext) GetParser() antlr.Parser { return s.parser } 15776 15777 func (s *TimeZoneSpecifierContext) CopyFrom(ctx *TimeZoneSpecifierContext) { 15778 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 15779 } 15780 15781 func (s *TimeZoneSpecifierContext) GetRuleContext() antlr.RuleContext { 15782 return s 15783 } 15784 15785 func (s *TimeZoneSpecifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 15786 return antlr.TreesStringTree(s, ruleNames, recog) 15787 } 15788 15789 type TimeZoneIntervalContext struct { 15790 *TimeZoneSpecifierContext 15791 } 15792 15793 func NewTimeZoneIntervalContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TimeZoneIntervalContext { 15794 var p = new(TimeZoneIntervalContext) 15795 15796 p.TimeZoneSpecifierContext = NewEmptyTimeZoneSpecifierContext() 15797 p.parser = parser 15798 p.CopyFrom(ctx.(*TimeZoneSpecifierContext)) 15799 15800 return p 15801 } 15802 15803 func (s *TimeZoneIntervalContext) GetRuleContext() antlr.RuleContext { 15804 return s 15805 } 15806 15807 func (s *TimeZoneIntervalContext) TIME() antlr.TerminalNode { 15808 return s.GetToken(SqlBaseParserTIME, 0) 15809 } 15810 15811 func (s *TimeZoneIntervalContext) ZONE() antlr.TerminalNode { 15812 return s.GetToken(SqlBaseParserZONE, 0) 15813 } 15814 15815 func (s *TimeZoneIntervalContext) Interval() IIntervalContext { 15816 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIntervalContext)(nil)).Elem(), 0) 15817 15818 if t == nil { 15819 return nil 15820 } 15821 15822 return t.(IIntervalContext) 15823 } 15824 15825 func (s *TimeZoneIntervalContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 15826 switch t := visitor.(type) { 15827 case SqlBaseVisitor: 15828 return t.VisitTimeZoneInterval(s) 15829 15830 default: 15831 return t.VisitChildren(s) 15832 } 15833 } 15834 15835 type TimeZoneStringContext struct { 15836 *TimeZoneSpecifierContext 15837 } 15838 15839 func NewTimeZoneStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TimeZoneStringContext { 15840 var p = new(TimeZoneStringContext) 15841 15842 p.TimeZoneSpecifierContext = NewEmptyTimeZoneSpecifierContext() 15843 p.parser = parser 15844 p.CopyFrom(ctx.(*TimeZoneSpecifierContext)) 15845 15846 return p 15847 } 15848 15849 func (s *TimeZoneStringContext) GetRuleContext() antlr.RuleContext { 15850 return s 15851 } 15852 15853 func (s *TimeZoneStringContext) TIME() antlr.TerminalNode { 15854 return s.GetToken(SqlBaseParserTIME, 0) 15855 } 15856 15857 func (s *TimeZoneStringContext) ZONE() antlr.TerminalNode { 15858 return s.GetToken(SqlBaseParserZONE, 0) 15859 } 15860 15861 func (s *TimeZoneStringContext) Sql_string() ISql_stringContext { 15862 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), 0) 15863 15864 if t == nil { 15865 return nil 15866 } 15867 15868 return t.(ISql_stringContext) 15869 } 15870 15871 func (s *TimeZoneStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 15872 switch t := visitor.(type) { 15873 case SqlBaseVisitor: 15874 return t.VisitTimeZoneString(s) 15875 15876 default: 15877 return t.VisitChildren(s) 15878 } 15879 } 15880 15881 func (p *SqlBaseParser) TimeZoneSpecifier() (localctx ITimeZoneSpecifierContext) { 15882 localctx = NewTimeZoneSpecifierContext(p, p.GetParserRuleContext(), p.GetState()) 15883 p.EnterRule(localctx, 74, SqlBaseParserRULE_timeZoneSpecifier) 15884 15885 defer func() { 15886 p.ExitRule() 15887 }() 15888 15889 defer func() { 15890 if err := recover(); err != nil { 15891 if v, ok := err.(antlr.RecognitionException); ok { 15892 localctx.SetException(v) 15893 p.GetErrorHandler().ReportError(p, v) 15894 p.GetErrorHandler().Recover(p, v) 15895 } else { 15896 panic(err) 15897 } 15898 } 15899 }() 15900 15901 p.SetState(1250) 15902 p.GetErrorHandler().Sync(p) 15903 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 156, p.GetParserRuleContext()) { 15904 case 1: 15905 localctx = NewTimeZoneIntervalContext(p, localctx) 15906 p.EnterOuterAlt(localctx, 1) 15907 { 15908 p.SetState(1244) 15909 p.Match(SqlBaseParserTIME) 15910 } 15911 { 15912 p.SetState(1245) 15913 p.Match(SqlBaseParserZONE) 15914 } 15915 { 15916 p.SetState(1246) 15917 p.Interval() 15918 } 15919 15920 case 2: 15921 localctx = NewTimeZoneStringContext(p, localctx) 15922 p.EnterOuterAlt(localctx, 2) 15923 { 15924 p.SetState(1247) 15925 p.Match(SqlBaseParserTIME) 15926 } 15927 { 15928 p.SetState(1248) 15929 p.Match(SqlBaseParserZONE) 15930 } 15931 { 15932 p.SetState(1249) 15933 p.Sql_string() 15934 } 15935 15936 } 15937 15938 return localctx 15939 } 15940 15941 // IComparisonOperatorContext is an interface to support dynamic dispatch. 15942 type IComparisonOperatorContext interface { 15943 antlr.ParserRuleContext 15944 15945 // GetParser returns the parser. 15946 GetParser() antlr.Parser 15947 15948 // IsComparisonOperatorContext differentiates from other interfaces. 15949 IsComparisonOperatorContext() 15950 } 15951 15952 type ComparisonOperatorContext struct { 15953 *antlr.BaseParserRuleContext 15954 parser antlr.Parser 15955 } 15956 15957 func NewEmptyComparisonOperatorContext() *ComparisonOperatorContext { 15958 var p = new(ComparisonOperatorContext) 15959 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 15960 p.RuleIndex = SqlBaseParserRULE_comparisonOperator 15961 return p 15962 } 15963 15964 func (*ComparisonOperatorContext) IsComparisonOperatorContext() {} 15965 15966 func NewComparisonOperatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ComparisonOperatorContext { 15967 var p = new(ComparisonOperatorContext) 15968 15969 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 15970 15971 p.parser = parser 15972 p.RuleIndex = SqlBaseParserRULE_comparisonOperator 15973 15974 return p 15975 } 15976 15977 func (s *ComparisonOperatorContext) GetParser() antlr.Parser { return s.parser } 15978 15979 func (s *ComparisonOperatorContext) EQ() antlr.TerminalNode { 15980 return s.GetToken(SqlBaseParserEQ, 0) 15981 } 15982 15983 func (s *ComparisonOperatorContext) NEQ() antlr.TerminalNode { 15984 return s.GetToken(SqlBaseParserNEQ, 0) 15985 } 15986 15987 func (s *ComparisonOperatorContext) LT() antlr.TerminalNode { 15988 return s.GetToken(SqlBaseParserLT, 0) 15989 } 15990 15991 func (s *ComparisonOperatorContext) LTE() antlr.TerminalNode { 15992 return s.GetToken(SqlBaseParserLTE, 0) 15993 } 15994 15995 func (s *ComparisonOperatorContext) GT() antlr.TerminalNode { 15996 return s.GetToken(SqlBaseParserGT, 0) 15997 } 15998 15999 func (s *ComparisonOperatorContext) GTE() antlr.TerminalNode { 16000 return s.GetToken(SqlBaseParserGTE, 0) 16001 } 16002 16003 func (s *ComparisonOperatorContext) GetRuleContext() antlr.RuleContext { 16004 return s 16005 } 16006 16007 func (s *ComparisonOperatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 16008 return antlr.TreesStringTree(s, ruleNames, recog) 16009 } 16010 16011 func (s *ComparisonOperatorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 16012 switch t := visitor.(type) { 16013 case SqlBaseVisitor: 16014 return t.VisitComparisonOperator(s) 16015 16016 default: 16017 return t.VisitChildren(s) 16018 } 16019 } 16020 16021 func (p *SqlBaseParser) ComparisonOperator() (localctx IComparisonOperatorContext) { 16022 localctx = NewComparisonOperatorContext(p, p.GetParserRuleContext(), p.GetState()) 16023 p.EnterRule(localctx, 76, SqlBaseParserRULE_comparisonOperator) 16024 var _la int 16025 16026 defer func() { 16027 p.ExitRule() 16028 }() 16029 16030 defer func() { 16031 if err := recover(); err != nil { 16032 if v, ok := err.(antlr.RecognitionException); ok { 16033 localctx.SetException(v) 16034 p.GetErrorHandler().ReportError(p, v) 16035 p.GetErrorHandler().Recover(p, v) 16036 } else { 16037 panic(err) 16038 } 16039 } 16040 }() 16041 16042 p.EnterOuterAlt(localctx, 1) 16043 { 16044 p.SetState(1252) 16045 _la = p.GetTokenStream().LA(1) 16046 16047 if !(((_la-188)&-(0x1f+1)) == 0 && ((1<<uint((_la-188)))&((1<<(SqlBaseParserEQ-188))|(1<<(SqlBaseParserNEQ-188))|(1<<(SqlBaseParserLT-188))|(1<<(SqlBaseParserLTE-188))|(1<<(SqlBaseParserGT-188))|(1<<(SqlBaseParserGTE-188)))) != 0) { 16048 p.GetErrorHandler().RecoverInline(p) 16049 } else { 16050 p.GetErrorHandler().ReportMatch(p) 16051 p.Consume() 16052 } 16053 } 16054 16055 return localctx 16056 } 16057 16058 // IComparisonQuantifierContext is an interface to support dynamic dispatch. 16059 type IComparisonQuantifierContext interface { 16060 antlr.ParserRuleContext 16061 16062 // GetParser returns the parser. 16063 GetParser() antlr.Parser 16064 16065 // IsComparisonQuantifierContext differentiates from other interfaces. 16066 IsComparisonQuantifierContext() 16067 } 16068 16069 type ComparisonQuantifierContext struct { 16070 *antlr.BaseParserRuleContext 16071 parser antlr.Parser 16072 } 16073 16074 func NewEmptyComparisonQuantifierContext() *ComparisonQuantifierContext { 16075 var p = new(ComparisonQuantifierContext) 16076 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 16077 p.RuleIndex = SqlBaseParserRULE_comparisonQuantifier 16078 return p 16079 } 16080 16081 func (*ComparisonQuantifierContext) IsComparisonQuantifierContext() {} 16082 16083 func NewComparisonQuantifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ComparisonQuantifierContext { 16084 var p = new(ComparisonQuantifierContext) 16085 16086 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 16087 16088 p.parser = parser 16089 p.RuleIndex = SqlBaseParserRULE_comparisonQuantifier 16090 16091 return p 16092 } 16093 16094 func (s *ComparisonQuantifierContext) GetParser() antlr.Parser { return s.parser } 16095 16096 func (s *ComparisonQuantifierContext) ALL() antlr.TerminalNode { 16097 return s.GetToken(SqlBaseParserALL, 0) 16098 } 16099 16100 func (s *ComparisonQuantifierContext) SOME() antlr.TerminalNode { 16101 return s.GetToken(SqlBaseParserSOME, 0) 16102 } 16103 16104 func (s *ComparisonQuantifierContext) ANY() antlr.TerminalNode { 16105 return s.GetToken(SqlBaseParserANY, 0) 16106 } 16107 16108 func (s *ComparisonQuantifierContext) GetRuleContext() antlr.RuleContext { 16109 return s 16110 } 16111 16112 func (s *ComparisonQuantifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 16113 return antlr.TreesStringTree(s, ruleNames, recog) 16114 } 16115 16116 func (s *ComparisonQuantifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 16117 switch t := visitor.(type) { 16118 case SqlBaseVisitor: 16119 return t.VisitComparisonQuantifier(s) 16120 16121 default: 16122 return t.VisitChildren(s) 16123 } 16124 } 16125 16126 func (p *SqlBaseParser) ComparisonQuantifier() (localctx IComparisonQuantifierContext) { 16127 localctx = NewComparisonQuantifierContext(p, p.GetParserRuleContext(), p.GetState()) 16128 p.EnterRule(localctx, 78, SqlBaseParserRULE_comparisonQuantifier) 16129 var _la int 16130 16131 defer func() { 16132 p.ExitRule() 16133 }() 16134 16135 defer func() { 16136 if err := recover(); err != nil { 16137 if v, ok := err.(antlr.RecognitionException); ok { 16138 localctx.SetException(v) 16139 p.GetErrorHandler().ReportError(p, v) 16140 p.GetErrorHandler().Recover(p, v) 16141 } else { 16142 panic(err) 16143 } 16144 } 16145 }() 16146 16147 p.EnterOuterAlt(localctx, 1) 16148 { 16149 p.SetState(1254) 16150 _la = p.GetTokenStream().LA(1) 16151 16152 if !(_la == SqlBaseParserALL || _la == SqlBaseParserANY || _la == SqlBaseParserSOME) { 16153 p.GetErrorHandler().RecoverInline(p) 16154 } else { 16155 p.GetErrorHandler().ReportMatch(p) 16156 p.Consume() 16157 } 16158 } 16159 16160 return localctx 16161 } 16162 16163 // IBooleanValueContext is an interface to support dynamic dispatch. 16164 type IBooleanValueContext interface { 16165 antlr.ParserRuleContext 16166 16167 // GetParser returns the parser. 16168 GetParser() antlr.Parser 16169 16170 // IsBooleanValueContext differentiates from other interfaces. 16171 IsBooleanValueContext() 16172 } 16173 16174 type BooleanValueContext struct { 16175 *antlr.BaseParserRuleContext 16176 parser antlr.Parser 16177 } 16178 16179 func NewEmptyBooleanValueContext() *BooleanValueContext { 16180 var p = new(BooleanValueContext) 16181 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 16182 p.RuleIndex = SqlBaseParserRULE_booleanValue 16183 return p 16184 } 16185 16186 func (*BooleanValueContext) IsBooleanValueContext() {} 16187 16188 func NewBooleanValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BooleanValueContext { 16189 var p = new(BooleanValueContext) 16190 16191 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 16192 16193 p.parser = parser 16194 p.RuleIndex = SqlBaseParserRULE_booleanValue 16195 16196 return p 16197 } 16198 16199 func (s *BooleanValueContext) GetParser() antlr.Parser { return s.parser } 16200 16201 func (s *BooleanValueContext) TRUE() antlr.TerminalNode { 16202 return s.GetToken(SqlBaseParserTRUE, 0) 16203 } 16204 16205 func (s *BooleanValueContext) FALSE() antlr.TerminalNode { 16206 return s.GetToken(SqlBaseParserFALSE, 0) 16207 } 16208 16209 func (s *BooleanValueContext) GetRuleContext() antlr.RuleContext { 16210 return s 16211 } 16212 16213 func (s *BooleanValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 16214 return antlr.TreesStringTree(s, ruleNames, recog) 16215 } 16216 16217 func (s *BooleanValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 16218 switch t := visitor.(type) { 16219 case SqlBaseVisitor: 16220 return t.VisitBooleanValue(s) 16221 16222 default: 16223 return t.VisitChildren(s) 16224 } 16225 } 16226 16227 func (p *SqlBaseParser) BooleanValue() (localctx IBooleanValueContext) { 16228 localctx = NewBooleanValueContext(p, p.GetParserRuleContext(), p.GetState()) 16229 p.EnterRule(localctx, 80, SqlBaseParserRULE_booleanValue) 16230 var _la int 16231 16232 defer func() { 16233 p.ExitRule() 16234 }() 16235 16236 defer func() { 16237 if err := recover(); err != nil { 16238 if v, ok := err.(antlr.RecognitionException); ok { 16239 localctx.SetException(v) 16240 p.GetErrorHandler().ReportError(p, v) 16241 p.GetErrorHandler().Recover(p, v) 16242 } else { 16243 panic(err) 16244 } 16245 } 16246 }() 16247 16248 p.EnterOuterAlt(localctx, 1) 16249 { 16250 p.SetState(1256) 16251 _la = p.GetTokenStream().LA(1) 16252 16253 if !(_la == SqlBaseParserFALSE || _la == SqlBaseParserTRUE) { 16254 p.GetErrorHandler().RecoverInline(p) 16255 } else { 16256 p.GetErrorHandler().ReportMatch(p) 16257 p.Consume() 16258 } 16259 } 16260 16261 return localctx 16262 } 16263 16264 // IIntervalContext is an interface to support dynamic dispatch. 16265 type IIntervalContext interface { 16266 antlr.ParserRuleContext 16267 16268 // GetParser returns the parser. 16269 GetParser() antlr.Parser 16270 16271 // GetSign returns the sign token. 16272 GetSign() antlr.Token 16273 16274 // SetSign sets the sign token. 16275 SetSign(antlr.Token) 16276 16277 // GetFrom returns the from rule contexts. 16278 GetFrom() IIntervalFieldContext 16279 16280 // GetTo returns the to rule contexts. 16281 GetTo() IIntervalFieldContext 16282 16283 // SetFrom sets the from rule contexts. 16284 SetFrom(IIntervalFieldContext) 16285 16286 // SetTo sets the to rule contexts. 16287 SetTo(IIntervalFieldContext) 16288 16289 // IsIntervalContext differentiates from other interfaces. 16290 IsIntervalContext() 16291 } 16292 16293 type IntervalContext struct { 16294 *antlr.BaseParserRuleContext 16295 parser antlr.Parser 16296 sign antlr.Token 16297 from IIntervalFieldContext 16298 to IIntervalFieldContext 16299 } 16300 16301 func NewEmptyIntervalContext() *IntervalContext { 16302 var p = new(IntervalContext) 16303 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 16304 p.RuleIndex = SqlBaseParserRULE_interval 16305 return p 16306 } 16307 16308 func (*IntervalContext) IsIntervalContext() {} 16309 16310 func NewIntervalContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IntervalContext { 16311 var p = new(IntervalContext) 16312 16313 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 16314 16315 p.parser = parser 16316 p.RuleIndex = SqlBaseParserRULE_interval 16317 16318 return p 16319 } 16320 16321 func (s *IntervalContext) GetParser() antlr.Parser { return s.parser } 16322 16323 func (s *IntervalContext) GetSign() antlr.Token { return s.sign } 16324 16325 func (s *IntervalContext) SetSign(v antlr.Token) { s.sign = v } 16326 16327 func (s *IntervalContext) GetFrom() IIntervalFieldContext { return s.from } 16328 16329 func (s *IntervalContext) GetTo() IIntervalFieldContext { return s.to } 16330 16331 func (s *IntervalContext) SetFrom(v IIntervalFieldContext) { s.from = v } 16332 16333 func (s *IntervalContext) SetTo(v IIntervalFieldContext) { s.to = v } 16334 16335 func (s *IntervalContext) INTERVAL() antlr.TerminalNode { 16336 return s.GetToken(SqlBaseParserINTERVAL, 0) 16337 } 16338 16339 func (s *IntervalContext) Sql_string() ISql_stringContext { 16340 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISql_stringContext)(nil)).Elem(), 0) 16341 16342 if t == nil { 16343 return nil 16344 } 16345 16346 return t.(ISql_stringContext) 16347 } 16348 16349 func (s *IntervalContext) AllIntervalField() []IIntervalFieldContext { 16350 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIntervalFieldContext)(nil)).Elem()) 16351 var tst = make([]IIntervalFieldContext, len(ts)) 16352 16353 for i, t := range ts { 16354 if t != nil { 16355 tst[i] = t.(IIntervalFieldContext) 16356 } 16357 } 16358 16359 return tst 16360 } 16361 16362 func (s *IntervalContext) IntervalField(i int) IIntervalFieldContext { 16363 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIntervalFieldContext)(nil)).Elem(), i) 16364 16365 if t == nil { 16366 return nil 16367 } 16368 16369 return t.(IIntervalFieldContext) 16370 } 16371 16372 func (s *IntervalContext) TO() antlr.TerminalNode { 16373 return s.GetToken(SqlBaseParserTO, 0) 16374 } 16375 16376 func (s *IntervalContext) PLUS() antlr.TerminalNode { 16377 return s.GetToken(SqlBaseParserPLUS, 0) 16378 } 16379 16380 func (s *IntervalContext) MINUS() antlr.TerminalNode { 16381 return s.GetToken(SqlBaseParserMINUS, 0) 16382 } 16383 16384 func (s *IntervalContext) GetRuleContext() antlr.RuleContext { 16385 return s 16386 } 16387 16388 func (s *IntervalContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 16389 return antlr.TreesStringTree(s, ruleNames, recog) 16390 } 16391 16392 func (s *IntervalContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 16393 switch t := visitor.(type) { 16394 case SqlBaseVisitor: 16395 return t.VisitInterval(s) 16396 16397 default: 16398 return t.VisitChildren(s) 16399 } 16400 } 16401 16402 func (p *SqlBaseParser) Interval() (localctx IIntervalContext) { 16403 localctx = NewIntervalContext(p, p.GetParserRuleContext(), p.GetState()) 16404 p.EnterRule(localctx, 82, SqlBaseParserRULE_interval) 16405 var _la int 16406 16407 defer func() { 16408 p.ExitRule() 16409 }() 16410 16411 defer func() { 16412 if err := recover(); err != nil { 16413 if v, ok := err.(antlr.RecognitionException); ok { 16414 localctx.SetException(v) 16415 p.GetErrorHandler().ReportError(p, v) 16416 p.GetErrorHandler().Recover(p, v) 16417 } else { 16418 panic(err) 16419 } 16420 } 16421 }() 16422 16423 p.EnterOuterAlt(localctx, 1) 16424 { 16425 p.SetState(1258) 16426 p.Match(SqlBaseParserINTERVAL) 16427 } 16428 p.SetState(1260) 16429 p.GetErrorHandler().Sync(p) 16430 _la = p.GetTokenStream().LA(1) 16431 16432 if _la == SqlBaseParserPLUS || _la == SqlBaseParserMINUS { 16433 { 16434 p.SetState(1259) 16435 16436 var _lt = p.GetTokenStream().LT(1) 16437 16438 localctx.(*IntervalContext).sign = _lt 16439 16440 _la = p.GetTokenStream().LA(1) 16441 16442 if !(_la == SqlBaseParserPLUS || _la == SqlBaseParserMINUS) { 16443 var _ri = p.GetErrorHandler().RecoverInline(p) 16444 16445 localctx.(*IntervalContext).sign = _ri 16446 } else { 16447 p.GetErrorHandler().ReportMatch(p) 16448 p.Consume() 16449 } 16450 } 16451 16452 } 16453 { 16454 p.SetState(1262) 16455 p.Sql_string() 16456 } 16457 { 16458 p.SetState(1263) 16459 16460 var _x = p.IntervalField() 16461 16462 localctx.(*IntervalContext).from = _x 16463 } 16464 p.SetState(1266) 16465 p.GetErrorHandler().Sync(p) 16466 16467 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 158, p.GetParserRuleContext()) == 1 { 16468 { 16469 p.SetState(1264) 16470 p.Match(SqlBaseParserTO) 16471 } 16472 { 16473 p.SetState(1265) 16474 16475 var _x = p.IntervalField() 16476 16477 localctx.(*IntervalContext).to = _x 16478 } 16479 16480 } 16481 16482 return localctx 16483 } 16484 16485 // IIntervalFieldContext is an interface to support dynamic dispatch. 16486 type IIntervalFieldContext interface { 16487 antlr.ParserRuleContext 16488 16489 // GetParser returns the parser. 16490 GetParser() antlr.Parser 16491 16492 // IsIntervalFieldContext differentiates from other interfaces. 16493 IsIntervalFieldContext() 16494 } 16495 16496 type IntervalFieldContext struct { 16497 *antlr.BaseParserRuleContext 16498 parser antlr.Parser 16499 } 16500 16501 func NewEmptyIntervalFieldContext() *IntervalFieldContext { 16502 var p = new(IntervalFieldContext) 16503 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 16504 p.RuleIndex = SqlBaseParserRULE_intervalField 16505 return p 16506 } 16507 16508 func (*IntervalFieldContext) IsIntervalFieldContext() {} 16509 16510 func NewIntervalFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IntervalFieldContext { 16511 var p = new(IntervalFieldContext) 16512 16513 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 16514 16515 p.parser = parser 16516 p.RuleIndex = SqlBaseParserRULE_intervalField 16517 16518 return p 16519 } 16520 16521 func (s *IntervalFieldContext) GetParser() antlr.Parser { return s.parser } 16522 16523 func (s *IntervalFieldContext) YEAR() antlr.TerminalNode { 16524 return s.GetToken(SqlBaseParserYEAR, 0) 16525 } 16526 16527 func (s *IntervalFieldContext) MONTH() antlr.TerminalNode { 16528 return s.GetToken(SqlBaseParserMONTH, 0) 16529 } 16530 16531 func (s *IntervalFieldContext) DAY() antlr.TerminalNode { 16532 return s.GetToken(SqlBaseParserDAY, 0) 16533 } 16534 16535 func (s *IntervalFieldContext) HOUR() antlr.TerminalNode { 16536 return s.GetToken(SqlBaseParserHOUR, 0) 16537 } 16538 16539 func (s *IntervalFieldContext) MINUTE() antlr.TerminalNode { 16540 return s.GetToken(SqlBaseParserMINUTE, 0) 16541 } 16542 16543 func (s *IntervalFieldContext) SECOND() antlr.TerminalNode { 16544 return s.GetToken(SqlBaseParserSECOND, 0) 16545 } 16546 16547 func (s *IntervalFieldContext) GetRuleContext() antlr.RuleContext { 16548 return s 16549 } 16550 16551 func (s *IntervalFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 16552 return antlr.TreesStringTree(s, ruleNames, recog) 16553 } 16554 16555 func (s *IntervalFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 16556 switch t := visitor.(type) { 16557 case SqlBaseVisitor: 16558 return t.VisitIntervalField(s) 16559 16560 default: 16561 return t.VisitChildren(s) 16562 } 16563 } 16564 16565 func (p *SqlBaseParser) IntervalField() (localctx IIntervalFieldContext) { 16566 localctx = NewIntervalFieldContext(p, p.GetParserRuleContext(), p.GetState()) 16567 p.EnterRule(localctx, 84, SqlBaseParserRULE_intervalField) 16568 var _la int 16569 16570 defer func() { 16571 p.ExitRule() 16572 }() 16573 16574 defer func() { 16575 if err := recover(); err != nil { 16576 if v, ok := err.(antlr.RecognitionException); ok { 16577 localctx.SetException(v) 16578 p.GetErrorHandler().ReportError(p, v) 16579 p.GetErrorHandler().Recover(p, v) 16580 } else { 16581 panic(err) 16582 } 16583 } 16584 }() 16585 16586 p.EnterOuterAlt(localctx, 1) 16587 { 16588 p.SetState(1268) 16589 _la = p.GetTokenStream().LA(1) 16590 16591 if !(_la == SqlBaseParserDAY || (((_la-76)&-(0x1f+1)) == 0 && ((1<<uint((_la-76)))&((1<<(SqlBaseParserHOUR-76))|(1<<(SqlBaseParserMINUTE-76))|(1<<(SqlBaseParserMONTH-76)))) != 0) || _la == SqlBaseParserSECOND || _la == SqlBaseParserYEAR) { 16592 p.GetErrorHandler().RecoverInline(p) 16593 } else { 16594 p.GetErrorHandler().ReportMatch(p) 16595 p.Consume() 16596 } 16597 } 16598 16599 return localctx 16600 } 16601 16602 // INormalFormContext is an interface to support dynamic dispatch. 16603 type INormalFormContext interface { 16604 antlr.ParserRuleContext 16605 16606 // GetParser returns the parser. 16607 GetParser() antlr.Parser 16608 16609 // IsNormalFormContext differentiates from other interfaces. 16610 IsNormalFormContext() 16611 } 16612 16613 type NormalFormContext struct { 16614 *antlr.BaseParserRuleContext 16615 parser antlr.Parser 16616 } 16617 16618 func NewEmptyNormalFormContext() *NormalFormContext { 16619 var p = new(NormalFormContext) 16620 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 16621 p.RuleIndex = SqlBaseParserRULE_normalForm 16622 return p 16623 } 16624 16625 func (*NormalFormContext) IsNormalFormContext() {} 16626 16627 func NewNormalFormContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NormalFormContext { 16628 var p = new(NormalFormContext) 16629 16630 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 16631 16632 p.parser = parser 16633 p.RuleIndex = SqlBaseParserRULE_normalForm 16634 16635 return p 16636 } 16637 16638 func (s *NormalFormContext) GetParser() antlr.Parser { return s.parser } 16639 16640 func (s *NormalFormContext) NFD() antlr.TerminalNode { 16641 return s.GetToken(SqlBaseParserNFD, 0) 16642 } 16643 16644 func (s *NormalFormContext) NFC() antlr.TerminalNode { 16645 return s.GetToken(SqlBaseParserNFC, 0) 16646 } 16647 16648 func (s *NormalFormContext) NFKD() antlr.TerminalNode { 16649 return s.GetToken(SqlBaseParserNFKD, 0) 16650 } 16651 16652 func (s *NormalFormContext) NFKC() antlr.TerminalNode { 16653 return s.GetToken(SqlBaseParserNFKC, 0) 16654 } 16655 16656 func (s *NormalFormContext) GetRuleContext() antlr.RuleContext { 16657 return s 16658 } 16659 16660 func (s *NormalFormContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 16661 return antlr.TreesStringTree(s, ruleNames, recog) 16662 } 16663 16664 func (s *NormalFormContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 16665 switch t := visitor.(type) { 16666 case SqlBaseVisitor: 16667 return t.VisitNormalForm(s) 16668 16669 default: 16670 return t.VisitChildren(s) 16671 } 16672 } 16673 16674 func (p *SqlBaseParser) NormalForm() (localctx INormalFormContext) { 16675 localctx = NewNormalFormContext(p, p.GetParserRuleContext(), p.GetState()) 16676 p.EnterRule(localctx, 86, SqlBaseParserRULE_normalForm) 16677 var _la int 16678 16679 defer func() { 16680 p.ExitRule() 16681 }() 16682 16683 defer func() { 16684 if err := recover(); err != nil { 16685 if v, ok := err.(antlr.RecognitionException); ok { 16686 localctx.SetException(v) 16687 p.GetErrorHandler().ReportError(p, v) 16688 p.GetErrorHandler().Recover(p, v) 16689 } else { 16690 panic(err) 16691 } 16692 } 16693 }() 16694 16695 p.EnterOuterAlt(localctx, 1) 16696 { 16697 p.SetState(1270) 16698 _la = p.GetTokenStream().LA(1) 16699 16700 if !(((_la-102)&-(0x1f+1)) == 0 && ((1<<uint((_la-102)))&((1<<(SqlBaseParserNFC-102))|(1<<(SqlBaseParserNFD-102))|(1<<(SqlBaseParserNFKC-102))|(1<<(SqlBaseParserNFKD-102)))) != 0) { 16701 p.GetErrorHandler().RecoverInline(p) 16702 } else { 16703 p.GetErrorHandler().ReportMatch(p) 16704 p.Consume() 16705 } 16706 } 16707 16708 return localctx 16709 } 16710 16711 // ISqltypeContext is an interface to support dynamic dispatch. 16712 type ISqltypeContext interface { 16713 antlr.ParserRuleContext 16714 16715 // GetParser returns the parser. 16716 GetParser() antlr.Parser 16717 16718 // GetFrom returns the from rule contexts. 16719 GetFrom() IIntervalFieldContext 16720 16721 // GetTo returns the to rule contexts. 16722 GetTo() IIntervalFieldContext 16723 16724 // SetFrom sets the from rule contexts. 16725 SetFrom(IIntervalFieldContext) 16726 16727 // SetTo sets the to rule contexts. 16728 SetTo(IIntervalFieldContext) 16729 16730 // IsSqltypeContext differentiates from other interfaces. 16731 IsSqltypeContext() 16732 } 16733 16734 type SqltypeContext struct { 16735 *antlr.BaseParserRuleContext 16736 parser antlr.Parser 16737 from IIntervalFieldContext 16738 to IIntervalFieldContext 16739 } 16740 16741 func NewEmptySqltypeContext() *SqltypeContext { 16742 var p = new(SqltypeContext) 16743 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 16744 p.RuleIndex = SqlBaseParserRULE_sqltype 16745 return p 16746 } 16747 16748 func (*SqltypeContext) IsSqltypeContext() {} 16749 16750 func NewSqltypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SqltypeContext { 16751 var p = new(SqltypeContext) 16752 16753 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 16754 16755 p.parser = parser 16756 p.RuleIndex = SqlBaseParserRULE_sqltype 16757 16758 return p 16759 } 16760 16761 func (s *SqltypeContext) GetParser() antlr.Parser { return s.parser } 16762 16763 func (s *SqltypeContext) GetFrom() IIntervalFieldContext { return s.from } 16764 16765 func (s *SqltypeContext) GetTo() IIntervalFieldContext { return s.to } 16766 16767 func (s *SqltypeContext) SetFrom(v IIntervalFieldContext) { s.from = v } 16768 16769 func (s *SqltypeContext) SetTo(v IIntervalFieldContext) { s.to = v } 16770 16771 func (s *SqltypeContext) ARRAY() antlr.TerminalNode { 16772 return s.GetToken(SqlBaseParserARRAY, 0) 16773 } 16774 16775 func (s *SqltypeContext) AllSqltype() []ISqltypeContext { 16776 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISqltypeContext)(nil)).Elem()) 16777 var tst = make([]ISqltypeContext, len(ts)) 16778 16779 for i, t := range ts { 16780 if t != nil { 16781 tst[i] = t.(ISqltypeContext) 16782 } 16783 } 16784 16785 return tst 16786 } 16787 16788 func (s *SqltypeContext) Sqltype(i int) ISqltypeContext { 16789 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISqltypeContext)(nil)).Elem(), i) 16790 16791 if t == nil { 16792 return nil 16793 } 16794 16795 return t.(ISqltypeContext) 16796 } 16797 16798 func (s *SqltypeContext) MAP() antlr.TerminalNode { 16799 return s.GetToken(SqlBaseParserMAP, 0) 16800 } 16801 16802 func (s *SqltypeContext) ROW() antlr.TerminalNode { 16803 return s.GetToken(SqlBaseParserROW, 0) 16804 } 16805 16806 func (s *SqltypeContext) AllIdentifier() []IIdentifierContext { 16807 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIdentifierContext)(nil)).Elem()) 16808 var tst = make([]IIdentifierContext, len(ts)) 16809 16810 for i, t := range ts { 16811 if t != nil { 16812 tst[i] = t.(IIdentifierContext) 16813 } 16814 } 16815 16816 return tst 16817 } 16818 16819 func (s *SqltypeContext) Identifier(i int) IIdentifierContext { 16820 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), i) 16821 16822 if t == nil { 16823 return nil 16824 } 16825 16826 return t.(IIdentifierContext) 16827 } 16828 16829 func (s *SqltypeContext) BaseType() IBaseTypeContext { 16830 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBaseTypeContext)(nil)).Elem(), 0) 16831 16832 if t == nil { 16833 return nil 16834 } 16835 16836 return t.(IBaseTypeContext) 16837 } 16838 16839 func (s *SqltypeContext) AllTypeParameter() []ITypeParameterContext { 16840 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITypeParameterContext)(nil)).Elem()) 16841 var tst = make([]ITypeParameterContext, len(ts)) 16842 16843 for i, t := range ts { 16844 if t != nil { 16845 tst[i] = t.(ITypeParameterContext) 16846 } 16847 } 16848 16849 return tst 16850 } 16851 16852 func (s *SqltypeContext) TypeParameter(i int) ITypeParameterContext { 16853 var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeParameterContext)(nil)).Elem(), i) 16854 16855 if t == nil { 16856 return nil 16857 } 16858 16859 return t.(ITypeParameterContext) 16860 } 16861 16862 func (s *SqltypeContext) INTERVAL() antlr.TerminalNode { 16863 return s.GetToken(SqlBaseParserINTERVAL, 0) 16864 } 16865 16866 func (s *SqltypeContext) TO() antlr.TerminalNode { 16867 return s.GetToken(SqlBaseParserTO, 0) 16868 } 16869 16870 func (s *SqltypeContext) AllIntervalField() []IIntervalFieldContext { 16871 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIntervalFieldContext)(nil)).Elem()) 16872 var tst = make([]IIntervalFieldContext, len(ts)) 16873 16874 for i, t := range ts { 16875 if t != nil { 16876 tst[i] = t.(IIntervalFieldContext) 16877 } 16878 } 16879 16880 return tst 16881 } 16882 16883 func (s *SqltypeContext) IntervalField(i int) IIntervalFieldContext { 16884 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIntervalFieldContext)(nil)).Elem(), i) 16885 16886 if t == nil { 16887 return nil 16888 } 16889 16890 return t.(IIntervalFieldContext) 16891 } 16892 16893 func (s *SqltypeContext) GetRuleContext() antlr.RuleContext { 16894 return s 16895 } 16896 16897 func (s *SqltypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 16898 return antlr.TreesStringTree(s, ruleNames, recog) 16899 } 16900 16901 func (s *SqltypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 16902 switch t := visitor.(type) { 16903 case SqlBaseVisitor: 16904 return t.VisitSqltype(s) 16905 16906 default: 16907 return t.VisitChildren(s) 16908 } 16909 } 16910 16911 func (p *SqlBaseParser) Sqltype() (localctx ISqltypeContext) { 16912 return p.sqltype(0) 16913 } 16914 16915 func (p *SqlBaseParser) sqltype(_p int) (localctx ISqltypeContext) { 16916 var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() 16917 _parentState := p.GetState() 16918 localctx = NewSqltypeContext(p, p.GetParserRuleContext(), _parentState) 16919 var _prevctx ISqltypeContext = localctx 16920 var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. 16921 _startState := 88 16922 p.EnterRecursionRule(localctx, 88, SqlBaseParserRULE_sqltype, _p) 16923 var _la int 16924 16925 defer func() { 16926 p.UnrollRecursionContexts(_parentctx) 16927 }() 16928 16929 defer func() { 16930 if err := recover(); err != nil { 16931 if v, ok := err.(antlr.RecognitionException); ok { 16932 localctx.SetException(v) 16933 p.GetErrorHandler().ReportError(p, v) 16934 p.GetErrorHandler().Recover(p, v) 16935 } else { 16936 panic(err) 16937 } 16938 } 16939 }() 16940 16941 var _alt int 16942 16943 p.EnterOuterAlt(localctx, 1) 16944 p.SetState(1319) 16945 p.GetErrorHandler().Sync(p) 16946 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 162, p.GetParserRuleContext()) { 16947 case 1: 16948 { 16949 p.SetState(1273) 16950 p.Match(SqlBaseParserARRAY) 16951 } 16952 { 16953 p.SetState(1274) 16954 p.Match(SqlBaseParserLT) 16955 } 16956 { 16957 p.SetState(1275) 16958 p.sqltype(0) 16959 } 16960 { 16961 p.SetState(1276) 16962 p.Match(SqlBaseParserGT) 16963 } 16964 16965 case 2: 16966 { 16967 p.SetState(1278) 16968 p.Match(SqlBaseParserMAP) 16969 } 16970 { 16971 p.SetState(1279) 16972 p.Match(SqlBaseParserLT) 16973 } 16974 { 16975 p.SetState(1280) 16976 p.sqltype(0) 16977 } 16978 { 16979 p.SetState(1281) 16980 p.Match(SqlBaseParserT__3) 16981 } 16982 { 16983 p.SetState(1282) 16984 p.sqltype(0) 16985 } 16986 { 16987 p.SetState(1283) 16988 p.Match(SqlBaseParserGT) 16989 } 16990 16991 case 3: 16992 { 16993 p.SetState(1285) 16994 p.Match(SqlBaseParserROW) 16995 } 16996 { 16997 p.SetState(1286) 16998 p.Match(SqlBaseParserT__1) 16999 } 17000 { 17001 p.SetState(1287) 17002 p.Identifier() 17003 } 17004 { 17005 p.SetState(1288) 17006 p.sqltype(0) 17007 } 17008 p.SetState(1295) 17009 p.GetErrorHandler().Sync(p) 17010 _la = p.GetTokenStream().LA(1) 17011 17012 for _la == SqlBaseParserT__3 { 17013 { 17014 p.SetState(1289) 17015 p.Match(SqlBaseParserT__3) 17016 } 17017 { 17018 p.SetState(1290) 17019 p.Identifier() 17020 } 17021 { 17022 p.SetState(1291) 17023 p.sqltype(0) 17024 } 17025 17026 p.SetState(1297) 17027 p.GetErrorHandler().Sync(p) 17028 _la = p.GetTokenStream().LA(1) 17029 } 17030 { 17031 p.SetState(1298) 17032 p.Match(SqlBaseParserT__2) 17033 } 17034 17035 case 4: 17036 { 17037 p.SetState(1300) 17038 p.BaseType() 17039 } 17040 p.SetState(1312) 17041 p.GetErrorHandler().Sync(p) 17042 17043 if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 161, p.GetParserRuleContext()) == 1 { 17044 { 17045 p.SetState(1301) 17046 p.Match(SqlBaseParserT__1) 17047 } 17048 { 17049 p.SetState(1302) 17050 p.TypeParameter() 17051 } 17052 p.SetState(1307) 17053 p.GetErrorHandler().Sync(p) 17054 _la = p.GetTokenStream().LA(1) 17055 17056 for _la == SqlBaseParserT__3 { 17057 { 17058 p.SetState(1303) 17059 p.Match(SqlBaseParserT__3) 17060 } 17061 { 17062 p.SetState(1304) 17063 p.TypeParameter() 17064 } 17065 17066 p.SetState(1309) 17067 p.GetErrorHandler().Sync(p) 17068 _la = p.GetTokenStream().LA(1) 17069 } 17070 { 17071 p.SetState(1310) 17072 p.Match(SqlBaseParserT__2) 17073 } 17074 17075 } 17076 17077 case 5: 17078 { 17079 p.SetState(1314) 17080 p.Match(SqlBaseParserINTERVAL) 17081 } 17082 { 17083 p.SetState(1315) 17084 17085 var _x = p.IntervalField() 17086 17087 localctx.(*SqltypeContext).from = _x 17088 } 17089 { 17090 p.SetState(1316) 17091 p.Match(SqlBaseParserTO) 17092 } 17093 { 17094 p.SetState(1317) 17095 17096 var _x = p.IntervalField() 17097 17098 localctx.(*SqltypeContext).to = _x 17099 } 17100 17101 } 17102 p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) 17103 p.SetState(1325) 17104 p.GetErrorHandler().Sync(p) 17105 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 163, p.GetParserRuleContext()) 17106 17107 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 17108 if _alt == 1 { 17109 if p.GetParseListeners() != nil { 17110 p.TriggerExitRuleEvent() 17111 } 17112 _prevctx = localctx 17113 localctx = NewSqltypeContext(p, _parentctx, _parentState) 17114 p.PushNewRecursionContext(localctx, _startState, SqlBaseParserRULE_sqltype) 17115 p.SetState(1321) 17116 17117 if !(p.Precpred(p.GetParserRuleContext(), 6)) { 17118 panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 6)", "")) 17119 } 17120 { 17121 p.SetState(1322) 17122 p.Match(SqlBaseParserARRAY) 17123 } 17124 17125 } 17126 p.SetState(1327) 17127 p.GetErrorHandler().Sync(p) 17128 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 163, p.GetParserRuleContext()) 17129 } 17130 17131 return localctx 17132 } 17133 17134 // ITypeParameterContext is an interface to support dynamic dispatch. 17135 type ITypeParameterContext interface { 17136 antlr.ParserRuleContext 17137 17138 // GetParser returns the parser. 17139 GetParser() antlr.Parser 17140 17141 // IsTypeParameterContext differentiates from other interfaces. 17142 IsTypeParameterContext() 17143 } 17144 17145 type TypeParameterContext struct { 17146 *antlr.BaseParserRuleContext 17147 parser antlr.Parser 17148 } 17149 17150 func NewEmptyTypeParameterContext() *TypeParameterContext { 17151 var p = new(TypeParameterContext) 17152 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 17153 p.RuleIndex = SqlBaseParserRULE_typeParameter 17154 return p 17155 } 17156 17157 func (*TypeParameterContext) IsTypeParameterContext() {} 17158 17159 func NewTypeParameterContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeParameterContext { 17160 var p = new(TypeParameterContext) 17161 17162 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 17163 17164 p.parser = parser 17165 p.RuleIndex = SqlBaseParserRULE_typeParameter 17166 17167 return p 17168 } 17169 17170 func (s *TypeParameterContext) GetParser() antlr.Parser { return s.parser } 17171 17172 func (s *TypeParameterContext) INTEGER_VALUE() antlr.TerminalNode { 17173 return s.GetToken(SqlBaseParserINTEGER_VALUE, 0) 17174 } 17175 17176 func (s *TypeParameterContext) Sqltype() ISqltypeContext { 17177 var t = s.GetTypedRuleContext(reflect.TypeOf((*ISqltypeContext)(nil)).Elem(), 0) 17178 17179 if t == nil { 17180 return nil 17181 } 17182 17183 return t.(ISqltypeContext) 17184 } 17185 17186 func (s *TypeParameterContext) GetRuleContext() antlr.RuleContext { 17187 return s 17188 } 17189 17190 func (s *TypeParameterContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 17191 return antlr.TreesStringTree(s, ruleNames, recog) 17192 } 17193 17194 func (s *TypeParameterContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 17195 switch t := visitor.(type) { 17196 case SqlBaseVisitor: 17197 return t.VisitTypeParameter(s) 17198 17199 default: 17200 return t.VisitChildren(s) 17201 } 17202 } 17203 17204 func (p *SqlBaseParser) TypeParameter() (localctx ITypeParameterContext) { 17205 localctx = NewTypeParameterContext(p, p.GetParserRuleContext(), p.GetState()) 17206 p.EnterRule(localctx, 90, SqlBaseParserRULE_typeParameter) 17207 17208 defer func() { 17209 p.ExitRule() 17210 }() 17211 17212 defer func() { 17213 if err := recover(); err != nil { 17214 if v, ok := err.(antlr.RecognitionException); ok { 17215 localctx.SetException(v) 17216 p.GetErrorHandler().ReportError(p, v) 17217 p.GetErrorHandler().Recover(p, v) 17218 } else { 17219 panic(err) 17220 } 17221 } 17222 }() 17223 17224 p.SetState(1330) 17225 p.GetErrorHandler().Sync(p) 17226 17227 switch p.GetTokenStream().LA(1) { 17228 case SqlBaseParserINTEGER_VALUE: 17229 p.EnterOuterAlt(localctx, 1) 17230 { 17231 p.SetState(1328) 17232 p.Match(SqlBaseParserINTEGER_VALUE) 17233 } 17234 17235 case SqlBaseParserADD, SqlBaseParserALL, SqlBaseParserANALYZE, SqlBaseParserANY, SqlBaseParserARRAY, SqlBaseParserASC, SqlBaseParserAT, SqlBaseParserBERNOULLI, SqlBaseParserCALL, SqlBaseParserCASCADE, SqlBaseParserCATALOGS, SqlBaseParserCOALESCE, SqlBaseParserCOLUMN, SqlBaseParserCOLUMNS, SqlBaseParserCOMMENT, SqlBaseParserCOMMITTED, SqlBaseParserCURRENT, SqlBaseParserDATA, SqlBaseParserDATE, SqlBaseParserDAY, SqlBaseParserDESC, SqlBaseParserDISTRIBUTED, SqlBaseParserEXCLUDING, SqlBaseParserEXPLAIN, SqlBaseParserFILTER, SqlBaseParserFIRST, SqlBaseParserFOLLOWING, SqlBaseParserFORMAT, SqlBaseParserFUNCTIONS, SqlBaseParserGRANT, SqlBaseParserGRANTS, SqlBaseParserGRAPHVIZ, SqlBaseParserHOUR, SqlBaseParserIF, SqlBaseParserINCLUDING, SqlBaseParserINPUT, SqlBaseParserINTEGER, SqlBaseParserINTERVAL, SqlBaseParserLAST, SqlBaseParserLATERAL, SqlBaseParserLEVEL, SqlBaseParserLIMIT, SqlBaseParserLOGICAL, SqlBaseParserMAP, SqlBaseParserMINUTE, SqlBaseParserMONTH, SqlBaseParserNFC, SqlBaseParserNFD, SqlBaseParserNFKC, SqlBaseParserNFKD, SqlBaseParserNO, SqlBaseParserNULLIF, SqlBaseParserNULLS, SqlBaseParserONLY, SqlBaseParserOPTION, SqlBaseParserORDINALITY, SqlBaseParserOUTPUT, SqlBaseParserOVER, SqlBaseParserPARTITION, SqlBaseParserPARTITIONS, SqlBaseParserPOSITION, SqlBaseParserPRECEDING, SqlBaseParserPRIVILEGES, SqlBaseParserPROPERTIES, SqlBaseParserPUBLIC, SqlBaseParserRANGE, SqlBaseParserREAD, SqlBaseParserRENAME, SqlBaseParserREPEATABLE, SqlBaseParserREPLACE, SqlBaseParserRESET, SqlBaseParserRESTRICT, SqlBaseParserREVOKE, SqlBaseParserROLLBACK, SqlBaseParserROW, SqlBaseParserROWS, SqlBaseParserSCHEMA, SqlBaseParserSCHEMAS, SqlBaseParserSECOND, SqlBaseParserSERIALIZABLE, SqlBaseParserSESSION, SqlBaseParserSET, SqlBaseParserSETS, SqlBaseParserSHOW, SqlBaseParserSMALLINT, SqlBaseParserSOME, SqlBaseParserSTART, SqlBaseParserSTATS, SqlBaseParserSUBSTRING, SqlBaseParserSYSTEM, SqlBaseParserTABLES, SqlBaseParserTABLESAMPLE, SqlBaseParserTEXT, SqlBaseParserTIME, SqlBaseParserTIMESTAMP, SqlBaseParserTINYINT, SqlBaseParserTO, SqlBaseParserTRY_CAST, SqlBaseParserTYPE, SqlBaseParserUNBOUNDED, SqlBaseParserUNCOMMITTED, SqlBaseParserUSE, SqlBaseParserVALIDATE, SqlBaseParserVERBOSE, SqlBaseParserVIEW, SqlBaseParserWORK, SqlBaseParserWRITE, SqlBaseParserYEAR, SqlBaseParserZONE, SqlBaseParserIDENTIFIER, SqlBaseParserDIGIT_IDENTIFIER, SqlBaseParserQUOTED_IDENTIFIER, SqlBaseParserBACKQUOTED_IDENTIFIER, SqlBaseParserTIME_WITH_TIME_ZONE, SqlBaseParserTIMESTAMP_WITH_TIME_ZONE, SqlBaseParserDOUBLE_PRECISION, SqlBaseParserCOMMIT, SqlBaseParserISOLATION, SqlBaseParserTRANSACTION: 17236 p.EnterOuterAlt(localctx, 2) 17237 { 17238 p.SetState(1329) 17239 p.sqltype(0) 17240 } 17241 17242 default: 17243 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 17244 } 17245 17246 return localctx 17247 } 17248 17249 // IBaseTypeContext is an interface to support dynamic dispatch. 17250 type IBaseTypeContext interface { 17251 antlr.ParserRuleContext 17252 17253 // GetParser returns the parser. 17254 GetParser() antlr.Parser 17255 17256 // IsBaseTypeContext differentiates from other interfaces. 17257 IsBaseTypeContext() 17258 } 17259 17260 type BaseTypeContext struct { 17261 *antlr.BaseParserRuleContext 17262 parser antlr.Parser 17263 } 17264 17265 func NewEmptyBaseTypeContext() *BaseTypeContext { 17266 var p = new(BaseTypeContext) 17267 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 17268 p.RuleIndex = SqlBaseParserRULE_baseType 17269 return p 17270 } 17271 17272 func (*BaseTypeContext) IsBaseTypeContext() {} 17273 17274 func NewBaseTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BaseTypeContext { 17275 var p = new(BaseTypeContext) 17276 17277 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 17278 17279 p.parser = parser 17280 p.RuleIndex = SqlBaseParserRULE_baseType 17281 17282 return p 17283 } 17284 17285 func (s *BaseTypeContext) GetParser() antlr.Parser { return s.parser } 17286 17287 func (s *BaseTypeContext) TIME_WITH_TIME_ZONE() antlr.TerminalNode { 17288 return s.GetToken(SqlBaseParserTIME_WITH_TIME_ZONE, 0) 17289 } 17290 17291 func (s *BaseTypeContext) TIMESTAMP_WITH_TIME_ZONE() antlr.TerminalNode { 17292 return s.GetToken(SqlBaseParserTIMESTAMP_WITH_TIME_ZONE, 0) 17293 } 17294 17295 func (s *BaseTypeContext) DOUBLE_PRECISION() antlr.TerminalNode { 17296 return s.GetToken(SqlBaseParserDOUBLE_PRECISION, 0) 17297 } 17298 17299 func (s *BaseTypeContext) Identifier() IIdentifierContext { 17300 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 17301 17302 if t == nil { 17303 return nil 17304 } 17305 17306 return t.(IIdentifierContext) 17307 } 17308 17309 func (s *BaseTypeContext) GetRuleContext() antlr.RuleContext { 17310 return s 17311 } 17312 17313 func (s *BaseTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 17314 return antlr.TreesStringTree(s, ruleNames, recog) 17315 } 17316 17317 func (s *BaseTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 17318 switch t := visitor.(type) { 17319 case SqlBaseVisitor: 17320 return t.VisitBaseType(s) 17321 17322 default: 17323 return t.VisitChildren(s) 17324 } 17325 } 17326 17327 func (p *SqlBaseParser) BaseType() (localctx IBaseTypeContext) { 17328 localctx = NewBaseTypeContext(p, p.GetParserRuleContext(), p.GetState()) 17329 p.EnterRule(localctx, 92, SqlBaseParserRULE_baseType) 17330 17331 defer func() { 17332 p.ExitRule() 17333 }() 17334 17335 defer func() { 17336 if err := recover(); err != nil { 17337 if v, ok := err.(antlr.RecognitionException); ok { 17338 localctx.SetException(v) 17339 p.GetErrorHandler().ReportError(p, v) 17340 p.GetErrorHandler().Recover(p, v) 17341 } else { 17342 panic(err) 17343 } 17344 } 17345 }() 17346 17347 p.SetState(1336) 17348 p.GetErrorHandler().Sync(p) 17349 17350 switch p.GetTokenStream().LA(1) { 17351 case SqlBaseParserTIME_WITH_TIME_ZONE: 17352 p.EnterOuterAlt(localctx, 1) 17353 { 17354 p.SetState(1332) 17355 p.Match(SqlBaseParserTIME_WITH_TIME_ZONE) 17356 } 17357 17358 case SqlBaseParserTIMESTAMP_WITH_TIME_ZONE: 17359 p.EnterOuterAlt(localctx, 2) 17360 { 17361 p.SetState(1333) 17362 p.Match(SqlBaseParserTIMESTAMP_WITH_TIME_ZONE) 17363 } 17364 17365 case SqlBaseParserDOUBLE_PRECISION: 17366 p.EnterOuterAlt(localctx, 3) 17367 { 17368 p.SetState(1334) 17369 p.Match(SqlBaseParserDOUBLE_PRECISION) 17370 } 17371 17372 case SqlBaseParserADD, SqlBaseParserALL, SqlBaseParserANALYZE, SqlBaseParserANY, SqlBaseParserARRAY, SqlBaseParserASC, SqlBaseParserAT, SqlBaseParserBERNOULLI, SqlBaseParserCALL, SqlBaseParserCASCADE, SqlBaseParserCATALOGS, SqlBaseParserCOALESCE, SqlBaseParserCOLUMN, SqlBaseParserCOLUMNS, SqlBaseParserCOMMENT, SqlBaseParserCOMMITTED, SqlBaseParserCURRENT, SqlBaseParserDATA, SqlBaseParserDATE, SqlBaseParserDAY, SqlBaseParserDESC, SqlBaseParserDISTRIBUTED, SqlBaseParserEXCLUDING, SqlBaseParserEXPLAIN, SqlBaseParserFILTER, SqlBaseParserFIRST, SqlBaseParserFOLLOWING, SqlBaseParserFORMAT, SqlBaseParserFUNCTIONS, SqlBaseParserGRANT, SqlBaseParserGRANTS, SqlBaseParserGRAPHVIZ, SqlBaseParserHOUR, SqlBaseParserIF, SqlBaseParserINCLUDING, SqlBaseParserINPUT, SqlBaseParserINTEGER, SqlBaseParserINTERVAL, SqlBaseParserLAST, SqlBaseParserLATERAL, SqlBaseParserLEVEL, SqlBaseParserLIMIT, SqlBaseParserLOGICAL, SqlBaseParserMAP, SqlBaseParserMINUTE, SqlBaseParserMONTH, SqlBaseParserNFC, SqlBaseParserNFD, SqlBaseParserNFKC, SqlBaseParserNFKD, SqlBaseParserNO, SqlBaseParserNULLIF, SqlBaseParserNULLS, SqlBaseParserONLY, SqlBaseParserOPTION, SqlBaseParserORDINALITY, SqlBaseParserOUTPUT, SqlBaseParserOVER, SqlBaseParserPARTITION, SqlBaseParserPARTITIONS, SqlBaseParserPOSITION, SqlBaseParserPRECEDING, SqlBaseParserPRIVILEGES, SqlBaseParserPROPERTIES, SqlBaseParserPUBLIC, SqlBaseParserRANGE, SqlBaseParserREAD, SqlBaseParserRENAME, SqlBaseParserREPEATABLE, SqlBaseParserREPLACE, SqlBaseParserRESET, SqlBaseParserRESTRICT, SqlBaseParserREVOKE, SqlBaseParserROLLBACK, SqlBaseParserROW, SqlBaseParserROWS, SqlBaseParserSCHEMA, SqlBaseParserSCHEMAS, SqlBaseParserSECOND, SqlBaseParserSERIALIZABLE, SqlBaseParserSESSION, SqlBaseParserSET, SqlBaseParserSETS, SqlBaseParserSHOW, SqlBaseParserSMALLINT, SqlBaseParserSOME, SqlBaseParserSTART, SqlBaseParserSTATS, SqlBaseParserSUBSTRING, SqlBaseParserSYSTEM, SqlBaseParserTABLES, SqlBaseParserTABLESAMPLE, SqlBaseParserTEXT, SqlBaseParserTIME, SqlBaseParserTIMESTAMP, SqlBaseParserTINYINT, SqlBaseParserTO, SqlBaseParserTRY_CAST, SqlBaseParserTYPE, SqlBaseParserUNBOUNDED, SqlBaseParserUNCOMMITTED, SqlBaseParserUSE, SqlBaseParserVALIDATE, SqlBaseParserVERBOSE, SqlBaseParserVIEW, SqlBaseParserWORK, SqlBaseParserWRITE, SqlBaseParserYEAR, SqlBaseParserZONE, SqlBaseParserIDENTIFIER, SqlBaseParserDIGIT_IDENTIFIER, SqlBaseParserQUOTED_IDENTIFIER, SqlBaseParserBACKQUOTED_IDENTIFIER, SqlBaseParserCOMMIT, SqlBaseParserISOLATION, SqlBaseParserTRANSACTION: 17373 p.EnterOuterAlt(localctx, 4) 17374 { 17375 p.SetState(1335) 17376 p.Identifier() 17377 } 17378 17379 default: 17380 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 17381 } 17382 17383 return localctx 17384 } 17385 17386 // IWhenClauseContext is an interface to support dynamic dispatch. 17387 type IWhenClauseContext interface { 17388 antlr.ParserRuleContext 17389 17390 // GetParser returns the parser. 17391 GetParser() antlr.Parser 17392 17393 // GetCondition returns the condition rule contexts. 17394 GetCondition() IExpressionContext 17395 17396 // GetResult returns the result rule contexts. 17397 GetResult() IExpressionContext 17398 17399 // SetCondition sets the condition rule contexts. 17400 SetCondition(IExpressionContext) 17401 17402 // SetResult sets the result rule contexts. 17403 SetResult(IExpressionContext) 17404 17405 // IsWhenClauseContext differentiates from other interfaces. 17406 IsWhenClauseContext() 17407 } 17408 17409 type WhenClauseContext struct { 17410 *antlr.BaseParserRuleContext 17411 parser antlr.Parser 17412 condition IExpressionContext 17413 result IExpressionContext 17414 } 17415 17416 func NewEmptyWhenClauseContext() *WhenClauseContext { 17417 var p = new(WhenClauseContext) 17418 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 17419 p.RuleIndex = SqlBaseParserRULE_whenClause 17420 return p 17421 } 17422 17423 func (*WhenClauseContext) IsWhenClauseContext() {} 17424 17425 func NewWhenClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WhenClauseContext { 17426 var p = new(WhenClauseContext) 17427 17428 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 17429 17430 p.parser = parser 17431 p.RuleIndex = SqlBaseParserRULE_whenClause 17432 17433 return p 17434 } 17435 17436 func (s *WhenClauseContext) GetParser() antlr.Parser { return s.parser } 17437 17438 func (s *WhenClauseContext) GetCondition() IExpressionContext { return s.condition } 17439 17440 func (s *WhenClauseContext) GetResult() IExpressionContext { return s.result } 17441 17442 func (s *WhenClauseContext) SetCondition(v IExpressionContext) { s.condition = v } 17443 17444 func (s *WhenClauseContext) SetResult(v IExpressionContext) { s.result = v } 17445 17446 func (s *WhenClauseContext) WHEN() antlr.TerminalNode { 17447 return s.GetToken(SqlBaseParserWHEN, 0) 17448 } 17449 17450 func (s *WhenClauseContext) THEN() antlr.TerminalNode { 17451 return s.GetToken(SqlBaseParserTHEN, 0) 17452 } 17453 17454 func (s *WhenClauseContext) AllExpression() []IExpressionContext { 17455 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IExpressionContext)(nil)).Elem()) 17456 var tst = make([]IExpressionContext, len(ts)) 17457 17458 for i, t := range ts { 17459 if t != nil { 17460 tst[i] = t.(IExpressionContext) 17461 } 17462 } 17463 17464 return tst 17465 } 17466 17467 func (s *WhenClauseContext) Expression(i int) IExpressionContext { 17468 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), i) 17469 17470 if t == nil { 17471 return nil 17472 } 17473 17474 return t.(IExpressionContext) 17475 } 17476 17477 func (s *WhenClauseContext) GetRuleContext() antlr.RuleContext { 17478 return s 17479 } 17480 17481 func (s *WhenClauseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 17482 return antlr.TreesStringTree(s, ruleNames, recog) 17483 } 17484 17485 func (s *WhenClauseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 17486 switch t := visitor.(type) { 17487 case SqlBaseVisitor: 17488 return t.VisitWhenClause(s) 17489 17490 default: 17491 return t.VisitChildren(s) 17492 } 17493 } 17494 17495 func (p *SqlBaseParser) WhenClause() (localctx IWhenClauseContext) { 17496 localctx = NewWhenClauseContext(p, p.GetParserRuleContext(), p.GetState()) 17497 p.EnterRule(localctx, 94, SqlBaseParserRULE_whenClause) 17498 17499 defer func() { 17500 p.ExitRule() 17501 }() 17502 17503 defer func() { 17504 if err := recover(); err != nil { 17505 if v, ok := err.(antlr.RecognitionException); ok { 17506 localctx.SetException(v) 17507 p.GetErrorHandler().ReportError(p, v) 17508 p.GetErrorHandler().Recover(p, v) 17509 } else { 17510 panic(err) 17511 } 17512 } 17513 }() 17514 17515 p.EnterOuterAlt(localctx, 1) 17516 { 17517 p.SetState(1338) 17518 p.Match(SqlBaseParserWHEN) 17519 } 17520 { 17521 p.SetState(1339) 17522 17523 var _x = p.Expression() 17524 17525 localctx.(*WhenClauseContext).condition = _x 17526 } 17527 { 17528 p.SetState(1340) 17529 p.Match(SqlBaseParserTHEN) 17530 } 17531 { 17532 p.SetState(1341) 17533 17534 var _x = p.Expression() 17535 17536 localctx.(*WhenClauseContext).result = _x 17537 } 17538 17539 return localctx 17540 } 17541 17542 // IFilterContext is an interface to support dynamic dispatch. 17543 type IFilterContext interface { 17544 antlr.ParserRuleContext 17545 17546 // GetParser returns the parser. 17547 GetParser() antlr.Parser 17548 17549 // IsFilterContext differentiates from other interfaces. 17550 IsFilterContext() 17551 } 17552 17553 type FilterContext struct { 17554 *antlr.BaseParserRuleContext 17555 parser antlr.Parser 17556 } 17557 17558 func NewEmptyFilterContext() *FilterContext { 17559 var p = new(FilterContext) 17560 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 17561 p.RuleIndex = SqlBaseParserRULE_filter 17562 return p 17563 } 17564 17565 func (*FilterContext) IsFilterContext() {} 17566 17567 func NewFilterContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FilterContext { 17568 var p = new(FilterContext) 17569 17570 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 17571 17572 p.parser = parser 17573 p.RuleIndex = SqlBaseParserRULE_filter 17574 17575 return p 17576 } 17577 17578 func (s *FilterContext) GetParser() antlr.Parser { return s.parser } 17579 17580 func (s *FilterContext) FILTER() antlr.TerminalNode { 17581 return s.GetToken(SqlBaseParserFILTER, 0) 17582 } 17583 17584 func (s *FilterContext) WHERE() antlr.TerminalNode { 17585 return s.GetToken(SqlBaseParserWHERE, 0) 17586 } 17587 17588 func (s *FilterContext) BooleanExpression() IBooleanExpressionContext { 17589 var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) 17590 17591 if t == nil { 17592 return nil 17593 } 17594 17595 return t.(IBooleanExpressionContext) 17596 } 17597 17598 func (s *FilterContext) GetRuleContext() antlr.RuleContext { 17599 return s 17600 } 17601 17602 func (s *FilterContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 17603 return antlr.TreesStringTree(s, ruleNames, recog) 17604 } 17605 17606 func (s *FilterContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 17607 switch t := visitor.(type) { 17608 case SqlBaseVisitor: 17609 return t.VisitFilter(s) 17610 17611 default: 17612 return t.VisitChildren(s) 17613 } 17614 } 17615 17616 func (p *SqlBaseParser) Filter() (localctx IFilterContext) { 17617 localctx = NewFilterContext(p, p.GetParserRuleContext(), p.GetState()) 17618 p.EnterRule(localctx, 96, SqlBaseParserRULE_filter) 17619 17620 defer func() { 17621 p.ExitRule() 17622 }() 17623 17624 defer func() { 17625 if err := recover(); err != nil { 17626 if v, ok := err.(antlr.RecognitionException); ok { 17627 localctx.SetException(v) 17628 p.GetErrorHandler().ReportError(p, v) 17629 p.GetErrorHandler().Recover(p, v) 17630 } else { 17631 panic(err) 17632 } 17633 } 17634 }() 17635 17636 p.EnterOuterAlt(localctx, 1) 17637 { 17638 p.SetState(1343) 17639 p.Match(SqlBaseParserFILTER) 17640 } 17641 { 17642 p.SetState(1344) 17643 p.Match(SqlBaseParserT__1) 17644 } 17645 { 17646 p.SetState(1345) 17647 p.Match(SqlBaseParserWHERE) 17648 } 17649 { 17650 p.SetState(1346) 17651 p.booleanExpression(0) 17652 } 17653 { 17654 p.SetState(1347) 17655 p.Match(SqlBaseParserT__2) 17656 } 17657 17658 return localctx 17659 } 17660 17661 // IExplainOptionContext is an interface to support dynamic dispatch. 17662 type IExplainOptionContext interface { 17663 antlr.ParserRuleContext 17664 17665 // GetParser returns the parser. 17666 GetParser() antlr.Parser 17667 17668 // IsExplainOptionContext differentiates from other interfaces. 17669 IsExplainOptionContext() 17670 } 17671 17672 type ExplainOptionContext struct { 17673 *antlr.BaseParserRuleContext 17674 parser antlr.Parser 17675 } 17676 17677 func NewEmptyExplainOptionContext() *ExplainOptionContext { 17678 var p = new(ExplainOptionContext) 17679 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 17680 p.RuleIndex = SqlBaseParserRULE_explainOption 17681 return p 17682 } 17683 17684 func (*ExplainOptionContext) IsExplainOptionContext() {} 17685 17686 func NewExplainOptionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExplainOptionContext { 17687 var p = new(ExplainOptionContext) 17688 17689 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 17690 17691 p.parser = parser 17692 p.RuleIndex = SqlBaseParserRULE_explainOption 17693 17694 return p 17695 } 17696 17697 func (s *ExplainOptionContext) GetParser() antlr.Parser { return s.parser } 17698 17699 func (s *ExplainOptionContext) CopyFrom(ctx *ExplainOptionContext) { 17700 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 17701 } 17702 17703 func (s *ExplainOptionContext) GetRuleContext() antlr.RuleContext { 17704 return s 17705 } 17706 17707 func (s *ExplainOptionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 17708 return antlr.TreesStringTree(s, ruleNames, recog) 17709 } 17710 17711 type ExplainFormatContext struct { 17712 *ExplainOptionContext 17713 value antlr.Token 17714 } 17715 17716 func NewExplainFormatContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExplainFormatContext { 17717 var p = new(ExplainFormatContext) 17718 17719 p.ExplainOptionContext = NewEmptyExplainOptionContext() 17720 p.parser = parser 17721 p.CopyFrom(ctx.(*ExplainOptionContext)) 17722 17723 return p 17724 } 17725 17726 func (s *ExplainFormatContext) GetValue() antlr.Token { return s.value } 17727 17728 func (s *ExplainFormatContext) SetValue(v antlr.Token) { s.value = v } 17729 17730 func (s *ExplainFormatContext) GetRuleContext() antlr.RuleContext { 17731 return s 17732 } 17733 17734 func (s *ExplainFormatContext) FORMAT() antlr.TerminalNode { 17735 return s.GetToken(SqlBaseParserFORMAT, 0) 17736 } 17737 17738 func (s *ExplainFormatContext) TEXT() antlr.TerminalNode { 17739 return s.GetToken(SqlBaseParserTEXT, 0) 17740 } 17741 17742 func (s *ExplainFormatContext) GRAPHVIZ() antlr.TerminalNode { 17743 return s.GetToken(SqlBaseParserGRAPHVIZ, 0) 17744 } 17745 17746 func (s *ExplainFormatContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 17747 switch t := visitor.(type) { 17748 case SqlBaseVisitor: 17749 return t.VisitExplainFormat(s) 17750 17751 default: 17752 return t.VisitChildren(s) 17753 } 17754 } 17755 17756 type ExplainTypeContext struct { 17757 *ExplainOptionContext 17758 value antlr.Token 17759 } 17760 17761 func NewExplainTypeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExplainTypeContext { 17762 var p = new(ExplainTypeContext) 17763 17764 p.ExplainOptionContext = NewEmptyExplainOptionContext() 17765 p.parser = parser 17766 p.CopyFrom(ctx.(*ExplainOptionContext)) 17767 17768 return p 17769 } 17770 17771 func (s *ExplainTypeContext) GetValue() antlr.Token { return s.value } 17772 17773 func (s *ExplainTypeContext) SetValue(v antlr.Token) { s.value = v } 17774 17775 func (s *ExplainTypeContext) GetRuleContext() antlr.RuleContext { 17776 return s 17777 } 17778 17779 func (s *ExplainTypeContext) TYPE() antlr.TerminalNode { 17780 return s.GetToken(SqlBaseParserTYPE, 0) 17781 } 17782 17783 func (s *ExplainTypeContext) LOGICAL() antlr.TerminalNode { 17784 return s.GetToken(SqlBaseParserLOGICAL, 0) 17785 } 17786 17787 func (s *ExplainTypeContext) DISTRIBUTED() antlr.TerminalNode { 17788 return s.GetToken(SqlBaseParserDISTRIBUTED, 0) 17789 } 17790 17791 func (s *ExplainTypeContext) VALIDATE() antlr.TerminalNode { 17792 return s.GetToken(SqlBaseParserVALIDATE, 0) 17793 } 17794 17795 func (s *ExplainTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 17796 switch t := visitor.(type) { 17797 case SqlBaseVisitor: 17798 return t.VisitExplainType(s) 17799 17800 default: 17801 return t.VisitChildren(s) 17802 } 17803 } 17804 17805 func (p *SqlBaseParser) ExplainOption() (localctx IExplainOptionContext) { 17806 localctx = NewExplainOptionContext(p, p.GetParserRuleContext(), p.GetState()) 17807 p.EnterRule(localctx, 98, SqlBaseParserRULE_explainOption) 17808 var _la int 17809 17810 defer func() { 17811 p.ExitRule() 17812 }() 17813 17814 defer func() { 17815 if err := recover(); err != nil { 17816 if v, ok := err.(antlr.RecognitionException); ok { 17817 localctx.SetException(v) 17818 p.GetErrorHandler().ReportError(p, v) 17819 p.GetErrorHandler().Recover(p, v) 17820 } else { 17821 panic(err) 17822 } 17823 } 17824 }() 17825 17826 p.SetState(1353) 17827 p.GetErrorHandler().Sync(p) 17828 17829 switch p.GetTokenStream().LA(1) { 17830 case SqlBaseParserFORMAT: 17831 localctx = NewExplainFormatContext(p, localctx) 17832 p.EnterOuterAlt(localctx, 1) 17833 { 17834 p.SetState(1349) 17835 p.Match(SqlBaseParserFORMAT) 17836 } 17837 { 17838 p.SetState(1350) 17839 17840 var _lt = p.GetTokenStream().LT(1) 17841 17842 localctx.(*ExplainFormatContext).value = _lt 17843 17844 _la = p.GetTokenStream().LA(1) 17845 17846 if !(_la == SqlBaseParserGRAPHVIZ || _la == SqlBaseParserTEXT) { 17847 var _ri = p.GetErrorHandler().RecoverInline(p) 17848 17849 localctx.(*ExplainFormatContext).value = _ri 17850 } else { 17851 p.GetErrorHandler().ReportMatch(p) 17852 p.Consume() 17853 } 17854 } 17855 17856 case SqlBaseParserTYPE: 17857 localctx = NewExplainTypeContext(p, localctx) 17858 p.EnterOuterAlt(localctx, 2) 17859 { 17860 p.SetState(1351) 17861 p.Match(SqlBaseParserTYPE) 17862 } 17863 { 17864 p.SetState(1352) 17865 17866 var _lt = p.GetTokenStream().LT(1) 17867 17868 localctx.(*ExplainTypeContext).value = _lt 17869 17870 _la = p.GetTokenStream().LA(1) 17871 17872 if !(_la == SqlBaseParserDISTRIBUTED || _la == SqlBaseParserLOGICAL || _la == SqlBaseParserVALIDATE) { 17873 var _ri = p.GetErrorHandler().RecoverInline(p) 17874 17875 localctx.(*ExplainTypeContext).value = _ri 17876 } else { 17877 p.GetErrorHandler().ReportMatch(p) 17878 p.Consume() 17879 } 17880 } 17881 17882 default: 17883 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 17884 } 17885 17886 return localctx 17887 } 17888 17889 // ICallArgumentContext is an interface to support dynamic dispatch. 17890 type ICallArgumentContext interface { 17891 antlr.ParserRuleContext 17892 17893 // GetParser returns the parser. 17894 GetParser() antlr.Parser 17895 17896 // IsCallArgumentContext differentiates from other interfaces. 17897 IsCallArgumentContext() 17898 } 17899 17900 type CallArgumentContext struct { 17901 *antlr.BaseParserRuleContext 17902 parser antlr.Parser 17903 } 17904 17905 func NewEmptyCallArgumentContext() *CallArgumentContext { 17906 var p = new(CallArgumentContext) 17907 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 17908 p.RuleIndex = SqlBaseParserRULE_callArgument 17909 return p 17910 } 17911 17912 func (*CallArgumentContext) IsCallArgumentContext() {} 17913 17914 func NewCallArgumentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CallArgumentContext { 17915 var p = new(CallArgumentContext) 17916 17917 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 17918 17919 p.parser = parser 17920 p.RuleIndex = SqlBaseParserRULE_callArgument 17921 17922 return p 17923 } 17924 17925 func (s *CallArgumentContext) GetParser() antlr.Parser { return s.parser } 17926 17927 func (s *CallArgumentContext) CopyFrom(ctx *CallArgumentContext) { 17928 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 17929 } 17930 17931 func (s *CallArgumentContext) GetRuleContext() antlr.RuleContext { 17932 return s 17933 } 17934 17935 func (s *CallArgumentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 17936 return antlr.TreesStringTree(s, ruleNames, recog) 17937 } 17938 17939 type PositionalArgumentContext struct { 17940 *CallArgumentContext 17941 } 17942 17943 func NewPositionalArgumentContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PositionalArgumentContext { 17944 var p = new(PositionalArgumentContext) 17945 17946 p.CallArgumentContext = NewEmptyCallArgumentContext() 17947 p.parser = parser 17948 p.CopyFrom(ctx.(*CallArgumentContext)) 17949 17950 return p 17951 } 17952 17953 func (s *PositionalArgumentContext) GetRuleContext() antlr.RuleContext { 17954 return s 17955 } 17956 17957 func (s *PositionalArgumentContext) Expression() IExpressionContext { 17958 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 17959 17960 if t == nil { 17961 return nil 17962 } 17963 17964 return t.(IExpressionContext) 17965 } 17966 17967 func (s *PositionalArgumentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 17968 switch t := visitor.(type) { 17969 case SqlBaseVisitor: 17970 return t.VisitPositionalArgument(s) 17971 17972 default: 17973 return t.VisitChildren(s) 17974 } 17975 } 17976 17977 type NamedArgumentContext struct { 17978 *CallArgumentContext 17979 } 17980 17981 func NewNamedArgumentContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NamedArgumentContext { 17982 var p = new(NamedArgumentContext) 17983 17984 p.CallArgumentContext = NewEmptyCallArgumentContext() 17985 p.parser = parser 17986 p.CopyFrom(ctx.(*CallArgumentContext)) 17987 17988 return p 17989 } 17990 17991 func (s *NamedArgumentContext) GetRuleContext() antlr.RuleContext { 17992 return s 17993 } 17994 17995 func (s *NamedArgumentContext) Identifier() IIdentifierContext { 17996 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 17997 17998 if t == nil { 17999 return nil 18000 } 18001 18002 return t.(IIdentifierContext) 18003 } 18004 18005 func (s *NamedArgumentContext) Expression() IExpressionContext { 18006 var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) 18007 18008 if t == nil { 18009 return nil 18010 } 18011 18012 return t.(IExpressionContext) 18013 } 18014 18015 func (s *NamedArgumentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18016 switch t := visitor.(type) { 18017 case SqlBaseVisitor: 18018 return t.VisitNamedArgument(s) 18019 18020 default: 18021 return t.VisitChildren(s) 18022 } 18023 } 18024 18025 func (p *SqlBaseParser) CallArgument() (localctx ICallArgumentContext) { 18026 localctx = NewCallArgumentContext(p, p.GetParserRuleContext(), p.GetState()) 18027 p.EnterRule(localctx, 100, SqlBaseParserRULE_callArgument) 18028 18029 defer func() { 18030 p.ExitRule() 18031 }() 18032 18033 defer func() { 18034 if err := recover(); err != nil { 18035 if v, ok := err.(antlr.RecognitionException); ok { 18036 localctx.SetException(v) 18037 p.GetErrorHandler().ReportError(p, v) 18038 p.GetErrorHandler().Recover(p, v) 18039 } else { 18040 panic(err) 18041 } 18042 } 18043 }() 18044 18045 p.SetState(1360) 18046 p.GetErrorHandler().Sync(p) 18047 switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 167, p.GetParserRuleContext()) { 18048 case 1: 18049 localctx = NewPositionalArgumentContext(p, localctx) 18050 p.EnterOuterAlt(localctx, 1) 18051 { 18052 p.SetState(1355) 18053 p.Expression() 18054 } 18055 18056 case 2: 18057 localctx = NewNamedArgumentContext(p, localctx) 18058 p.EnterOuterAlt(localctx, 2) 18059 { 18060 p.SetState(1356) 18061 p.Identifier() 18062 } 18063 { 18064 p.SetState(1357) 18065 p.Match(SqlBaseParserT__8) 18066 } 18067 { 18068 p.SetState(1358) 18069 p.Expression() 18070 } 18071 18072 } 18073 18074 return localctx 18075 } 18076 18077 // IPrivilegeContext is an interface to support dynamic dispatch. 18078 type IPrivilegeContext interface { 18079 antlr.ParserRuleContext 18080 18081 // GetParser returns the parser. 18082 GetParser() antlr.Parser 18083 18084 // IsPrivilegeContext differentiates from other interfaces. 18085 IsPrivilegeContext() 18086 } 18087 18088 type PrivilegeContext struct { 18089 *antlr.BaseParserRuleContext 18090 parser antlr.Parser 18091 } 18092 18093 func NewEmptyPrivilegeContext() *PrivilegeContext { 18094 var p = new(PrivilegeContext) 18095 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 18096 p.RuleIndex = SqlBaseParserRULE_privilege 18097 return p 18098 } 18099 18100 func (*PrivilegeContext) IsPrivilegeContext() {} 18101 18102 func NewPrivilegeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PrivilegeContext { 18103 var p = new(PrivilegeContext) 18104 18105 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 18106 18107 p.parser = parser 18108 p.RuleIndex = SqlBaseParserRULE_privilege 18109 18110 return p 18111 } 18112 18113 func (s *PrivilegeContext) GetParser() antlr.Parser { return s.parser } 18114 18115 func (s *PrivilegeContext) SELECT() antlr.TerminalNode { 18116 return s.GetToken(SqlBaseParserSELECT, 0) 18117 } 18118 18119 func (s *PrivilegeContext) DELETE() antlr.TerminalNode { 18120 return s.GetToken(SqlBaseParserDELETE, 0) 18121 } 18122 18123 func (s *PrivilegeContext) INSERT() antlr.TerminalNode { 18124 return s.GetToken(SqlBaseParserINSERT, 0) 18125 } 18126 18127 func (s *PrivilegeContext) Identifier() IIdentifierContext { 18128 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), 0) 18129 18130 if t == nil { 18131 return nil 18132 } 18133 18134 return t.(IIdentifierContext) 18135 } 18136 18137 func (s *PrivilegeContext) GetRuleContext() antlr.RuleContext { 18138 return s 18139 } 18140 18141 func (s *PrivilegeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 18142 return antlr.TreesStringTree(s, ruleNames, recog) 18143 } 18144 18145 func (s *PrivilegeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18146 switch t := visitor.(type) { 18147 case SqlBaseVisitor: 18148 return t.VisitPrivilege(s) 18149 18150 default: 18151 return t.VisitChildren(s) 18152 } 18153 } 18154 18155 func (p *SqlBaseParser) Privilege() (localctx IPrivilegeContext) { 18156 localctx = NewPrivilegeContext(p, p.GetParserRuleContext(), p.GetState()) 18157 p.EnterRule(localctx, 102, SqlBaseParserRULE_privilege) 18158 18159 defer func() { 18160 p.ExitRule() 18161 }() 18162 18163 defer func() { 18164 if err := recover(); err != nil { 18165 if v, ok := err.(antlr.RecognitionException); ok { 18166 localctx.SetException(v) 18167 p.GetErrorHandler().ReportError(p, v) 18168 p.GetErrorHandler().Recover(p, v) 18169 } else { 18170 panic(err) 18171 } 18172 } 18173 }() 18174 18175 p.SetState(1366) 18176 p.GetErrorHandler().Sync(p) 18177 18178 switch p.GetTokenStream().LA(1) { 18179 case SqlBaseParserSELECT: 18180 p.EnterOuterAlt(localctx, 1) 18181 { 18182 p.SetState(1362) 18183 p.Match(SqlBaseParserSELECT) 18184 } 18185 18186 case SqlBaseParserDELETE: 18187 p.EnterOuterAlt(localctx, 2) 18188 { 18189 p.SetState(1363) 18190 p.Match(SqlBaseParserDELETE) 18191 } 18192 18193 case SqlBaseParserINSERT: 18194 p.EnterOuterAlt(localctx, 3) 18195 { 18196 p.SetState(1364) 18197 p.Match(SqlBaseParserINSERT) 18198 } 18199 18200 case SqlBaseParserADD, SqlBaseParserALL, SqlBaseParserANALYZE, SqlBaseParserANY, SqlBaseParserARRAY, SqlBaseParserASC, SqlBaseParserAT, SqlBaseParserBERNOULLI, SqlBaseParserCALL, SqlBaseParserCASCADE, SqlBaseParserCATALOGS, SqlBaseParserCOALESCE, SqlBaseParserCOLUMN, SqlBaseParserCOLUMNS, SqlBaseParserCOMMENT, SqlBaseParserCOMMITTED, SqlBaseParserCURRENT, SqlBaseParserDATA, SqlBaseParserDATE, SqlBaseParserDAY, SqlBaseParserDESC, SqlBaseParserDISTRIBUTED, SqlBaseParserEXCLUDING, SqlBaseParserEXPLAIN, SqlBaseParserFILTER, SqlBaseParserFIRST, SqlBaseParserFOLLOWING, SqlBaseParserFORMAT, SqlBaseParserFUNCTIONS, SqlBaseParserGRANT, SqlBaseParserGRANTS, SqlBaseParserGRAPHVIZ, SqlBaseParserHOUR, SqlBaseParserIF, SqlBaseParserINCLUDING, SqlBaseParserINPUT, SqlBaseParserINTEGER, SqlBaseParserINTERVAL, SqlBaseParserLAST, SqlBaseParserLATERAL, SqlBaseParserLEVEL, SqlBaseParserLIMIT, SqlBaseParserLOGICAL, SqlBaseParserMAP, SqlBaseParserMINUTE, SqlBaseParserMONTH, SqlBaseParserNFC, SqlBaseParserNFD, SqlBaseParserNFKC, SqlBaseParserNFKD, SqlBaseParserNO, SqlBaseParserNULLIF, SqlBaseParserNULLS, SqlBaseParserONLY, SqlBaseParserOPTION, SqlBaseParserORDINALITY, SqlBaseParserOUTPUT, SqlBaseParserOVER, SqlBaseParserPARTITION, SqlBaseParserPARTITIONS, SqlBaseParserPOSITION, SqlBaseParserPRECEDING, SqlBaseParserPRIVILEGES, SqlBaseParserPROPERTIES, SqlBaseParserPUBLIC, SqlBaseParserRANGE, SqlBaseParserREAD, SqlBaseParserRENAME, SqlBaseParserREPEATABLE, SqlBaseParserREPLACE, SqlBaseParserRESET, SqlBaseParserRESTRICT, SqlBaseParserREVOKE, SqlBaseParserROLLBACK, SqlBaseParserROW, SqlBaseParserROWS, SqlBaseParserSCHEMA, SqlBaseParserSCHEMAS, SqlBaseParserSECOND, SqlBaseParserSERIALIZABLE, SqlBaseParserSESSION, SqlBaseParserSET, SqlBaseParserSETS, SqlBaseParserSHOW, SqlBaseParserSMALLINT, SqlBaseParserSOME, SqlBaseParserSTART, SqlBaseParserSTATS, SqlBaseParserSUBSTRING, SqlBaseParserSYSTEM, SqlBaseParserTABLES, SqlBaseParserTABLESAMPLE, SqlBaseParserTEXT, SqlBaseParserTIME, SqlBaseParserTIMESTAMP, SqlBaseParserTINYINT, SqlBaseParserTO, SqlBaseParserTRY_CAST, SqlBaseParserTYPE, SqlBaseParserUNBOUNDED, SqlBaseParserUNCOMMITTED, SqlBaseParserUSE, SqlBaseParserVALIDATE, SqlBaseParserVERBOSE, SqlBaseParserVIEW, SqlBaseParserWORK, SqlBaseParserWRITE, SqlBaseParserYEAR, SqlBaseParserZONE, SqlBaseParserIDENTIFIER, SqlBaseParserDIGIT_IDENTIFIER, SqlBaseParserQUOTED_IDENTIFIER, SqlBaseParserBACKQUOTED_IDENTIFIER, SqlBaseParserCOMMIT, SqlBaseParserISOLATION, SqlBaseParserTRANSACTION: 18201 p.EnterOuterAlt(localctx, 4) 18202 { 18203 p.SetState(1365) 18204 p.Identifier() 18205 } 18206 18207 default: 18208 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 18209 } 18210 18211 return localctx 18212 } 18213 18214 // IQualifiedNameContext is an interface to support dynamic dispatch. 18215 type IQualifiedNameContext interface { 18216 antlr.ParserRuleContext 18217 18218 // GetParser returns the parser. 18219 GetParser() antlr.Parser 18220 18221 // IsQualifiedNameContext differentiates from other interfaces. 18222 IsQualifiedNameContext() 18223 } 18224 18225 type QualifiedNameContext struct { 18226 *antlr.BaseParserRuleContext 18227 parser antlr.Parser 18228 } 18229 18230 func NewEmptyQualifiedNameContext() *QualifiedNameContext { 18231 var p = new(QualifiedNameContext) 18232 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 18233 p.RuleIndex = SqlBaseParserRULE_qualifiedName 18234 return p 18235 } 18236 18237 func (*QualifiedNameContext) IsQualifiedNameContext() {} 18238 18239 func NewQualifiedNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *QualifiedNameContext { 18240 var p = new(QualifiedNameContext) 18241 18242 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 18243 18244 p.parser = parser 18245 p.RuleIndex = SqlBaseParserRULE_qualifiedName 18246 18247 return p 18248 } 18249 18250 func (s *QualifiedNameContext) GetParser() antlr.Parser { return s.parser } 18251 18252 func (s *QualifiedNameContext) AllIdentifier() []IIdentifierContext { 18253 var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IIdentifierContext)(nil)).Elem()) 18254 var tst = make([]IIdentifierContext, len(ts)) 18255 18256 for i, t := range ts { 18257 if t != nil { 18258 tst[i] = t.(IIdentifierContext) 18259 } 18260 } 18261 18262 return tst 18263 } 18264 18265 func (s *QualifiedNameContext) Identifier(i int) IIdentifierContext { 18266 var t = s.GetTypedRuleContext(reflect.TypeOf((*IIdentifierContext)(nil)).Elem(), i) 18267 18268 if t == nil { 18269 return nil 18270 } 18271 18272 return t.(IIdentifierContext) 18273 } 18274 18275 func (s *QualifiedNameContext) GetRuleContext() antlr.RuleContext { 18276 return s 18277 } 18278 18279 func (s *QualifiedNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 18280 return antlr.TreesStringTree(s, ruleNames, recog) 18281 } 18282 18283 func (s *QualifiedNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18284 switch t := visitor.(type) { 18285 case SqlBaseVisitor: 18286 return t.VisitQualifiedName(s) 18287 18288 default: 18289 return t.VisitChildren(s) 18290 } 18291 } 18292 18293 func (p *SqlBaseParser) QualifiedName() (localctx IQualifiedNameContext) { 18294 localctx = NewQualifiedNameContext(p, p.GetParserRuleContext(), p.GetState()) 18295 p.EnterRule(localctx, 104, SqlBaseParserRULE_qualifiedName) 18296 18297 defer func() { 18298 p.ExitRule() 18299 }() 18300 18301 defer func() { 18302 if err := recover(); err != nil { 18303 if v, ok := err.(antlr.RecognitionException); ok { 18304 localctx.SetException(v) 18305 p.GetErrorHandler().ReportError(p, v) 18306 p.GetErrorHandler().Recover(p, v) 18307 } else { 18308 panic(err) 18309 } 18310 } 18311 }() 18312 18313 var _alt int 18314 18315 p.EnterOuterAlt(localctx, 1) 18316 { 18317 p.SetState(1368) 18318 p.Identifier() 18319 } 18320 p.SetState(1373) 18321 p.GetErrorHandler().Sync(p) 18322 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 169, p.GetParserRuleContext()) 18323 18324 for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { 18325 if _alt == 1 { 18326 { 18327 p.SetState(1369) 18328 p.Match(SqlBaseParserT__0) 18329 } 18330 { 18331 p.SetState(1370) 18332 p.Identifier() 18333 } 18334 18335 } 18336 p.SetState(1375) 18337 p.GetErrorHandler().Sync(p) 18338 _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 169, p.GetParserRuleContext()) 18339 } 18340 18341 return localctx 18342 } 18343 18344 // IIdentifierContext is an interface to support dynamic dispatch. 18345 type IIdentifierContext interface { 18346 antlr.ParserRuleContext 18347 18348 // GetParser returns the parser. 18349 GetParser() antlr.Parser 18350 18351 // IsIdentifierContext differentiates from other interfaces. 18352 IsIdentifierContext() 18353 } 18354 18355 type IdentifierContext struct { 18356 *antlr.BaseParserRuleContext 18357 parser antlr.Parser 18358 } 18359 18360 func NewEmptyIdentifierContext() *IdentifierContext { 18361 var p = new(IdentifierContext) 18362 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 18363 p.RuleIndex = SqlBaseParserRULE_identifier 18364 return p 18365 } 18366 18367 func (*IdentifierContext) IsIdentifierContext() {} 18368 18369 func NewIdentifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IdentifierContext { 18370 var p = new(IdentifierContext) 18371 18372 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 18373 18374 p.parser = parser 18375 p.RuleIndex = SqlBaseParserRULE_identifier 18376 18377 return p 18378 } 18379 18380 func (s *IdentifierContext) GetParser() antlr.Parser { return s.parser } 18381 18382 func (s *IdentifierContext) CopyFrom(ctx *IdentifierContext) { 18383 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 18384 } 18385 18386 func (s *IdentifierContext) GetRuleContext() antlr.RuleContext { 18387 return s 18388 } 18389 18390 func (s *IdentifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 18391 return antlr.TreesStringTree(s, ruleNames, recog) 18392 } 18393 18394 type BackQuotedIdentifierContext struct { 18395 *IdentifierContext 18396 } 18397 18398 func NewBackQuotedIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BackQuotedIdentifierContext { 18399 var p = new(BackQuotedIdentifierContext) 18400 18401 p.IdentifierContext = NewEmptyIdentifierContext() 18402 p.parser = parser 18403 p.CopyFrom(ctx.(*IdentifierContext)) 18404 18405 return p 18406 } 18407 18408 func (s *BackQuotedIdentifierContext) GetRuleContext() antlr.RuleContext { 18409 return s 18410 } 18411 18412 func (s *BackQuotedIdentifierContext) BACKQUOTED_IDENTIFIER() antlr.TerminalNode { 18413 return s.GetToken(SqlBaseParserBACKQUOTED_IDENTIFIER, 0) 18414 } 18415 18416 func (s *BackQuotedIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18417 switch t := visitor.(type) { 18418 case SqlBaseVisitor: 18419 return t.VisitBackQuotedIdentifier(s) 18420 18421 default: 18422 return t.VisitChildren(s) 18423 } 18424 } 18425 18426 type QuotedIdentifierContext struct { 18427 *IdentifierContext 18428 } 18429 18430 func NewQuotedIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QuotedIdentifierContext { 18431 var p = new(QuotedIdentifierContext) 18432 18433 p.IdentifierContext = NewEmptyIdentifierContext() 18434 p.parser = parser 18435 p.CopyFrom(ctx.(*IdentifierContext)) 18436 18437 return p 18438 } 18439 18440 func (s *QuotedIdentifierContext) GetRuleContext() antlr.RuleContext { 18441 return s 18442 } 18443 18444 func (s *QuotedIdentifierContext) QUOTED_IDENTIFIER() antlr.TerminalNode { 18445 return s.GetToken(SqlBaseParserQUOTED_IDENTIFIER, 0) 18446 } 18447 18448 func (s *QuotedIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18449 switch t := visitor.(type) { 18450 case SqlBaseVisitor: 18451 return t.VisitQuotedIdentifier(s) 18452 18453 default: 18454 return t.VisitChildren(s) 18455 } 18456 } 18457 18458 type DigitIdentifierContext struct { 18459 *IdentifierContext 18460 } 18461 18462 func NewDigitIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DigitIdentifierContext { 18463 var p = new(DigitIdentifierContext) 18464 18465 p.IdentifierContext = NewEmptyIdentifierContext() 18466 p.parser = parser 18467 p.CopyFrom(ctx.(*IdentifierContext)) 18468 18469 return p 18470 } 18471 18472 func (s *DigitIdentifierContext) GetRuleContext() antlr.RuleContext { 18473 return s 18474 } 18475 18476 func (s *DigitIdentifierContext) DIGIT_IDENTIFIER() antlr.TerminalNode { 18477 return s.GetToken(SqlBaseParserDIGIT_IDENTIFIER, 0) 18478 } 18479 18480 func (s *DigitIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18481 switch t := visitor.(type) { 18482 case SqlBaseVisitor: 18483 return t.VisitDigitIdentifier(s) 18484 18485 default: 18486 return t.VisitChildren(s) 18487 } 18488 } 18489 18490 type UnquotedIdentifierContext struct { 18491 *IdentifierContext 18492 } 18493 18494 func NewUnquotedIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UnquotedIdentifierContext { 18495 var p = new(UnquotedIdentifierContext) 18496 18497 p.IdentifierContext = NewEmptyIdentifierContext() 18498 p.parser = parser 18499 p.CopyFrom(ctx.(*IdentifierContext)) 18500 18501 return p 18502 } 18503 18504 func (s *UnquotedIdentifierContext) GetRuleContext() antlr.RuleContext { 18505 return s 18506 } 18507 18508 func (s *UnquotedIdentifierContext) IDENTIFIER() antlr.TerminalNode { 18509 return s.GetToken(SqlBaseParserIDENTIFIER, 0) 18510 } 18511 18512 func (s *UnquotedIdentifierContext) NonReserved() INonReservedContext { 18513 var t = s.GetTypedRuleContext(reflect.TypeOf((*INonReservedContext)(nil)).Elem(), 0) 18514 18515 if t == nil { 18516 return nil 18517 } 18518 18519 return t.(INonReservedContext) 18520 } 18521 18522 func (s *UnquotedIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18523 switch t := visitor.(type) { 18524 case SqlBaseVisitor: 18525 return t.VisitUnquotedIdentifier(s) 18526 18527 default: 18528 return t.VisitChildren(s) 18529 } 18530 } 18531 18532 func (p *SqlBaseParser) Identifier() (localctx IIdentifierContext) { 18533 localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) 18534 p.EnterRule(localctx, 106, SqlBaseParserRULE_identifier) 18535 18536 defer func() { 18537 p.ExitRule() 18538 }() 18539 18540 defer func() { 18541 if err := recover(); err != nil { 18542 if v, ok := err.(antlr.RecognitionException); ok { 18543 localctx.SetException(v) 18544 p.GetErrorHandler().ReportError(p, v) 18545 p.GetErrorHandler().Recover(p, v) 18546 } else { 18547 panic(err) 18548 } 18549 } 18550 }() 18551 18552 p.SetState(1381) 18553 p.GetErrorHandler().Sync(p) 18554 18555 switch p.GetTokenStream().LA(1) { 18556 case SqlBaseParserIDENTIFIER: 18557 localctx = NewUnquotedIdentifierContext(p, localctx) 18558 p.EnterOuterAlt(localctx, 1) 18559 { 18560 p.SetState(1376) 18561 p.Match(SqlBaseParserIDENTIFIER) 18562 } 18563 18564 case SqlBaseParserQUOTED_IDENTIFIER: 18565 localctx = NewQuotedIdentifierContext(p, localctx) 18566 p.EnterOuterAlt(localctx, 2) 18567 { 18568 p.SetState(1377) 18569 p.Match(SqlBaseParserQUOTED_IDENTIFIER) 18570 } 18571 18572 case SqlBaseParserADD, SqlBaseParserALL, SqlBaseParserANALYZE, SqlBaseParserANY, SqlBaseParserARRAY, SqlBaseParserASC, SqlBaseParserAT, SqlBaseParserBERNOULLI, SqlBaseParserCALL, SqlBaseParserCASCADE, SqlBaseParserCATALOGS, SqlBaseParserCOALESCE, SqlBaseParserCOLUMN, SqlBaseParserCOLUMNS, SqlBaseParserCOMMENT, SqlBaseParserCOMMITTED, SqlBaseParserCURRENT, SqlBaseParserDATA, SqlBaseParserDATE, SqlBaseParserDAY, SqlBaseParserDESC, SqlBaseParserDISTRIBUTED, SqlBaseParserEXCLUDING, SqlBaseParserEXPLAIN, SqlBaseParserFILTER, SqlBaseParserFIRST, SqlBaseParserFOLLOWING, SqlBaseParserFORMAT, SqlBaseParserFUNCTIONS, SqlBaseParserGRANT, SqlBaseParserGRANTS, SqlBaseParserGRAPHVIZ, SqlBaseParserHOUR, SqlBaseParserIF, SqlBaseParserINCLUDING, SqlBaseParserINPUT, SqlBaseParserINTEGER, SqlBaseParserINTERVAL, SqlBaseParserLAST, SqlBaseParserLATERAL, SqlBaseParserLEVEL, SqlBaseParserLIMIT, SqlBaseParserLOGICAL, SqlBaseParserMAP, SqlBaseParserMINUTE, SqlBaseParserMONTH, SqlBaseParserNFC, SqlBaseParserNFD, SqlBaseParserNFKC, SqlBaseParserNFKD, SqlBaseParserNO, SqlBaseParserNULLIF, SqlBaseParserNULLS, SqlBaseParserONLY, SqlBaseParserOPTION, SqlBaseParserORDINALITY, SqlBaseParserOUTPUT, SqlBaseParserOVER, SqlBaseParserPARTITION, SqlBaseParserPARTITIONS, SqlBaseParserPOSITION, SqlBaseParserPRECEDING, SqlBaseParserPRIVILEGES, SqlBaseParserPROPERTIES, SqlBaseParserPUBLIC, SqlBaseParserRANGE, SqlBaseParserREAD, SqlBaseParserRENAME, SqlBaseParserREPEATABLE, SqlBaseParserREPLACE, SqlBaseParserRESET, SqlBaseParserRESTRICT, SqlBaseParserREVOKE, SqlBaseParserROLLBACK, SqlBaseParserROW, SqlBaseParserROWS, SqlBaseParserSCHEMA, SqlBaseParserSCHEMAS, SqlBaseParserSECOND, SqlBaseParserSERIALIZABLE, SqlBaseParserSESSION, SqlBaseParserSET, SqlBaseParserSETS, SqlBaseParserSHOW, SqlBaseParserSMALLINT, SqlBaseParserSOME, SqlBaseParserSTART, SqlBaseParserSTATS, SqlBaseParserSUBSTRING, SqlBaseParserSYSTEM, SqlBaseParserTABLES, SqlBaseParserTABLESAMPLE, SqlBaseParserTEXT, SqlBaseParserTIME, SqlBaseParserTIMESTAMP, SqlBaseParserTINYINT, SqlBaseParserTO, SqlBaseParserTRY_CAST, SqlBaseParserTYPE, SqlBaseParserUNBOUNDED, SqlBaseParserUNCOMMITTED, SqlBaseParserUSE, SqlBaseParserVALIDATE, SqlBaseParserVERBOSE, SqlBaseParserVIEW, SqlBaseParserWORK, SqlBaseParserWRITE, SqlBaseParserYEAR, SqlBaseParserZONE, SqlBaseParserCOMMIT, SqlBaseParserISOLATION, SqlBaseParserTRANSACTION: 18573 localctx = NewUnquotedIdentifierContext(p, localctx) 18574 p.EnterOuterAlt(localctx, 3) 18575 { 18576 p.SetState(1378) 18577 p.NonReserved() 18578 } 18579 18580 case SqlBaseParserBACKQUOTED_IDENTIFIER: 18581 localctx = NewBackQuotedIdentifierContext(p, localctx) 18582 p.EnterOuterAlt(localctx, 4) 18583 { 18584 p.SetState(1379) 18585 p.Match(SqlBaseParserBACKQUOTED_IDENTIFIER) 18586 } 18587 18588 case SqlBaseParserDIGIT_IDENTIFIER: 18589 localctx = NewDigitIdentifierContext(p, localctx) 18590 p.EnterOuterAlt(localctx, 5) 18591 { 18592 p.SetState(1380) 18593 p.Match(SqlBaseParserDIGIT_IDENTIFIER) 18594 } 18595 18596 default: 18597 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 18598 } 18599 18600 return localctx 18601 } 18602 18603 // INumberContext is an interface to support dynamic dispatch. 18604 type INumberContext interface { 18605 antlr.ParserRuleContext 18606 18607 // GetParser returns the parser. 18608 GetParser() antlr.Parser 18609 18610 // IsNumberContext differentiates from other interfaces. 18611 IsNumberContext() 18612 } 18613 18614 type NumberContext struct { 18615 *antlr.BaseParserRuleContext 18616 parser antlr.Parser 18617 } 18618 18619 func NewEmptyNumberContext() *NumberContext { 18620 var p = new(NumberContext) 18621 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 18622 p.RuleIndex = SqlBaseParserRULE_number 18623 return p 18624 } 18625 18626 func (*NumberContext) IsNumberContext() {} 18627 18628 func NewNumberContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NumberContext { 18629 var p = new(NumberContext) 18630 18631 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 18632 18633 p.parser = parser 18634 p.RuleIndex = SqlBaseParserRULE_number 18635 18636 return p 18637 } 18638 18639 func (s *NumberContext) GetParser() antlr.Parser { return s.parser } 18640 18641 func (s *NumberContext) CopyFrom(ctx *NumberContext) { 18642 s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) 18643 } 18644 18645 func (s *NumberContext) GetRuleContext() antlr.RuleContext { 18646 return s 18647 } 18648 18649 func (s *NumberContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 18650 return antlr.TreesStringTree(s, ruleNames, recog) 18651 } 18652 18653 type DecimalLiteralContext struct { 18654 *NumberContext 18655 } 18656 18657 func NewDecimalLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DecimalLiteralContext { 18658 var p = new(DecimalLiteralContext) 18659 18660 p.NumberContext = NewEmptyNumberContext() 18661 p.parser = parser 18662 p.CopyFrom(ctx.(*NumberContext)) 18663 18664 return p 18665 } 18666 18667 func (s *DecimalLiteralContext) GetRuleContext() antlr.RuleContext { 18668 return s 18669 } 18670 18671 func (s *DecimalLiteralContext) DECIMAL_VALUE() antlr.TerminalNode { 18672 return s.GetToken(SqlBaseParserDECIMAL_VALUE, 0) 18673 } 18674 18675 func (s *DecimalLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18676 switch t := visitor.(type) { 18677 case SqlBaseVisitor: 18678 return t.VisitDecimalLiteral(s) 18679 18680 default: 18681 return t.VisitChildren(s) 18682 } 18683 } 18684 18685 type DoubleLiteralContext struct { 18686 *NumberContext 18687 } 18688 18689 func NewDoubleLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DoubleLiteralContext { 18690 var p = new(DoubleLiteralContext) 18691 18692 p.NumberContext = NewEmptyNumberContext() 18693 p.parser = parser 18694 p.CopyFrom(ctx.(*NumberContext)) 18695 18696 return p 18697 } 18698 18699 func (s *DoubleLiteralContext) GetRuleContext() antlr.RuleContext { 18700 return s 18701 } 18702 18703 func (s *DoubleLiteralContext) DOUBLE_VALUE() antlr.TerminalNode { 18704 return s.GetToken(SqlBaseParserDOUBLE_VALUE, 0) 18705 } 18706 18707 func (s *DoubleLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18708 switch t := visitor.(type) { 18709 case SqlBaseVisitor: 18710 return t.VisitDoubleLiteral(s) 18711 18712 default: 18713 return t.VisitChildren(s) 18714 } 18715 } 18716 18717 type IntegerLiteralContext struct { 18718 *NumberContext 18719 } 18720 18721 func NewIntegerLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntegerLiteralContext { 18722 var p = new(IntegerLiteralContext) 18723 18724 p.NumberContext = NewEmptyNumberContext() 18725 p.parser = parser 18726 p.CopyFrom(ctx.(*NumberContext)) 18727 18728 return p 18729 } 18730 18731 func (s *IntegerLiteralContext) GetRuleContext() antlr.RuleContext { 18732 return s 18733 } 18734 18735 func (s *IntegerLiteralContext) INTEGER_VALUE() antlr.TerminalNode { 18736 return s.GetToken(SqlBaseParserINTEGER_VALUE, 0) 18737 } 18738 18739 func (s *IntegerLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 18740 switch t := visitor.(type) { 18741 case SqlBaseVisitor: 18742 return t.VisitIntegerLiteral(s) 18743 18744 default: 18745 return t.VisitChildren(s) 18746 } 18747 } 18748 18749 func (p *SqlBaseParser) Number() (localctx INumberContext) { 18750 localctx = NewNumberContext(p, p.GetParserRuleContext(), p.GetState()) 18751 p.EnterRule(localctx, 108, SqlBaseParserRULE_number) 18752 18753 defer func() { 18754 p.ExitRule() 18755 }() 18756 18757 defer func() { 18758 if err := recover(); err != nil { 18759 if v, ok := err.(antlr.RecognitionException); ok { 18760 localctx.SetException(v) 18761 p.GetErrorHandler().ReportError(p, v) 18762 p.GetErrorHandler().Recover(p, v) 18763 } else { 18764 panic(err) 18765 } 18766 } 18767 }() 18768 18769 p.SetState(1386) 18770 p.GetErrorHandler().Sync(p) 18771 18772 switch p.GetTokenStream().LA(1) { 18773 case SqlBaseParserDECIMAL_VALUE: 18774 localctx = NewDecimalLiteralContext(p, localctx) 18775 p.EnterOuterAlt(localctx, 1) 18776 { 18777 p.SetState(1383) 18778 p.Match(SqlBaseParserDECIMAL_VALUE) 18779 } 18780 18781 case SqlBaseParserDOUBLE_VALUE: 18782 localctx = NewDoubleLiteralContext(p, localctx) 18783 p.EnterOuterAlt(localctx, 2) 18784 { 18785 p.SetState(1384) 18786 p.Match(SqlBaseParserDOUBLE_VALUE) 18787 } 18788 18789 case SqlBaseParserINTEGER_VALUE: 18790 localctx = NewIntegerLiteralContext(p, localctx) 18791 p.EnterOuterAlt(localctx, 3) 18792 { 18793 p.SetState(1385) 18794 p.Match(SqlBaseParserINTEGER_VALUE) 18795 } 18796 18797 default: 18798 panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) 18799 } 18800 18801 return localctx 18802 } 18803 18804 // INonReservedContext is an interface to support dynamic dispatch. 18805 type INonReservedContext interface { 18806 antlr.ParserRuleContext 18807 18808 // GetParser returns the parser. 18809 GetParser() antlr.Parser 18810 18811 // IsNonReservedContext differentiates from other interfaces. 18812 IsNonReservedContext() 18813 } 18814 18815 type NonReservedContext struct { 18816 *antlr.BaseParserRuleContext 18817 parser antlr.Parser 18818 } 18819 18820 func NewEmptyNonReservedContext() *NonReservedContext { 18821 var p = new(NonReservedContext) 18822 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) 18823 p.RuleIndex = SqlBaseParserRULE_nonReserved 18824 return p 18825 } 18826 18827 func (*NonReservedContext) IsNonReservedContext() {} 18828 18829 func NewNonReservedContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NonReservedContext { 18830 var p = new(NonReservedContext) 18831 18832 p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) 18833 18834 p.parser = parser 18835 p.RuleIndex = SqlBaseParserRULE_nonReserved 18836 18837 return p 18838 } 18839 18840 func (s *NonReservedContext) GetParser() antlr.Parser { return s.parser } 18841 18842 func (s *NonReservedContext) ADD() antlr.TerminalNode { 18843 return s.GetToken(SqlBaseParserADD, 0) 18844 } 18845 18846 func (s *NonReservedContext) ALL() antlr.TerminalNode { 18847 return s.GetToken(SqlBaseParserALL, 0) 18848 } 18849 18850 func (s *NonReservedContext) ANALYZE() antlr.TerminalNode { 18851 return s.GetToken(SqlBaseParserANALYZE, 0) 18852 } 18853 18854 func (s *NonReservedContext) ANY() antlr.TerminalNode { 18855 return s.GetToken(SqlBaseParserANY, 0) 18856 } 18857 18858 func (s *NonReservedContext) ARRAY() antlr.TerminalNode { 18859 return s.GetToken(SqlBaseParserARRAY, 0) 18860 } 18861 18862 func (s *NonReservedContext) ASC() antlr.TerminalNode { 18863 return s.GetToken(SqlBaseParserASC, 0) 18864 } 18865 18866 func (s *NonReservedContext) AT() antlr.TerminalNode { 18867 return s.GetToken(SqlBaseParserAT, 0) 18868 } 18869 18870 func (s *NonReservedContext) BERNOULLI() antlr.TerminalNode { 18871 return s.GetToken(SqlBaseParserBERNOULLI, 0) 18872 } 18873 18874 func (s *NonReservedContext) CALL() antlr.TerminalNode { 18875 return s.GetToken(SqlBaseParserCALL, 0) 18876 } 18877 18878 func (s *NonReservedContext) CASCADE() antlr.TerminalNode { 18879 return s.GetToken(SqlBaseParserCASCADE, 0) 18880 } 18881 18882 func (s *NonReservedContext) CATALOGS() antlr.TerminalNode { 18883 return s.GetToken(SqlBaseParserCATALOGS, 0) 18884 } 18885 18886 func (s *NonReservedContext) COALESCE() antlr.TerminalNode { 18887 return s.GetToken(SqlBaseParserCOALESCE, 0) 18888 } 18889 18890 func (s *NonReservedContext) COLUMN() antlr.TerminalNode { 18891 return s.GetToken(SqlBaseParserCOLUMN, 0) 18892 } 18893 18894 func (s *NonReservedContext) COLUMNS() antlr.TerminalNode { 18895 return s.GetToken(SqlBaseParserCOLUMNS, 0) 18896 } 18897 18898 func (s *NonReservedContext) COMMENT() antlr.TerminalNode { 18899 return s.GetToken(SqlBaseParserCOMMENT, 0) 18900 } 18901 18902 func (s *NonReservedContext) COMMIT() antlr.TerminalNode { 18903 return s.GetToken(SqlBaseParserCOMMIT, 0) 18904 } 18905 18906 func (s *NonReservedContext) COMMITTED() antlr.TerminalNode { 18907 return s.GetToken(SqlBaseParserCOMMITTED, 0) 18908 } 18909 18910 func (s *NonReservedContext) CURRENT() antlr.TerminalNode { 18911 return s.GetToken(SqlBaseParserCURRENT, 0) 18912 } 18913 18914 func (s *NonReservedContext) DATA() antlr.TerminalNode { 18915 return s.GetToken(SqlBaseParserDATA, 0) 18916 } 18917 18918 func (s *NonReservedContext) DATE() antlr.TerminalNode { 18919 return s.GetToken(SqlBaseParserDATE, 0) 18920 } 18921 18922 func (s *NonReservedContext) DAY() antlr.TerminalNode { 18923 return s.GetToken(SqlBaseParserDAY, 0) 18924 } 18925 18926 func (s *NonReservedContext) DESC() antlr.TerminalNode { 18927 return s.GetToken(SqlBaseParserDESC, 0) 18928 } 18929 18930 func (s *NonReservedContext) DISTRIBUTED() antlr.TerminalNode { 18931 return s.GetToken(SqlBaseParserDISTRIBUTED, 0) 18932 } 18933 18934 func (s *NonReservedContext) EXCLUDING() antlr.TerminalNode { 18935 return s.GetToken(SqlBaseParserEXCLUDING, 0) 18936 } 18937 18938 func (s *NonReservedContext) EXPLAIN() antlr.TerminalNode { 18939 return s.GetToken(SqlBaseParserEXPLAIN, 0) 18940 } 18941 18942 func (s *NonReservedContext) FILTER() antlr.TerminalNode { 18943 return s.GetToken(SqlBaseParserFILTER, 0) 18944 } 18945 18946 func (s *NonReservedContext) FIRST() antlr.TerminalNode { 18947 return s.GetToken(SqlBaseParserFIRST, 0) 18948 } 18949 18950 func (s *NonReservedContext) FOLLOWING() antlr.TerminalNode { 18951 return s.GetToken(SqlBaseParserFOLLOWING, 0) 18952 } 18953 18954 func (s *NonReservedContext) FORMAT() antlr.TerminalNode { 18955 return s.GetToken(SqlBaseParserFORMAT, 0) 18956 } 18957 18958 func (s *NonReservedContext) FUNCTIONS() antlr.TerminalNode { 18959 return s.GetToken(SqlBaseParserFUNCTIONS, 0) 18960 } 18961 18962 func (s *NonReservedContext) GRANT() antlr.TerminalNode { 18963 return s.GetToken(SqlBaseParserGRANT, 0) 18964 } 18965 18966 func (s *NonReservedContext) GRANTS() antlr.TerminalNode { 18967 return s.GetToken(SqlBaseParserGRANTS, 0) 18968 } 18969 18970 func (s *NonReservedContext) GRAPHVIZ() antlr.TerminalNode { 18971 return s.GetToken(SqlBaseParserGRAPHVIZ, 0) 18972 } 18973 18974 func (s *NonReservedContext) HOUR() antlr.TerminalNode { 18975 return s.GetToken(SqlBaseParserHOUR, 0) 18976 } 18977 18978 func (s *NonReservedContext) IF() antlr.TerminalNode { 18979 return s.GetToken(SqlBaseParserIF, 0) 18980 } 18981 18982 func (s *NonReservedContext) INCLUDING() antlr.TerminalNode { 18983 return s.GetToken(SqlBaseParserINCLUDING, 0) 18984 } 18985 18986 func (s *NonReservedContext) INPUT() antlr.TerminalNode { 18987 return s.GetToken(SqlBaseParserINPUT, 0) 18988 } 18989 18990 func (s *NonReservedContext) INTEGER() antlr.TerminalNode { 18991 return s.GetToken(SqlBaseParserINTEGER, 0) 18992 } 18993 18994 func (s *NonReservedContext) INTERVAL() antlr.TerminalNode { 18995 return s.GetToken(SqlBaseParserINTERVAL, 0) 18996 } 18997 18998 func (s *NonReservedContext) ISOLATION() antlr.TerminalNode { 18999 return s.GetToken(SqlBaseParserISOLATION, 0) 19000 } 19001 19002 func (s *NonReservedContext) LAST() antlr.TerminalNode { 19003 return s.GetToken(SqlBaseParserLAST, 0) 19004 } 19005 19006 func (s *NonReservedContext) LATERAL() antlr.TerminalNode { 19007 return s.GetToken(SqlBaseParserLATERAL, 0) 19008 } 19009 19010 func (s *NonReservedContext) LEVEL() antlr.TerminalNode { 19011 return s.GetToken(SqlBaseParserLEVEL, 0) 19012 } 19013 19014 func (s *NonReservedContext) LIMIT() antlr.TerminalNode { 19015 return s.GetToken(SqlBaseParserLIMIT, 0) 19016 } 19017 19018 func (s *NonReservedContext) LOGICAL() antlr.TerminalNode { 19019 return s.GetToken(SqlBaseParserLOGICAL, 0) 19020 } 19021 19022 func (s *NonReservedContext) MAP() antlr.TerminalNode { 19023 return s.GetToken(SqlBaseParserMAP, 0) 19024 } 19025 19026 func (s *NonReservedContext) MINUTE() antlr.TerminalNode { 19027 return s.GetToken(SqlBaseParserMINUTE, 0) 19028 } 19029 19030 func (s *NonReservedContext) MONTH() antlr.TerminalNode { 19031 return s.GetToken(SqlBaseParserMONTH, 0) 19032 } 19033 19034 func (s *NonReservedContext) NFC() antlr.TerminalNode { 19035 return s.GetToken(SqlBaseParserNFC, 0) 19036 } 19037 19038 func (s *NonReservedContext) NFD() antlr.TerminalNode { 19039 return s.GetToken(SqlBaseParserNFD, 0) 19040 } 19041 19042 func (s *NonReservedContext) NFKC() antlr.TerminalNode { 19043 return s.GetToken(SqlBaseParserNFKC, 0) 19044 } 19045 19046 func (s *NonReservedContext) NFKD() antlr.TerminalNode { 19047 return s.GetToken(SqlBaseParserNFKD, 0) 19048 } 19049 19050 func (s *NonReservedContext) NO() antlr.TerminalNode { 19051 return s.GetToken(SqlBaseParserNO, 0) 19052 } 19053 19054 func (s *NonReservedContext) NULLIF() antlr.TerminalNode { 19055 return s.GetToken(SqlBaseParserNULLIF, 0) 19056 } 19057 19058 func (s *NonReservedContext) NULLS() antlr.TerminalNode { 19059 return s.GetToken(SqlBaseParserNULLS, 0) 19060 } 19061 19062 func (s *NonReservedContext) ONLY() antlr.TerminalNode { 19063 return s.GetToken(SqlBaseParserONLY, 0) 19064 } 19065 19066 func (s *NonReservedContext) OPTION() antlr.TerminalNode { 19067 return s.GetToken(SqlBaseParserOPTION, 0) 19068 } 19069 19070 func (s *NonReservedContext) ORDINALITY() antlr.TerminalNode { 19071 return s.GetToken(SqlBaseParserORDINALITY, 0) 19072 } 19073 19074 func (s *NonReservedContext) OUTPUT() antlr.TerminalNode { 19075 return s.GetToken(SqlBaseParserOUTPUT, 0) 19076 } 19077 19078 func (s *NonReservedContext) OVER() antlr.TerminalNode { 19079 return s.GetToken(SqlBaseParserOVER, 0) 19080 } 19081 19082 func (s *NonReservedContext) PARTITION() antlr.TerminalNode { 19083 return s.GetToken(SqlBaseParserPARTITION, 0) 19084 } 19085 19086 func (s *NonReservedContext) PARTITIONS() antlr.TerminalNode { 19087 return s.GetToken(SqlBaseParserPARTITIONS, 0) 19088 } 19089 19090 func (s *NonReservedContext) POSITION() antlr.TerminalNode { 19091 return s.GetToken(SqlBaseParserPOSITION, 0) 19092 } 19093 19094 func (s *NonReservedContext) PRECEDING() antlr.TerminalNode { 19095 return s.GetToken(SqlBaseParserPRECEDING, 0) 19096 } 19097 19098 func (s *NonReservedContext) PRIVILEGES() antlr.TerminalNode { 19099 return s.GetToken(SqlBaseParserPRIVILEGES, 0) 19100 } 19101 19102 func (s *NonReservedContext) PROPERTIES() antlr.TerminalNode { 19103 return s.GetToken(SqlBaseParserPROPERTIES, 0) 19104 } 19105 19106 func (s *NonReservedContext) PUBLIC() antlr.TerminalNode { 19107 return s.GetToken(SqlBaseParserPUBLIC, 0) 19108 } 19109 19110 func (s *NonReservedContext) RANGE() antlr.TerminalNode { 19111 return s.GetToken(SqlBaseParserRANGE, 0) 19112 } 19113 19114 func (s *NonReservedContext) READ() antlr.TerminalNode { 19115 return s.GetToken(SqlBaseParserREAD, 0) 19116 } 19117 19118 func (s *NonReservedContext) RENAME() antlr.TerminalNode { 19119 return s.GetToken(SqlBaseParserRENAME, 0) 19120 } 19121 19122 func (s *NonReservedContext) REPEATABLE() antlr.TerminalNode { 19123 return s.GetToken(SqlBaseParserREPEATABLE, 0) 19124 } 19125 19126 func (s *NonReservedContext) REPLACE() antlr.TerminalNode { 19127 return s.GetToken(SqlBaseParserREPLACE, 0) 19128 } 19129 19130 func (s *NonReservedContext) RESET() antlr.TerminalNode { 19131 return s.GetToken(SqlBaseParserRESET, 0) 19132 } 19133 19134 func (s *NonReservedContext) RESTRICT() antlr.TerminalNode { 19135 return s.GetToken(SqlBaseParserRESTRICT, 0) 19136 } 19137 19138 func (s *NonReservedContext) REVOKE() antlr.TerminalNode { 19139 return s.GetToken(SqlBaseParserREVOKE, 0) 19140 } 19141 19142 func (s *NonReservedContext) ROLLBACK() antlr.TerminalNode { 19143 return s.GetToken(SqlBaseParserROLLBACK, 0) 19144 } 19145 19146 func (s *NonReservedContext) ROW() antlr.TerminalNode { 19147 return s.GetToken(SqlBaseParserROW, 0) 19148 } 19149 19150 func (s *NonReservedContext) ROWS() antlr.TerminalNode { 19151 return s.GetToken(SqlBaseParserROWS, 0) 19152 } 19153 19154 func (s *NonReservedContext) SCHEMA() antlr.TerminalNode { 19155 return s.GetToken(SqlBaseParserSCHEMA, 0) 19156 } 19157 19158 func (s *NonReservedContext) SCHEMAS() antlr.TerminalNode { 19159 return s.GetToken(SqlBaseParserSCHEMAS, 0) 19160 } 19161 19162 func (s *NonReservedContext) SECOND() antlr.TerminalNode { 19163 return s.GetToken(SqlBaseParserSECOND, 0) 19164 } 19165 19166 func (s *NonReservedContext) SERIALIZABLE() antlr.TerminalNode { 19167 return s.GetToken(SqlBaseParserSERIALIZABLE, 0) 19168 } 19169 19170 func (s *NonReservedContext) SESSION() antlr.TerminalNode { 19171 return s.GetToken(SqlBaseParserSESSION, 0) 19172 } 19173 19174 func (s *NonReservedContext) SET() antlr.TerminalNode { 19175 return s.GetToken(SqlBaseParserSET, 0) 19176 } 19177 19178 func (s *NonReservedContext) SETS() antlr.TerminalNode { 19179 return s.GetToken(SqlBaseParserSETS, 0) 19180 } 19181 19182 func (s *NonReservedContext) SHOW() antlr.TerminalNode { 19183 return s.GetToken(SqlBaseParserSHOW, 0) 19184 } 19185 19186 func (s *NonReservedContext) SMALLINT() antlr.TerminalNode { 19187 return s.GetToken(SqlBaseParserSMALLINT, 0) 19188 } 19189 19190 func (s *NonReservedContext) SOME() antlr.TerminalNode { 19191 return s.GetToken(SqlBaseParserSOME, 0) 19192 } 19193 19194 func (s *NonReservedContext) START() antlr.TerminalNode { 19195 return s.GetToken(SqlBaseParserSTART, 0) 19196 } 19197 19198 func (s *NonReservedContext) STATS() antlr.TerminalNode { 19199 return s.GetToken(SqlBaseParserSTATS, 0) 19200 } 19201 19202 func (s *NonReservedContext) SUBSTRING() antlr.TerminalNode { 19203 return s.GetToken(SqlBaseParserSUBSTRING, 0) 19204 } 19205 19206 func (s *NonReservedContext) SYSTEM() antlr.TerminalNode { 19207 return s.GetToken(SqlBaseParserSYSTEM, 0) 19208 } 19209 19210 func (s *NonReservedContext) TABLES() antlr.TerminalNode { 19211 return s.GetToken(SqlBaseParserTABLES, 0) 19212 } 19213 19214 func (s *NonReservedContext) TABLESAMPLE() antlr.TerminalNode { 19215 return s.GetToken(SqlBaseParserTABLESAMPLE, 0) 19216 } 19217 19218 func (s *NonReservedContext) TEXT() antlr.TerminalNode { 19219 return s.GetToken(SqlBaseParserTEXT, 0) 19220 } 19221 19222 func (s *NonReservedContext) TIME() antlr.TerminalNode { 19223 return s.GetToken(SqlBaseParserTIME, 0) 19224 } 19225 19226 func (s *NonReservedContext) TIMESTAMP() antlr.TerminalNode { 19227 return s.GetToken(SqlBaseParserTIMESTAMP, 0) 19228 } 19229 19230 func (s *NonReservedContext) TINYINT() antlr.TerminalNode { 19231 return s.GetToken(SqlBaseParserTINYINT, 0) 19232 } 19233 19234 func (s *NonReservedContext) TO() antlr.TerminalNode { 19235 return s.GetToken(SqlBaseParserTO, 0) 19236 } 19237 19238 func (s *NonReservedContext) TRANSACTION() antlr.TerminalNode { 19239 return s.GetToken(SqlBaseParserTRANSACTION, 0) 19240 } 19241 19242 func (s *NonReservedContext) TRY_CAST() antlr.TerminalNode { 19243 return s.GetToken(SqlBaseParserTRY_CAST, 0) 19244 } 19245 19246 func (s *NonReservedContext) TYPE() antlr.TerminalNode { 19247 return s.GetToken(SqlBaseParserTYPE, 0) 19248 } 19249 19250 func (s *NonReservedContext) UNBOUNDED() antlr.TerminalNode { 19251 return s.GetToken(SqlBaseParserUNBOUNDED, 0) 19252 } 19253 19254 func (s *NonReservedContext) UNCOMMITTED() antlr.TerminalNode { 19255 return s.GetToken(SqlBaseParserUNCOMMITTED, 0) 19256 } 19257 19258 func (s *NonReservedContext) USE() antlr.TerminalNode { 19259 return s.GetToken(SqlBaseParserUSE, 0) 19260 } 19261 19262 func (s *NonReservedContext) VALIDATE() antlr.TerminalNode { 19263 return s.GetToken(SqlBaseParserVALIDATE, 0) 19264 } 19265 19266 func (s *NonReservedContext) VERBOSE() antlr.TerminalNode { 19267 return s.GetToken(SqlBaseParserVERBOSE, 0) 19268 } 19269 19270 func (s *NonReservedContext) VIEW() antlr.TerminalNode { 19271 return s.GetToken(SqlBaseParserVIEW, 0) 19272 } 19273 19274 func (s *NonReservedContext) WORK() antlr.TerminalNode { 19275 return s.GetToken(SqlBaseParserWORK, 0) 19276 } 19277 19278 func (s *NonReservedContext) WRITE() antlr.TerminalNode { 19279 return s.GetToken(SqlBaseParserWRITE, 0) 19280 } 19281 19282 func (s *NonReservedContext) YEAR() antlr.TerminalNode { 19283 return s.GetToken(SqlBaseParserYEAR, 0) 19284 } 19285 19286 func (s *NonReservedContext) ZONE() antlr.TerminalNode { 19287 return s.GetToken(SqlBaseParserZONE, 0) 19288 } 19289 19290 func (s *NonReservedContext) GetRuleContext() antlr.RuleContext { 19291 return s 19292 } 19293 19294 func (s *NonReservedContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { 19295 return antlr.TreesStringTree(s, ruleNames, recog) 19296 } 19297 19298 func (s *NonReservedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { 19299 switch t := visitor.(type) { 19300 case SqlBaseVisitor: 19301 return t.VisitNonReserved(s) 19302 19303 default: 19304 return t.VisitChildren(s) 19305 } 19306 } 19307 19308 func (p *SqlBaseParser) NonReserved() (localctx INonReservedContext) { 19309 localctx = NewNonReservedContext(p, p.GetParserRuleContext(), p.GetState()) 19310 p.EnterRule(localctx, 110, SqlBaseParserRULE_nonReserved) 19311 var _la int 19312 19313 defer func() { 19314 p.ExitRule() 19315 }() 19316 19317 defer func() { 19318 if err := recover(); err != nil { 19319 if v, ok := err.(antlr.RecognitionException); ok { 19320 localctx.SetException(v) 19321 p.GetErrorHandler().ReportError(p, v) 19322 p.GetErrorHandler().Recover(p, v) 19323 } else { 19324 panic(err) 19325 } 19326 } 19327 }() 19328 19329 p.EnterOuterAlt(localctx, 1) 19330 { 19331 p.SetState(1388) 19332 _la = p.GetTokenStream().LA(1) 19333 19334 if !((((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<SqlBaseParserADD)|(1<<SqlBaseParserALL)|(1<<SqlBaseParserANALYZE)|(1<<SqlBaseParserANY)|(1<<SqlBaseParserARRAY)|(1<<SqlBaseParserASC)|(1<<SqlBaseParserAT)|(1<<SqlBaseParserBERNOULLI)|(1<<SqlBaseParserCALL)|(1<<SqlBaseParserCASCADE)|(1<<SqlBaseParserCATALOGS)|(1<<SqlBaseParserCOALESCE)|(1<<SqlBaseParserCOLUMN)|(1<<SqlBaseParserCOLUMNS)|(1<<SqlBaseParserCOMMENT))) != 0) || (((_la-32)&-(0x1f+1)) == 0 && ((1<<uint((_la-32)))&((1<<(SqlBaseParserCOMMITTED-32))|(1<<(SqlBaseParserCURRENT-32))|(1<<(SqlBaseParserDATA-32))|(1<<(SqlBaseParserDATE-32))|(1<<(SqlBaseParserDAY-32))|(1<<(SqlBaseParserDESC-32))|(1<<(SqlBaseParserDISTRIBUTED-32))|(1<<(SqlBaseParserEXCLUDING-32))|(1<<(SqlBaseParserEXPLAIN-32))|(1<<(SqlBaseParserFILTER-32))|(1<<(SqlBaseParserFIRST-32)))) != 0) || (((_la-64)&-(0x1f+1)) == 0 && ((1<<uint((_la-64)))&((1<<(SqlBaseParserFOLLOWING-64))|(1<<(SqlBaseParserFORMAT-64))|(1<<(SqlBaseParserFUNCTIONS-64))|(1<<(SqlBaseParserGRANT-64))|(1<<(SqlBaseParserGRANTS-64))|(1<<(SqlBaseParserGRAPHVIZ-64))|(1<<(SqlBaseParserHOUR-64))|(1<<(SqlBaseParserIF-64))|(1<<(SqlBaseParserINCLUDING-64))|(1<<(SqlBaseParserINPUT-64))|(1<<(SqlBaseParserINTEGER-64))|(1<<(SqlBaseParserINTERVAL-64))|(1<<(SqlBaseParserLAST-64))|(1<<(SqlBaseParserLATERAL-64))|(1<<(SqlBaseParserLEVEL-64))|(1<<(SqlBaseParserLIMIT-64)))) != 0) || (((_la-97)&-(0x1f+1)) == 0 && ((1<<uint((_la-97)))&((1<<(SqlBaseParserLOGICAL-97))|(1<<(SqlBaseParserMAP-97))|(1<<(SqlBaseParserMINUTE-97))|(1<<(SqlBaseParserMONTH-97))|(1<<(SqlBaseParserNFC-97))|(1<<(SqlBaseParserNFD-97))|(1<<(SqlBaseParserNFKC-97))|(1<<(SqlBaseParserNFKD-97))|(1<<(SqlBaseParserNO-97))|(1<<(SqlBaseParserNULLIF-97))|(1<<(SqlBaseParserNULLS-97))|(1<<(SqlBaseParserONLY-97))|(1<<(SqlBaseParserOPTION-97))|(1<<(SqlBaseParserORDINALITY-97))|(1<<(SqlBaseParserOUTPUT-97))|(1<<(SqlBaseParserOVER-97))|(1<<(SqlBaseParserPARTITION-97))|(1<<(SqlBaseParserPARTITIONS-97))|(1<<(SqlBaseParserPOSITION-97))|(1<<(SqlBaseParserPRECEDING-97))|(1<<(SqlBaseParserPRIVILEGES-97))|(1<<(SqlBaseParserPROPERTIES-97))|(1<<(SqlBaseParserPUBLIC-97)))) != 0) || (((_la-129)&-(0x1f+1)) == 0 && ((1<<uint((_la-129)))&((1<<(SqlBaseParserRANGE-129))|(1<<(SqlBaseParserREAD-129))|(1<<(SqlBaseParserRENAME-129))|(1<<(SqlBaseParserREPEATABLE-129))|(1<<(SqlBaseParserREPLACE-129))|(1<<(SqlBaseParserRESET-129))|(1<<(SqlBaseParserRESTRICT-129))|(1<<(SqlBaseParserREVOKE-129))|(1<<(SqlBaseParserROLLBACK-129))|(1<<(SqlBaseParserROW-129))|(1<<(SqlBaseParserROWS-129))|(1<<(SqlBaseParserSCHEMA-129))|(1<<(SqlBaseParserSCHEMAS-129))|(1<<(SqlBaseParserSECOND-129))|(1<<(SqlBaseParserSERIALIZABLE-129))|(1<<(SqlBaseParserSESSION-129))|(1<<(SqlBaseParserSET-129))|(1<<(SqlBaseParserSETS-129))|(1<<(SqlBaseParserSHOW-129))|(1<<(SqlBaseParserSMALLINT-129))|(1<<(SqlBaseParserSOME-129))|(1<<(SqlBaseParserSTART-129))|(1<<(SqlBaseParserSTATS-129))|(1<<(SqlBaseParserSUBSTRING-129))|(1<<(SqlBaseParserSYSTEM-129))|(1<<(SqlBaseParserTABLES-129))|(1<<(SqlBaseParserTABLESAMPLE-129)))) != 0) || (((_la-161)&-(0x1f+1)) == 0 && ((1<<uint((_la-161)))&((1<<(SqlBaseParserTEXT-161))|(1<<(SqlBaseParserTIME-161))|(1<<(SqlBaseParserTIMESTAMP-161))|(1<<(SqlBaseParserTINYINT-161))|(1<<(SqlBaseParserTO-161))|(1<<(SqlBaseParserTRY_CAST-161))|(1<<(SqlBaseParserTYPE-161))|(1<<(SqlBaseParserUNBOUNDED-161))|(1<<(SqlBaseParserUNCOMMITTED-161))|(1<<(SqlBaseParserUSE-161))|(1<<(SqlBaseParserVALIDATE-161))|(1<<(SqlBaseParserVERBOSE-161))|(1<<(SqlBaseParserVIEW-161))|(1<<(SqlBaseParserWORK-161))|(1<<(SqlBaseParserWRITE-161))|(1<<(SqlBaseParserYEAR-161))|(1<<(SqlBaseParserZONE-161)))) != 0) || (((_la-218)&-(0x1f+1)) == 0 && ((1<<uint((_la-218)))&((1<<(SqlBaseParserCOMMIT-218))|(1<<(SqlBaseParserISOLATION-218))|(1<<(SqlBaseParserTRANSACTION-218)))) != 0)) { 19335 p.GetErrorHandler().RecoverInline(p) 19336 } else { 19337 p.GetErrorHandler().ReportMatch(p) 19338 p.Consume() 19339 } 19340 } 19341 19342 return localctx 19343 } 19344 19345 func (p *SqlBaseParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { 19346 switch ruleIndex { 19347 case 11: 19348 var t *QueryTermContext = nil 19349 if localctx != nil { 19350 t = localctx.(*QueryTermContext) 19351 } 19352 return p.QueryTerm_Sempred(t, predIndex) 19353 19354 case 22: 19355 var t *RelationContext = nil 19356 if localctx != nil { 19357 t = localctx.(*RelationContext) 19358 } 19359 return p.Relation_Sempred(t, predIndex) 19360 19361 case 31: 19362 var t *BooleanExpressionContext = nil 19363 if localctx != nil { 19364 t = localctx.(*BooleanExpressionContext) 19365 } 19366 return p.BooleanExpression_Sempred(t, predIndex) 19367 19368 case 34: 19369 var t *ValueExpressionContext = nil 19370 if localctx != nil { 19371 t = localctx.(*ValueExpressionContext) 19372 } 19373 return p.ValueExpression_Sempred(t, predIndex) 19374 19375 case 35: 19376 var t *PrimaryExpressionContext = nil 19377 if localctx != nil { 19378 t = localctx.(*PrimaryExpressionContext) 19379 } 19380 return p.PrimaryExpression_Sempred(t, predIndex) 19381 19382 case 44: 19383 var t *SqltypeContext = nil 19384 if localctx != nil { 19385 t = localctx.(*SqltypeContext) 19386 } 19387 return p.Sqltype_Sempred(t, predIndex) 19388 19389 default: 19390 panic("No predicate with index: " + fmt.Sprint(ruleIndex)) 19391 } 19392 } 19393 19394 func (p *SqlBaseParser) QueryTerm_Sempred(localctx antlr.RuleContext, predIndex int) bool { 19395 switch predIndex { 19396 case 0: 19397 return p.Precpred(p.GetParserRuleContext(), 2) 19398 19399 case 1: 19400 return p.Precpred(p.GetParserRuleContext(), 1) 19401 19402 default: 19403 panic("No predicate with index: " + fmt.Sprint(predIndex)) 19404 } 19405 } 19406 19407 func (p *SqlBaseParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int) bool { 19408 switch predIndex { 19409 case 2: 19410 return p.Precpred(p.GetParserRuleContext(), 2) 19411 19412 default: 19413 panic("No predicate with index: " + fmt.Sprint(predIndex)) 19414 } 19415 } 19416 19417 func (p *SqlBaseParser) BooleanExpression_Sempred(localctx antlr.RuleContext, predIndex int) bool { 19418 switch predIndex { 19419 case 3: 19420 return p.Precpred(p.GetParserRuleContext(), 2) 19421 19422 case 4: 19423 return p.Precpred(p.GetParserRuleContext(), 1) 19424 19425 default: 19426 panic("No predicate with index: " + fmt.Sprint(predIndex)) 19427 } 19428 } 19429 19430 func (p *SqlBaseParser) ValueExpression_Sempred(localctx antlr.RuleContext, predIndex int) bool { 19431 switch predIndex { 19432 case 5: 19433 return p.Precpred(p.GetParserRuleContext(), 3) 19434 19435 case 6: 19436 return p.Precpred(p.GetParserRuleContext(), 2) 19437 19438 case 7: 19439 return p.Precpred(p.GetParserRuleContext(), 1) 19440 19441 case 8: 19442 return p.Precpred(p.GetParserRuleContext(), 5) 19443 19444 default: 19445 panic("No predicate with index: " + fmt.Sprint(predIndex)) 19446 } 19447 } 19448 19449 func (p *SqlBaseParser) PrimaryExpression_Sempred(localctx antlr.RuleContext, predIndex int) bool { 19450 switch predIndex { 19451 case 9: 19452 return p.Precpred(p.GetParserRuleContext(), 14) 19453 19454 case 10: 19455 return p.Precpred(p.GetParserRuleContext(), 12) 19456 19457 default: 19458 panic("No predicate with index: " + fmt.Sprint(predIndex)) 19459 } 19460 } 19461 19462 func (p *SqlBaseParser) Sqltype_Sempred(localctx antlr.RuleContext, predIndex int) bool { 19463 switch predIndex { 19464 case 11: 19465 return p.Precpred(p.GetParserRuleContext(), 6) 19466 19467 default: 19468 panic("No predicate with index: " + fmt.Sprint(predIndex)) 19469 } 19470 }