1 /* Driver template for the LEMON parser generator.
2 ** The author disclaims copyright to this source code.
4 /* First off, code is include which follows the "include" declaration
5 ** in the input file. */
12 ** An instance of this structure holds information about the
13 ** LIMIT clause of a SELECT statement.
16 Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
17 Expr *pOffset; /* The OFFSET expression. NULL if there is none */
21 ** An instance of this structure is used to store the LIKE,
22 ** GLOB, NOT LIKE, and NOT GLOB operators.
25 Token eOperator; /* "like" or "glob" or "regexp" */
26 int not; /* True if the NOT keyword is present */
30 ** An instance of the following structure describes the event of a
31 ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
32 ** TK_DELETE, or TK_INSTEAD. If the event is of the form
36 ** Then the "b" IdList records the list "a,b,c".
38 struct TrigEvent { int a; IdList * b; };
41 ** An instance of this structure holds the ATTACH key and the key type.
43 struct AttachKey { int type; Token key; };
46 /* Next is all token values, in a form suitable for use by makeheaders.
47 ** This section will be null unless lemon is run with the -m switch.
50 ** These constants (all generated automatically by the parser generator)
51 ** specify the various kinds of tokens (terminals) that the parser
54 ** Each symbol here is a terminal symbol in the grammar.
56 /* Make sure the INTERFACE macro is defined.
61 /* The next thing included is series of defines which control
62 ** various aspects of the generated parser.
63 ** YYCODETYPE is the data type used for storing terminal
64 ** and nonterminal numbers. "unsigned char" is
65 ** used if there are fewer than 250 terminals
66 ** and nonterminals. "int" is used otherwise.
67 ** YYNOCODE is a number of type YYCODETYPE which corresponds
68 ** to no legal terminal or nonterminal number. This
69 ** number is used to fill in empty slots of the hash
71 ** YYFALLBACK If defined, this indicates that one or more tokens
72 ** have fall-back values which should be used if the
73 ** original value of the token will not parse.
74 ** YYACTIONTYPE is the data type used for storing terminal
75 ** and nonterminal numbers. "unsigned char" is
76 ** used if there are fewer than 250 rules and
77 ** states combined. "int" is used otherwise.
78 ** sqlite3ParserTOKENTYPE is the data type used for minor tokens given
79 ** directly to the parser from the tokenizer.
80 ** YYMINORTYPE is the data type used for all minor tokens.
81 ** This is typically a union of many types, one of
82 ** which is sqlite3ParserTOKENTYPE. The entry in the union
83 ** for base tokens is called "yy0".
84 ** YYSTACKDEPTH is the maximum depth of the parser's stack. If
85 ** zero the stack is dynamically sized using realloc()
86 ** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument
87 ** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument
88 ** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser
89 ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser
90 ** YYNSTATE the combined number of states.
91 ** YYNRULE the number of rules in the grammar
92 ** YYERRORSYMBOL is the code number of the error symbol. If not
93 ** defined, then do no error processing.
95 #define YYCODETYPE unsigned char
97 #define YYACTIONTYPE unsigned short int
99 #define sqlite3ParserTOKENTYPE Token
101 sqlite3ParserTOKENTYPE yy0;
107 struct LimitVal yy234;
109 struct TrigEvent yy370;
112 struct {int value; int mask;} yy405;
118 #define YYSTACKDEPTH 100
120 #define sqlite3ParserARG_SDECL Parse *pParse;
121 #define sqlite3ParserARG_PDECL ,Parse *pParse
122 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
123 #define sqlite3ParserARG_STORE yypParser->pParse = pParse
126 #define YYERRORSYMBOL 138
127 #define YYERRSYMDT yy495
129 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
130 #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
131 #define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
133 /* Next are that tables used to determine what action to take based on the
134 ** current state and lookahead token. These tables are used to implement
135 ** functions that take a state number and lookahead value and return an
138 ** Suppose the action integer is N. Then the action is determined as
141 ** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
142 ** token onto the stack and goto state N.
144 ** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
146 ** N == YYNSTATE+YYNRULE A syntax error has occurred.
148 ** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
150 ** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
151 ** slots in the yy_action[] table.
153 ** The action table is constructed as a single large table named yy_action[].
154 ** Given state S and lookahead X, the action is computed as
156 ** yy_action[ yy_shift_ofst[S] + X ]
158 ** If the index value yy_shift_ofst[S]+X is out of range or if the value
159 ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
160 ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
161 ** and that yy_default[S] should be used instead.
163 ** The formula above is for computing the action when the lookahead is
164 ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
165 ** a reduce action) then the yy_reduce_ofst[] array is used in place of
166 ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
167 ** YY_SHIFT_USE_DFLT.
169 ** The following are the tables generated in this section:
171 ** yy_action[] A single table containing all actions.
172 ** yy_lookahead[] A table containing the lookahead for each entry in
173 ** yy_action. Used to detect hash collisions.
174 ** yy_shift_ofst[] For each state, the offset into yy_action for
175 ** shifting terminals.
176 ** yy_reduce_ofst[] For each state, the offset into yy_action for
177 ** shifting non-terminals after a reduce.
178 ** yy_default[] Default action for each state.
180 static const YYACTIONTYPE yy_action[] = {
181 /* 0 */ 290, 898, 122, 585, 407, 170, 2, 437, 61, 61,
182 /* 10 */ 61, 61, 517, 63, 63, 63, 63, 64, 64, 65,
183 /* 20 */ 65, 65, 66, 231, 445, 209, 422, 428, 68, 63,
184 /* 30 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 231,
185 /* 40 */ 389, 386, 394, 449, 60, 59, 295, 432, 433, 429,
186 /* 50 */ 429, 62, 62, 61, 61, 61, 61, 261, 63, 63,
187 /* 60 */ 63, 63, 64, 64, 65, 65, 65, 66, 231, 290,
188 /* 70 */ 491, 492, 437, 487, 206, 81, 67, 417, 69, 152,
189 /* 80 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
190 /* 90 */ 231, 67, 460, 69, 152, 422, 428, 571, 262, 58,
191 /* 100 */ 64, 64, 65, 65, 65, 66, 231, 395, 396, 419,
192 /* 110 */ 419, 419, 290, 60, 59, 295, 432, 433, 429, 429,
193 /* 120 */ 62, 62, 61, 61, 61, 61, 315, 63, 63, 63,
194 /* 130 */ 63, 64, 64, 65, 65, 65, 66, 231, 422, 428,
195 /* 140 */ 93, 65, 65, 65, 66, 231, 394, 231, 412, 34,
196 /* 150 */ 56, 296, 440, 441, 408, 486, 60, 59, 295, 432,
197 /* 160 */ 433, 429, 429, 62, 62, 61, 61, 61, 61, 488,
198 /* 170 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
199 /* 180 */ 231, 290, 255, 522, 293, 569, 112, 406, 520, 449,
200 /* 190 */ 329, 315, 405, 20, 437, 338, 517, 394, 530, 529,
201 /* 200 */ 503, 445, 209, 568, 567, 206, 528, 422, 428, 147,
202 /* 210 */ 148, 395, 396, 412, 41, 208, 149, 531, 370, 487,
203 /* 220 */ 259, 566, 257, 417, 290, 60, 59, 295, 432, 433,
204 /* 230 */ 429, 429, 62, 62, 61, 61, 61, 61, 315, 63,
205 /* 240 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 231,
206 /* 250 */ 422, 428, 445, 331, 212, 419, 419, 419, 361, 437,
207 /* 260 */ 412, 41, 395, 396, 364, 565, 208, 290, 60, 59,
208 /* 270 */ 295, 432, 433, 429, 429, 62, 62, 61, 61, 61,
209 /* 280 */ 61, 394, 63, 63, 63, 63, 64, 64, 65, 65,
210 /* 290 */ 65, 66, 231, 422, 428, 489, 298, 522, 472, 66,
211 /* 300 */ 231, 211, 472, 224, 409, 284, 532, 20, 447, 521,
212 /* 310 */ 166, 60, 59, 295, 432, 433, 429, 429, 62, 62,
213 /* 320 */ 61, 61, 61, 61, 472, 63, 63, 63, 63, 64,
214 /* 330 */ 64, 65, 65, 65, 66, 231, 207, 478, 315, 76,
215 /* 340 */ 290, 235, 298, 55, 482, 225, 395, 396, 179, 545,
216 /* 350 */ 492, 343, 346, 347, 67, 150, 69, 152, 337, 522,
217 /* 360 */ 412, 35, 348, 237, 249, 368, 422, 428, 576, 20,
218 /* 370 */ 162, 116, 239, 341, 244, 342, 174, 320, 440, 441,
219 /* 380 */ 412, 3, 79, 250, 60, 59, 295, 432, 433, 429,
220 /* 390 */ 429, 62, 62, 61, 61, 61, 61, 172, 63, 63,
221 /* 400 */ 63, 63, 64, 64, 65, 65, 65, 66, 231, 290,
222 /* 410 */ 249, 548, 232, 485, 508, 351, 315, 116, 239, 341,
223 /* 420 */ 244, 342, 174, 179, 315, 523, 343, 346, 347, 250,
224 /* 430 */ 218, 413, 153, 462, 509, 422, 428, 348, 412, 34,
225 /* 440 */ 463, 208, 175, 173, 158, 233, 412, 34, 336, 547,
226 /* 450 */ 447, 321, 166, 60, 59, 295, 432, 433, 429, 429,
227 /* 460 */ 62, 62, 61, 61, 61, 61, 413, 63, 63, 63,
228 /* 470 */ 63, 64, 64, 65, 65, 65, 66, 231, 290, 540,
229 /* 480 */ 333, 515, 502, 539, 454, 569, 300, 19, 329, 142,
230 /* 490 */ 315, 388, 315, 328, 2, 360, 455, 292, 481, 371,
231 /* 500 */ 267, 266, 250, 568, 422, 428, 586, 389, 386, 456,
232 /* 510 */ 206, 493, 412, 49, 412, 49, 301, 583, 889, 157,
233 /* 520 */ 889, 494, 60, 59, 295, 432, 433, 429, 429, 62,
234 /* 530 */ 62, 61, 61, 61, 61, 199, 63, 63, 63, 63,
235 /* 540 */ 64, 64, 65, 65, 65, 66, 231, 290, 315, 179,
236 /* 550 */ 436, 253, 343, 346, 347, 368, 151, 580, 306, 248,
237 /* 560 */ 307, 450, 75, 348, 77, 380, 208, 423, 424, 413,
238 /* 570 */ 412, 27, 317, 422, 428, 438, 1, 22, 583, 888,
239 /* 580 */ 394, 888, 542, 476, 318, 261, 435, 435, 426, 427,
240 /* 590 */ 413, 60, 59, 295, 432, 433, 429, 429, 62, 62,
241 /* 600 */ 61, 61, 61, 61, 326, 63, 63, 63, 63, 64,
242 /* 610 */ 64, 65, 65, 65, 66, 231, 290, 425, 580, 372,
243 /* 620 */ 219, 92, 515, 9, 334, 394, 555, 394, 454, 67,
244 /* 630 */ 394, 69, 152, 397, 398, 399, 318, 234, 435, 435,
245 /* 640 */ 455, 316, 422, 428, 297, 395, 396, 318, 430, 435,
246 /* 650 */ 435, 579, 289, 456, 220, 325, 5, 217, 544, 290,
247 /* 660 */ 60, 59, 295, 432, 433, 429, 429, 62, 62, 61,
248 /* 670 */ 61, 61, 61, 393, 63, 63, 63, 63, 64, 64,
249 /* 680 */ 65, 65, 65, 66, 231, 422, 428, 480, 311, 390,
250 /* 690 */ 395, 396, 395, 396, 205, 395, 396, 821, 271, 515,
251 /* 700 */ 248, 198, 290, 60, 59, 295, 432, 433, 429, 429,
252 /* 710 */ 62, 62, 61, 61, 61, 61, 468, 63, 63, 63,
253 /* 720 */ 63, 64, 64, 65, 65, 65, 66, 231, 422, 428,
254 /* 730 */ 169, 158, 261, 261, 302, 413, 274, 117, 272, 261,
255 /* 740 */ 515, 515, 261, 515, 190, 290, 60, 70, 295, 432,
256 /* 750 */ 433, 429, 429, 62, 62, 61, 61, 61, 61, 377,
257 /* 760 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
258 /* 770 */ 231, 422, 428, 382, 557, 303, 304, 248, 413, 318,
259 /* 780 */ 558, 435, 435, 559, 538, 358, 538, 385, 290, 194,
260 /* 790 */ 59, 295, 432, 433, 429, 429, 62, 62, 61, 61,
261 /* 800 */ 61, 61, 369, 63, 63, 63, 63, 64, 64, 65,
262 /* 810 */ 65, 65, 66, 231, 422, 428, 394, 273, 248, 248,
263 /* 820 */ 170, 246, 437, 413, 384, 365, 176, 177, 178, 467,
264 /* 830 */ 309, 121, 154, 126, 295, 432, 433, 429, 429, 62,
265 /* 840 */ 62, 61, 61, 61, 61, 315, 63, 63, 63, 63,
266 /* 850 */ 64, 64, 65, 65, 65, 66, 231, 72, 322, 175,
267 /* 860 */ 4, 315, 261, 315, 294, 261, 413, 412, 28, 315,
268 /* 870 */ 261, 315, 319, 72, 322, 315, 4, 418, 443, 443,
269 /* 880 */ 294, 395, 396, 412, 23, 412, 32, 437, 319, 324,
270 /* 890 */ 327, 412, 53, 412, 52, 315, 156, 412, 97, 449,
271 /* 900 */ 315, 192, 315, 275, 315, 324, 376, 469, 500, 315,
272 /* 910 */ 476, 277, 476, 163, 292, 449, 315, 412, 95, 74,
273 /* 920 */ 73, 467, 412, 100, 412, 101, 412, 111, 72, 313,
274 /* 930 */ 314, 412, 113, 417, 446, 74, 73, 479, 412, 16,
275 /* 940 */ 379, 315, 181, 465, 72, 313, 314, 72, 322, 417,
276 /* 950 */ 4, 206, 315, 184, 294, 315, 497, 498, 474, 206,
277 /* 960 */ 171, 339, 319, 412, 98, 419, 419, 419, 420, 421,
278 /* 970 */ 11, 359, 378, 305, 412, 33, 413, 412, 96, 324,
279 /* 980 */ 458, 419, 419, 419, 420, 421, 11, 413, 411, 449,
280 /* 990 */ 411, 160, 410, 315, 410, 466, 221, 222, 223, 103,
281 /* 1000 */ 83, 471, 315, 507, 506, 315, 620, 475, 315, 74,
282 /* 1010 */ 73, 245, 203, 21, 279, 412, 24, 437, 72, 313,
283 /* 1020 */ 314, 280, 315, 417, 412, 54, 505, 412, 114, 315,
284 /* 1030 */ 412, 115, 504, 201, 145, 547, 240, 510, 524, 200,
285 /* 1040 */ 315, 511, 202, 315, 412, 25, 315, 241, 315, 18,
286 /* 1050 */ 315, 412, 36, 315, 254, 419, 419, 419, 420, 421,
287 /* 1060 */ 11, 256, 412, 37, 258, 412, 26, 315, 412, 38,
288 /* 1070 */ 412, 39, 412, 40, 260, 412, 42, 315, 512, 315,
289 /* 1080 */ 126, 315, 437, 315, 187, 375, 276, 266, 265, 412,
290 /* 1090 */ 43, 291, 315, 252, 315, 126, 206, 581, 8, 412,
291 /* 1100 */ 44, 412, 29, 412, 30, 412, 45, 350, 363, 126,
292 /* 1110 */ 315, 543, 315, 126, 412, 46, 412, 47, 315, 355,
293 /* 1120 */ 381, 551, 315, 171, 552, 315, 90, 562, 578, 90,
294 /* 1130 */ 288, 366, 412, 48, 412, 31, 582, 367, 268, 269,
295 /* 1140 */ 412, 10, 270, 554, 412, 50, 564, 412, 51, 278,
296 /* 1150 */ 281, 282, 575, 144, 442, 403, 323, 226, 444, 461,
297 /* 1160 */ 464, 242, 503, 550, 561, 513, 161, 392, 400, 516,
298 /* 1170 */ 401, 345, 402, 7, 312, 83, 227, 332, 228, 82,
299 /* 1180 */ 330, 57, 408, 416, 168, 78, 459, 123, 210, 414,
300 /* 1190 */ 84, 335, 340, 299, 496, 500, 490, 229, 495, 243,
301 /* 1200 */ 104, 247, 499, 501, 230, 285, 415, 215, 514, 518,
302 /* 1210 */ 525, 526, 519, 236, 527, 473, 238, 352, 477, 286,
303 /* 1220 */ 182, 356, 533, 354, 119, 183, 185, 87, 546, 130,
304 /* 1230 */ 186, 535, 188, 140, 362, 191, 553, 216, 373, 374,
305 /* 1240 */ 131, 560, 308, 132, 133, 572, 577, 136, 263, 134,
306 /* 1250 */ 139, 536, 573, 391, 91, 94, 404, 574, 99, 214,
307 /* 1260 */ 102, 621, 622, 431, 164, 434, 165, 71, 141, 17,
308 /* 1270 */ 439, 448, 451, 155, 6, 452, 470, 110, 167, 453,
309 /* 1280 */ 457, 124, 13, 213, 120, 80, 12, 125, 159, 483,
310 /* 1290 */ 484, 85, 310, 105, 180, 251, 106, 118, 86, 107,
311 /* 1300 */ 241, 344, 349, 353, 143, 534, 127, 357, 171, 189,
312 /* 1310 */ 264, 108, 287, 128, 549, 129, 193, 537, 541, 14,
313 /* 1320 */ 195, 88, 196, 556, 197, 137, 138, 135, 15, 563,
314 /* 1330 */ 570, 109, 283, 146, 204, 383, 387, 899, 584, 899,
315 /* 1340 */ 899, 899, 899, 899, 89,
317 static const YYCODETYPE yy_lookahead[] = {
318 /* 0 */ 16, 139, 140, 141, 168, 21, 144, 23, 69, 70,
319 /* 10 */ 71, 72, 176, 74, 75, 76, 77, 78, 79, 80,
320 /* 20 */ 81, 82, 83, 84, 78, 79, 42, 43, 73, 74,
321 /* 30 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
322 /* 40 */ 1, 2, 23, 58, 60, 61, 62, 63, 64, 65,
323 /* 50 */ 66, 67, 68, 69, 70, 71, 72, 147, 74, 75,
324 /* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
325 /* 70 */ 185, 186, 88, 88, 110, 22, 217, 92, 219, 220,
326 /* 80 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
327 /* 90 */ 84, 217, 218, 219, 220, 42, 43, 238, 188, 46,
328 /* 100 */ 78, 79, 80, 81, 82, 83, 84, 88, 89, 124,
329 /* 110 */ 125, 126, 16, 60, 61, 62, 63, 64, 65, 66,
330 /* 120 */ 67, 68, 69, 70, 71, 72, 147, 74, 75, 76,
331 /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
332 /* 140 */ 44, 80, 81, 82, 83, 84, 23, 84, 169, 170,
333 /* 150 */ 19, 164, 165, 166, 23, 169, 60, 61, 62, 63,
334 /* 160 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 169,
335 /* 170 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
336 /* 180 */ 84, 16, 14, 147, 150, 147, 21, 167, 168, 58,
337 /* 190 */ 211, 147, 156, 157, 23, 216, 176, 23, 181, 176,
338 /* 200 */ 177, 78, 79, 165, 166, 110, 183, 42, 43, 78,
339 /* 210 */ 79, 88, 89, 169, 170, 228, 180, 181, 123, 88,
340 /* 220 */ 52, 98, 54, 92, 16, 60, 61, 62, 63, 64,
341 /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 147, 74,
342 /* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
343 /* 250 */ 42, 43, 78, 209, 210, 124, 125, 126, 224, 88,
344 /* 260 */ 169, 170, 88, 89, 230, 227, 228, 16, 60, 61,
345 /* 270 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
346 /* 280 */ 72, 23, 74, 75, 76, 77, 78, 79, 80, 81,
347 /* 290 */ 82, 83, 84, 42, 43, 160, 16, 147, 161, 83,
348 /* 300 */ 84, 210, 161, 153, 169, 158, 156, 157, 161, 162,
349 /* 310 */ 163, 60, 61, 62, 63, 64, 65, 66, 67, 68,
350 /* 320 */ 69, 70, 71, 72, 161, 74, 75, 76, 77, 78,
351 /* 330 */ 79, 80, 81, 82, 83, 84, 192, 200, 147, 131,
352 /* 340 */ 16, 200, 16, 199, 20, 190, 88, 89, 90, 185,
353 /* 350 */ 186, 93, 94, 95, 217, 22, 219, 220, 147, 147,
354 /* 360 */ 169, 170, 104, 200, 84, 147, 42, 43, 156, 157,
355 /* 370 */ 90, 91, 92, 93, 94, 95, 96, 164, 165, 166,
356 /* 380 */ 169, 170, 131, 103, 60, 61, 62, 63, 64, 65,
357 /* 390 */ 66, 67, 68, 69, 70, 71, 72, 155, 74, 75,
358 /* 400 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
359 /* 410 */ 84, 11, 221, 20, 30, 16, 147, 91, 92, 93,
360 /* 420 */ 94, 95, 96, 90, 147, 181, 93, 94, 95, 103,
361 /* 430 */ 212, 189, 155, 27, 50, 42, 43, 104, 169, 170,
362 /* 440 */ 34, 228, 43, 201, 202, 147, 169, 170, 206, 49,
363 /* 450 */ 161, 162, 163, 60, 61, 62, 63, 64, 65, 66,
364 /* 460 */ 67, 68, 69, 70, 71, 72, 189, 74, 75, 76,
365 /* 470 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 25,
366 /* 480 */ 211, 147, 20, 29, 12, 147, 102, 19, 211, 21,
367 /* 490 */ 147, 141, 147, 216, 144, 41, 24, 98, 20, 99,
368 /* 500 */ 100, 101, 103, 165, 42, 43, 0, 1, 2, 37,
369 /* 510 */ 110, 39, 169, 170, 169, 170, 182, 19, 20, 147,
370 /* 520 */ 22, 49, 60, 61, 62, 63, 64, 65, 66, 67,
371 /* 530 */ 68, 69, 70, 71, 72, 155, 74, 75, 76, 77,
372 /* 540 */ 78, 79, 80, 81, 82, 83, 84, 16, 147, 90,
373 /* 550 */ 20, 20, 93, 94, 95, 147, 155, 59, 215, 225,
374 /* 560 */ 215, 20, 130, 104, 132, 227, 228, 42, 43, 189,
375 /* 570 */ 169, 170, 16, 42, 43, 20, 19, 22, 19, 20,
376 /* 580 */ 23, 22, 18, 147, 106, 147, 108, 109, 63, 64,
377 /* 590 */ 189, 60, 61, 62, 63, 64, 65, 66, 67, 68,
378 /* 600 */ 69, 70, 71, 72, 186, 74, 75, 76, 77, 78,
379 /* 610 */ 79, 80, 81, 82, 83, 84, 16, 92, 59, 55,
380 /* 620 */ 212, 21, 147, 19, 147, 23, 188, 23, 12, 217,
381 /* 630 */ 23, 219, 220, 7, 8, 9, 106, 147, 108, 109,
382 /* 640 */ 24, 147, 42, 43, 208, 88, 89, 106, 92, 108,
383 /* 650 */ 109, 244, 245, 37, 145, 39, 191, 182, 94, 16,
384 /* 660 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
385 /* 670 */ 70, 71, 72, 147, 74, 75, 76, 77, 78, 79,
386 /* 680 */ 80, 81, 82, 83, 84, 42, 43, 80, 142, 143,
387 /* 690 */ 88, 89, 88, 89, 148, 88, 89, 133, 14, 147,
388 /* 700 */ 225, 155, 16, 60, 61, 62, 63, 64, 65, 66,
389 /* 710 */ 67, 68, 69, 70, 71, 72, 114, 74, 75, 76,
390 /* 720 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
391 /* 730 */ 201, 202, 147, 147, 182, 189, 52, 147, 54, 147,
392 /* 740 */ 147, 147, 147, 147, 155, 16, 60, 61, 62, 63,
393 /* 750 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 213,
394 /* 760 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
395 /* 770 */ 84, 42, 43, 188, 188, 182, 182, 225, 189, 106,
396 /* 780 */ 188, 108, 109, 188, 99, 100, 101, 241, 16, 155,
397 /* 790 */ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
398 /* 800 */ 71, 72, 213, 74, 75, 76, 77, 78, 79, 80,
399 /* 810 */ 81, 82, 83, 84, 42, 43, 23, 133, 225, 225,
400 /* 820 */ 21, 225, 23, 189, 239, 236, 99, 100, 101, 22,
401 /* 830 */ 242, 243, 155, 22, 62, 63, 64, 65, 66, 67,
402 /* 840 */ 68, 69, 70, 71, 72, 147, 74, 75, 76, 77,
403 /* 850 */ 78, 79, 80, 81, 82, 83, 84, 16, 17, 43,
404 /* 860 */ 19, 147, 147, 147, 23, 147, 189, 169, 170, 147,
405 /* 870 */ 147, 147, 31, 16, 17, 147, 19, 147, 124, 125,
406 /* 880 */ 23, 88, 89, 169, 170, 169, 170, 88, 31, 48,
407 /* 890 */ 147, 169, 170, 169, 170, 147, 89, 169, 170, 58,
408 /* 900 */ 147, 22, 147, 188, 147, 48, 188, 114, 97, 147,
409 /* 910 */ 147, 188, 147, 19, 98, 58, 147, 169, 170, 78,
410 /* 920 */ 79, 114, 169, 170, 169, 170, 169, 170, 87, 88,
411 /* 930 */ 89, 169, 170, 92, 161, 78, 79, 80, 169, 170,
412 /* 940 */ 91, 147, 155, 22, 87, 88, 89, 16, 17, 92,
413 /* 950 */ 19, 110, 147, 155, 23, 147, 7, 8, 20, 110,
414 /* 960 */ 22, 80, 31, 169, 170, 124, 125, 126, 127, 128,
415 /* 970 */ 129, 208, 123, 208, 169, 170, 189, 169, 170, 48,
416 /* 980 */ 147, 124, 125, 126, 127, 128, 129, 189, 107, 58,
417 /* 990 */ 107, 5, 111, 147, 111, 203, 10, 11, 12, 13,
418 /* 1000 */ 121, 147, 147, 91, 92, 147, 112, 147, 147, 78,
419 /* 1010 */ 79, 147, 26, 19, 28, 169, 170, 23, 87, 88,
420 /* 1020 */ 89, 35, 147, 92, 169, 170, 178, 169, 170, 147,
421 /* 1030 */ 169, 170, 147, 47, 113, 49, 92, 178, 147, 53,
422 /* 1040 */ 147, 178, 56, 147, 169, 170, 147, 103, 147, 19,
423 /* 1050 */ 147, 169, 170, 147, 147, 124, 125, 126, 127, 128,
424 /* 1060 */ 129, 147, 169, 170, 147, 169, 170, 147, 169, 170,
425 /* 1070 */ 169, 170, 169, 170, 147, 169, 170, 147, 20, 147,
426 /* 1080 */ 22, 147, 88, 147, 232, 99, 100, 101, 147, 169,
427 /* 1090 */ 170, 105, 147, 20, 147, 22, 110, 20, 68, 169,
428 /* 1100 */ 170, 169, 170, 169, 170, 169, 170, 20, 147, 22,
429 /* 1110 */ 147, 20, 147, 22, 169, 170, 169, 170, 147, 233,
430 /* 1120 */ 134, 20, 147, 22, 20, 147, 22, 20, 20, 22,
431 /* 1130 */ 22, 147, 169, 170, 169, 170, 59, 147, 147, 147,
432 /* 1140 */ 169, 170, 147, 147, 169, 170, 147, 169, 170, 147,
433 /* 1150 */ 147, 147, 147, 191, 229, 149, 223, 193, 229, 172,
434 /* 1160 */ 172, 172, 177, 194, 194, 172, 6, 146, 146, 172,
435 /* 1170 */ 146, 173, 146, 22, 154, 121, 194, 118, 195, 119,
436 /* 1180 */ 116, 120, 23, 160, 112, 130, 152, 152, 222, 189,
437 /* 1190 */ 98, 115, 98, 40, 179, 97, 171, 196, 171, 171,
438 /* 1200 */ 19, 84, 173, 171, 197, 174, 198, 226, 160, 160,
439 /* 1210 */ 171, 171, 179, 204, 171, 205, 204, 15, 205, 174,
440 /* 1220 */ 151, 38, 152, 152, 60, 151, 151, 130, 184, 19,
441 /* 1230 */ 152, 152, 151, 214, 152, 184, 194, 226, 152, 15,
442 /* 1240 */ 187, 194, 152, 187, 187, 33, 137, 184, 234, 187,
443 /* 1250 */ 214, 235, 152, 1, 237, 237, 20, 152, 159, 175,
444 /* 1260 */ 175, 112, 112, 92, 112, 107, 112, 19, 19, 231,
445 /* 1270 */ 20, 20, 11, 19, 117, 20, 114, 240, 22, 20,
446 /* 1280 */ 20, 19, 117, 44, 243, 22, 22, 20, 112, 20,
447 /* 1290 */ 20, 19, 246, 19, 96, 20, 19, 32, 19, 19,
448 /* 1300 */ 103, 44, 44, 16, 21, 17, 98, 36, 22, 98,
449 /* 1310 */ 133, 19, 5, 45, 1, 102, 122, 51, 45, 19,
450 /* 1320 */ 113, 68, 14, 17, 115, 102, 122, 113, 19, 123,
451 /* 1330 */ 20, 14, 136, 19, 135, 57, 3, 247, 4, 247,
452 /* 1340 */ 247, 247, 247, 247, 68,
454 #define YY_SHIFT_USE_DFLT (-62)
455 #define YY_SHIFT_MAX 387
456 static const short yy_shift_ofst[] = {
457 /* 0 */ 39, 841, 986, -16, 841, 931, 931, 258, 123, -36,
458 /* 10 */ 96, 931, 931, 931, 931, 931, -45, 400, 174, 19,
459 /* 20 */ 171, -54, -54, 53, 165, 208, 251, 324, 393, 462,
460 /* 30 */ 531, 600, 643, 686, 643, 643, 643, 643, 643, 643,
461 /* 40 */ 643, 643, 643, 643, 643, 643, 643, 643, 643, 643,
462 /* 50 */ 643, 643, 729, 772, 772, 857, 931, 931, 931, 931,
463 /* 60 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
464 /* 70 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
465 /* 80 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
466 /* 90 */ 931, 931, 931, 931, 931, -61, -61, 6, 6, 280,
467 /* 100 */ 22, 61, 399, 564, 19, 19, 19, 19, 19, 19,
468 /* 110 */ 19, 216, 171, 63, -62, -62, 131, 326, 472, 472,
469 /* 120 */ 498, 559, 506, 799, 19, 799, 19, 19, 19, 19,
470 /* 130 */ 19, 19, 19, 19, 19, 19, 19, 19, 19, 849,
471 /* 140 */ 95, -36, -36, -36, -62, -62, -62, -15, -15, 333,
472 /* 150 */ 459, 478, 557, 530, 541, 616, 602, 793, 604, 607,
473 /* 160 */ 626, 19, 19, 881, 19, 19, 994, 19, 19, 807,
474 /* 170 */ 19, 19, 673, 807, 19, 19, 384, 384, 384, 19,
475 /* 180 */ 19, 673, 19, 19, 673, 19, 454, 685, 19, 19,
476 /* 190 */ 673, 19, 19, 19, 673, 19, 19, 19, 673, 673,
477 /* 200 */ 19, 19, 19, 19, 19, 468, 883, 921, 754, 754,
478 /* 210 */ 432, 406, 406, 406, 816, 406, 406, 811, 879, 879,
479 /* 220 */ 1160, 1160, 1160, 1160, 1151, -36, 1054, 1059, 1060, 1064,
480 /* 230 */ 1061, 1159, 1055, 1072, 1072, 1092, 1076, 1092, 1076, 1094,
481 /* 240 */ 1094, 1153, 1094, 1098, 1094, 1181, 1117, 1159, 1117, 1159,
482 /* 250 */ 1153, 1094, 1094, 1094, 1181, 1202, 1072, 1202, 1072, 1202,
483 /* 260 */ 1072, 1072, 1183, 1097, 1202, 1072, 1164, 1164, 1210, 1054,
484 /* 270 */ 1072, 1224, 1224, 1224, 1224, 1054, 1164, 1210, 1072, 1212,
485 /* 280 */ 1212, 1072, 1072, 1109, -62, -62, -62, -62, -62, -62,
486 /* 290 */ 525, 684, 727, 168, 894, 556, 555, 938, 944, 949,
487 /* 300 */ 912, 1058, 1073, 1087, 1091, 1101, 1104, 1107, 1030, 1108,
488 /* 310 */ 1077, 1252, 1236, 1149, 1150, 1152, 1154, 1171, 1158, 1248,
489 /* 320 */ 1250, 1251, 1249, 1261, 1254, 1255, 1256, 1259, 1260, 1263,
490 /* 330 */ 1157, 1264, 1165, 1263, 1162, 1262, 1267, 1176, 1269, 1270,
491 /* 340 */ 1265, 1239, 1272, 1257, 1274, 1275, 1277, 1279, 1258, 1280,
492 /* 350 */ 1198, 1197, 1287, 1288, 1283, 1208, 1271, 1266, 1268, 1286,
493 /* 360 */ 1273, 1177, 1211, 1292, 1307, 1313, 1213, 1253, 1276, 1194,
494 /* 370 */ 1300, 1207, 1308, 1209, 1306, 1214, 1223, 1204, 1309, 1206,
495 /* 380 */ 1310, 1317, 1278, 1199, 1196, 1314, 1333, 1334,
497 #define YY_REDUCE_USE_DFLT (-165)
498 #define YY_REDUCE_MAX 289
499 static const short yy_reduce_ofst[] = {
500 /* 0 */ -138, 277, 546, 137, 401, -21, 44, 36, 38, 242,
501 /* 10 */ -141, 191, 91, 269, 343, 345, -126, 589, 338, 150,
502 /* 20 */ 147, -13, 213, 412, 412, 412, 412, 412, 412, 412,
503 /* 30 */ 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
504 /* 40 */ 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
505 /* 50 */ 412, 412, 412, 412, 412, 211, 698, 714, 716, 722,
506 /* 60 */ 724, 728, 748, 753, 755, 757, 762, 769, 794, 805,
507 /* 70 */ 808, 846, 855, 858, 861, 875, 882, 893, 896, 899,
508 /* 80 */ 901, 903, 906, 920, 930, 932, 934, 936, 945, 947,
509 /* 90 */ 963, 965, 971, 975, 978, 412, 412, 412, 412, 20,
510 /* 100 */ 412, 412, 23, 34, 334, 475, 552, 593, 594, 585,
511 /* 110 */ 212, 412, 289, 412, 412, 412, 135, -164, -115, 164,
512 /* 120 */ 407, 407, 350, 141, 436, 163, 596, -90, 763, 218,
513 /* 130 */ 765, 438, 586, 592, 595, 715, 718, 408, 723, 380,
514 /* 140 */ 634, 677, 787, 798, 144, 529, 588, -14, 0, 17,
515 /* 150 */ 244, 155, 298, 155, 155, 418, 372, 477, 490, 494,
516 /* 160 */ 509, 526, 590, 465, 494, 730, 773, 743, 833, 792,
517 /* 170 */ 854, 860, 155, 792, 864, 885, 848, 859, 863, 891,
518 /* 180 */ 907, 155, 914, 917, 155, 927, 852, 886, 941, 961,
519 /* 190 */ 155, 984, 990, 991, 155, 992, 995, 996, 155, 155,
520 /* 200 */ 999, 1002, 1003, 1004, 1005, 1006, 962, 964, 925, 929,
521 /* 210 */ 933, 987, 988, 989, 985, 993, 997, 998, 969, 970,
522 /* 220 */ 1021, 1022, 1024, 1026, 1020, 1000, 982, 983, 1001, 1007,
523 /* 230 */ 1008, 1023, 966, 1034, 1035, 1009, 1010, 1012, 1013, 1025,
524 /* 240 */ 1027, 1015, 1028, 1029, 1032, 1031, 981, 1048, 1011, 1049,
525 /* 250 */ 1033, 1039, 1040, 1043, 1045, 1069, 1070, 1074, 1071, 1075,
526 /* 260 */ 1078, 1079, 1014, 1016, 1081, 1082, 1044, 1051, 1019, 1042,
527 /* 270 */ 1086, 1053, 1056, 1057, 1062, 1047, 1063, 1036, 1090, 1017,
528 /* 280 */ 1018, 1100, 1105, 1037, 1099, 1084, 1085, 1038, 1041, 1046,
530 static const YYACTIONTYPE yy_default[] = {
531 /* 0 */ 592, 816, 897, 707, 897, 816, 897, 897, 843, 711,
532 /* 10 */ 872, 814, 897, 897, 897, 897, 789, 897, 843, 897,
533 /* 20 */ 623, 843, 843, 740, 897, 897, 897, 897, 897, 897,
534 /* 30 */ 897, 897, 741, 897, 818, 813, 809, 811, 810, 817,
535 /* 40 */ 742, 731, 738, 745, 723, 856, 747, 748, 754, 755,
536 /* 50 */ 873, 871, 777, 776, 795, 897, 897, 897, 897, 897,
537 /* 60 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
538 /* 70 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
539 /* 80 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
540 /* 90 */ 897, 897, 897, 897, 897, 779, 800, 778, 788, 616,
541 /* 100 */ 780, 781, 676, 611, 897, 897, 897, 897, 897, 897,
542 /* 110 */ 897, 782, 897, 783, 796, 797, 897, 897, 897, 897,
543 /* 120 */ 897, 897, 592, 707, 897, 707, 897, 897, 897, 897,
544 /* 130 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
545 /* 140 */ 897, 897, 897, 897, 701, 711, 890, 897, 897, 667,
546 /* 150 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
547 /* 160 */ 599, 597, 897, 699, 897, 897, 625, 897, 897, 709,
548 /* 170 */ 897, 897, 714, 715, 897, 897, 897, 897, 897, 897,
549 /* 180 */ 897, 613, 897, 897, 688, 897, 849, 897, 897, 897,
550 /* 190 */ 863, 897, 897, 897, 861, 897, 897, 897, 690, 750,
551 /* 200 */ 830, 897, 876, 878, 897, 897, 699, 708, 897, 897,
552 /* 210 */ 812, 734, 734, 734, 646, 734, 734, 649, 744, 744,
553 /* 220 */ 596, 596, 596, 596, 666, 897, 744, 735, 737, 727,
554 /* 230 */ 739, 897, 897, 716, 716, 724, 726, 724, 726, 678,
555 /* 240 */ 678, 663, 678, 649, 678, 822, 827, 897, 827, 897,
556 /* 250 */ 663, 678, 678, 678, 822, 608, 716, 608, 716, 608,
557 /* 260 */ 716, 716, 853, 855, 608, 716, 680, 680, 756, 744,
558 /* 270 */ 716, 687, 687, 687, 687, 744, 680, 756, 716, 875,
559 /* 280 */ 875, 716, 716, 883, 633, 651, 651, 858, 890, 895,
560 /* 290 */ 897, 897, 897, 897, 763, 897, 897, 897, 897, 897,
561 /* 300 */ 897, 897, 897, 897, 897, 897, 897, 897, 836, 897,
562 /* 310 */ 897, 897, 897, 768, 764, 897, 765, 897, 693, 897,
563 /* 320 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 815,
564 /* 330 */ 897, 728, 897, 736, 897, 897, 897, 897, 897, 897,
565 /* 340 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
566 /* 350 */ 897, 897, 897, 897, 897, 897, 897, 897, 851, 852,
567 /* 360 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
568 /* 370 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
569 /* 380 */ 897, 897, 882, 897, 897, 885, 593, 897, 587, 590,
570 /* 390 */ 589, 591, 595, 598, 620, 621, 622, 600, 601, 602,
571 /* 400 */ 603, 604, 605, 606, 612, 614, 632, 634, 618, 636,
572 /* 410 */ 697, 698, 760, 691, 692, 696, 771, 762, 766, 767,
573 /* 420 */ 769, 770, 784, 785, 787, 793, 799, 802, 786, 791,
574 /* 430 */ 792, 794, 798, 801, 694, 695, 805, 619, 626, 627,
575 /* 440 */ 630, 631, 839, 841, 840, 842, 629, 628, 772, 775,
576 /* 450 */ 807, 808, 864, 865, 866, 867, 868, 803, 717, 806,
577 /* 460 */ 790, 729, 732, 733, 730, 700, 710, 719, 720, 721,
578 /* 470 */ 722, 705, 706, 712, 725, 758, 759, 713, 702, 703,
579 /* 480 */ 704, 804, 761, 773, 774, 637, 638, 768, 639, 640,
580 /* 490 */ 641, 679, 682, 683, 684, 642, 661, 664, 665, 643,
581 /* 500 */ 650, 644, 645, 652, 653, 654, 657, 658, 659, 660,
582 /* 510 */ 655, 656, 823, 824, 828, 826, 825, 647, 648, 662,
583 /* 520 */ 635, 624, 617, 668, 671, 672, 673, 674, 675, 677,
584 /* 530 */ 669, 670, 615, 607, 609, 718, 845, 854, 850, 846,
585 /* 540 */ 847, 848, 610, 819, 820, 681, 752, 753, 844, 857,
586 /* 550 */ 859, 757, 860, 862, 887, 685, 686, 689, 829, 869,
587 /* 560 */ 743, 746, 749, 751, 831, 832, 833, 834, 837, 838,
588 /* 570 */ 835, 870, 874, 877, 879, 880, 881, 884, 886, 891,
589 /* 580 */ 892, 893, 896, 894, 594, 588,
591 #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
593 /* The next table maps tokens into fallback tokens. If a construct
594 ** like the following:
596 ** %fallback ID X Y Z.
598 ** appears in the grammer, then ID becomes a fallback token for X, Y,
599 ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
600 ** but it does not parse, the type of the token is changed to ID and
601 ** the parse is retried before an error is thrown.
604 static const YYCODETYPE yyFallback[] = {
605 0, /* $ => nothing */
606 0, /* SEMI => nothing */
607 23, /* EXPLAIN => ID */
608 23, /* QUERY => ID */
610 23, /* BEGIN => ID */
611 0, /* TRANSACTION => nothing */
612 23, /* DEFERRED => ID */
613 23, /* IMMEDIATE => ID */
614 23, /* EXCLUSIVE => ID */
615 0, /* COMMIT => nothing */
617 0, /* ROLLBACK => nothing */
618 0, /* CREATE => nothing */
619 0, /* TABLE => nothing */
621 0, /* NOT => nothing */
622 0, /* EXISTS => nothing */
624 0, /* LP => nothing */
625 0, /* RP => nothing */
626 0, /* AS => nothing */
627 0, /* COMMA => nothing */
628 0, /* ID => nothing */
629 23, /* ABORT => ID */
630 23, /* AFTER => ID */
631 23, /* ANALYZE => ID */
633 23, /* ATTACH => ID */
634 23, /* BEFORE => ID */
635 23, /* CASCADE => ID */
637 23, /* CONFLICT => ID */
638 23, /* DATABASE => ID */
640 23, /* DETACH => ID */
644 23, /* IGNORE => ID */
645 23, /* INITIALLY => ID */
646 23, /* INSTEAD => ID */
647 23, /* LIKE_KW => ID */
648 23, /* MATCH => ID */
651 23, /* OFFSET => ID */
652 23, /* PRAGMA => ID */
653 23, /* RAISE => ID */
654 23, /* REPLACE => ID */
655 23, /* RESTRICT => ID */
657 23, /* TRIGGER => ID */
658 23, /* VACUUM => ID */
660 23, /* VIRTUAL => ID */
661 23, /* REINDEX => ID */
662 23, /* RENAME => ID */
663 23, /* CTIME_KW => ID */
664 0, /* ANY => nothing */
665 0, /* OR => nothing */
666 0, /* AND => nothing */
667 0, /* IS => nothing */
668 0, /* BETWEEN => nothing */
669 0, /* IN => nothing */
670 0, /* ISNULL => nothing */
671 0, /* NOTNULL => nothing */
672 0, /* NE => nothing */
673 0, /* EQ => nothing */
674 0, /* GT => nothing */
675 0, /* LE => nothing */
676 0, /* LT => nothing */
677 0, /* GE => nothing */
678 0, /* ESCAPE => nothing */
679 0, /* BITAND => nothing */
680 0, /* BITOR => nothing */
681 0, /* LSHIFT => nothing */
682 0, /* RSHIFT => nothing */
683 0, /* PLUS => nothing */
684 0, /* MINUS => nothing */
685 0, /* STAR => nothing */
686 0, /* SLASH => nothing */
687 0, /* REM => nothing */
688 0, /* CONCAT => nothing */
689 0, /* COLLATE => nothing */
690 0, /* UMINUS => nothing */
691 0, /* UPLUS => nothing */
692 0, /* BITNOT => nothing */
693 0, /* STRING => nothing */
694 0, /* JOIN_KW => nothing */
695 0, /* CONSTRAINT => nothing */
696 0, /* DEFAULT => nothing */
697 0, /* NULL => nothing */
698 0, /* PRIMARY => nothing */
699 0, /* UNIQUE => nothing */
700 0, /* CHECK => nothing */
701 0, /* REFERENCES => nothing */
702 0, /* AUTOINCR => nothing */
703 0, /* ON => nothing */
704 0, /* DELETE => nothing */
705 0, /* UPDATE => nothing */
706 0, /* INSERT => nothing */
707 0, /* SET => nothing */
708 0, /* DEFERRABLE => nothing */
709 0, /* FOREIGN => nothing */
710 0, /* DROP => nothing */
711 0, /* UNION => nothing */
712 0, /* ALL => nothing */
713 0, /* EXCEPT => nothing */
714 0, /* INTERSECT => nothing */
715 0, /* SELECT => nothing */
716 0, /* DISTINCT => nothing */
717 0, /* DOT => nothing */
718 0, /* FROM => nothing */
719 0, /* JOIN => nothing */
720 0, /* USING => nothing */
721 0, /* ORDER => nothing */
722 0, /* BY => nothing */
723 0, /* GROUP => nothing */
724 0, /* HAVING => nothing */
725 0, /* LIMIT => nothing */
726 0, /* WHERE => nothing */
727 0, /* INTO => nothing */
728 0, /* VALUES => nothing */
729 0, /* INTEGER => nothing */
730 0, /* FLOAT => nothing */
731 0, /* BLOB => nothing */
732 0, /* REGISTER => nothing */
733 0, /* VARIABLE => nothing */
734 0, /* CASE => nothing */
735 0, /* WHEN => nothing */
736 0, /* THEN => nothing */
737 0, /* ELSE => nothing */
738 0, /* INDEX => nothing */
739 0, /* ALTER => nothing */
740 0, /* TO => nothing */
741 0, /* ADD => nothing */
742 0, /* COLUMNKW => nothing */
744 #endif /* YYFALLBACK */
746 /* The following structure represents a single element of the
747 ** parser's stack. Information stored includes:
749 ** + The state number for the parser at this level of the stack.
751 ** + The value of the token stored at this level of the stack.
752 ** (In other words, the "major" token.)
754 ** + The semantic value stored at this level of the stack. This is
755 ** the information used by the action routines in the grammar.
756 ** It is sometimes called the "minor" token.
758 struct yyStackEntry {
759 int stateno; /* The state-number */
760 int major; /* The major token value. This is the code
761 ** number for the token at this stack level */
762 YYMINORTYPE minor; /* The user-supplied minor token value. This
763 ** is the value of the token */
765 typedef struct yyStackEntry yyStackEntry;
767 /* The state of the parser is completely contained in an instance of
768 ** the following structure */
770 int yyidx; /* Index of top element in stack */
771 int yyerrcnt; /* Shifts left before out of the error */
772 sqlite3ParserARG_SDECL /* A place to hold %extra_argument */
774 int yystksz; /* Current side of the stack */
775 yyStackEntry *yystack; /* The parser's stack */
777 yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
780 typedef struct yyParser yyParser;
784 static FILE *yyTraceFILE = 0;
785 static char *yyTracePrompt = 0;
790 ** Turn parser tracing on by giving a stream to which to write the trace
791 ** and a prompt to preface each trace message. Tracing is turned off
792 ** by making either argument NULL
796 ** <li> A FILE* to which trace output should be written.
797 ** If NULL, then tracing is turned off.
798 ** <li> A prefix string written at the beginning of every
799 ** line of trace output. If NULL, then tracing is
806 void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
807 yyTraceFILE = TraceFILE;
808 yyTracePrompt = zTracePrompt;
809 if( yyTraceFILE==0 ) yyTracePrompt = 0;
810 else if( yyTracePrompt==0 ) yyTraceFILE = 0;
815 /* For tracing shifts, the names of all terminals and nonterminals
816 ** are required. The following table supplies these names */
817 static const char *const yyTokenName[] = {
818 "$", "SEMI", "EXPLAIN", "QUERY",
819 "PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
820 "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END",
821 "ROLLBACK", "CREATE", "TABLE", "IF",
822 "NOT", "EXISTS", "TEMP", "LP",
823 "RP", "AS", "COMMA", "ID",
824 "ABORT", "AFTER", "ANALYZE", "ASC",
825 "ATTACH", "BEFORE", "CASCADE", "CAST",
826 "CONFLICT", "DATABASE", "DESC", "DETACH",
827 "EACH", "FAIL", "FOR", "IGNORE",
828 "INITIALLY", "INSTEAD", "LIKE_KW", "MATCH",
829 "KEY", "OF", "OFFSET", "PRAGMA",
830 "RAISE", "REPLACE", "RESTRICT", "ROW",
831 "TRIGGER", "VACUUM", "VIEW", "VIRTUAL",
832 "REINDEX", "RENAME", "CTIME_KW", "ANY",
833 "OR", "AND", "IS", "BETWEEN",
834 "IN", "ISNULL", "NOTNULL", "NE",
835 "EQ", "GT", "LE", "LT",
836 "GE", "ESCAPE", "BITAND", "BITOR",
837 "LSHIFT", "RSHIFT", "PLUS", "MINUS",
838 "STAR", "SLASH", "REM", "CONCAT",
839 "COLLATE", "UMINUS", "UPLUS", "BITNOT",
840 "STRING", "JOIN_KW", "CONSTRAINT", "DEFAULT",
841 "NULL", "PRIMARY", "UNIQUE", "CHECK",
842 "REFERENCES", "AUTOINCR", "ON", "DELETE",
843 "UPDATE", "INSERT", "SET", "DEFERRABLE",
844 "FOREIGN", "DROP", "UNION", "ALL",
845 "EXCEPT", "INTERSECT", "SELECT", "DISTINCT",
846 "DOT", "FROM", "JOIN", "USING",
847 "ORDER", "BY", "GROUP", "HAVING",
848 "LIMIT", "WHERE", "INTO", "VALUES",
849 "INTEGER", "FLOAT", "BLOB", "REGISTER",
850 "VARIABLE", "CASE", "WHEN", "THEN",
851 "ELSE", "INDEX", "ALTER", "TO",
852 "ADD", "COLUMNKW", "error", "input",
853 "cmdlist", "ecmd", "cmdx", "cmd",
854 "explain", "transtype", "trans_opt", "nm",
855 "create_table", "create_table_args", "temp", "ifnotexists",
856 "dbnm", "columnlist", "conslist_opt", "select",
857 "column", "columnid", "type", "carglist",
858 "id", "ids", "typetoken", "typename",
859 "signed", "plus_num", "minus_num", "carg",
860 "ccons", "term", "expr", "onconf",
861 "sortorder", "autoinc", "idxlist_opt", "refargs",
862 "defer_subclause", "refarg", "refact", "init_deferred_pred_opt",
863 "conslist", "tcons", "idxlist", "defer_subclause_opt",
864 "orconf", "resolvetype", "raisetype", "ifexists",
865 "fullname", "oneselect", "multiselect_op", "distinct",
866 "selcollist", "from", "where_opt", "groupby_opt",
867 "having_opt", "orderby_opt", "limit_opt", "sclp",
868 "as", "seltablist", "stl_prefix", "joinop",
869 "on_opt", "using_opt", "seltablist_paren", "joinop2",
870 "inscollist", "sortlist", "sortitem", "nexprlist",
871 "setlist", "insert_cmd", "inscollist_opt", "itemlist",
872 "exprlist", "likeop", "escape", "between_op",
873 "in_op", "case_operand", "case_exprlist", "case_else",
874 "uniqueflag", "idxitem", "collate", "nmnum",
875 "plus_opt", "number", "trigger_decl", "trigger_cmd_list",
876 "trigger_time", "trigger_event", "foreach_clause", "when_clause",
877 "trigger_cmd", "database_kw_opt", "key_opt", "add_column_fullname",
878 "kwcolumn_opt", "create_vtab", "vtabarglist", "vtabarg",
879 "vtabargtoken", "lp", "anylist",
884 /* For tracing reduce actions, the names of all rules are required.
886 static const char *const yyRuleName[] = {
887 /* 0 */ "input ::= cmdlist",
888 /* 1 */ "cmdlist ::= cmdlist ecmd",
889 /* 2 */ "cmdlist ::= ecmd",
890 /* 3 */ "cmdx ::= cmd",
891 /* 4 */ "ecmd ::= SEMI",
892 /* 5 */ "ecmd ::= explain cmdx SEMI",
893 /* 6 */ "explain ::=",
894 /* 7 */ "explain ::= EXPLAIN",
895 /* 8 */ "explain ::= EXPLAIN QUERY PLAN",
896 /* 9 */ "cmd ::= BEGIN transtype trans_opt",
897 /* 10 */ "trans_opt ::=",
898 /* 11 */ "trans_opt ::= TRANSACTION",
899 /* 12 */ "trans_opt ::= TRANSACTION nm",
900 /* 13 */ "transtype ::=",
901 /* 14 */ "transtype ::= DEFERRED",
902 /* 15 */ "transtype ::= IMMEDIATE",
903 /* 16 */ "transtype ::= EXCLUSIVE",
904 /* 17 */ "cmd ::= COMMIT trans_opt",
905 /* 18 */ "cmd ::= END trans_opt",
906 /* 19 */ "cmd ::= ROLLBACK trans_opt",
907 /* 20 */ "cmd ::= create_table create_table_args",
908 /* 21 */ "create_table ::= CREATE temp TABLE ifnotexists nm dbnm",
909 /* 22 */ "ifnotexists ::=",
910 /* 23 */ "ifnotexists ::= IF NOT EXISTS",
911 /* 24 */ "temp ::= TEMP",
913 /* 26 */ "create_table_args ::= LP columnlist conslist_opt RP",
914 /* 27 */ "create_table_args ::= AS select",
915 /* 28 */ "columnlist ::= columnlist COMMA column",
916 /* 29 */ "columnlist ::= column",
917 /* 30 */ "column ::= columnid type carglist",
918 /* 31 */ "columnid ::= nm",
919 /* 32 */ "id ::= ID",
920 /* 33 */ "ids ::= ID|STRING",
921 /* 34 */ "nm ::= ID",
922 /* 35 */ "nm ::= STRING",
923 /* 36 */ "nm ::= JOIN_KW",
925 /* 38 */ "type ::= typetoken",
926 /* 39 */ "typetoken ::= typename",
927 /* 40 */ "typetoken ::= typename LP signed RP",
928 /* 41 */ "typetoken ::= typename LP signed COMMA signed RP",
929 /* 42 */ "typename ::= ids",
930 /* 43 */ "typename ::= typename ids",
931 /* 44 */ "signed ::= plus_num",
932 /* 45 */ "signed ::= minus_num",
933 /* 46 */ "carglist ::= carglist carg",
934 /* 47 */ "carglist ::=",
935 /* 48 */ "carg ::= CONSTRAINT nm ccons",
936 /* 49 */ "carg ::= ccons",
937 /* 50 */ "ccons ::= DEFAULT term",
938 /* 51 */ "ccons ::= DEFAULT LP expr RP",
939 /* 52 */ "ccons ::= DEFAULT PLUS term",
940 /* 53 */ "ccons ::= DEFAULT MINUS term",
941 /* 54 */ "ccons ::= DEFAULT id",
942 /* 55 */ "ccons ::= NULL onconf",
943 /* 56 */ "ccons ::= NOT NULL onconf",
944 /* 57 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
945 /* 58 */ "ccons ::= UNIQUE onconf",
946 /* 59 */ "ccons ::= CHECK LP expr RP",
947 /* 60 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
948 /* 61 */ "ccons ::= defer_subclause",
949 /* 62 */ "ccons ::= COLLATE id",
950 /* 63 */ "autoinc ::=",
951 /* 64 */ "autoinc ::= AUTOINCR",
952 /* 65 */ "refargs ::=",
953 /* 66 */ "refargs ::= refargs refarg",
954 /* 67 */ "refarg ::= MATCH nm",
955 /* 68 */ "refarg ::= ON DELETE refact",
956 /* 69 */ "refarg ::= ON UPDATE refact",
957 /* 70 */ "refarg ::= ON INSERT refact",
958 /* 71 */ "refact ::= SET NULL",
959 /* 72 */ "refact ::= SET DEFAULT",
960 /* 73 */ "refact ::= CASCADE",
961 /* 74 */ "refact ::= RESTRICT",
962 /* 75 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
963 /* 76 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
964 /* 77 */ "init_deferred_pred_opt ::=",
965 /* 78 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
966 /* 79 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
967 /* 80 */ "conslist_opt ::=",
968 /* 81 */ "conslist_opt ::= COMMA conslist",
969 /* 82 */ "conslist ::= conslist COMMA tcons",
970 /* 83 */ "conslist ::= conslist tcons",
971 /* 84 */ "conslist ::= tcons",
972 /* 85 */ "tcons ::= CONSTRAINT nm",
973 /* 86 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
974 /* 87 */ "tcons ::= UNIQUE LP idxlist RP onconf",
975 /* 88 */ "tcons ::= CHECK LP expr RP onconf",
976 /* 89 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
977 /* 90 */ "defer_subclause_opt ::=",
978 /* 91 */ "defer_subclause_opt ::= defer_subclause",
979 /* 92 */ "onconf ::=",
980 /* 93 */ "onconf ::= ON CONFLICT resolvetype",
981 /* 94 */ "orconf ::=",
982 /* 95 */ "orconf ::= OR resolvetype",
983 /* 96 */ "resolvetype ::= raisetype",
984 /* 97 */ "resolvetype ::= IGNORE",
985 /* 98 */ "resolvetype ::= REPLACE",
986 /* 99 */ "cmd ::= DROP TABLE ifexists fullname",
987 /* 100 */ "ifexists ::= IF EXISTS",
988 /* 101 */ "ifexists ::=",
989 /* 102 */ "cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select",
990 /* 103 */ "cmd ::= DROP VIEW ifexists fullname",
991 /* 104 */ "cmd ::= select",
992 /* 105 */ "select ::= oneselect",
993 /* 106 */ "select ::= select multiselect_op oneselect",
994 /* 107 */ "multiselect_op ::= UNION",
995 /* 108 */ "multiselect_op ::= UNION ALL",
996 /* 109 */ "multiselect_op ::= EXCEPT|INTERSECT",
997 /* 110 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
998 /* 111 */ "distinct ::= DISTINCT",
999 /* 112 */ "distinct ::= ALL",
1000 /* 113 */ "distinct ::=",
1001 /* 114 */ "sclp ::= selcollist COMMA",
1002 /* 115 */ "sclp ::=",
1003 /* 116 */ "selcollist ::= sclp expr as",
1004 /* 117 */ "selcollist ::= sclp STAR",
1005 /* 118 */ "selcollist ::= sclp nm DOT STAR",
1006 /* 119 */ "as ::= AS nm",
1007 /* 120 */ "as ::= ids",
1009 /* 122 */ "from ::=",
1010 /* 123 */ "from ::= FROM seltablist",
1011 /* 124 */ "stl_prefix ::= seltablist joinop",
1012 /* 125 */ "stl_prefix ::=",
1013 /* 126 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt",
1014 /* 127 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt",
1015 /* 128 */ "seltablist_paren ::= select",
1016 /* 129 */ "seltablist_paren ::= seltablist",
1017 /* 130 */ "dbnm ::=",
1018 /* 131 */ "dbnm ::= DOT nm",
1019 /* 132 */ "fullname ::= nm dbnm",
1020 /* 133 */ "joinop ::= COMMA|JOIN",
1021 /* 134 */ "joinop ::= JOIN_KW JOIN",
1022 /* 135 */ "joinop ::= JOIN_KW nm JOIN",
1023 /* 136 */ "joinop ::= JOIN_KW nm nm JOIN",
1024 /* 137 */ "on_opt ::= ON expr",
1025 /* 138 */ "on_opt ::=",
1026 /* 139 */ "using_opt ::= USING LP inscollist RP",
1027 /* 140 */ "using_opt ::=",
1028 /* 141 */ "orderby_opt ::=",
1029 /* 142 */ "orderby_opt ::= ORDER BY sortlist",
1030 /* 143 */ "sortlist ::= sortlist COMMA sortitem sortorder",
1031 /* 144 */ "sortlist ::= sortitem sortorder",
1032 /* 145 */ "sortitem ::= expr",
1033 /* 146 */ "sortorder ::= ASC",
1034 /* 147 */ "sortorder ::= DESC",
1035 /* 148 */ "sortorder ::=",
1036 /* 149 */ "groupby_opt ::=",
1037 /* 150 */ "groupby_opt ::= GROUP BY nexprlist",
1038 /* 151 */ "having_opt ::=",
1039 /* 152 */ "having_opt ::= HAVING expr",
1040 /* 153 */ "limit_opt ::=",
1041 /* 154 */ "limit_opt ::= LIMIT expr",
1042 /* 155 */ "limit_opt ::= LIMIT expr OFFSET expr",
1043 /* 156 */ "limit_opt ::= LIMIT expr COMMA expr",
1044 /* 157 */ "cmd ::= DELETE FROM fullname where_opt",
1045 /* 158 */ "where_opt ::=",
1046 /* 159 */ "where_opt ::= WHERE expr",
1047 /* 160 */ "cmd ::= UPDATE orconf fullname SET setlist where_opt",
1048 /* 161 */ "setlist ::= setlist COMMA nm EQ expr",
1049 /* 162 */ "setlist ::= nm EQ expr",
1050 /* 163 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP",
1051 /* 164 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
1052 /* 165 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
1053 /* 166 */ "insert_cmd ::= INSERT orconf",
1054 /* 167 */ "insert_cmd ::= REPLACE",
1055 /* 168 */ "itemlist ::= itemlist COMMA expr",
1056 /* 169 */ "itemlist ::= expr",
1057 /* 170 */ "inscollist_opt ::=",
1058 /* 171 */ "inscollist_opt ::= LP inscollist RP",
1059 /* 172 */ "inscollist ::= inscollist COMMA nm",
1060 /* 173 */ "inscollist ::= nm",
1061 /* 174 */ "expr ::= term",
1062 /* 175 */ "expr ::= LP expr RP",
1063 /* 176 */ "term ::= NULL",
1064 /* 177 */ "expr ::= ID",
1065 /* 178 */ "expr ::= JOIN_KW",
1066 /* 179 */ "expr ::= nm DOT nm",
1067 /* 180 */ "expr ::= nm DOT nm DOT nm",
1068 /* 181 */ "term ::= INTEGER|FLOAT|BLOB",
1069 /* 182 */ "term ::= STRING",
1070 /* 183 */ "expr ::= REGISTER",
1071 /* 184 */ "expr ::= VARIABLE",
1072 /* 185 */ "expr ::= expr COLLATE id",
1073 /* 186 */ "expr ::= CAST LP expr AS typetoken RP",
1074 /* 187 */ "expr ::= ID LP distinct exprlist RP",
1075 /* 188 */ "expr ::= ID LP STAR RP",
1076 /* 189 */ "term ::= CTIME_KW",
1077 /* 190 */ "expr ::= expr AND expr",
1078 /* 191 */ "expr ::= expr OR expr",
1079 /* 192 */ "expr ::= expr LT|GT|GE|LE expr",
1080 /* 193 */ "expr ::= expr EQ|NE expr",
1081 /* 194 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
1082 /* 195 */ "expr ::= expr PLUS|MINUS expr",
1083 /* 196 */ "expr ::= expr STAR|SLASH|REM expr",
1084 /* 197 */ "expr ::= expr CONCAT expr",
1085 /* 198 */ "likeop ::= LIKE_KW",
1086 /* 199 */ "likeop ::= NOT LIKE_KW",
1087 /* 200 */ "likeop ::= MATCH",
1088 /* 201 */ "likeop ::= NOT MATCH",
1089 /* 202 */ "escape ::= ESCAPE expr",
1090 /* 203 */ "escape ::=",
1091 /* 204 */ "expr ::= expr likeop expr escape",
1092 /* 205 */ "expr ::= expr ISNULL|NOTNULL",
1093 /* 206 */ "expr ::= expr IS NULL",
1094 /* 207 */ "expr ::= expr NOT NULL",
1095 /* 208 */ "expr ::= expr IS NOT NULL",
1096 /* 209 */ "expr ::= NOT|BITNOT expr",
1097 /* 210 */ "expr ::= MINUS expr",
1098 /* 211 */ "expr ::= PLUS expr",
1099 /* 212 */ "between_op ::= BETWEEN",
1100 /* 213 */ "between_op ::= NOT BETWEEN",
1101 /* 214 */ "expr ::= expr between_op expr AND expr",
1102 /* 215 */ "in_op ::= IN",
1103 /* 216 */ "in_op ::= NOT IN",
1104 /* 217 */ "expr ::= expr in_op LP exprlist RP",
1105 /* 218 */ "expr ::= LP select RP",
1106 /* 219 */ "expr ::= expr in_op LP select RP",
1107 /* 220 */ "expr ::= expr in_op nm dbnm",
1108 /* 221 */ "expr ::= EXISTS LP select RP",
1109 /* 222 */ "expr ::= CASE case_operand case_exprlist case_else END",
1110 /* 223 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
1111 /* 224 */ "case_exprlist ::= WHEN expr THEN expr",
1112 /* 225 */ "case_else ::= ELSE expr",
1113 /* 226 */ "case_else ::=",
1114 /* 227 */ "case_operand ::= expr",
1115 /* 228 */ "case_operand ::=",
1116 /* 229 */ "exprlist ::= nexprlist",
1117 /* 230 */ "exprlist ::=",
1118 /* 231 */ "nexprlist ::= nexprlist COMMA expr",
1119 /* 232 */ "nexprlist ::= expr",
1120 /* 233 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
1121 /* 234 */ "uniqueflag ::= UNIQUE",
1122 /* 235 */ "uniqueflag ::=",
1123 /* 236 */ "idxlist_opt ::=",
1124 /* 237 */ "idxlist_opt ::= LP idxlist RP",
1125 /* 238 */ "idxlist ::= idxlist COMMA idxitem collate sortorder",
1126 /* 239 */ "idxlist ::= idxitem collate sortorder",
1127 /* 240 */ "idxitem ::= nm",
1128 /* 241 */ "collate ::=",
1129 /* 242 */ "collate ::= COLLATE id",
1130 /* 243 */ "cmd ::= DROP INDEX ifexists fullname",
1131 /* 244 */ "cmd ::= VACUUM",
1132 /* 245 */ "cmd ::= VACUUM nm",
1133 /* 246 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
1134 /* 247 */ "cmd ::= PRAGMA nm dbnm EQ ON",
1135 /* 248 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
1136 /* 249 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
1137 /* 250 */ "cmd ::= PRAGMA nm dbnm",
1138 /* 251 */ "nmnum ::= plus_num",
1139 /* 252 */ "nmnum ::= nm",
1140 /* 253 */ "plus_num ::= plus_opt number",
1141 /* 254 */ "minus_num ::= MINUS number",
1142 /* 255 */ "number ::= INTEGER|FLOAT",
1143 /* 256 */ "plus_opt ::= PLUS",
1144 /* 257 */ "plus_opt ::=",
1145 /* 258 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END",
1146 /* 259 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
1147 /* 260 */ "trigger_time ::= BEFORE",
1148 /* 261 */ "trigger_time ::= AFTER",
1149 /* 262 */ "trigger_time ::= INSTEAD OF",
1150 /* 263 */ "trigger_time ::=",
1151 /* 264 */ "trigger_event ::= DELETE|INSERT",
1152 /* 265 */ "trigger_event ::= UPDATE",
1153 /* 266 */ "trigger_event ::= UPDATE OF inscollist",
1154 /* 267 */ "foreach_clause ::=",
1155 /* 268 */ "foreach_clause ::= FOR EACH ROW",
1156 /* 269 */ "when_clause ::=",
1157 /* 270 */ "when_clause ::= WHEN expr",
1158 /* 271 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
1159 /* 272 */ "trigger_cmd_list ::=",
1160 /* 273 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt",
1161 /* 274 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP",
1162 /* 275 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select",
1163 /* 276 */ "trigger_cmd ::= DELETE FROM nm where_opt",
1164 /* 277 */ "trigger_cmd ::= select",
1165 /* 278 */ "expr ::= RAISE LP IGNORE RP",
1166 /* 279 */ "expr ::= RAISE LP raisetype COMMA nm RP",
1167 /* 280 */ "raisetype ::= ROLLBACK",
1168 /* 281 */ "raisetype ::= ABORT",
1169 /* 282 */ "raisetype ::= FAIL",
1170 /* 283 */ "cmd ::= DROP TRIGGER ifexists fullname",
1171 /* 284 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
1172 /* 285 */ "cmd ::= DETACH database_kw_opt expr",
1173 /* 286 */ "key_opt ::=",
1174 /* 287 */ "key_opt ::= KEY expr",
1175 /* 288 */ "database_kw_opt ::= DATABASE",
1176 /* 289 */ "database_kw_opt ::=",
1177 /* 290 */ "cmd ::= REINDEX",
1178 /* 291 */ "cmd ::= REINDEX nm dbnm",
1179 /* 292 */ "cmd ::= ANALYZE",
1180 /* 293 */ "cmd ::= ANALYZE nm dbnm",
1181 /* 294 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
1182 /* 295 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
1183 /* 296 */ "add_column_fullname ::= fullname",
1184 /* 297 */ "kwcolumn_opt ::=",
1185 /* 298 */ "kwcolumn_opt ::= COLUMNKW",
1186 /* 299 */ "cmd ::= create_vtab",
1187 /* 300 */ "cmd ::= create_vtab LP vtabarglist RP",
1188 /* 301 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm",
1189 /* 302 */ "vtabarglist ::= vtabarg",
1190 /* 303 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
1191 /* 304 */ "vtabarg ::=",
1192 /* 305 */ "vtabarg ::= vtabarg vtabargtoken",
1193 /* 306 */ "vtabargtoken ::= ANY",
1194 /* 307 */ "vtabargtoken ::= lp anylist RP",
1195 /* 308 */ "lp ::= LP",
1196 /* 309 */ "anylist ::=",
1197 /* 310 */ "anylist ::= anylist ANY",
1204 ** Try to increase the size of the parser stack.
1206 static void yyGrowStack(yyParser *p){
1210 newSize = p->yystksz*2 + 100;
1211 pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1214 p->yystksz = newSize;
1217 fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
1218 yyTracePrompt, p->yystksz);
1226 ** This function allocates a new parser.
1227 ** The only argument is a pointer to a function which works like
1231 ** A pointer to the function used to allocate memory.
1234 ** A pointer to a parser. This pointer is used in subsequent calls
1235 ** to sqlite3Parser and sqlite3ParserFree.
1237 void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
1239 pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
1241 pParser->yyidx = -1;
1243 yyGrowStack(pParser);
1249 /* The following function deletes the value associated with a
1250 ** symbol. The symbol can be either a terminal or nonterminal.
1251 ** "yymajor" is the symbol code, and "yypminor" is a pointer to
1254 static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
1256 /* Here is inserted the actions which take place when a
1257 ** terminal or non-terminal is destroyed. This can happen
1258 ** when the symbol is popped from the stack during a
1259 ** reduce or during error processing or when a parser is
1260 ** being destroyed before it is finished parsing.
1262 ** Note: during a reduce, the only symbols destroyed are those
1263 ** which appear on the RHS of the rule, but which are not used
1264 ** inside the C code.
1270 {sqlite3SelectDelete((yypminor->yy219));}
1271 #line 1273 "parse.c"
1284 {sqlite3ExprDelete((yypminor->yy172));}
1285 #line 1287 "parse.c"
1300 {sqlite3ExprListDelete((yypminor->yy174));}
1301 #line 1303 "parse.c"
1308 {sqlite3SrcListDelete((yypminor->yy373));}
1309 #line 1311 "parse.c"
1315 {sqlite3IdListDelete((yypminor->yy432));}
1316 #line 1318 "parse.c"
1321 {sqlite3DeleteTriggerStep((yypminor->yy243));}
1322 #line 1324 "parse.c"
1326 {sqlite3IdListDelete((yypminor->yy370).b);}
1327 #line 1329 "parse.c"
1330 #line 1063 "parse.y"
1331 {sqlite3ExprDelete((yypminor->yy386));}
1332 #line 1334 "parse.c"
1334 default: break; /* If no destructor action specified: do nothing */
1339 ** Pop the parser's stack once.
1341 ** If there is a destructor routine associated with the token which
1342 ** is popped from the stack, then call it.
1344 ** Return the major token number for the symbol popped.
1346 static int yy_pop_parser_stack(yyParser *pParser){
1348 yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
1350 if( pParser->yyidx<0 ) return 0;
1352 if( yyTraceFILE && pParser->yyidx>=0 ){
1353 fprintf(yyTraceFILE,"%sPopping %s\n",
1355 yyTokenName[yytos->major]);
1358 yymajor = yytos->major;
1359 yy_destructor( yymajor, &yytos->minor);
1365 ** Deallocate and destroy a parser. Destructors are all called for
1366 ** all stack elements before shutting the parser down.
1370 ** <li> A pointer to the parser. This should be a pointer
1371 ** obtained from sqlite3ParserAlloc.
1372 ** <li> A pointer to a function used to reclaim memory obtained
1376 void sqlite3ParserFree(
1377 void *p, /* The parser to be deleted */
1378 void (*freeProc)(void*) /* Function used to reclaim memory */
1380 yyParser *pParser = (yyParser*)p;
1381 if( pParser==0 ) return;
1382 while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
1384 free(pParser->yystack);
1386 (*freeProc)((void*)pParser);
1390 ** Find the appropriate action for a parser given the terminal
1391 ** look-ahead token iLookAhead.
1393 ** If the look-ahead token is YYNOCODE, then check to see if the action is
1394 ** independent of the look-ahead. If it is, return the action, otherwise
1395 ** return YY_NO_ACTION.
1397 static int yy_find_shift_action(
1398 yyParser *pParser, /* The parser */
1399 YYCODETYPE iLookAhead /* The look-ahead token */
1402 int stateno = pParser->yystack[pParser->yyidx].stateno;
1404 if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
1405 return yy_default[stateno];
1407 if( iLookAhead==YYNOCODE ){
1408 return YY_NO_ACTION;
1411 if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
1414 int iFallback; /* Fallback token */
1415 if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
1416 && (iFallback = yyFallback[iLookAhead])!=0 ){
1419 fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
1420 yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
1423 return yy_find_shift_action(pParser, iFallback);
1428 int j = i - iLookAhead + YYWILDCARD;
1429 if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){
1432 fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
1433 yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
1436 return yy_action[j];
1439 #endif /* YYWILDCARD */
1441 return yy_default[stateno];
1443 return yy_action[i];
1448 ** Find the appropriate action for a parser given the non-terminal
1449 ** look-ahead token iLookAhead.
1451 ** If the look-ahead token is YYNOCODE, then check to see if the action is
1452 ** independent of the look-ahead. If it is, return the action, otherwise
1453 ** return YY_NO_ACTION.
1455 static int yy_find_reduce_action(
1456 int stateno, /* Current state number */
1457 YYCODETYPE iLookAhead /* The look-ahead token */
1460 /* int stateno = pParser->yystack[pParser->yyidx].stateno; */
1462 if( stateno>YY_REDUCE_MAX ||
1463 (i = yy_reduce_ofst[stateno])==YY_REDUCE_USE_DFLT ){
1464 return yy_default[stateno];
1466 if( iLookAhead==YYNOCODE ){
1467 return YY_NO_ACTION;
1470 if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
1471 return yy_default[stateno];
1473 return yy_action[i];
1478 ** The following routine is called if the stack overflows.
1480 static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
1481 sqlite3ParserARG_FETCH;
1485 fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
1488 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
1489 /* Here code is inserted which will execute if the parser
1490 ** stack every overflows */
1493 sqlite3ErrorMsg(pParse, "parser stack overflow");
1494 pParse->parseError = 1;
1495 #line 1498 "parse.c"
1496 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
1500 ** Perform a shift action.
1502 static void yy_shift(
1503 yyParser *yypParser, /* The parser to be shifted */
1504 int yyNewState, /* The new state to shift in */
1505 int yyMajor, /* The major token to shift in */
1506 YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */
1508 yyStackEntry *yytos;
1511 if( yypParser->yyidx>=YYSTACKDEPTH ){
1512 yyStackOverflow(yypParser, yypMinor);
1516 if( yypParser->yyidx>=yypParser->yystksz ){
1517 yyGrowStack(yypParser);
1518 if( yypParser->yyidx>=yypParser->yystksz ){
1519 yyStackOverflow(yypParser, yypMinor);
1524 yytos = &yypParser->yystack[yypParser->yyidx];
1525 yytos->stateno = yyNewState;
1526 yytos->major = yyMajor;
1527 yytos->minor = *yypMinor;
1529 if( yyTraceFILE && yypParser->yyidx>0 ){
1531 fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
1532 fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
1533 for(i=1; i<=yypParser->yyidx; i++)
1534 fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
1535 fprintf(yyTraceFILE,"\n");
1540 /* The following table contains information about every rule that
1541 ** is used during the reduce.
1543 static const struct {
1544 YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
1545 unsigned char nrhs; /* Number of right-hand side symbols in the rule */
1860 static void yy_accept(yyParser*); /* Forward Declaration */
1863 ** Perform a reduce action and the shift that must immediately
1864 ** follow the reduce.
1866 static void yy_reduce(
1867 yyParser *yypParser, /* The parser */
1868 int yyruleno /* Number of the rule by which to reduce */
1870 int yygoto; /* The next state */
1871 int yyact; /* The next action */
1872 YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
1873 yyStackEntry *yymsp; /* The top of the parser's stack */
1874 int yysize; /* Amount to pop the stack */
1875 sqlite3ParserARG_FETCH;
1876 yymsp = &yypParser->yystack[yypParser->yyidx];
1878 if( yyTraceFILE && yyruleno>=0
1879 && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
1880 fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
1881 yyRuleName[yyruleno]);
1885 /* Silence complaints from purify about yygotominor being uninitialized
1886 ** in some cases when it is copied into the stack after the following
1887 ** switch. yygotominor is uninitialized when a rule reduces that does
1888 ** not set the value of its left-hand side nonterminal. Leaving the
1889 ** value of the nonterminal uninitialized is utterly harmless as long
1890 ** as the value is never used. So really the only thing this code
1891 ** accomplishes is to quieten purify.
1893 ** 2007-01-16: The wireshark project (www.wireshark.org) reports that
1894 ** without this code, their parser segfaults. I'm not sure what there
1895 ** parser is doing to make this happen. This is the second bug report
1896 ** from wireshark this week. Clearly they are stressing Lemon in ways
1897 ** that it has not been previously stressed... (SQLite ticket #2172)
1899 memset(&yygotominor, 0, sizeof(yygotominor));
1903 /* Beginning here are the reduction cases. A typical example
1906 ** #line <lineno> <grammarfile>
1907 ** { ... } // User supplied code
1908 ** #line <lineno> <thisfile>
1949 #line 1952 "parse.c"
1953 { sqlite3FinishCoding(pParse); }
1954 #line 1957 "parse.c"
1958 { sqlite3BeginParse(pParse, 0); }
1959 #line 1962 "parse.c"
1963 { sqlite3BeginParse(pParse, 1); }
1964 #line 1967 "parse.c"
1968 { sqlite3BeginParse(pParse, 2); }
1969 #line 1972 "parse.c"
1973 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy46);}
1974 #line 1977 "parse.c"
1978 {yygotominor.yy46 = TK_DEFERRED;}
1979 #line 1982 "parse.c"
1987 {yygotominor.yy46 = yymsp[0].major;}
1988 #line 1991 "parse.c"
1993 {sqlite3CommitTransaction(pParse);}
1994 #line 1997 "parse.c"
1998 {sqlite3RollbackTransaction(pParse);}
1999 #line 2002 "parse.c"
2004 sqlite3StartTable(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410,yymsp[-4].minor.yy46,0,0,yymsp[-2].minor.yy46);
2006 #line 2009 "parse.c"
2020 {yygotominor.yy46 = 0;}
2021 #line 2024 "parse.c"
2032 {yygotominor.yy46 = 1;}
2033 #line 2036 "parse.c"
2038 sqlite3EndTable(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy0,0);
2040 #line 2043 "parse.c"
2045 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy219);
2046 sqlite3SelectDelete(yymsp[0].minor.yy219);
2048 #line 2051 "parse.c"
2053 yygotominor.yy410.z = yymsp[-2].minor.yy410.z;
2054 yygotominor.yy410.n = (pParse->sLastToken.z-yymsp[-2].minor.yy410.z) + pParse->sLastToken.n;
2056 #line 2059 "parse.c"
2061 sqlite3AddColumn(pParse,&yymsp[0].minor.yy410);
2062 yygotominor.yy410 = yymsp[0].minor.yy410;
2064 #line 2067 "parse.c"
2073 {yygotominor.yy410 = yymsp[0].minor.yy0;}
2074 #line 2077 "parse.c"
2078 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy410);}
2079 #line 2082 "parse.c"
2093 {yygotominor.yy410 = yymsp[0].minor.yy410;}
2094 #line 2097 "parse.c"
2099 yygotominor.yy410.z = yymsp[-3].minor.yy410.z;
2100 yygotominor.yy410.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy410.z;
2102 #line 2105 "parse.c"
2107 yygotominor.yy410.z = yymsp[-5].minor.yy410.z;
2108 yygotominor.yy410.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy410.z;
2110 #line 2113 "parse.c"
2114 {yygotominor.yy410.z=yymsp[-1].minor.yy410.z; yygotominor.yy410.n=yymsp[0].minor.yy410.n+(yymsp[0].minor.yy410.z-yymsp[-1].minor.yy410.z);}
2115 #line 2118 "parse.c"
2120 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy172);}
2121 #line 2124 "parse.c"
2125 {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy172);}
2126 #line 2129 "parse.c"
2131 Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy172, 0, 0);
2132 sqlite3AddDefaultValue(pParse,p);
2134 #line 2137 "parse.c"
2139 Expr *p = sqlite3PExpr(pParse, TK_STRING, 0, 0, &yymsp[0].minor.yy410);
2140 sqlite3AddDefaultValue(pParse,p);
2142 #line 2145 "parse.c"
2146 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy46);}
2147 #line 2150 "parse.c"
2151 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy46,yymsp[0].minor.yy46,yymsp[-2].minor.yy46);}
2152 #line 2155 "parse.c"
2156 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy46,0,0,0,0);}
2157 #line 2160 "parse.c"
2161 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy172);}
2162 #line 2165 "parse.c"
2166 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy410,yymsp[-1].minor.yy174,yymsp[0].minor.yy46);}
2167 #line 2170 "parse.c"
2171 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy46);}
2172 #line 2175 "parse.c"
2176 {sqlite3AddCollateType(pParse, (char*)yymsp[0].minor.yy410.z, yymsp[0].minor.yy410.n);}
2177 #line 2180 "parse.c"
2181 { yygotominor.yy46 = OE_Restrict * 0x010101; }
2182 #line 2185 "parse.c"
2186 { yygotominor.yy46 = (yymsp[-1].minor.yy46 & yymsp[0].minor.yy405.mask) | yymsp[0].minor.yy405.value; }
2187 #line 2190 "parse.c"
2191 { yygotominor.yy405.value = 0; yygotominor.yy405.mask = 0x000000; }
2192 #line 2195 "parse.c"
2196 { yygotominor.yy405.value = yymsp[0].minor.yy46; yygotominor.yy405.mask = 0x0000ff; }
2197 #line 2200 "parse.c"
2201 { yygotominor.yy405.value = yymsp[0].minor.yy46<<8; yygotominor.yy405.mask = 0x00ff00; }
2202 #line 2205 "parse.c"
2206 { yygotominor.yy405.value = yymsp[0].minor.yy46<<16; yygotominor.yy405.mask = 0xff0000; }
2207 #line 2210 "parse.c"
2211 { yygotominor.yy46 = OE_SetNull; }
2212 #line 2215 "parse.c"
2216 { yygotominor.yy46 = OE_SetDflt; }
2217 #line 2220 "parse.c"
2221 { yygotominor.yy46 = OE_Cascade; }
2222 #line 2225 "parse.c"
2226 { yygotominor.yy46 = OE_Restrict; }
2227 #line 2230 "parse.c"
2237 {yygotominor.yy46 = yymsp[0].minor.yy46;}
2238 #line 2241 "parse.c"
2242 {yygotominor.yy410.n = 0; yygotominor.yy410.z = 0;}
2243 #line 2246 "parse.c"
2247 {yygotominor.yy410 = yymsp[-1].minor.yy0;}
2248 #line 2251 "parse.c"
2252 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy174,yymsp[0].minor.yy46,yymsp[-2].minor.yy46,0);}
2253 #line 2256 "parse.c"
2257 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy174,yymsp[0].minor.yy46,0,0,0,0);}
2258 #line 2261 "parse.c"
2262 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy172);}
2263 #line 2266 "parse.c"
2268 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy174, &yymsp[-3].minor.yy410, yymsp[-2].minor.yy174, yymsp[-1].minor.yy46);
2269 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy46);
2271 #line 2274 "parse.c"
2276 {yygotominor.yy46 = OE_Default;}
2277 #line 2280 "parse.c"
2281 {yygotominor.yy46 = OE_Ignore;}
2282 #line 2285 "parse.c"
2287 {yygotominor.yy46 = OE_Replace;}
2288 #line 2291 "parse.c"
2293 sqlite3DropTable(pParse, yymsp[0].minor.yy373, 0, yymsp[-1].minor.yy46);
2295 #line 2298 "parse.c"
2300 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy410, &yymsp[-2].minor.yy410, yymsp[0].minor.yy219, yymsp[-6].minor.yy46, yymsp[-4].minor.yy46);
2302 #line 2305 "parse.c"
2307 sqlite3DropTable(pParse, yymsp[0].minor.yy373, 1, yymsp[-1].minor.yy46);
2309 #line 2312 "parse.c"
2314 sqlite3Select(pParse, yymsp[0].minor.yy219, SRT_Callback, 0, 0, 0, 0, 0);
2315 sqlite3SelectDelete(yymsp[0].minor.yy219);
2317 #line 2320 "parse.c"
2322 {yygotominor.yy219 = yymsp[0].minor.yy219;}
2323 #line 2326 "parse.c"
2328 if( yymsp[0].minor.yy219 ){
2329 yymsp[0].minor.yy219->op = yymsp[-1].minor.yy46;
2330 yymsp[0].minor.yy219->pPrior = yymsp[-2].minor.yy219;
2332 sqlite3SelectDelete(yymsp[-2].minor.yy219);
2334 yygotominor.yy219 = yymsp[0].minor.yy219;
2336 #line 2339 "parse.c"
2340 {yygotominor.yy46 = TK_ALL;}
2341 #line 2344 "parse.c"
2346 yygotominor.yy219 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy174,yymsp[-5].minor.yy373,yymsp[-4].minor.yy172,yymsp[-3].minor.yy174,yymsp[-2].minor.yy172,yymsp[-1].minor.yy174,yymsp[-7].minor.yy46,yymsp[0].minor.yy234.pLimit,yymsp[0].minor.yy234.pOffset);
2348 #line 2351 "parse.c"
2353 {yygotominor.yy174 = yymsp[-1].minor.yy174;}
2354 #line 2357 "parse.c"
2362 {yygotominor.yy174 = 0;}
2363 #line 2366 "parse.c"
2368 yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy174,yymsp[-1].minor.yy172,yymsp[0].minor.yy410.n?&yymsp[0].minor.yy410:0);
2370 #line 2373 "parse.c"
2375 Expr *p = sqlite3PExpr(pParse, TK_ALL, 0, 0, 0);
2376 yygotominor.yy174 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy174, p, 0);
2378 #line 2381 "parse.c"
2383 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, 0);
2384 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy410);
2385 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
2386 yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy174, pDot, 0);
2388 #line 2391 "parse.c"
2392 {yygotominor.yy410.n = 0;}
2393 #line 2396 "parse.c"
2397 {yygotominor.yy373 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy373));}
2398 #line 2401 "parse.c"
2403 yygotominor.yy373 = yymsp[0].minor.yy373;
2404 sqlite3SrcListShiftJoinType(yygotominor.yy373);
2406 #line 2409 "parse.c"
2411 yygotominor.yy373 = yymsp[-1].minor.yy373;
2412 if( yygotominor.yy373 && yygotominor.yy373->nSrc>0 ) yygotominor.yy373->a[yygotominor.yy373->nSrc-1].jointype = yymsp[0].minor.yy46;
2414 #line 2417 "parse.c"
2418 {yygotominor.yy373 = 0;}
2419 #line 2422 "parse.c"
2424 yygotominor.yy373 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy373,&yymsp[-4].minor.yy410,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,0,yymsp[-1].minor.yy172,yymsp[0].minor.yy432);
2426 #line 2429 "parse.c"
2431 yygotominor.yy373 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy373,0,0,&yymsp[-2].minor.yy410,yymsp[-4].minor.yy219,yymsp[-1].minor.yy172,yymsp[0].minor.yy432);
2433 #line 2436 "parse.c"
2438 sqlite3SrcListShiftJoinType(yymsp[0].minor.yy373);
2439 yygotominor.yy219 = sqlite3SelectNew(pParse,0,yymsp[0].minor.yy373,0,0,0,0,0,0,0);
2441 #line 2444 "parse.c"
2445 {yygotominor.yy410.z=0; yygotominor.yy410.n=0;}
2446 #line 2449 "parse.c"
2450 {yygotominor.yy373 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410);}
2451 #line 2454 "parse.c"
2455 { yygotominor.yy46 = JT_INNER; }
2456 #line 2459 "parse.c"
2460 { yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
2461 #line 2464 "parse.c"
2465 { yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy410,0); }
2466 #line 2469 "parse.c"
2470 { yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy410,&yymsp[-1].minor.yy410); }
2471 #line 2474 "parse.c"
2482 {yygotominor.yy172 = yymsp[0].minor.yy172;}
2483 #line 2486 "parse.c"
2492 {yygotominor.yy172 = 0;}
2493 #line 2496 "parse.c"
2498 {yygotominor.yy432 = yymsp[-1].minor.yy432;}
2499 #line 2502 "parse.c"
2504 {yygotominor.yy432 = 0;}
2505 #line 2508 "parse.c"
2511 {yygotominor.yy174 = yymsp[0].minor.yy174;}
2512 #line 2515 "parse.c"
2517 yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy174,yymsp[-1].minor.yy172,0);
2518 if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
2520 #line 2523 "parse.c"
2525 yygotominor.yy174 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy172,0);
2526 if( yygotominor.yy174 && yygotominor.yy174->a ) yygotominor.yy174->a[0].sortOrder = yymsp[0].minor.yy46;
2528 #line 2531 "parse.c"
2533 {yygotominor.yy46 = SQLITE_SO_ASC;}
2534 #line 2537 "parse.c"
2538 {yygotominor.yy46 = SQLITE_SO_DESC;}
2539 #line 2542 "parse.c"
2543 {yygotominor.yy234.pLimit = 0; yygotominor.yy234.pOffset = 0;}
2544 #line 2547 "parse.c"
2548 {yygotominor.yy234.pLimit = yymsp[0].minor.yy172; yygotominor.yy234.pOffset = 0;}
2549 #line 2552 "parse.c"
2553 {yygotominor.yy234.pLimit = yymsp[-2].minor.yy172; yygotominor.yy234.pOffset = yymsp[0].minor.yy172;}
2554 #line 2557 "parse.c"
2558 {yygotominor.yy234.pOffset = yymsp[-2].minor.yy172; yygotominor.yy234.pLimit = yymsp[0].minor.yy172;}
2559 #line 2562 "parse.c"
2563 {sqlite3DeleteFrom(pParse,yymsp[-1].minor.yy373,yymsp[0].minor.yy172);}
2564 #line 2567 "parse.c"
2569 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy174,SQLITE_MAX_COLUMN,"set list");
2570 sqlite3Update(pParse,yymsp[-3].minor.yy373,yymsp[-1].minor.yy174,yymsp[0].minor.yy172,yymsp[-4].minor.yy46);
2572 #line 2575 "parse.c"
2576 {yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy174,yymsp[0].minor.yy172,&yymsp[-2].minor.yy410);}
2577 #line 2580 "parse.c"
2581 {yygotominor.yy174 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy172,&yymsp[-2].minor.yy410);}
2582 #line 2585 "parse.c"
2586 {sqlite3Insert(pParse, yymsp[-5].minor.yy373, yymsp[-1].minor.yy174, 0, yymsp[-4].minor.yy432, yymsp[-7].minor.yy46);}
2587 #line 2590 "parse.c"
2591 {sqlite3Insert(pParse, yymsp[-2].minor.yy373, 0, yymsp[0].minor.yy219, yymsp[-1].minor.yy432, yymsp[-4].minor.yy46);}
2592 #line 2595 "parse.c"
2596 {sqlite3Insert(pParse, yymsp[-3].minor.yy373, 0, 0, yymsp[-2].minor.yy432, yymsp[-5].minor.yy46);}
2597 #line 2600 "parse.c"
2602 {yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy174,yymsp[0].minor.yy172,0);}
2603 #line 2606 "parse.c"
2608 {yygotominor.yy174 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy172,0);}
2609 #line 2612 "parse.c"
2613 {yygotominor.yy432 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy432,&yymsp[0].minor.yy410);}
2614 #line 2617 "parse.c"
2618 {yygotominor.yy432 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy410);}
2619 #line 2622 "parse.c"
2623 {yygotominor.yy172 = yymsp[-1].minor.yy172; sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); }
2624 #line 2627 "parse.c"
2630 {yygotominor.yy172 = sqlite3PExpr(pParse, yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);}
2631 #line 2634 "parse.c"
2636 {yygotominor.yy172 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);}
2637 #line 2640 "parse.c"
2642 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy410);
2643 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy410);
2644 yygotominor.yy172 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
2646 #line 2649 "parse.c"
2651 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy410);
2652 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy410);
2653 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy410);
2654 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
2655 yygotominor.yy172 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
2657 #line 2660 "parse.c"
2661 {yygotominor.yy172 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);}
2662 #line 2665 "parse.c"
2667 Token *pToken = &yymsp[0].minor.yy0;
2668 Expr *pExpr = yygotominor.yy172 = sqlite3PExpr(pParse, TK_VARIABLE, 0, 0, pToken);
2669 sqlite3ExprAssignVarNumber(pParse, pExpr);
2671 #line 2674 "parse.c"
2676 yygotominor.yy172 = sqlite3ExprSetColl(pParse, yymsp[-2].minor.yy172, &yymsp[0].minor.yy410);
2678 #line 2681 "parse.c"
2683 yygotominor.yy172 = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy172, 0, &yymsp[-1].minor.yy410);
2684 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
2686 #line 2689 "parse.c"
2691 if( yymsp[-1].minor.yy174 && yymsp[-1].minor.yy174->nExpr>SQLITE_MAX_FUNCTION_ARG ){
2692 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
2694 yygotominor.yy172 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy174, &yymsp[-4].minor.yy0);
2695 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
2696 if( yymsp[-2].minor.yy46 && yygotominor.yy172 ){
2697 yygotominor.yy172->flags |= EP_Distinct;
2700 #line 2703 "parse.c"
2705 yygotominor.yy172 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
2706 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
2708 #line 2711 "parse.c"
2713 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
2714 ** treated as functions that return constants */
2715 yygotominor.yy172 = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
2716 if( yygotominor.yy172 ){
2717 yygotominor.yy172->op = TK_CONST_FUNC;
2718 yygotominor.yy172->span = yymsp[0].minor.yy0;
2721 #line 2724 "parse.c"
2732 {yygotominor.yy172 = sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy172,yymsp[0].minor.yy172,0);}
2733 #line 2736 "parse.c"
2738 {yygotominor.yy72.eOperator = yymsp[0].minor.yy0; yygotominor.yy72.not = 0;}
2739 #line 2742 "parse.c"
2744 {yygotominor.yy72.eOperator = yymsp[0].minor.yy0; yygotominor.yy72.not = 1;}
2745 #line 2748 "parse.c"
2751 pList = sqlite3ExprListAppend(pParse,0, yymsp[-1].minor.yy172, 0);
2752 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-3].minor.yy172, 0);
2753 if( yymsp[0].minor.yy172 ){
2754 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy172, 0);
2756 yygotominor.yy172 = sqlite3ExprFunction(pParse, pList, &yymsp[-2].minor.yy72.eOperator);
2757 if( yymsp[-2].minor.yy72.not ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
2758 sqlite3ExprSpan(yygotominor.yy172, &yymsp[-3].minor.yy172->span, &yymsp[-1].minor.yy172->span);
2759 if( yygotominor.yy172 ) yygotominor.yy172->flags |= EP_InfixFunc;
2761 #line 2764 "parse.c"
2766 yygotominor.yy172 = sqlite3PExpr(pParse, yymsp[0].major, yymsp[-1].minor.yy172, 0, 0);
2767 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy172->span,&yymsp[0].minor.yy0);
2769 #line 2772 "parse.c"
2774 yygotominor.yy172 = sqlite3PExpr(pParse, TK_ISNULL, yymsp[-2].minor.yy172, 0, 0);
2775 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy172->span,&yymsp[0].minor.yy0);
2777 #line 2780 "parse.c"
2782 yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-2].minor.yy172, 0, 0);
2783 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy172->span,&yymsp[0].minor.yy0);
2785 #line 2788 "parse.c"
2790 yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-3].minor.yy172, 0, 0);
2791 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy172->span,&yymsp[0].minor.yy0);
2793 #line 2796 "parse.c"
2798 yygotominor.yy172 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy172, 0, 0);
2799 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
2801 #line 2804 "parse.c"
2806 yygotominor.yy172 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy172, 0, 0);
2807 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
2809 #line 2812 "parse.c"
2814 yygotominor.yy172 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy172, 0, 0);
2815 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
2817 #line 2820 "parse.c"
2822 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy172, 0);
2823 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy172, 0);
2824 yygotominor.yy172 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy172, 0, 0);
2825 if( yygotominor.yy172 ){
2826 yygotominor.yy172->pList = pList;
2828 sqlite3ExprListDelete(pList);
2830 if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
2831 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy172->span);
2833 #line 2836 "parse.c"
2838 yygotominor.yy172 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy172, 0, 0);
2839 if( yygotominor.yy172 ){
2840 yygotominor.yy172->pList = yymsp[-1].minor.yy174;
2841 sqlite3ExprSetHeight(yygotominor.yy172);
2843 sqlite3ExprListDelete(yymsp[-1].minor.yy174);
2845 if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
2846 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy0);
2848 #line 2851 "parse.c"
2853 yygotominor.yy172 = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
2854 if( yygotominor.yy172 ){
2855 yygotominor.yy172->pSelect = yymsp[-1].minor.yy219;
2856 sqlite3ExprSetHeight(yygotominor.yy172);
2858 sqlite3SelectDelete(yymsp[-1].minor.yy219);
2860 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
2862 #line 2865 "parse.c"
2867 yygotominor.yy172 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy172, 0, 0);
2868 if( yygotominor.yy172 ){
2869 yygotominor.yy172->pSelect = yymsp[-1].minor.yy219;
2870 sqlite3ExprSetHeight(yygotominor.yy172);
2872 sqlite3SelectDelete(yymsp[-1].minor.yy219);
2874 if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
2875 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy0);
2877 #line 2880 "parse.c"
2882 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410);
2883 yygotominor.yy172 = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy172, 0, 0);
2884 if( yygotominor.yy172 ){
2885 yygotominor.yy172->pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
2886 sqlite3ExprSetHeight(yygotominor.yy172);
2888 sqlite3SrcListDelete(pSrc);
2890 if( yymsp[-2].minor.yy46 ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
2891 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy172->span,yymsp[0].minor.yy410.z?&yymsp[0].minor.yy410:&yymsp[-1].minor.yy410);
2893 #line 2896 "parse.c"
2898 Expr *p = yygotominor.yy172 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
2900 p->pSelect = yymsp[-1].minor.yy219;
2901 sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
2902 sqlite3ExprSetHeight(yygotominor.yy172);
2904 sqlite3SelectDelete(yymsp[-1].minor.yy219);
2907 #line 2910 "parse.c"
2912 yygotominor.yy172 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, 0);
2913 if( yygotominor.yy172 ){
2914 yygotominor.yy172->pList = yymsp[-2].minor.yy174;
2915 sqlite3ExprSetHeight(yygotominor.yy172);
2917 sqlite3ExprListDelete(yymsp[-2].minor.yy174);
2919 sqlite3ExprSpan(yygotominor.yy172, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
2921 #line 2924 "parse.c"
2926 yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy174, yymsp[-2].minor.yy172, 0);
2927 yygotominor.yy174 = sqlite3ExprListAppend(pParse,yygotominor.yy174, yymsp[0].minor.yy172, 0);
2929 #line 2932 "parse.c"
2934 yygotominor.yy174 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy172, 0);
2935 yygotominor.yy174 = sqlite3ExprListAppend(pParse,yygotominor.yy174, yymsp[0].minor.yy172, 0);
2937 #line 2940 "parse.c"
2942 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy410, &yymsp[-5].minor.yy410,
2943 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy410,0), yymsp[-1].minor.yy174, yymsp[-9].minor.yy46,
2944 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy46);
2946 #line 2949 "parse.c"
2951 {yygotominor.yy46 = OE_Abort;}
2952 #line 2955 "parse.c"
2956 {yygotominor.yy46 = OE_None;}
2957 #line 2960 "parse.c"
2963 if( yymsp[-1].minor.yy410.n>0 ){
2964 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
2965 if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)yymsp[-1].minor.yy410.z, yymsp[-1].minor.yy410.n);
2967 yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy174, p, &yymsp[-2].minor.yy410);
2968 sqlite3ExprListCheckLength(pParse, yygotominor.yy174, SQLITE_MAX_COLUMN, "index");
2969 if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
2971 #line 2974 "parse.c"
2977 if( yymsp[-1].minor.yy410.n>0 ){
2978 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
2979 if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)yymsp[-1].minor.yy410.z, yymsp[-1].minor.yy410.n);
2981 yygotominor.yy174 = sqlite3ExprListAppend(pParse,0, p, &yymsp[-2].minor.yy410);
2982 sqlite3ExprListCheckLength(pParse, yygotominor.yy174, SQLITE_MAX_COLUMN, "index");
2983 if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
2985 #line 2988 "parse.c"
2989 {yygotominor.yy410.z = 0; yygotominor.yy410.n = 0;}
2990 #line 2993 "parse.c"
2994 {sqlite3DropIndex(pParse, yymsp[0].minor.yy373, yymsp[-1].minor.yy46);}
2995 #line 2998 "parse.c"
3000 {sqlite3Vacuum(pParse);}
3001 #line 3004 "parse.c"
3005 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy410,0);}
3006 #line 3009 "parse.c"
3010 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy0,0);}
3011 #line 3014 "parse.c"
3016 sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy410,1);
3018 #line 3021 "parse.c"
3022 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy410,&yymsp[-3].minor.yy410,&yymsp[-1].minor.yy410,0);}
3023 #line 3026 "parse.c"
3027 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410,0,0);}
3028 #line 3031 "parse.c"
3034 all.z = yymsp[-3].minor.yy410.z;
3035 all.n = (yymsp[0].minor.yy0.z - yymsp[-3].minor.yy410.z) + yymsp[0].minor.yy0.n;
3036 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy243, &all);
3038 #line 3041 "parse.c"
3043 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy410, &yymsp[-6].minor.yy410, yymsp[-5].minor.yy46, yymsp[-4].minor.yy370.a, yymsp[-4].minor.yy370.b, yymsp[-2].minor.yy373, yymsp[0].minor.yy172, yymsp[-10].minor.yy46, yymsp[-8].minor.yy46);
3044 yygotominor.yy410 = (yymsp[-6].minor.yy410.n==0?yymsp[-7].minor.yy410:yymsp[-6].minor.yy410);
3046 #line 3049 "parse.c"
3051 { yygotominor.yy46 = TK_BEFORE; }
3052 #line 3055 "parse.c"
3056 { yygotominor.yy46 = TK_AFTER; }
3057 #line 3060 "parse.c"
3061 { yygotominor.yy46 = TK_INSTEAD;}
3062 #line 3065 "parse.c"
3067 {yygotominor.yy370.a = yymsp[0].major; yygotominor.yy370.b = 0;}
3068 #line 3071 "parse.c"
3072 {yygotominor.yy370.a = TK_UPDATE; yygotominor.yy370.b = yymsp[0].minor.yy432;}
3073 #line 3076 "parse.c"
3077 { yygotominor.yy172 = 0; }
3078 #line 3081 "parse.c"
3082 { yygotominor.yy172 = yymsp[0].minor.yy172; }
3083 #line 3086 "parse.c"
3088 if( yymsp[-2].minor.yy243 ){
3089 yymsp[-2].minor.yy243->pLast->pNext = yymsp[-1].minor.yy243;
3091 yymsp[-2].minor.yy243 = yymsp[-1].minor.yy243;
3093 yymsp[-2].minor.yy243->pLast = yymsp[-1].minor.yy243;
3094 yygotominor.yy243 = yymsp[-2].minor.yy243;
3096 #line 3099 "parse.c"
3099 #line 1000 "parse.y"
3100 { yygotominor.yy243 = 0; }
3101 #line 3104 "parse.c"
3104 #line 1006 "parse.y"
3105 { yygotominor.yy243 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-3].minor.yy410, yymsp[-1].minor.yy174, yymsp[0].minor.yy172, yymsp[-4].minor.yy46); }
3106 #line 3109 "parse.c"
3109 #line 1011 "parse.y"
3110 {yygotominor.yy243 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy410, yymsp[-4].minor.yy432, yymsp[-1].minor.yy174, 0, yymsp[-7].minor.yy46);}
3111 #line 3114 "parse.c"
3114 #line 1014 "parse.y"
3115 {yygotominor.yy243 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy410, yymsp[-1].minor.yy432, 0, yymsp[0].minor.yy219, yymsp[-4].minor.yy46);}
3116 #line 3119 "parse.c"
3119 #line 1018 "parse.y"
3120 {yygotominor.yy243 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-1].minor.yy410, yymsp[0].minor.yy172);}
3121 #line 3124 "parse.c"
3124 #line 1021 "parse.y"
3125 {yygotominor.yy243 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy219); }
3126 #line 3129 "parse.c"
3129 #line 1024 "parse.y"
3131 yygotominor.yy172 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
3132 if( yygotominor.yy172 ){
3133 yygotominor.yy172->iColumn = OE_Ignore;
3134 sqlite3ExprSpan(yygotominor.yy172, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
3137 #line 3140 "parse.c"
3140 #line 1031 "parse.y"
3142 yygotominor.yy172 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy410);
3143 if( yygotominor.yy172 ) {
3144 yygotominor.yy172->iColumn = yymsp[-3].minor.yy46;
3145 sqlite3ExprSpan(yygotominor.yy172, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
3148 #line 3151 "parse.c"
3151 #line 1041 "parse.y"
3152 {yygotominor.yy46 = OE_Rollback;}
3153 #line 3156 "parse.c"
3156 #line 1043 "parse.y"
3157 {yygotominor.yy46 = OE_Fail;}
3158 #line 3161 "parse.c"
3161 #line 1048 "parse.y"
3163 sqlite3DropTrigger(pParse,yymsp[0].minor.yy373,yymsp[-1].minor.yy46);
3165 #line 3168 "parse.c"
3168 #line 1055 "parse.y"
3170 sqlite3Attach(pParse, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, yymsp[0].minor.yy386);
3172 #line 3175 "parse.c"
3175 #line 1058 "parse.y"
3177 sqlite3Detach(pParse, yymsp[0].minor.yy172);
3179 #line 3182 "parse.c"
3182 #line 1064 "parse.y"
3183 { yygotominor.yy386 = 0; }
3184 #line 3187 "parse.c"
3187 #line 1065 "parse.y"
3188 { yygotominor.yy386 = yymsp[0].minor.yy172; }
3189 #line 3192 "parse.c"
3192 #line 1073 "parse.y"
3193 {sqlite3Reindex(pParse, 0, 0);}
3194 #line 3197 "parse.c"
3197 #line 1074 "parse.y"
3198 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy410, &yymsp[0].minor.yy410);}
3199 #line 3202 "parse.c"
3202 #line 1079 "parse.y"
3203 {sqlite3Analyze(pParse, 0, 0);}
3204 #line 3207 "parse.c"
3207 #line 1080 "parse.y"
3208 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy410, &yymsp[0].minor.yy410);}
3209 #line 3212 "parse.c"
3212 #line 1085 "parse.y"
3214 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy373,&yymsp[0].minor.yy410);
3216 #line 3219 "parse.c"
3219 #line 1088 "parse.y"
3221 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy410);
3223 #line 3226 "parse.c"
3226 #line 1091 "parse.y"
3228 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy373);
3230 #line 3233 "parse.c"
3233 #line 1100 "parse.y"
3234 {sqlite3VtabFinishParse(pParse,0);}
3235 #line 3238 "parse.c"
3238 #line 1101 "parse.y"
3239 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
3240 #line 3243 "parse.c"
3243 #line 1102 "parse.y"
3245 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy410, &yymsp[-2].minor.yy410, &yymsp[0].minor.yy410);
3247 #line 3250 "parse.c"
3250 #line 1107 "parse.y"
3251 {sqlite3VtabArgInit(pParse);}
3252 #line 3255 "parse.c"
3258 #line 1109 "parse.y"
3259 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
3260 #line 3263 "parse.c"
3263 yygoto = yyRuleInfo[yyruleno].lhs;
3264 yysize = yyRuleInfo[yyruleno].nrhs;
3265 yypParser->yyidx -= yysize;
3266 yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto);
3267 if( yyact < YYNSTATE ){
3269 /* If we are not debugging and the reduce action popped at least
3270 ** one element off the stack, then we can push the new element back
3271 ** onto the stack here, and skip the stack overflow test in yy_shift().
3272 ** That gives a significant speed improvement. */
3276 yymsp->stateno = yyact;
3277 yymsp->major = yygoto;
3278 yymsp->minor = yygotominor;
3282 yy_shift(yypParser,yyact,yygoto,&yygotominor);
3284 }else if( yyact == YYNSTATE + YYNRULE + 1 ){
3285 yy_accept(yypParser);
3290 ** The following code executes when the parse fails
3292 static void yy_parse_failed(
3293 yyParser *yypParser /* The parser */
3295 sqlite3ParserARG_FETCH;
3298 fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
3301 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
3302 /* Here code is inserted which will be executed whenever the
3304 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3308 ** The following code executes when a syntax error first occurs.
3310 static void yy_syntax_error(
3311 yyParser *yypParser, /* The parser */
3312 int yymajor, /* The major type of the error token */
3313 YYMINORTYPE yyminor /* The minor type of the error token */
3315 sqlite3ParserARG_FETCH;
3316 #define TOKEN (yyminor.yy0)
3319 if( !pParse->parseError ){
3321 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
3323 sqlite3ErrorMsg(pParse, "incomplete SQL statement");
3325 pParse->parseError = 1;
3327 #line 3331 "parse.c"
3328 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3332 ** The following is executed when the parser accepts
3334 static void yy_accept(
3335 yyParser *yypParser /* The parser */
3337 sqlite3ParserARG_FETCH;
3340 fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
3343 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
3344 /* Here code is inserted which will be executed whenever the
3345 ** parser accepts */
3346 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3349 /* The main parser program.
3350 ** The first argument is a pointer to a structure obtained from
3351 ** "sqlite3ParserAlloc" which describes the current state of the parser.
3352 ** The second argument is the major token number. The third is
3353 ** the minor token. The fourth optional argument is whatever the
3354 ** user wants (and specified in the grammar) and is available for
3355 ** use by the action routines.
3359 ** <li> A pointer to the parser (an opaque structure.)
3360 ** <li> The major token number.
3361 ** <li> The minor token number.
3362 ** <li> An option argument of a grammar-specified type.
3369 void *yyp, /* The parser */
3370 int yymajor, /* The major token code number */
3371 sqlite3ParserTOKENTYPE yyminor /* The value for the token */
3372 sqlite3ParserARG_PDECL /* Optional %extra_argument parameter */
3374 YYMINORTYPE yyminorunion;
3375 int yyact; /* The parser action. */
3376 int yyendofinput; /* True if we are at the end of input */
3377 int yyerrorhit = 0; /* True if yymajor has invoked an error */
3378 yyParser *yypParser; /* The parser */
3380 /* (re)initialize the parser, if necessary */
3381 yypParser = (yyParser*)yyp;
3382 if( yypParser->yyidx<0 ){
3384 if( yypParser->yystksz <=0 ){
3385 memset(&yyminorunion, 0, sizeof(yyminorunion));
3386 yyStackOverflow(yypParser, &yyminorunion);
3390 yypParser->yyidx = 0;
3391 yypParser->yyerrcnt = -1;
3392 yypParser->yystack[0].stateno = 0;
3393 yypParser->yystack[0].major = 0;
3395 yyminorunion.yy0 = yyminor;
3396 yyendofinput = (yymajor==0);
3397 sqlite3ParserARG_STORE;
3401 fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
3406 yyact = yy_find_shift_action(yypParser,yymajor);
3407 if( yyact<YYNSTATE ){
3408 yy_shift(yypParser,yyact,yymajor,&yyminorunion);
3409 yypParser->yyerrcnt--;
3410 if( yyendofinput && yypParser->yyidx>=0 ){
3415 }else if( yyact < YYNSTATE + YYNRULE ){
3416 yy_reduce(yypParser,yyact-YYNSTATE);
3417 }else if( yyact == YY_ERROR_ACTION ){
3421 fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
3424 #ifdef YYERRORSYMBOL
3425 /* A syntax error has occurred.
3426 ** The response to an error depends upon whether or not the
3427 ** grammar defines an error token "ERROR".
3429 ** This is what we do if the grammar does define ERROR:
3431 ** * Call the %syntax_error function.
3433 ** * Begin popping the stack until we enter a state where
3434 ** it is legal to shift the error symbol, then shift
3435 ** the error symbol.
3437 ** * Set the error count to three.
3439 ** * Begin accepting and shifting new tokens. No new error
3440 ** processing will occur until three tokens have been
3441 ** shifted successfully.
3444 if( yypParser->yyerrcnt<0 ){
3445 yy_syntax_error(yypParser,yymajor,yyminorunion);
3447 yymx = yypParser->yystack[yypParser->yyidx].major;
3448 if( yymx==YYERRORSYMBOL || yyerrorhit ){
3451 fprintf(yyTraceFILE,"%sDiscard input token %s\n",
3452 yyTracePrompt,yyTokenName[yymajor]);
3455 yy_destructor(yymajor,&yyminorunion);
3459 yypParser->yyidx >= 0 &&
3460 yymx != YYERRORSYMBOL &&
3461 (yyact = yy_find_reduce_action(
3462 yypParser->yystack[yypParser->yyidx].stateno,
3463 YYERRORSYMBOL)) >= YYNSTATE
3465 yy_pop_parser_stack(yypParser);
3467 if( yypParser->yyidx < 0 || yymajor==0 ){
3468 yy_destructor(yymajor,&yyminorunion);
3469 yy_parse_failed(yypParser);
3471 }else if( yymx!=YYERRORSYMBOL ){
3474 yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
3477 yypParser->yyerrcnt = 3;
3479 #else /* YYERRORSYMBOL is not defined */
3480 /* This is what we do if the grammar does not define ERROR:
3482 ** * Report an error message, and throw away the input token.
3484 ** * If the input token is $, then fail the parse.
3486 ** As before, subsequent error messages are suppressed until
3487 ** three input tokens have been successfully shifted.
3489 if( yypParser->yyerrcnt<=0 ){
3490 yy_syntax_error(yypParser,yymajor,yyminorunion);
3492 yypParser->yyerrcnt = 3;
3493 yy_destructor(yymajor,&yyminorunion);
3495 yy_parse_failed(yypParser);
3500 yy_accept(yypParser);
3503 }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );