monotone

monotone Mtn Source Tree

Root/sqlite/parse.c

1/* Driver template for the LEMON parser generator.
2** The author disclaims copyright to this source code.
3*/
4/* First off, code is include which follows the "include" declaration
5** in the input file. */
6#include <stdio.h>
7
8#include "sqliteInt.h"
9#include "parse.h"
10#line 56 "parse.y"
11
12/*
13** An instance of this structure holds information about the
14** LIMIT clause of a SELECT statement.
15*/
16struct LimitVal {
17 Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
18 Expr *pOffset; /* The OFFSET expression. NULL if there is none */
19};
20
21/*
22** An instance of this structure is used to store the LIKE,
23** GLOB, NOT LIKE, and NOT GLOB operators.
24*/
25struct LikeOp {
26 Token eOperator; /* "like" or "glob" or "regexp" */
27 int not; /* True if the NOT keyword is present */
28};
29
30/*
31** An instance of the following structure describes the event of a
32** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
33** TK_DELETE, or TK_INSTEAD. If the event is of the form
34**
35** UPDATE ON (a,b,c)
36**
37** Then the "b" IdList records the list "a,b,c".
38*/
39struct TrigEvent { int a; IdList * b; };
40
41/*
42** An instance of this structure holds the ATTACH key and the key type.
43*/
44struct AttachKey { int type; Token key; };
45
46#line 48 "parse.c"
47/* Next is all token values, in a form suitable for use by makeheaders.
48** This section will be null unless lemon is run with the -m switch.
49*/
50/*
51** These constants (all generated automatically by the parser generator)
52** specify the various kinds of tokens (terminals) that the parser
53** understands.
54**
55** Each symbol here is a terminal symbol in the grammar.
56*/
57/* Make sure the INTERFACE macro is defined.
58*/
59#ifndef INTERFACE
60# define INTERFACE 1
61#endif
62/* The next thing included is series of defines which control
63** various aspects of the generated parser.
64** YYCODETYPE is the data type used for storing terminal
65** and nonterminal numbers. "unsigned char" is
66** used if there are fewer than 250 terminals
67** and nonterminals. "int" is used otherwise.
68** YYNOCODE is a number of type YYCODETYPE which corresponds
69** to no legal terminal or nonterminal number. This
70** number is used to fill in empty slots of the hash
71** table.
72** YYFALLBACK If defined, this indicates that one or more tokens
73** have fall-back values which should be used if the
74** original value of the token will not parse.
75** YYACTIONTYPE is the data type used for storing terminal
76** and nonterminal numbers. "unsigned char" is
77** used if there are fewer than 250 rules and
78** states combined. "int" is used otherwise.
79** sqlite3ParserTOKENTYPE is the data type used for minor tokens given
80** directly to the parser from the tokenizer.
81** YYMINORTYPE is the data type used for all minor tokens.
82** This is typically a union of many types, one of
83** which is sqlite3ParserTOKENTYPE. The entry in the union
84** for base tokens is called "yy0".
85** YYSTACKDEPTH is the maximum depth of the parser's stack. If
86** zero the stack is dynamically sized using realloc()
87** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument
88** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument
89** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser
90** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser
91** YYNSTATE the combined number of states.
92** YYNRULE the number of rules in the grammar
93** YYERRORSYMBOL is the code number of the error symbol. If not
94** defined, then do no error processing.
95*/
96#define YYCODETYPE unsigned char
97#define YYNOCODE 248
98#define YYACTIONTYPE unsigned short int
99#define YYWILDCARD 59
100#define sqlite3ParserTOKENTYPE Token
101typedef union {
102 sqlite3ParserTOKENTYPE yy0;
103 int yy46;
104 struct LikeOp yy72;
105 Expr* yy172;
106 ExprList* yy174;
107 Select* yy219;
108 struct LimitVal yy234;
109 TriggerStep* yy243;
110 struct TrigEvent yy370;
111 SrcList* yy373;
112 Expr * yy386;
113 struct {int value; int mask;} yy405;
114 Token yy410;
115 IdList* yy432;
116 int yy495;
117} YYMINORTYPE;
118#ifndef YYSTACKDEPTH
119#define YYSTACKDEPTH 100
120#endif
121#define sqlite3ParserARG_SDECL Parse *pParse;
122#define sqlite3ParserARG_PDECL ,Parse *pParse
123#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
124#define sqlite3ParserARG_STORE yypParser->pParse = pParse
125#define YYNSTATE 586
126#define YYNRULE 311
127#define YYERRORSYMBOL 138
128#define YYERRSYMDT yy495
129#define YYFALLBACK 1
130#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
131#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
132#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
133
134/* Next are that tables used to determine what action to take based on the
135** current state and lookahead token. These tables are used to implement
136** functions that take a state number and lookahead value and return an
137** action integer.
138**
139** Suppose the action integer is N. Then the action is determined as
140** follows
141**
142** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
143** token onto the stack and goto state N.
144**
145** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
146**
147** N == YYNSTATE+YYNRULE A syntax error has occurred.
148**
149** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
150**
151** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
152** slots in the yy_action[] table.
153**
154** The action table is constructed as a single large table named yy_action[].
155** Given state S and lookahead X, the action is computed as
156**
157** yy_action[ yy_shift_ofst[S] + X ]
158**
159** If the index value yy_shift_ofst[S]+X is out of range or if the value
160** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
161** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
162** and that yy_default[S] should be used instead.
163**
164** The formula above is for computing the action when the lookahead is
165** a terminal symbol. If the lookahead is a non-terminal (as occurs after
166** a reduce action) then the yy_reduce_ofst[] array is used in place of
167** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
168** YY_SHIFT_USE_DFLT.
169**
170** The following are the tables generated in this section:
171**
172** yy_action[] A single table containing all actions.
173** yy_lookahead[] A table containing the lookahead for each entry in
174** yy_action. Used to detect hash collisions.
175** yy_shift_ofst[] For each state, the offset into yy_action for
176** shifting terminals.
177** yy_reduce_ofst[] For each state, the offset into yy_action for
178** shifting non-terminals after a reduce.
179** yy_default[] Default action for each state.
180*/
181static const YYACTIONTYPE yy_action[] = {
182 /* 0 */ 289, 898, 121, 585, 405, 169, 2, 435, 61, 61,
183 /* 10 */ 61, 61, 517, 63, 63, 63, 63, 64, 64, 65,
184 /* 20 */ 65, 65, 66, 230, 387, 384, 420, 426, 68, 63,
185 /* 30 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 230,
186 /* 40 */ 443, 208, 392, 447, 60, 59, 294, 430, 431, 427,
187 /* 50 */ 427, 62, 62, 61, 61, 61, 61, 205, 63, 63,
188 /* 60 */ 63, 63, 64, 64, 65, 65, 65, 66, 230, 289,
189 /* 70 */ 368, 316, 435, 487, 205, 80, 67, 415, 69, 151,
190 /* 80 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
191 /* 90 */ 230, 515, 162, 410, 35, 420, 426, 443, 571, 58,
192 /* 100 */ 64, 64, 65, 65, 65, 66, 230, 393, 394, 417,
193 /* 110 */ 417, 417, 289, 60, 59, 294, 430, 431, 427, 427,
194 /* 120 */ 62, 62, 61, 61, 61, 61, 302, 63, 63, 63,
195 /* 130 */ 63, 64, 64, 65, 65, 65, 66, 230, 420, 426,
196 /* 140 */ 92, 65, 65, 65, 66, 230, 392, 456, 472, 67,
197 /* 150 */ 56, 69, 151, 169, 406, 435, 60, 59, 294, 430,
198 /* 160 */ 431, 427, 427, 62, 62, 61, 61, 61, 61, 247,
199 /* 170 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
200 /* 180 */ 230, 289, 569, 522, 292, 620, 111, 478, 515, 447,
201 /* 190 */ 230, 316, 403, 21, 67, 460, 69, 151, 66, 230,
202 /* 200 */ 568, 443, 208, 67, 224, 69, 151, 420, 426, 146,
203 /* 210 */ 147, 393, 394, 410, 41, 386, 148, 531, 2, 487,
204 /* 220 */ 435, 566, 232, 415, 289, 60, 59, 294, 430, 431,
205 /* 230 */ 427, 427, 62, 62, 61, 61, 61, 61, 316, 63,
206 /* 240 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 230,
207 /* 250 */ 420, 426, 486, 330, 211, 417, 417, 417, 359, 270,
208 /* 260 */ 410, 41, 378, 207, 362, 542, 245, 289, 60, 59,
209 /* 270 */ 294, 430, 431, 427, 427, 62, 62, 61, 61, 61,
210 /* 280 */ 61, 392, 63, 63, 63, 63, 64, 64, 65, 65,
211 /* 290 */ 65, 66, 230, 420, 426, 260, 299, 273, 522, 271,
212 /* 300 */ 522, 210, 370, 319, 223, 433, 433, 532, 21, 576,
213 /* 310 */ 21, 60, 59, 294, 430, 431, 427, 427, 62, 62,
214 /* 320 */ 61, 61, 61, 61, 191, 63, 63, 63, 63, 64,
215 /* 330 */ 64, 65, 65, 65, 66, 230, 261, 316, 239, 76,
216 /* 340 */ 289, 544, 299, 149, 482, 150, 393, 394, 178, 240,
217 /* 350 */ 569, 341, 344, 345, 404, 520, 445, 322, 165, 410,
218 /* 360 */ 28, 540, 346, 517, 248, 539, 420, 426, 568, 567,
219 /* 370 */ 161, 115, 238, 339, 243, 340, 173, 358, 272, 411,
220 /* 380 */ 821, 488, 79, 249, 60, 59, 294, 430, 431, 427,
221 /* 390 */ 427, 62, 62, 61, 61, 61, 61, 530, 63, 63,
222 /* 400 */ 63, 63, 64, 64, 65, 65, 65, 66, 230, 289,
223 /* 410 */ 248, 178, 465, 485, 341, 344, 345, 115, 238, 339,
224 /* 420 */ 243, 340, 173, 82, 316, 346, 316, 491, 492, 249,
225 /* 430 */ 565, 207, 152, 523, 489, 420, 426, 178, 529, 503,
226 /* 440 */ 341, 344, 345, 407, 472, 528, 410, 35, 410, 35,
227 /* 450 */ 171, 346, 198, 60, 59, 294, 430, 431, 427, 427,
228 /* 460 */ 62, 62, 61, 61, 61, 61, 411, 63, 63, 63,
229 /* 470 */ 63, 64, 64, 65, 65, 65, 66, 230, 289, 548,
230 /* 480 */ 579, 288, 502, 234, 411, 316, 411, 316, 296, 283,
231 /* 490 */ 298, 316, 445, 521, 165, 476, 172, 157, 421, 422,
232 /* 500 */ 457, 335, 457, 144, 420, 426, 366, 410, 35, 410,
233 /* 510 */ 36, 435, 1, 410, 49, 327, 392, 547, 193, 424,
234 /* 520 */ 425, 156, 60, 59, 294, 430, 431, 427, 427, 62,
235 /* 530 */ 62, 61, 61, 61, 61, 333, 63, 63, 63, 63,
236 /* 540 */ 64, 64, 65, 65, 65, 66, 230, 289, 423, 332,
237 /* 550 */ 452, 252, 411, 295, 438, 439, 297, 316, 349, 307,
238 /* 560 */ 231, 457, 453, 321, 438, 439, 392, 369, 266, 265,
239 /* 570 */ 189, 217, 392, 420, 426, 454, 435, 493, 205, 410,
240 /* 580 */ 49, 393, 394, 583, 889, 174, 889, 494, 545, 492,
241 /* 590 */ 392, 60, 59, 294, 430, 431, 427, 427, 62, 62,
242 /* 600 */ 61, 61, 61, 61, 411, 63, 63, 63, 63, 64,
243 /* 610 */ 64, 65, 65, 65, 66, 230, 289, 207, 586, 387,
244 /* 620 */ 384, 91, 10, 580, 336, 308, 392, 207, 367, 480,
245 /* 630 */ 316, 393, 394, 583, 888, 219, 888, 393, 394, 476,
246 /* 640 */ 291, 233, 420, 426, 481, 249, 410, 3, 434, 260,
247 /* 650 */ 317, 363, 410, 29, 448, 393, 394, 468, 260, 289,
248 /* 660 */ 60, 59, 294, 430, 431, 427, 427, 62, 62, 61,
249 /* 670 */ 61, 61, 61, 580, 63, 63, 63, 63, 64, 64,
250 /* 680 */ 65, 65, 65, 66, 230, 420, 426, 391, 312, 388,
251 /* 690 */ 555, 393, 394, 75, 204, 77, 395, 396, 397, 557,
252 /* 700 */ 357, 197, 289, 60, 59, 294, 430, 431, 427, 427,
253 /* 710 */ 62, 62, 61, 61, 61, 61, 316, 63, 63, 63,
254 /* 720 */ 63, 64, 64, 65, 65, 65, 66, 230, 420, 426,
255 /* 730 */ 319, 116, 433, 433, 319, 411, 433, 433, 410, 24,
256 /* 740 */ 319, 515, 433, 433, 515, 289, 60, 70, 294, 430,
257 /* 750 */ 431, 427, 427, 62, 62, 61, 61, 61, 61, 375,
258 /* 760 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
259 /* 770 */ 230, 420, 426, 538, 356, 538, 216, 260, 472, 303,
260 /* 780 */ 175, 176, 177, 254, 476, 515, 260, 383, 289, 5,
261 /* 790 */ 59, 294, 430, 431, 427, 427, 62, 62, 61, 61,
262 /* 800 */ 61, 61, 316, 63, 63, 63, 63, 64, 64, 65,
263 /* 810 */ 65, 65, 66, 230, 420, 426, 392, 236, 380, 247,
264 /* 820 */ 304, 258, 247, 256, 410, 33, 260, 558, 125, 467,
265 /* 830 */ 515, 416, 168, 157, 294, 430, 431, 427, 427, 62,
266 /* 840 */ 62, 61, 61, 61, 61, 306, 63, 63, 63, 63,
267 /* 850 */ 64, 64, 65, 65, 65, 66, 230, 72, 323, 452,
268 /* 860 */ 4, 153, 22, 247, 293, 305, 435, 559, 316, 382,
269 /* 870 */ 316, 453, 320, 72, 323, 316, 4, 366, 316, 180,
270 /* 880 */ 293, 393, 394, 20, 454, 141, 326, 316, 320, 325,
271 /* 890 */ 410, 53, 410, 52, 316, 411, 155, 410, 96, 447,
272 /* 900 */ 410, 94, 316, 500, 316, 325, 328, 469, 247, 410,
273 /* 910 */ 99, 444, 260, 411, 318, 447, 410, 100, 316, 74,
274 /* 920 */ 73, 467, 183, 260, 410, 110, 410, 112, 72, 314,
275 /* 930 */ 315, 435, 337, 415, 458, 74, 73, 479, 316, 377,
276 /* 940 */ 410, 17, 218, 19, 72, 314, 315, 72, 323, 415,
277 /* 950 */ 4, 205, 316, 274, 293, 316, 411, 466, 205, 409,
278 /* 960 */ 410, 97, 320, 408, 374, 417, 417, 417, 418, 419,
279 /* 970 */ 12, 376, 316, 206, 410, 34, 174, 410, 95, 325,
280 /* 980 */ 55, 417, 417, 417, 418, 419, 12, 310, 120, 447,
281 /* 990 */ 428, 159, 9, 260, 410, 25, 220, 221, 222, 102,
282 /* 1000 */ 441, 441, 316, 471, 409, 316, 475, 316, 408, 74,
283 /* 1010 */ 73, 436, 202, 23, 278, 455, 244, 13, 72, 314,
284 /* 1020 */ 315, 279, 316, 415, 410, 54, 316, 410, 113, 410,
285 /* 1030 */ 114, 291, 581, 200, 276, 547, 462, 497, 498, 199,
286 /* 1040 */ 316, 504, 201, 463, 410, 26, 316, 524, 410, 37,
287 /* 1050 */ 316, 474, 316, 170, 253, 417, 417, 417, 418, 419,
288 /* 1060 */ 12, 505, 410, 38, 510, 483, 316, 13, 410, 27,
289 /* 1070 */ 508, 582, 410, 39, 410, 40, 316, 255, 507, 506,
290 /* 1080 */ 512, 316, 125, 316, 511, 373, 275, 265, 410, 42,
291 /* 1090 */ 509, 290, 316, 251, 316, 125, 205, 257, 410, 43,
292 /* 1100 */ 316, 259, 316, 410, 44, 410, 30, 348, 316, 125,
293 /* 1110 */ 316, 353, 186, 316, 410, 31, 410, 45, 316, 543,
294 /* 1120 */ 379, 125, 410, 46, 410, 47, 316, 551, 264, 170,
295 /* 1130 */ 410, 48, 410, 32, 401, 410, 11, 552, 440, 89,
296 /* 1140 */ 410, 50, 301, 562, 578, 89, 287, 361, 410, 51,
297 /* 1150 */ 364, 365, 267, 268, 269, 554, 143, 564, 277, 324,
298 /* 1160 */ 280, 281, 575, 225, 442, 461, 464, 503, 241, 513,
299 /* 1170 */ 516, 550, 343, 160, 561, 390, 8, 313, 398, 399,
300 /* 1180 */ 400, 412, 82, 226, 331, 329, 81, 406, 57, 78,
301 /* 1190 */ 209, 167, 83, 459, 122, 414, 227, 334, 228, 338,
302 /* 1200 */ 300, 500, 103, 496, 246, 519, 514, 490, 495, 242,
303 /* 1210 */ 214, 518, 499, 229, 501, 413, 350, 533, 284, 525,
304 /* 1220 */ 526, 527, 235, 181, 473, 237, 285, 477, 182, 354,
305 /* 1230 */ 352, 184, 86, 185, 118, 535, 187, 546, 360, 190,
306 /* 1240 */ 129, 553, 139, 371, 372, 130, 215, 309, 560, 131,
307 /* 1250 */ 132, 133, 572, 577, 135, 573, 98, 574, 389, 262,
308 /* 1260 */ 402, 621, 536, 213, 101, 622, 432, 163, 164, 429,
309 /* 1270 */ 138, 71, 449, 437, 446, 140, 470, 154, 6, 450,
310 /* 1280 */ 7, 158, 166, 451, 14, 123, 13, 124, 484, 212,
311 /* 1290 */ 84, 342, 104, 105, 90, 250, 85, 117, 106, 347,
312 /* 1300 */ 179, 240, 351, 142, 534, 126, 18, 170, 93, 263,
313 /* 1310 */ 188, 107, 355, 286, 109, 127, 549, 541, 128, 119,
314 /* 1320 */ 537, 192, 15, 194, 195, 136, 196, 134, 556, 563,
315 /* 1330 */ 311, 137, 16, 108, 570, 203, 145, 385, 381, 282,
316 /* 1340 */ 584, 899, 899, 899, 899, 899, 87, 899, 88,
317};
318static const YYCODETYPE yy_lookahead[] = {
319 /* 0 */ 16, 139, 140, 141, 168, 21, 144, 23, 69, 70,
320 /* 10 */ 71, 72, 176, 74, 75, 76, 77, 78, 79, 80,
321 /* 20 */ 81, 82, 83, 84, 1, 2, 42, 43, 73, 74,
322 /* 30 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
323 /* 40 */ 78, 79, 23, 58, 60, 61, 62, 63, 64, 65,
324 /* 50 */ 66, 67, 68, 69, 70, 71, 72, 110, 74, 75,
325 /* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
326 /* 70 */ 123, 147, 88, 88, 110, 22, 216, 92, 218, 219,
327 /* 80 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
328 /* 90 */ 84, 147, 19, 169, 170, 42, 43, 78, 238, 46,
329 /* 100 */ 78, 79, 80, 81, 82, 83, 84, 88, 89, 124,
330 /* 110 */ 125, 126, 16, 60, 61, 62, 63, 64, 65, 66,
331 /* 120 */ 67, 68, 69, 70, 71, 72, 182, 74, 75, 76,
332 /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
333 /* 140 */ 44, 80, 81, 82, 83, 84, 23, 223, 161, 216,
334 /* 150 */ 19, 218, 219, 21, 23, 23, 60, 61, 62, 63,
335 /* 160 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 225,
336 /* 170 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
337 /* 180 */ 84, 16, 147, 147, 150, 112, 21, 200, 147, 58,
338 /* 190 */ 84, 147, 156, 157, 216, 217, 218, 219, 83, 84,
339 /* 200 */ 165, 78, 79, 216, 190, 218, 219, 42, 43, 78,
340 /* 210 */ 79, 88, 89, 169, 170, 141, 180, 181, 144, 88,
341 /* 220 */ 88, 98, 147, 92, 16, 60, 61, 62, 63, 64,
342 /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 147, 74,
343 /* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
344 /* 250 */ 42, 43, 169, 209, 210, 124, 125, 126, 224, 14,
345 /* 260 */ 169, 170, 227, 228, 230, 18, 225, 16, 60, 61,
346 /* 270 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
347 /* 280 */ 72, 23, 74, 75, 76, 77, 78, 79, 80, 81,
348 /* 290 */ 82, 83, 84, 42, 43, 147, 16, 52, 147, 54,
349 /* 300 */ 147, 210, 55, 106, 153, 108, 109, 156, 157, 156,
350 /* 310 */ 157, 60, 61, 62, 63, 64, 65, 66, 67, 68,
351 /* 320 */ 69, 70, 71, 72, 22, 74, 75, 76, 77, 78,
352 /* 330 */ 79, 80, 81, 82, 83, 84, 188, 147, 92, 131,
353 /* 340 */ 16, 94, 16, 22, 20, 155, 88, 89, 90, 103,
354 /* 350 */ 147, 93, 94, 95, 167, 168, 161, 162, 163, 169,
355 /* 360 */ 170, 25, 104, 176, 84, 29, 42, 43, 165, 166,
356 /* 370 */ 90, 91, 92, 93, 94, 95, 96, 41, 133, 189,
357 /* 380 */ 133, 169, 131, 103, 60, 61, 62, 63, 64, 65,
358 /* 390 */ 66, 67, 68, 69, 70, 71, 72, 181, 74, 75,
359 /* 400 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
360 /* 410 */ 84, 90, 22, 20, 93, 94, 95, 91, 92, 93,
361 /* 420 */ 94, 95, 96, 121, 147, 104, 147, 185, 186, 103,
362 /* 430 */ 227, 228, 155, 181, 160, 42, 43, 90, 176, 177,
363 /* 440 */ 93, 94, 95, 169, 161, 183, 169, 170, 169, 170,
364 /* 450 */ 155, 104, 155, 60, 61, 62, 63, 64, 65, 66,
365 /* 460 */ 67, 68, 69, 70, 71, 72, 189, 74, 75, 76,
366 /* 470 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 11,
367 /* 480 */ 244, 245, 20, 200, 189, 147, 189, 147, 211, 158,
368 /* 490 */ 211, 147, 161, 162, 163, 147, 201, 202, 42, 43,
369 /* 500 */ 223, 206, 223, 113, 42, 43, 147, 169, 170, 169,
370 /* 510 */ 170, 23, 19, 169, 170, 186, 23, 49, 155, 63,
371 /* 520 */ 64, 147, 60, 61, 62, 63, 64, 65, 66, 67,
372 /* 530 */ 68, 69, 70, 71, 72, 147, 74, 75, 76, 77,
373 /* 540 */ 78, 79, 80, 81, 82, 83, 84, 16, 92, 211,
374 /* 550 */ 12, 20, 189, 164, 165, 166, 208, 147, 16, 215,
375 /* 560 */ 220, 223, 24, 164, 165, 166, 23, 99, 100, 101,
376 /* 570 */ 155, 212, 23, 42, 43, 37, 88, 39, 110, 169,
377 /* 580 */ 170, 88, 89, 19, 20, 43, 22, 49, 185, 186,
378 /* 590 */ 23, 60, 61, 62, 63, 64, 65, 66, 67, 68,
379 /* 600 */ 69, 70, 71, 72, 189, 74, 75, 76, 77, 78,
380 /* 610 */ 79, 80, 81, 82, 83, 84, 16, 228, 0, 1,
381 /* 620 */ 2, 21, 19, 59, 147, 215, 23, 228, 213, 80,
382 /* 630 */ 147, 88, 89, 19, 20, 145, 22, 88, 89, 147,
383 /* 640 */ 98, 147, 42, 43, 20, 103, 169, 170, 20, 147,
384 /* 650 */ 147, 236, 169, 170, 20, 88, 89, 114, 147, 16,
385 /* 660 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
386 /* 670 */ 70, 71, 72, 59, 74, 75, 76, 77, 78, 79,
387 /* 680 */ 80, 81, 82, 83, 84, 42, 43, 147, 142, 143,
388 /* 690 */ 188, 88, 89, 130, 148, 132, 7, 8, 9, 188,
389 /* 700 */ 208, 155, 16, 60, 61, 62, 63, 64, 65, 66,
390 /* 710 */ 67, 68, 69, 70, 71, 72, 147, 74, 75, 76,
391 /* 720 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
392 /* 730 */ 106, 147, 108, 109, 106, 189, 108, 109, 169, 170,
393 /* 740 */ 106, 147, 108, 109, 147, 16, 60, 61, 62, 63,
394 /* 750 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 213,
395 /* 760 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
396 /* 770 */ 84, 42, 43, 99, 100, 101, 182, 147, 161, 182,
397 /* 780 */ 99, 100, 101, 14, 147, 147, 147, 241, 16, 191,
398 /* 790 */ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
399 /* 800 */ 71, 72, 147, 74, 75, 76, 77, 78, 79, 80,
400 /* 810 */ 81, 82, 83, 84, 42, 43, 23, 200, 188, 225,
401 /* 820 */ 182, 52, 225, 54, 169, 170, 147, 188, 22, 22,
402 /* 830 */ 147, 147, 201, 202, 62, 63, 64, 65, 66, 67,
403 /* 840 */ 68, 69, 70, 71, 72, 208, 74, 75, 76, 77,
404 /* 850 */ 78, 79, 80, 81, 82, 83, 84, 16, 17, 12,
405 /* 860 */ 19, 155, 19, 225, 23, 182, 23, 188, 147, 239,
406 /* 870 */ 147, 24, 31, 16, 17, 147, 19, 147, 147, 155,
407 /* 880 */ 23, 88, 89, 19, 37, 21, 39, 147, 31, 48,
408 /* 890 */ 169, 170, 169, 170, 147, 189, 89, 169, 170, 58,
409 /* 900 */ 169, 170, 147, 97, 147, 48, 147, 114, 225, 169,
410 /* 910 */ 170, 161, 147, 189, 16, 58, 169, 170, 147, 78,
411 /* 920 */ 79, 114, 155, 147, 169, 170, 169, 170, 87, 88,
412 /* 930 */ 89, 88, 80, 92, 147, 78, 79, 80, 147, 91,
413 /* 940 */ 169, 170, 212, 19, 87, 88, 89, 16, 17, 92,
414 /* 950 */ 19, 110, 147, 188, 23, 147, 189, 203, 110, 107,
415 /* 960 */ 169, 170, 31, 111, 188, 124, 125, 126, 127, 128,
416 /* 970 */ 129, 123, 147, 192, 169, 170, 43, 169, 170, 48,
417 /* 980 */ 199, 124, 125, 126, 127, 128, 129, 242, 243, 58,
418 /* 990 */ 92, 5, 68, 147, 169, 170, 10, 11, 12, 13,
419 /* 1000 */ 124, 125, 147, 147, 107, 147, 147, 147, 111, 78,
420 /* 1010 */ 79, 20, 26, 22, 28, 20, 147, 22, 87, 88,
421 /* 1020 */ 89, 35, 147, 92, 169, 170, 147, 169, 170, 169,
422 /* 1030 */ 170, 98, 20, 47, 188, 49, 27, 7, 8, 53,
423 /* 1040 */ 147, 147, 56, 34, 169, 170, 147, 147, 169, 170,
424 /* 1050 */ 147, 20, 147, 22, 147, 124, 125, 126, 127, 128,
425 /* 1060 */ 129, 178, 169, 170, 178, 20, 147, 22, 169, 170,
426 /* 1070 */ 30, 59, 169, 170, 169, 170, 147, 147, 91, 92,
427 /* 1080 */ 20, 147, 22, 147, 178, 99, 100, 101, 169, 170,
428 /* 1090 */ 50, 105, 147, 20, 147, 22, 110, 147, 169, 170,
429 /* 1100 */ 147, 147, 147, 169, 170, 169, 170, 20, 147, 22,
430 /* 1110 */ 147, 233, 232, 147, 169, 170, 169, 170, 147, 20,
431 /* 1120 */ 134, 22, 169, 170, 169, 170, 147, 20, 147, 22,
432 /* 1130 */ 169, 170, 169, 170, 149, 169, 170, 20, 229, 22,
433 /* 1140 */ 169, 170, 102, 20, 20, 22, 22, 147, 169, 170,
434 /* 1150 */ 147, 147, 147, 147, 147, 147, 191, 147, 147, 222,
435 /* 1160 */ 147, 147, 147, 193, 229, 172, 172, 177, 172, 172,
436 /* 1170 */ 172, 194, 173, 6, 194, 146, 22, 154, 146, 146,
437 /* 1180 */ 146, 189, 121, 194, 118, 116, 119, 23, 120, 130,
438 /* 1190 */ 221, 112, 98, 152, 152, 160, 195, 115, 196, 98,
439 /* 1200 */ 40, 97, 19, 179, 84, 179, 160, 171, 171, 171,
440 /* 1210 */ 226, 160, 173, 197, 171, 198, 15, 152, 174, 171,
441 /* 1220 */ 171, 171, 204, 151, 205, 204, 174, 205, 151, 38,
442 /* 1230 */ 152, 151, 130, 152, 60, 152, 151, 184, 152, 184,
443 /* 1240 */ 19, 194, 214, 152, 15, 187, 226, 152, 194, 187,
444 /* 1250 */ 187, 187, 33, 137, 184, 152, 159, 152, 1, 234,
445 /* 1260 */ 20, 112, 235, 175, 175, 112, 107, 112, 112, 92,
446 /* 1270 */ 214, 19, 11, 20, 20, 19, 114, 19, 117, 20,
447 /* 1280 */ 117, 112, 22, 20, 22, 19, 22, 20, 20, 44,
448 /* 1290 */ 19, 44, 19, 19, 237, 20, 19, 32, 19, 44,
449 /* 1300 */ 96, 103, 16, 21, 17, 98, 231, 22, 237, 133,
450 /* 1310 */ 98, 19, 36, 5, 240, 45, 1, 45, 102, 243,
451 /* 1320 */ 51, 122, 19, 113, 14, 102, 115, 113, 17, 123,
452 /* 1330 */ 246, 122, 19, 14, 20, 135, 19, 3, 57, 136,
453 /* 1340 */ 4, 247, 247, 247, 247, 247, 68, 247, 68,
454};
455#define YY_SHIFT_USE_DFLT (-62)
456#define YY_SHIFT_MAX 385
457static const short yy_shift_ofst[] = {
458 /* 0 */ 23, 841, 986, -16, 841, 931, 931, 931, 258, 123,
459 /* 10 */ -36, 96, 931, 931, 931, 931, 931, -45, 468, 19,
460 /* 20 */ 567, 488, -38, -38, 53, 165, 208, 251, 324, 393,
461 /* 30 */ 462, 531, 600, 643, 686, 643, 643, 643, 643, 643,
462 /* 40 */ 643, 643, 643, 643, 643, 643, 643, 643, 643, 643,
463 /* 50 */ 643, 643, 729, 772, 772, 857, 931, 931, 931, 931,
464 /* 60 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
465 /* 70 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
466 /* 80 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
467 /* 90 */ 931, 931, 931, 931, -61, -61, 6, 6, 280, 22,
468 /* 100 */ 61, 542, 247, 567, 567, 567, 567, 567, 567, 567,
469 /* 110 */ 115, 488, 106, -62, -62, 131, 326, 538, 538, 564,
470 /* 120 */ 614, 618, 132, 567, 132, 567, 567, 567, 567, 567,
471 /* 130 */ 567, 567, 567, 567, 567, 567, 567, 567, 848, -53,
472 /* 140 */ -36, -36, -36, -62, -62, -62, -15, -15, 321, 347,
473 /* 150 */ 624, 493, 628, 634, 847, 543, 793, 603, 549, 689,
474 /* 160 */ 567, 567, 852, 567, 567, 843, 567, 567, 807, 567,
475 /* 170 */ 567, 197, 807, 567, 567, 1040, 1040, 1040, 567, 567,
476 /* 180 */ 197, 567, 567, 197, 567, 336, 674, 567, 567, 197,
477 /* 190 */ 567, 567, 567, 197, 567, 567, 567, 197, 197, 567,
478 /* 200 */ 567, 567, 567, 567, 864, 897, 390, 876, 876, 563,
479 /* 210 */ 1009, 1009, 1009, 933, 1009, 1009, 806, 302, 302, 1167,
480 /* 220 */ 1167, 1167, 1167, 1154, -36, 1061, 1066, 1067, 1069, 1068,
481 /* 230 */ 1164, 1059, 1079, 1079, 1094, 1082, 1094, 1082, 1101, 1101,
482 /* 240 */ 1160, 1101, 1104, 1101, 1183, 1120, 1164, 1120, 1164, 1160,
483 /* 250 */ 1101, 1101, 1101, 1183, 1201, 1079, 1201, 1079, 1201, 1079,
484 /* 260 */ 1079, 1191, 1102, 1201, 1079, 1174, 1174, 1221, 1061, 1079,
485 /* 270 */ 1229, 1229, 1229, 1229, 1061, 1174, 1221, 1079, 1219, 1219,
486 /* 280 */ 1079, 1079, 1116, -62, -62, -62, -62, -62, -62, 456,
487 /* 290 */ 245, 681, 769, 73, 898, 991, 995, 1031, 1045, 246,
488 /* 300 */ 1030, 987, 1060, 1073, 1087, 1099, 1107, 1117, 1123, 924,
489 /* 310 */ 1124, 1012, 1257, 1240, 1149, 1153, 1155, 1156, 1177, 1159,
490 /* 320 */ 1252, 1253, 1254, 1256, 1261, 1258, 1259, 1260, 1263, 1161,
491 /* 330 */ 1262, 1163, 1264, 1162, 1266, 1267, 1169, 1268, 1265, 1245,
492 /* 340 */ 1271, 1247, 1273, 1275, 1274, 1277, 1255, 1279, 1204, 1198,
493 /* 350 */ 1286, 1287, 1282, 1207, 1276, 1269, 1270, 1285, 1272, 1176,
494 /* 360 */ 1212, 1292, 1308, 1315, 1216, 1278, 1280, 1199, 1303, 1210,
495 /* 370 */ 1310, 1211, 1311, 1214, 1223, 1209, 1313, 1206, 1314, 1319,
496 /* 380 */ 1281, 1200, 1203, 1317, 1334, 1336,
497};
498#define YY_REDUCE_USE_DFLT (-165)
499#define YY_REDUCE_MAX 288
500static const short yy_reduce_ofst[] = {
501 /* 0 */ -138, 277, 546, -13, 190, 279, 44, 338, 36, 203,
502 /* 10 */ 295, -140, 340, -76, 91, 344, 410, -22, 415, 35,
503 /* 20 */ 151, 331, 389, 399, -67, -67, -67, -67, -67, -67,
504 /* 30 */ -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
505 /* 40 */ -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
506 /* 50 */ -67, -67, -67, -67, -67, 477, 483, 569, 655, 721,
507 /* 60 */ 723, 728, 731, 740, 747, 755, 757, 771, 791, 805,
508 /* 70 */ 808, 825, 855, 858, 860, 875, 879, 893, 899, 903,
509 /* 80 */ 905, 919, 929, 934, 936, 945, 947, 953, 955, 961,
510 /* 90 */ 963, 966, 971, 979, -67, -67, -67, -67, 187, -67,
511 /* 100 */ -67, 262, 34, -56, 594, 597, 638, 683, 630, 153,
512 /* 110 */ -67, 195, -67, -67, -67, 274, -164, 242, 403, 236,
513 /* 120 */ 236, 74, 283, 348, 617, 41, 148, 492, 359, 637,
514 /* 130 */ 502, 511, 639, 679, 765, 776, 730, 846, 297, 363,
515 /* 140 */ 706, 724, 767, 781, 631, 745, 83, 212, 216, 252,
516 /* 150 */ 14, 75, 14, 14, 329, 374, 388, 494, 503, 490,
517 /* 160 */ 540, 584, 598, 503, 684, 750, 759, 787, 754, 856,
518 /* 170 */ 859, 14, 754, 869, 894, 883, 886, 906, 900, 907,
519 /* 180 */ 14, 930, 950, 14, 954, 880, 878, 981, 1000, 14,
520 /* 190 */ 1003, 1004, 1005, 14, 1006, 1007, 1008, 14, 14, 1010,
521 /* 200 */ 1011, 1013, 1014, 1015, 985, 965, 970, 909, 935, 937,
522 /* 210 */ 993, 994, 996, 990, 997, 998, 999, 977, 980, 1029,
523 /* 220 */ 1032, 1033, 1034, 1023, 992, 989, 1001, 1002, 1016, 1017,
524 /* 230 */ 1035, 969, 1041, 1042, 1018, 1019, 1021, 1022, 1036, 1037,
525 /* 240 */ 1024, 1038, 1039, 1043, 1044, 984, 1046, 1020, 1051, 1026,
526 /* 250 */ 1048, 1049, 1050, 1052, 1072, 1065, 1077, 1078, 1080, 1081,
527 /* 260 */ 1083, 1025, 1027, 1085, 1086, 1053, 1055, 1028, 1047, 1091,
528 /* 270 */ 1058, 1062, 1063, 1064, 1054, 1070, 1056, 1095, 1057, 1071,
529 /* 280 */ 1103, 1105, 1074, 1097, 1088, 1089, 1075, 1076, 1084,
530};
531static const YYACTIONTYPE yy_default[] = {
532 /* 0 */ 592, 818, 897, 707, 897, 818, 897, 818, 897, 843,
533 /* 10 */ 711, 872, 814, 818, 897, 897, 897, 789, 897, 843,
534 /* 20 */ 897, 623, 843, 843, 740, 897, 897, 897, 897, 897,
535 /* 30 */ 897, 897, 897, 741, 897, 817, 813, 809, 811, 810,
536 /* 40 */ 742, 731, 738, 745, 723, 856, 747, 748, 754, 755,
537 /* 50 */ 873, 871, 777, 776, 795, 897, 897, 897, 897, 897,
538 /* 60 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
539 /* 70 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
540 /* 80 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
541 /* 90 */ 897, 897, 897, 897, 779, 800, 778, 788, 616, 780,
542 /* 100 */ 781, 676, 611, 897, 897, 897, 897, 897, 897, 897,
543 /* 110 */ 782, 897, 783, 796, 797, 897, 897, 897, 897, 897,
544 /* 120 */ 897, 592, 707, 897, 707, 897, 897, 897, 897, 897,
545 /* 130 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
546 /* 140 */ 897, 897, 897, 701, 711, 890, 897, 897, 667, 897,
547 /* 150 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 599,
548 /* 160 */ 597, 897, 699, 897, 897, 625, 897, 897, 709, 897,
549 /* 170 */ 897, 714, 715, 897, 897, 897, 897, 897, 897, 897,
550 /* 180 */ 613, 897, 897, 688, 897, 849, 897, 897, 897, 863,
551 /* 190 */ 897, 897, 897, 861, 897, 897, 897, 690, 750, 830,
552 /* 200 */ 897, 876, 878, 897, 897, 699, 708, 897, 897, 812,
553 /* 210 */ 734, 734, 734, 646, 734, 734, 649, 744, 744, 596,
554 /* 220 */ 596, 596, 596, 666, 897, 744, 735, 737, 727, 739,
555 /* 230 */ 897, 897, 716, 716, 724, 726, 724, 726, 678, 678,
556 /* 240 */ 663, 678, 649, 678, 822, 827, 897, 827, 897, 663,
557 /* 250 */ 678, 678, 678, 822, 608, 716, 608, 716, 608, 716,
558 /* 260 */ 716, 853, 855, 608, 716, 680, 680, 756, 744, 716,
559 /* 270 */ 687, 687, 687, 687, 744, 680, 756, 716, 875, 875,
560 /* 280 */ 716, 716, 883, 633, 651, 651, 858, 890, 895, 897,
561 /* 290 */ 897, 897, 897, 763, 897, 897, 897, 897, 897, 897,
562 /* 300 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 836,
563 /* 310 */ 897, 897, 897, 897, 768, 764, 897, 765, 897, 693,
564 /* 320 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
565 /* 330 */ 728, 897, 736, 897, 897, 897, 897, 897, 897, 897,
566 /* 340 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
567 /* 350 */ 897, 897, 897, 897, 897, 897, 851, 852, 897, 897,
568 /* 360 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
569 /* 370 */ 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
570 /* 380 */ 882, 897, 897, 885, 593, 897, 587, 590, 589, 591,
571 /* 390 */ 595, 598, 620, 621, 622, 600, 601, 602, 603, 604,
572 /* 400 */ 605, 606, 612, 614, 632, 634, 618, 636, 697, 698,
573 /* 410 */ 760, 691, 692, 696, 771, 762, 766, 767, 769, 770,
574 /* 420 */ 784, 785, 787, 793, 799, 802, 786, 791, 792, 794,
575 /* 430 */ 798, 801, 694, 695, 805, 619, 626, 627, 630, 631,
576 /* 440 */ 839, 841, 840, 842, 629, 628, 772, 775, 807, 808,
577 /* 450 */ 864, 865, 866, 867, 868, 803, 815, 816, 717, 806,
578 /* 460 */ 790, 729, 732, 733, 730, 700, 710, 719, 720, 721,
579 /* 470 */ 722, 705, 706, 712, 725, 758, 759, 713, 702, 703,
580 /* 480 */ 704, 804, 761, 773, 774, 637, 638, 768, 639, 640,
581 /* 490 */ 641, 679, 682, 683, 684, 642, 661, 664, 665, 643,
582 /* 500 */ 650, 644, 645, 652, 653, 654, 657, 658, 659, 660,
583 /* 510 */ 655, 656, 823, 824, 828, 826, 825, 647, 648, 662,
584 /* 520 */ 635, 624, 617, 668, 671, 672, 673, 674, 675, 677,
585 /* 530 */ 669, 670, 615, 607, 609, 718, 845, 854, 850, 846,
586 /* 540 */ 847, 848, 610, 819, 820, 681, 752, 753, 844, 857,
587 /* 550 */ 859, 757, 860, 862, 887, 685, 686, 689, 829, 869,
588 /* 560 */ 743, 746, 749, 751, 831, 832, 833, 834, 837, 838,
589 /* 570 */ 835, 870, 874, 877, 879, 880, 881, 884, 886, 891,
590 /* 580 */ 892, 893, 896, 894, 594, 588,
591};
592#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
593
594/* The next table maps tokens into fallback tokens. If a construct
595** like the following:
596**
597** %fallback ID X Y Z.
598**
599** appears in the grammer, then ID becomes a fallback token for X, Y,
600** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
601** but it does not parse, the type of the token is changed to ID and
602** the parse is retried before an error is thrown.
603*/
604#ifdef YYFALLBACK
605static const YYCODETYPE yyFallback[] = {
606 0, /* $ => nothing */
607 0, /* SEMI => nothing */
608 23, /* EXPLAIN => ID */
609 23, /* QUERY => ID */
610 23, /* PLAN => ID */
611 23, /* BEGIN => ID */
612 0, /* TRANSACTION => nothing */
613 23, /* DEFERRED => ID */
614 23, /* IMMEDIATE => ID */
615 23, /* EXCLUSIVE => ID */
616 0, /* COMMIT => nothing */
617 23, /* END => ID */
618 0, /* ROLLBACK => nothing */
619 0, /* CREATE => nothing */
620 0, /* TABLE => nothing */
621 23, /* IF => ID */
622 0, /* NOT => nothing */
623 0, /* EXISTS => nothing */
624 23, /* TEMP => ID */
625 0, /* LP => nothing */
626 0, /* RP => nothing */
627 0, /* AS => nothing */
628 0, /* COMMA => nothing */
629 0, /* ID => nothing */
630 23, /* ABORT => ID */
631 23, /* AFTER => ID */
632 23, /* ANALYZE => ID */
633 23, /* ASC => ID */
634 23, /* ATTACH => ID */
635 23, /* BEFORE => ID */
636 23, /* CASCADE => ID */
637 23, /* CAST => ID */
638 23, /* CONFLICT => ID */
639 23, /* DATABASE => ID */
640 23, /* DESC => ID */
641 23, /* DETACH => ID */
642 23, /* EACH => ID */
643 23, /* FAIL => ID */
644 23, /* FOR => ID */
645 23, /* IGNORE => ID */
646 23, /* INITIALLY => ID */
647 23, /* INSTEAD => ID */
648 23, /* LIKE_KW => ID */
649 23, /* MATCH => ID */
650 23, /* KEY => ID */
651 23, /* OF => ID */
652 23, /* OFFSET => ID */
653 23, /* PRAGMA => ID */
654 23, /* RAISE => ID */
655 23, /* REPLACE => ID */
656 23, /* RESTRICT => ID */
657 23, /* ROW => ID */
658 23, /* TRIGGER => ID */
659 23, /* VACUUM => ID */
660 23, /* VIEW => ID */
661 23, /* VIRTUAL => ID */
662 23, /* REINDEX => ID */
663 23, /* RENAME => ID */
664 23, /* CTIME_KW => ID */
665 0, /* ANY => nothing */
666 0, /* OR => nothing */
667 0, /* AND => nothing */
668 0, /* IS => nothing */
669 0, /* BETWEEN => nothing */
670 0, /* IN => nothing */
671 0, /* ISNULL => nothing */
672 0, /* NOTNULL => nothing */
673 0, /* NE => nothing */
674 0, /* EQ => nothing */
675 0, /* GT => nothing */
676 0, /* LE => nothing */
677 0, /* LT => nothing */
678 0, /* GE => nothing */
679 0, /* ESCAPE => nothing */
680 0, /* BITAND => nothing */
681 0, /* BITOR => nothing */
682 0, /* LSHIFT => nothing */
683 0, /* RSHIFT => nothing */
684 0, /* PLUS => nothing */
685 0, /* MINUS => nothing */
686 0, /* STAR => nothing */
687 0, /* SLASH => nothing */
688 0, /* REM => nothing */
689 0, /* CONCAT => nothing */
690 0, /* COLLATE => nothing */
691 0, /* UMINUS => nothing */
692 0, /* UPLUS => nothing */
693 0, /* BITNOT => nothing */
694 0, /* STRING => nothing */
695 0, /* JOIN_KW => nothing */
696 0, /* CONSTRAINT => nothing */
697 0, /* DEFAULT => nothing */
698 0, /* NULL => nothing */
699 0, /* PRIMARY => nothing */
700 0, /* UNIQUE => nothing */
701 0, /* CHECK => nothing */
702 0, /* REFERENCES => nothing */
703 0, /* AUTOINCR => nothing */
704 0, /* ON => nothing */
705 0, /* DELETE => nothing */
706 0, /* UPDATE => nothing */
707 0, /* INSERT => nothing */
708 0, /* SET => nothing */
709 0, /* DEFERRABLE => nothing */
710 0, /* FOREIGN => nothing */
711 0, /* DROP => nothing */
712 0, /* UNION => nothing */
713 0, /* ALL => nothing */
714 0, /* EXCEPT => nothing */
715 0, /* INTERSECT => nothing */
716 0, /* SELECT => nothing */
717 0, /* DISTINCT => nothing */
718 0, /* DOT => nothing */
719 0, /* FROM => nothing */
720 0, /* JOIN => nothing */
721 0, /* USING => nothing */
722 0, /* ORDER => nothing */
723 0, /* BY => nothing */
724 0, /* GROUP => nothing */
725 0, /* HAVING => nothing */
726 0, /* LIMIT => nothing */
727 0, /* WHERE => nothing */
728 0, /* INTO => nothing */
729 0, /* VALUES => nothing */
730 0, /* INTEGER => nothing */
731 0, /* FLOAT => nothing */
732 0, /* BLOB => nothing */
733 0, /* REGISTER => nothing */
734 0, /* VARIABLE => nothing */
735 0, /* CASE => nothing */
736 0, /* WHEN => nothing */
737 0, /* THEN => nothing */
738 0, /* ELSE => nothing */
739 0, /* INDEX => nothing */
740 0, /* ALTER => nothing */
741 0, /* TO => nothing */
742 0, /* ADD => nothing */
743 0, /* COLUMNKW => nothing */
744};
745#endif /* YYFALLBACK */
746
747/* The following structure represents a single element of the
748** parser's stack. Information stored includes:
749**
750** + The state number for the parser at this level of the stack.
751**
752** + The value of the token stored at this level of the stack.
753** (In other words, the "major" token.)
754**
755** + The semantic value stored at this level of the stack. This is
756** the information used by the action routines in the grammar.
757** It is sometimes called the "minor" token.
758*/
759struct yyStackEntry {
760 int stateno; /* The state-number */
761 int major; /* The major token value. This is the code
762 ** number for the token at this stack level */
763 YYMINORTYPE minor; /* The user-supplied minor token value. This
764 ** is the value of the token */
765};
766typedef struct yyStackEntry yyStackEntry;
767
768/* The state of the parser is completely contained in an instance of
769** the following structure */
770struct yyParser {
771 int yyidx; /* Index of top element in stack */
772 int yyerrcnt; /* Shifts left before out of the error */
773 sqlite3ParserARG_SDECL /* A place to hold %extra_argument */
774#if YYSTACKDEPTH<=0
775 int yystksz; /* Current side of the stack */
776 yyStackEntry *yystack; /* The parser's stack */
777#else
778 yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
779#endif
780};
781typedef struct yyParser yyParser;
782
783#ifndef NDEBUG
784#include <stdio.h>
785static FILE *yyTraceFILE = 0;
786static char *yyTracePrompt = 0;
787#endif /* NDEBUG */
788
789#ifndef NDEBUG
790/*
791** Turn parser tracing on by giving a stream to which to write the trace
792** and a prompt to preface each trace message. Tracing is turned off
793** by making either argument NULL
794**
795** Inputs:
796** <ul>
797** <li> A FILE* to which trace output should be written.
798** If NULL, then tracing is turned off.
799** <li> A prefix string written at the beginning of every
800** line of trace output. If NULL, then tracing is
801** turned off.
802** </ul>
803**
804** Outputs:
805** None.
806*/
807void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
808 yyTraceFILE = TraceFILE;
809 yyTracePrompt = zTracePrompt;
810 if( yyTraceFILE==0 ) yyTracePrompt = 0;
811 else if( yyTracePrompt==0 ) yyTraceFILE = 0;
812}
813#endif /* NDEBUG */
814
815#ifndef NDEBUG
816/* For tracing shifts, the names of all terminals and nonterminals
817** are required. The following table supplies these names */
818static const char *const yyTokenName[] = {
819 "$", "SEMI", "EXPLAIN", "QUERY",
820 "PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
821 "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END",
822 "ROLLBACK", "CREATE", "TABLE", "IF",
823 "NOT", "EXISTS", "TEMP", "LP",
824 "RP", "AS", "COMMA", "ID",
825 "ABORT", "AFTER", "ANALYZE", "ASC",
826 "ATTACH", "BEFORE", "CASCADE", "CAST",
827 "CONFLICT", "DATABASE", "DESC", "DETACH",
828 "EACH", "FAIL", "FOR", "IGNORE",
829 "INITIALLY", "INSTEAD", "LIKE_KW", "MATCH",
830 "KEY", "OF", "OFFSET", "PRAGMA",
831 "RAISE", "REPLACE", "RESTRICT", "ROW",
832 "TRIGGER", "VACUUM", "VIEW", "VIRTUAL",
833 "REINDEX", "RENAME", "CTIME_KW", "ANY",
834 "OR", "AND", "IS", "BETWEEN",
835 "IN", "ISNULL", "NOTNULL", "NE",
836 "EQ", "GT", "LE", "LT",
837 "GE", "ESCAPE", "BITAND", "BITOR",
838 "LSHIFT", "RSHIFT", "PLUS", "MINUS",
839 "STAR", "SLASH", "REM", "CONCAT",
840 "COLLATE", "UMINUS", "UPLUS", "BITNOT",
841 "STRING", "JOIN_KW", "CONSTRAINT", "DEFAULT",
842 "NULL", "PRIMARY", "UNIQUE", "CHECK",
843 "REFERENCES", "AUTOINCR", "ON", "DELETE",
844 "UPDATE", "INSERT", "SET", "DEFERRABLE",
845 "FOREIGN", "DROP", "UNION", "ALL",
846 "EXCEPT", "INTERSECT", "SELECT", "DISTINCT",
847 "DOT", "FROM", "JOIN", "USING",
848 "ORDER", "BY", "GROUP", "HAVING",
849 "LIMIT", "WHERE", "INTO", "VALUES",
850 "INTEGER", "FLOAT", "BLOB", "REGISTER",
851 "VARIABLE", "CASE", "WHEN", "THEN",
852 "ELSE", "INDEX", "ALTER", "TO",
853 "ADD", "COLUMNKW", "error", "input",
854 "cmdlist", "ecmd", "cmdx", "cmd",
855 "explain", "transtype", "trans_opt", "nm",
856 "create_table", "create_table_args", "temp", "ifnotexists",
857 "dbnm", "columnlist", "conslist_opt", "select",
858 "column", "columnid", "type", "carglist",
859 "id", "ids", "typetoken", "typename",
860 "signed", "plus_num", "minus_num", "carg",
861 "ccons", "term", "expr", "onconf",
862 "sortorder", "autoinc", "idxlist_opt", "refargs",
863 "defer_subclause", "refarg", "refact", "init_deferred_pred_opt",
864 "conslist", "tcons", "idxlist", "defer_subclause_opt",
865 "orconf", "resolvetype", "raisetype", "ifexists",
866 "fullname", "oneselect", "multiselect_op", "distinct",
867 "selcollist", "from", "where_opt", "groupby_opt",
868 "having_opt", "orderby_opt", "limit_opt", "sclp",
869 "as", "seltablist", "stl_prefix", "joinop",
870 "on_opt", "using_opt", "seltablist_paren", "joinop2",
871 "inscollist", "sortlist", "sortitem", "exprlist",
872 "setlist", "insert_cmd", "inscollist_opt", "itemlist",
873 "likeop", "escape", "between_op", "in_op",
874 "case_operand", "case_exprlist", "case_else", "expritem",
875 "uniqueflag", "idxitem", "collate", "nmnum",
876 "plus_opt", "number", "trigger_decl", "trigger_cmd_list",
877 "trigger_time", "trigger_event", "foreach_clause", "when_clause",
878 "trigger_cmd", "database_kw_opt", "key_opt", "add_column_fullname",
879 "kwcolumn_opt", "create_vtab", "vtabarglist", "vtabarg",
880 "vtabargtoken", "lp", "anylist",
881};
882#endif /* NDEBUG */
883
884#ifndef NDEBUG
885/* For tracing reduce actions, the names of all rules are required.
886*/
887static const char *const yyRuleName[] = {
888 /* 0 */ "input ::= cmdlist",
889 /* 1 */ "cmdlist ::= cmdlist ecmd",
890 /* 2 */ "cmdlist ::= ecmd",
891 /* 3 */ "cmdx ::= cmd",
892 /* 4 */ "ecmd ::= SEMI",
893 /* 5 */ "ecmd ::= explain cmdx SEMI",
894 /* 6 */ "explain ::=",
895 /* 7 */ "explain ::= EXPLAIN",
896 /* 8 */ "explain ::= EXPLAIN QUERY PLAN",
897 /* 9 */ "cmd ::= BEGIN transtype trans_opt",
898 /* 10 */ "trans_opt ::=",
899 /* 11 */ "trans_opt ::= TRANSACTION",
900 /* 12 */ "trans_opt ::= TRANSACTION nm",
901 /* 13 */ "transtype ::=",
902 /* 14 */ "transtype ::= DEFERRED",
903 /* 15 */ "transtype ::= IMMEDIATE",
904 /* 16 */ "transtype ::= EXCLUSIVE",
905 /* 17 */ "cmd ::= COMMIT trans_opt",
906 /* 18 */ "cmd ::= END trans_opt",
907 /* 19 */ "cmd ::= ROLLBACK trans_opt",
908 /* 20 */ "cmd ::= create_table create_table_args",
909 /* 21 */ "create_table ::= CREATE temp TABLE ifnotexists nm dbnm",
910 /* 22 */ "ifnotexists ::=",
911 /* 23 */ "ifnotexists ::= IF NOT EXISTS",
912 /* 24 */ "temp ::= TEMP",
913 /* 25 */ "temp ::=",
914 /* 26 */ "create_table_args ::= LP columnlist conslist_opt RP",
915 /* 27 */ "create_table_args ::= AS select",
916 /* 28 */ "columnlist ::= columnlist COMMA column",
917 /* 29 */ "columnlist ::= column",
918 /* 30 */ "column ::= columnid type carglist",
919 /* 31 */ "columnid ::= nm",
920 /* 32 */ "id ::= ID",
921 /* 33 */ "ids ::= ID|STRING",
922 /* 34 */ "nm ::= ID",
923 /* 35 */ "nm ::= STRING",
924 /* 36 */ "nm ::= JOIN_KW",
925 /* 37 */ "type ::=",
926 /* 38 */ "type ::= typetoken",
927 /* 39 */ "typetoken ::= typename",
928 /* 40 */ "typetoken ::= typename LP signed RP",
929 /* 41 */ "typetoken ::= typename LP signed COMMA signed RP",
930 /* 42 */ "typename ::= ids",
931 /* 43 */ "typename ::= typename ids",
932 /* 44 */ "signed ::= plus_num",
933 /* 45 */ "signed ::= minus_num",
934 /* 46 */ "carglist ::= carglist carg",
935 /* 47 */ "carglist ::=",
936 /* 48 */ "carg ::= CONSTRAINT nm ccons",
937 /* 49 */ "carg ::= ccons",
938 /* 50 */ "ccons ::= DEFAULT term",
939 /* 51 */ "ccons ::= DEFAULT LP expr RP",
940 /* 52 */ "ccons ::= DEFAULT PLUS term",
941 /* 53 */ "ccons ::= DEFAULT MINUS term",
942 /* 54 */ "ccons ::= DEFAULT id",
943 /* 55 */ "ccons ::= NULL onconf",
944 /* 56 */ "ccons ::= NOT NULL onconf",
945 /* 57 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
946 /* 58 */ "ccons ::= UNIQUE onconf",
947 /* 59 */ "ccons ::= CHECK LP expr RP",
948 /* 60 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
949 /* 61 */ "ccons ::= defer_subclause",
950 /* 62 */ "ccons ::= COLLATE id",
951 /* 63 */ "autoinc ::=",
952 /* 64 */ "autoinc ::= AUTOINCR",
953 /* 65 */ "refargs ::=",
954 /* 66 */ "refargs ::= refargs refarg",
955 /* 67 */ "refarg ::= MATCH nm",
956 /* 68 */ "refarg ::= ON DELETE refact",
957 /* 69 */ "refarg ::= ON UPDATE refact",
958 /* 70 */ "refarg ::= ON INSERT refact",
959 /* 71 */ "refact ::= SET NULL",
960 /* 72 */ "refact ::= SET DEFAULT",
961 /* 73 */ "refact ::= CASCADE",
962 /* 74 */ "refact ::= RESTRICT",
963 /* 75 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
964 /* 76 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
965 /* 77 */ "init_deferred_pred_opt ::=",
966 /* 78 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
967 /* 79 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
968 /* 80 */ "conslist_opt ::=",
969 /* 81 */ "conslist_opt ::= COMMA conslist",
970 /* 82 */ "conslist ::= conslist COMMA tcons",
971 /* 83 */ "conslist ::= conslist tcons",
972 /* 84 */ "conslist ::= tcons",
973 /* 85 */ "tcons ::= CONSTRAINT nm",
974 /* 86 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
975 /* 87 */ "tcons ::= UNIQUE LP idxlist RP onconf",
976 /* 88 */ "tcons ::= CHECK LP expr RP onconf",
977 /* 89 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
978 /* 90 */ "defer_subclause_opt ::=",
979 /* 91 */ "defer_subclause_opt ::= defer_subclause",
980 /* 92 */ "onconf ::=",
981 /* 93 */ "onconf ::= ON CONFLICT resolvetype",
982 /* 94 */ "orconf ::=",
983 /* 95 */ "orconf ::= OR resolvetype",
984 /* 96 */ "resolvetype ::= raisetype",
985 /* 97 */ "resolvetype ::= IGNORE",
986 /* 98 */ "resolvetype ::= REPLACE",
987 /* 99 */ "cmd ::= DROP TABLE ifexists fullname",
988 /* 100 */ "ifexists ::= IF EXISTS",
989 /* 101 */ "ifexists ::=",
990 /* 102 */ "cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select",
991 /* 103 */ "cmd ::= DROP VIEW ifexists fullname",
992 /* 104 */ "cmd ::= select",
993 /* 105 */ "select ::= oneselect",
994 /* 106 */ "select ::= select multiselect_op oneselect",
995 /* 107 */ "multiselect_op ::= UNION",
996 /* 108 */ "multiselect_op ::= UNION ALL",
997 /* 109 */ "multiselect_op ::= EXCEPT|INTERSECT",
998 /* 110 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
999 /* 111 */ "distinct ::= DISTINCT",
1000 /* 112 */ "distinct ::= ALL",
1001 /* 113 */ "distinct ::=",
1002 /* 114 */ "sclp ::= selcollist COMMA",
1003 /* 115 */ "sclp ::=",
1004 /* 116 */ "selcollist ::= sclp expr as",
1005 /* 117 */ "selcollist ::= sclp STAR",
1006 /* 118 */ "selcollist ::= sclp nm DOT STAR",
1007 /* 119 */ "as ::= AS nm",
1008 /* 120 */ "as ::= ids",
1009 /* 121 */ "as ::=",
1010 /* 122 */ "from ::=",
1011 /* 123 */ "from ::= FROM seltablist",
1012 /* 124 */ "stl_prefix ::= seltablist joinop",
1013 /* 125 */ "stl_prefix ::=",
1014 /* 126 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt",
1015 /* 127 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt",
1016 /* 128 */ "seltablist_paren ::= select",
1017 /* 129 */ "seltablist_paren ::= seltablist",
1018 /* 130 */ "dbnm ::=",
1019 /* 131 */ "dbnm ::= DOT nm",
1020 /* 132 */ "fullname ::= nm dbnm",
1021 /* 133 */ "joinop ::= COMMA|JOIN",
1022 /* 134 */ "joinop ::= JOIN_KW JOIN",
1023 /* 135 */ "joinop ::= JOIN_KW nm JOIN",
1024 /* 136 */ "joinop ::= JOIN_KW nm nm JOIN",
1025 /* 137 */ "on_opt ::= ON expr",
1026 /* 138 */ "on_opt ::=",
1027 /* 139 */ "using_opt ::= USING LP inscollist RP",
1028 /* 140 */ "using_opt ::=",
1029 /* 141 */ "orderby_opt ::=",
1030 /* 142 */ "orderby_opt ::= ORDER BY sortlist",
1031 /* 143 */ "sortlist ::= sortlist COMMA sortitem sortorder",
1032 /* 144 */ "sortlist ::= sortitem sortorder",
1033 /* 145 */ "sortitem ::= expr",
1034 /* 146 */ "sortorder ::= ASC",
1035 /* 147 */ "sortorder ::= DESC",
1036 /* 148 */ "sortorder ::=",
1037 /* 149 */ "groupby_opt ::=",
1038 /* 150 */ "groupby_opt ::= GROUP BY exprlist",
1039 /* 151 */ "having_opt ::=",
1040 /* 152 */ "having_opt ::= HAVING expr",
1041 /* 153 */ "limit_opt ::=",
1042 /* 154 */ "limit_opt ::= LIMIT expr",
1043 /* 155 */ "limit_opt ::= LIMIT expr OFFSET expr",
1044 /* 156 */ "limit_opt ::= LIMIT expr COMMA expr",
1045 /* 157 */ "cmd ::= DELETE FROM fullname where_opt",
1046 /* 158 */ "where_opt ::=",
1047 /* 159 */ "where_opt ::= WHERE expr",
1048 /* 160 */ "cmd ::= UPDATE orconf fullname SET setlist where_opt",
1049 /* 161 */ "setlist ::= setlist COMMA nm EQ expr",
1050 /* 162 */ "setlist ::= nm EQ expr",
1051 /* 163 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP",
1052 /* 164 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
1053 /* 165 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
1054 /* 166 */ "insert_cmd ::= INSERT orconf",
1055 /* 167 */ "insert_cmd ::= REPLACE",
1056 /* 168 */ "itemlist ::= itemlist COMMA expr",
1057 /* 169 */ "itemlist ::= expr",
1058 /* 170 */ "inscollist_opt ::=",
1059 /* 171 */ "inscollist_opt ::= LP inscollist RP",
1060 /* 172 */ "inscollist ::= inscollist COMMA nm",
1061 /* 173 */ "inscollist ::= nm",
1062 /* 174 */ "expr ::= term",
1063 /* 175 */ "expr ::= LP expr RP",
1064 /* 176 */ "term ::= NULL",
1065 /* 177 */ "expr ::= ID",
1066 /* 178 */ "expr ::= JOIN_KW",
1067 /* 179 */ "expr ::= nm DOT nm",
1068 /* 180 */ "expr ::= nm DOT nm DOT nm",
1069 /* 181 */ "term ::= INTEGER|FLOAT|BLOB",
1070 /* 182 */ "term ::= STRING",
1071 /* 183 */ "expr ::= REGISTER",
1072 /* 184 */ "expr ::= VARIABLE",
1073 /* 185 */ "expr ::= expr COLLATE id",
1074 /* 186 */ "expr ::= CAST LP expr AS typetoken RP",
1075 /* 187 */ "expr ::= ID LP distinct exprlist RP",
1076 /* 188 */ "expr ::= ID LP STAR RP",
1077 /* 189 */ "term ::= CTIME_KW",
1078 /* 190 */ "expr ::= expr AND expr",
1079 /* 191 */ "expr ::= expr OR expr",
1080 /* 192 */ "expr ::= expr LT|GT|GE|LE expr",
1081 /* 193 */ "expr ::= expr EQ|NE expr",
1082 /* 194 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
1083 /* 195 */ "expr ::= expr PLUS|MINUS expr",
1084 /* 196 */ "expr ::= expr STAR|SLASH|REM expr",
1085 /* 197 */ "expr ::= expr CONCAT expr",
1086 /* 198 */ "likeop ::= LIKE_KW",
1087 /* 199 */ "likeop ::= NOT LIKE_KW",
1088 /* 200 */ "likeop ::= MATCH",
1089 /* 201 */ "likeop ::= NOT MATCH",
1090 /* 202 */ "escape ::= ESCAPE expr",
1091 /* 203 */ "escape ::=",
1092 /* 204 */ "expr ::= expr likeop expr escape",
1093 /* 205 */ "expr ::= expr ISNULL|NOTNULL",
1094 /* 206 */ "expr ::= expr IS NULL",
1095 /* 207 */ "expr ::= expr NOT NULL",
1096 /* 208 */ "expr ::= expr IS NOT NULL",
1097 /* 209 */ "expr ::= NOT|BITNOT expr",
1098 /* 210 */ "expr ::= MINUS expr",
1099 /* 211 */ "expr ::= PLUS expr",
1100 /* 212 */ "between_op ::= BETWEEN",
1101 /* 213 */ "between_op ::= NOT BETWEEN",
1102 /* 214 */ "expr ::= expr between_op expr AND expr",
1103 /* 215 */ "in_op ::= IN",
1104 /* 216 */ "in_op ::= NOT IN",
1105 /* 217 */ "expr ::= expr in_op LP exprlist RP",
1106 /* 218 */ "expr ::= LP select RP",
1107 /* 219 */ "expr ::= expr in_op LP select RP",
1108 /* 220 */ "expr ::= expr in_op nm dbnm",
1109 /* 221 */ "expr ::= EXISTS LP select RP",
1110 /* 222 */ "expr ::= CASE case_operand case_exprlist case_else END",
1111 /* 223 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
1112 /* 224 */ "case_exprlist ::= WHEN expr THEN expr",
1113 /* 225 */ "case_else ::= ELSE expr",
1114 /* 226 */ "case_else ::=",
1115 /* 227 */ "case_operand ::= expr",
1116 /* 228 */ "case_operand ::=",
1117 /* 229 */ "exprlist ::= exprlist COMMA expritem",
1118 /* 230 */ "exprlist ::= expritem",
1119 /* 231 */ "expritem ::= expr",
1120 /* 232 */ "expritem ::=",
1121 /* 233 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
1122 /* 234 */ "uniqueflag ::= UNIQUE",
1123 /* 235 */ "uniqueflag ::=",
1124 /* 236 */ "idxlist_opt ::=",
1125 /* 237 */ "idxlist_opt ::= LP idxlist RP",
1126 /* 238 */ "idxlist ::= idxlist COMMA idxitem collate sortorder",
1127 /* 239 */ "idxlist ::= idxitem collate sortorder",
1128 /* 240 */ "idxitem ::= nm",
1129 /* 241 */ "collate ::=",
1130 /* 242 */ "collate ::= COLLATE id",
1131 /* 243 */ "cmd ::= DROP INDEX ifexists fullname",
1132 /* 244 */ "cmd ::= VACUUM",
1133 /* 245 */ "cmd ::= VACUUM nm",
1134 /* 246 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
1135 /* 247 */ "cmd ::= PRAGMA nm dbnm EQ ON",
1136 /* 248 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
1137 /* 249 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
1138 /* 250 */ "cmd ::= PRAGMA nm dbnm",
1139 /* 251 */ "nmnum ::= plus_num",
1140 /* 252 */ "nmnum ::= nm",
1141 /* 253 */ "plus_num ::= plus_opt number",
1142 /* 254 */ "minus_num ::= MINUS number",
1143 /* 255 */ "number ::= INTEGER|FLOAT",
1144 /* 256 */ "plus_opt ::= PLUS",
1145 /* 257 */ "plus_opt ::=",
1146 /* 258 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END",
1147 /* 259 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
1148 /* 260 */ "trigger_time ::= BEFORE",
1149 /* 261 */ "trigger_time ::= AFTER",
1150 /* 262 */ "trigger_time ::= INSTEAD OF",
1151 /* 263 */ "trigger_time ::=",
1152 /* 264 */ "trigger_event ::= DELETE|INSERT",
1153 /* 265 */ "trigger_event ::= UPDATE",
1154 /* 266 */ "trigger_event ::= UPDATE OF inscollist",
1155 /* 267 */ "foreach_clause ::=",
1156 /* 268 */ "foreach_clause ::= FOR EACH ROW",
1157 /* 269 */ "when_clause ::=",
1158 /* 270 */ "when_clause ::= WHEN expr",
1159 /* 271 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
1160 /* 272 */ "trigger_cmd_list ::=",
1161 /* 273 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt",
1162 /* 274 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP",
1163 /* 275 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select",
1164 /* 276 */ "trigger_cmd ::= DELETE FROM nm where_opt",
1165 /* 277 */ "trigger_cmd ::= select",
1166 /* 278 */ "expr ::= RAISE LP IGNORE RP",
1167 /* 279 */ "expr ::= RAISE LP raisetype COMMA nm RP",
1168 /* 280 */ "raisetype ::= ROLLBACK",
1169 /* 281 */ "raisetype ::= ABORT",
1170 /* 282 */ "raisetype ::= FAIL",
1171 /* 283 */ "cmd ::= DROP TRIGGER ifexists fullname",
1172 /* 284 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
1173 /* 285 */ "cmd ::= DETACH database_kw_opt expr",
1174 /* 286 */ "key_opt ::=",
1175 /* 287 */ "key_opt ::= KEY expr",
1176 /* 288 */ "database_kw_opt ::= DATABASE",
1177 /* 289 */ "database_kw_opt ::=",
1178 /* 290 */ "cmd ::= REINDEX",
1179 /* 291 */ "cmd ::= REINDEX nm dbnm",
1180 /* 292 */ "cmd ::= ANALYZE",
1181 /* 293 */ "cmd ::= ANALYZE nm dbnm",
1182 /* 294 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
1183 /* 295 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
1184 /* 296 */ "add_column_fullname ::= fullname",
1185 /* 297 */ "kwcolumn_opt ::=",
1186 /* 298 */ "kwcolumn_opt ::= COLUMNKW",
1187 /* 299 */ "cmd ::= create_vtab",
1188 /* 300 */ "cmd ::= create_vtab LP vtabarglist RP",
1189 /* 301 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm",
1190 /* 302 */ "vtabarglist ::= vtabarg",
1191 /* 303 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
1192 /* 304 */ "vtabarg ::=",
1193 /* 305 */ "vtabarg ::= vtabarg vtabargtoken",
1194 /* 306 */ "vtabargtoken ::= ANY",
1195 /* 307 */ "vtabargtoken ::= lp anylist RP",
1196 /* 308 */ "lp ::= LP",
1197 /* 309 */ "anylist ::=",
1198 /* 310 */ "anylist ::= anylist ANY",
1199};
1200#endif /* NDEBUG */
1201
1202
1203#if YYSTACKDEPTH<=0
1204/*
1205** Try to increase the size of the parser stack.
1206*/
1207static void yyGrowStack(yyParser *p){
1208 int newSize;
1209 yyStackEntry *pNew;
1210
1211 newSize = p->yystksz*2 + 100;
1212 pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1213 if( pNew ){
1214 p->yystack = pNew;
1215 p->yystksz = newSize;
1216#ifndef NDEBUG
1217 if( yyTraceFILE ){
1218 fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
1219 yyTracePrompt, p->yystksz);
1220 }
1221#endif
1222 }
1223}
1224#endif
1225
1226/*
1227** This function allocates a new parser.
1228** The only argument is a pointer to a function which works like
1229** malloc.
1230**
1231** Inputs:
1232** A pointer to the function used to allocate memory.
1233**
1234** Outputs:
1235** A pointer to a parser. This pointer is used in subsequent calls
1236** to sqlite3Parser and sqlite3ParserFree.
1237*/
1238void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
1239 yyParser *pParser;
1240 pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
1241 if( pParser ){
1242 pParser->yyidx = -1;
1243#if YYSTACKDEPTH<=0
1244 yyGrowStack(pParser);
1245#endif
1246 }
1247 return pParser;
1248}
1249
1250/* The following function deletes the value associated with a
1251** symbol. The symbol can be either a terminal or nonterminal.
1252** "yymajor" is the symbol code, and "yypminor" is a pointer to
1253** the value.
1254*/
1255static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
1256 switch( yymajor ){
1257 /* Here is inserted the actions which take place when a
1258 ** terminal or non-terminal is destroyed. This can happen
1259 ** when the symbol is popped from the stack during a
1260 ** reduce or during error processing or when a parser is
1261 ** being destroyed before it is finished parsing.
1262 **
1263 ** Note: during a reduce, the only symbols destroyed are those
1264 ** which appear on the RHS of the rule, but which are not used
1265 ** inside the C code.
1266 */
1267 case 155:
1268 case 189:
1269 case 206:
1270#line 374 "parse.y"
1271{sqlite3SelectDelete((yypminor->yy219));}
1272#line 1274 "parse.c"
1273 break;
1274 case 169:
1275 case 170:
1276 case 194:
1277 case 196:
1278 case 204:
1279 case 210:
1280 case 217:
1281 case 220:
1282 case 222:
1283 case 223:
1284 case 235:
1285#line 627 "parse.y"
1286{sqlite3ExprDelete((yypminor->yy172));}
1287#line 1289 "parse.c"
1288 break;
1289 case 174:
1290 case 182:
1291 case 192:
1292 case 195:
1293 case 197:
1294 case 199:
1295 case 209:
1296 case 211:
1297 case 212:
1298 case 215:
1299 case 221:
1300#line 876 "parse.y"
1301{sqlite3ExprListDelete((yypminor->yy174));}
1302#line 1304 "parse.c"
1303 break;
1304 case 188:
1305 case 193:
1306 case 201:
1307 case 202:
1308#line 489 "parse.y"
1309{sqlite3SrcListDelete((yypminor->yy373));}
1310#line 1312 "parse.c"
1311 break;
1312 case 205:
1313 case 208:
1314 case 214:
1315#line 506 "parse.y"
1316{sqlite3IdListDelete((yypminor->yy432));}
1317#line 1319 "parse.c"
1318 break;
1319 case 231:
1320 case 236:
1321#line 979 "parse.y"
1322{sqlite3DeleteTriggerStep((yypminor->yy243));}
1323#line 1325 "parse.c"
1324 break;
1325 case 233:
1326#line 965 "parse.y"
1327{sqlite3IdListDelete((yypminor->yy370).b);}
1328#line 1330 "parse.c"
1329 break;
1330 case 238:
1331#line 1052 "parse.y"
1332{sqlite3ExprDelete((yypminor->yy386));}
1333#line 1335 "parse.c"
1334 break;
1335 default: break; /* If no destructor action specified: do nothing */
1336 }
1337}
1338
1339/*
1340** Pop the parser's stack once.
1341**
1342** If there is a destructor routine associated with the token which
1343** is popped from the stack, then call it.
1344**
1345** Return the major token number for the symbol popped.
1346*/
1347static int yy_pop_parser_stack(yyParser *pParser){
1348 YYCODETYPE yymajor;
1349 yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
1350
1351 if( pParser->yyidx<0 ) return 0;
1352#ifndef NDEBUG
1353 if( yyTraceFILE && pParser->yyidx>=0 ){
1354 fprintf(yyTraceFILE,"%sPopping %s\n",
1355 yyTracePrompt,
1356 yyTokenName[yytos->major]);
1357 }
1358#endif
1359 yymajor = yytos->major;
1360 yy_destructor( yymajor, &yytos->minor);
1361 pParser->yyidx--;
1362 return yymajor;
1363}
1364
1365/*
1366** Deallocate and destroy a parser. Destructors are all called for
1367** all stack elements before shutting the parser down.
1368**
1369** Inputs:
1370** <ul>
1371** <li> A pointer to the parser. This should be a pointer
1372** obtained from sqlite3ParserAlloc.
1373** <li> A pointer to a function used to reclaim memory obtained
1374** from malloc.
1375** </ul>
1376*/
1377void sqlite3ParserFree(
1378 void *p, /* The parser to be deleted */
1379 void (*freeProc)(void*) /* Function used to reclaim memory */
1380){
1381 yyParser *pParser = (yyParser*)p;
1382 if( pParser==0 ) return;
1383 while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
1384#if YYSTACKDEPTH<=0
1385 free(pParser->yystack);
1386#endif
1387 (*freeProc)((void*)pParser);
1388}
1389
1390/*
1391** Find the appropriate action for a parser given the terminal
1392** look-ahead token iLookAhead.
1393**
1394** If the look-ahead token is YYNOCODE, then check to see if the action is
1395** independent of the look-ahead. If it is, return the action, otherwise
1396** return YY_NO_ACTION.
1397*/
1398static int yy_find_shift_action(
1399 yyParser *pParser, /* The parser */
1400 YYCODETYPE iLookAhead /* The look-ahead token */
1401){
1402 int i;
1403 int stateno = pParser->yystack[pParser->yyidx].stateno;
1404
1405 if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
1406 return yy_default[stateno];
1407 }
1408 if( iLookAhead==YYNOCODE ){
1409 return YY_NO_ACTION;
1410 }
1411 i += iLookAhead;
1412 if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
1413 if( iLookAhead>0 ){
1414#ifdef YYFALLBACK
1415 int iFallback; /* Fallback token */
1416 if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
1417 && (iFallback = yyFallback[iLookAhead])!=0 ){
1418#ifndef NDEBUG
1419 if( yyTraceFILE ){
1420 fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
1421 yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
1422 }
1423#endif
1424 return yy_find_shift_action(pParser, iFallback);
1425 }
1426#endif
1427#ifdef YYWILDCARD
1428 {
1429 int j = i - iLookAhead + YYWILDCARD;
1430 if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){
1431#ifndef NDEBUG
1432 if( yyTraceFILE ){
1433 fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
1434 yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
1435 }
1436#endif /* NDEBUG */
1437 return yy_action[j];
1438 }
1439 }
1440#endif /* YYWILDCARD */
1441 }
1442 return yy_default[stateno];
1443 }else{
1444 return yy_action[i];
1445 }
1446}
1447
1448/*
1449** Find the appropriate action for a parser given the non-terminal
1450** look-ahead token iLookAhead.
1451**
1452** If the look-ahead token is YYNOCODE, then check to see if the action is
1453** independent of the look-ahead. If it is, return the action, otherwise
1454** return YY_NO_ACTION.
1455*/
1456static int yy_find_reduce_action(
1457 int stateno, /* Current state number */
1458 YYCODETYPE iLookAhead /* The look-ahead token */
1459){
1460 int i;
1461 /* int stateno = pParser->yystack[pParser->yyidx].stateno; */
1462
1463 if( stateno>YY_REDUCE_MAX ||
1464 (i = yy_reduce_ofst[stateno])==YY_REDUCE_USE_DFLT ){
1465 return yy_default[stateno];
1466 }
1467 if( iLookAhead==YYNOCODE ){
1468 return YY_NO_ACTION;
1469 }
1470 i += iLookAhead;
1471 if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
1472 return yy_default[stateno];
1473 }else{
1474 return yy_action[i];
1475 }
1476}
1477
1478/*
1479** The following routine is called if the stack overflows.
1480*/
1481static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
1482 sqlite3ParserARG_FETCH;
1483 yypParser->yyidx--;
1484#ifndef NDEBUG
1485 if( yyTraceFILE ){
1486 fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
1487 }
1488#endif
1489 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
1490 /* Here code is inserted which will execute if the parser
1491 ** stack every overflows */
1492#line 44 "parse.y"
1493
1494 sqlite3ErrorMsg(pParse, "parser stack overflow");
1495 pParse->parseError = 1;
1496#line 1499 "parse.c"
1497 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
1498}
1499
1500/*
1501** Perform a shift action.
1502*/
1503static void yy_shift(
1504 yyParser *yypParser, /* The parser to be shifted */
1505 int yyNewState, /* The new state to shift in */
1506 int yyMajor, /* The major token to shift in */
1507 YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */
1508){
1509 yyStackEntry *yytos;
1510 yypParser->yyidx++;
1511#if YYSTACKDEPTH>0
1512 if( yypParser->yyidx>=YYSTACKDEPTH ){
1513 yyStackOverflow(yypParser, yypMinor);
1514 return;
1515 }
1516#else
1517 if( yypParser->yyidx>=yypParser->yystksz ){
1518 yyGrowStack(yypParser);
1519 if( yypParser->yyidx>=yypParser->yystksz ){
1520 yyStackOverflow(yypParser, yypMinor);
1521 return;
1522 }
1523 }
1524#endif
1525 yytos = &yypParser->yystack[yypParser->yyidx];
1526 yytos->stateno = yyNewState;
1527 yytos->major = yyMajor;
1528 yytos->minor = *yypMinor;
1529#ifndef NDEBUG
1530 if( yyTraceFILE && yypParser->yyidx>0 ){
1531 int i;
1532 fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
1533 fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
1534 for(i=1; i<=yypParser->yyidx; i++)
1535 fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
1536 fprintf(yyTraceFILE,"\n");
1537 }
1538#endif
1539}
1540
1541/* The following table contains information about every rule that
1542** is used during the reduce.
1543*/
1544static const struct {
1545 YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
1546 unsigned char nrhs; /* Number of right-hand side symbols in the rule */
1547} yyRuleInfo[] = {
1548 { 139, 1 },
1549 { 140, 2 },
1550 { 140, 1 },
1551 { 142, 1 },
1552 { 141, 1 },
1553 { 141, 3 },
1554 { 144, 0 },
1555 { 144, 1 },
1556 { 144, 3 },
1557 { 143, 3 },
1558 { 146, 0 },
1559 { 146, 1 },
1560 { 146, 2 },
1561 { 145, 0 },
1562 { 145, 1 },
1563 { 145, 1 },
1564 { 145, 1 },
1565 { 143, 2 },
1566 { 143, 2 },
1567 { 143, 2 },
1568 { 143, 2 },
1569 { 148, 6 },
1570 { 151, 0 },
1571 { 151, 3 },
1572 { 150, 1 },
1573 { 150, 0 },
1574 { 149, 4 },
1575 { 149, 2 },
1576 { 153, 3 },
1577 { 153, 1 },
1578 { 156, 3 },
1579 { 157, 1 },
1580 { 160, 1 },
1581 { 161, 1 },
1582 { 147, 1 },
1583 { 147, 1 },
1584 { 147, 1 },
1585 { 158, 0 },
1586 { 158, 1 },
1587 { 162, 1 },
1588 { 162, 4 },
1589 { 162, 6 },
1590 { 163, 1 },
1591 { 163, 2 },
1592 { 164, 1 },
1593 { 164, 1 },
1594 { 159, 2 },
1595 { 159, 0 },
1596 { 167, 3 },
1597 { 167, 1 },
1598 { 168, 2 },
1599 { 168, 4 },
1600 { 168, 3 },
1601 { 168, 3 },
1602 { 168, 2 },
1603 { 168, 2 },
1604 { 168, 3 },
1605 { 168, 5 },
1606 { 168, 2 },
1607 { 168, 4 },
1608 { 168, 4 },
1609 { 168, 1 },
1610 { 168, 2 },
1611 { 173, 0 },
1612 { 173, 1 },
1613 { 175, 0 },
1614 { 175, 2 },
1615 { 177, 2 },
1616 { 177, 3 },
1617 { 177, 3 },
1618 { 177, 3 },
1619 { 178, 2 },
1620 { 178, 2 },
1621 { 178, 1 },
1622 { 178, 1 },
1623 { 176, 3 },
1624 { 176, 2 },
1625 { 179, 0 },
1626 { 179, 2 },
1627 { 179, 2 },
1628 { 154, 0 },
1629 { 154, 2 },
1630 { 180, 3 },
1631 { 180, 2 },
1632 { 180, 1 },
1633 { 181, 2 },
1634 { 181, 7 },
1635 { 181, 5 },
1636 { 181, 5 },
1637 { 181, 10 },
1638 { 183, 0 },
1639 { 183, 1 },
1640 { 171, 0 },
1641 { 171, 3 },
1642 { 184, 0 },
1643 { 184, 2 },
1644 { 185, 1 },
1645 { 185, 1 },
1646 { 185, 1 },
1647 { 143, 4 },
1648 { 187, 2 },
1649 { 187, 0 },
1650 { 143, 8 },
1651 { 143, 4 },
1652 { 143, 1 },
1653 { 155, 1 },
1654 { 155, 3 },
1655 { 190, 1 },
1656 { 190, 2 },
1657 { 190, 1 },
1658 { 189, 9 },
1659 { 191, 1 },
1660 { 191, 1 },
1661 { 191, 0 },
1662 { 199, 2 },
1663 { 199, 0 },
1664 { 192, 3 },
1665 { 192, 2 },
1666 { 192, 4 },
1667 { 200, 2 },
1668 { 200, 1 },
1669 { 200, 0 },
1670 { 193, 0 },
1671 { 193, 2 },
1672 { 202, 2 },
1673 { 202, 0 },
1674 { 201, 6 },
1675 { 201, 7 },
1676 { 206, 1 },
1677 { 206, 1 },
1678 { 152, 0 },
1679 { 152, 2 },
1680 { 188, 2 },
1681 { 203, 1 },
1682 { 203, 2 },
1683 { 203, 3 },
1684 { 203, 4 },
1685 { 204, 2 },
1686 { 204, 0 },
1687 { 205, 4 },
1688 { 205, 0 },
1689 { 197, 0 },
1690 { 197, 3 },
1691 { 209, 4 },
1692 { 209, 2 },
1693 { 210, 1 },
1694 { 172, 1 },
1695 { 172, 1 },
1696 { 172, 0 },
1697 { 195, 0 },
1698 { 195, 3 },
1699 { 196, 0 },
1700 { 196, 2 },
1701 { 198, 0 },
1702 { 198, 2 },
1703 { 198, 4 },
1704 { 198, 4 },
1705 { 143, 4 },
1706 { 194, 0 },
1707 { 194, 2 },
1708 { 143, 6 },
1709 { 212, 5 },
1710 { 212, 3 },
1711 { 143, 8 },
1712 { 143, 5 },
1713 { 143, 6 },
1714 { 213, 2 },
1715 { 213, 1 },
1716 { 215, 3 },
1717 { 215, 1 },
1718 { 214, 0 },
1719 { 214, 3 },
1720 { 208, 3 },
1721 { 208, 1 },
1722 { 170, 1 },
1723 { 170, 3 },
1724 { 169, 1 },
1725 { 170, 1 },
1726 { 170, 1 },
1727 { 170, 3 },
1728 { 170, 5 },
1729 { 169, 1 },
1730 { 169, 1 },
1731 { 170, 1 },
1732 { 170, 1 },
1733 { 170, 3 },
1734 { 170, 6 },
1735 { 170, 5 },
1736 { 170, 4 },
1737 { 169, 1 },
1738 { 170, 3 },
1739 { 170, 3 },
1740 { 170, 3 },
1741 { 170, 3 },
1742 { 170, 3 },
1743 { 170, 3 },
1744 { 170, 3 },
1745 { 170, 3 },
1746 { 216, 1 },
1747 { 216, 2 },
1748 { 216, 1 },
1749 { 216, 2 },
1750 { 217, 2 },
1751 { 217, 0 },
1752 { 170, 4 },
1753 { 170, 2 },
1754 { 170, 3 },
1755 { 170, 3 },
1756 { 170, 4 },
1757 { 170, 2 },
1758 { 170, 2 },
1759 { 170, 2 },
1760 { 218, 1 },
1761 { 218, 2 },
1762 { 170, 5 },
1763 { 219, 1 },
1764 { 219, 2 },
1765 { 170, 5 },
1766 { 170, 3 },
1767 { 170, 5 },
1768 { 170, 4 },
1769 { 170, 4 },
1770 { 170, 5 },
1771 { 221, 5 },
1772 { 221, 4 },
1773 { 222, 2 },
1774 { 222, 0 },
1775 { 220, 1 },
1776 { 220, 0 },
1777 { 211, 3 },
1778 { 211, 1 },
1779 { 223, 1 },
1780 { 223, 0 },
1781 { 143, 11 },
1782 { 224, 1 },
1783 { 224, 0 },
1784 { 174, 0 },
1785 { 174, 3 },
1786 { 182, 5 },
1787 { 182, 3 },
1788 { 225, 1 },
1789 { 226, 0 },
1790 { 226, 2 },
1791 { 143, 4 },
1792 { 143, 1 },
1793 { 143, 2 },
1794 { 143, 5 },
1795 { 143, 5 },
1796 { 143, 5 },
1797 { 143, 6 },
1798 { 143, 3 },
1799 { 227, 1 },
1800 { 227, 1 },
1801 { 165, 2 },
1802 { 166, 2 },
1803 { 229, 1 },
1804 { 228, 1 },
1805 { 228, 0 },
1806 { 143, 5 },
1807 { 230, 11 },
1808 { 232, 1 },
1809 { 232, 1 },
1810 { 232, 2 },
1811 { 232, 0 },
1812 { 233, 1 },
1813 { 233, 1 },
1814 { 233, 3 },
1815 { 234, 0 },
1816 { 234, 3 },
1817 { 235, 0 },
1818 { 235, 2 },
1819 { 231, 3 },
1820 { 231, 0 },
1821 { 236, 6 },
1822 { 236, 8 },
1823 { 236, 5 },
1824 { 236, 4 },
1825 { 236, 1 },
1826 { 170, 4 },
1827 { 170, 6 },
1828 { 186, 1 },
1829 { 186, 1 },
1830 { 186, 1 },
1831 { 143, 4 },
1832 { 143, 6 },
1833 { 143, 3 },
1834 { 238, 0 },
1835 { 238, 2 },
1836 { 237, 1 },
1837 { 237, 0 },
1838 { 143, 1 },
1839 { 143, 3 },
1840 { 143, 1 },
1841 { 143, 3 },
1842 { 143, 6 },
1843 { 143, 6 },
1844 { 239, 1 },
1845 { 240, 0 },
1846 { 240, 1 },
1847 { 143, 1 },
1848 { 143, 4 },
1849 { 241, 7 },
1850 { 242, 1 },
1851 { 242, 3 },
1852 { 243, 0 },
1853 { 243, 2 },
1854 { 244, 1 },
1855 { 244, 3 },
1856 { 245, 1 },
1857 { 246, 0 },
1858 { 246, 2 },
1859};
1860
1861static void yy_accept(yyParser*); /* Forward Declaration */
1862
1863/*
1864** Perform a reduce action and the shift that must immediately
1865** follow the reduce.
1866*/
1867static void yy_reduce(
1868 yyParser *yypParser, /* The parser */
1869 int yyruleno /* Number of the rule by which to reduce */
1870){
1871 int yygoto; /* The next state */
1872 int yyact; /* The next action */
1873 YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
1874 yyStackEntry *yymsp; /* The top of the parser's stack */
1875 int yysize; /* Amount to pop the stack */
1876 sqlite3ParserARG_FETCH;
1877 yymsp = &yypParser->yystack[yypParser->yyidx];
1878#ifndef NDEBUG
1879 if( yyTraceFILE && yyruleno>=0
1880 && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
1881 fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
1882 yyRuleName[yyruleno]);
1883 }
1884#endif /* NDEBUG */
1885
1886 /* Silence complaints from purify about yygotominor being uninitialized
1887 ** in some cases when it is copied into the stack after the following
1888 ** switch. yygotominor is uninitialized when a rule reduces that does
1889 ** not set the value of its left-hand side nonterminal. Leaving the
1890 ** value of the nonterminal uninitialized is utterly harmless as long
1891 ** as the value is never used. So really the only thing this code
1892 ** accomplishes is to quieten purify.
1893 **
1894 ** 2007-01-16: The wireshark project (www.wireshark.org) reports that
1895 ** without this code, their parser segfaults. I'm not sure what there
1896 ** parser is doing to make this happen. This is the second bug report
1897 ** from wireshark this week. Clearly they are stressing Lemon in ways
1898 ** that it has not been previously stressed... (SQLite ticket #2172)
1899 */
1900 memset(&yygotominor, 0, sizeof(yygotominor));
1901
1902
1903 switch( yyruleno ){
1904 /* Beginning here are the reduction cases. A typical example
1905 ** follows:
1906 ** case 0:
1907 ** #line <lineno> <grammarfile>
1908 ** { ... } // User supplied code
1909 ** #line <lineno> <thisfile>
1910 ** break;
1911 */
1912 case 0:
1913 case 1:
1914 case 2:
1915 case 4:
1916 case 5:
1917 case 10:
1918 case 11:
1919 case 12:
1920 case 20:
1921 case 28:
1922 case 29:
1923 case 37:
1924 case 44:
1925 case 45:
1926 case 46:
1927 case 47:
1928 case 48:
1929 case 49:
1930 case 55:
1931 case 82:
1932 case 83:
1933 case 84:
1934 case 85:
1935 case 256:
1936 case 257:
1937 case 267:
1938 case 268:
1939 case 288:
1940 case 289:
1941 case 297:
1942 case 298:
1943 case 302:
1944 case 303:
1945 case 305:
1946 case 309:
1947#line 97 "parse.y"
1948{
1949}
1950#line 1953 "parse.c"
1951 break;
1952 case 3:
1953#line 100 "parse.y"
1954{ sqlite3FinishCoding(pParse); }
1955#line 1958 "parse.c"
1956 break;
1957 case 6:
1958#line 103 "parse.y"
1959{ sqlite3BeginParse(pParse, 0); }
1960#line 1963 "parse.c"
1961 break;
1962 case 7:
1963#line 105 "parse.y"
1964{ sqlite3BeginParse(pParse, 1); }
1965#line 1968 "parse.c"
1966 break;
1967 case 8:
1968#line 106 "parse.y"
1969{ sqlite3BeginParse(pParse, 2); }
1970#line 1973 "parse.c"
1971 break;
1972 case 9:
1973#line 112 "parse.y"
1974{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy46);}
1975#line 1978 "parse.c"
1976 break;
1977 case 13:
1978#line 117 "parse.y"
1979{yygotominor.yy46 = TK_DEFERRED;}
1980#line 1983 "parse.c"
1981 break;
1982 case 14:
1983 case 15:
1984 case 16:
1985 case 107:
1986 case 109:
1987#line 118 "parse.y"
1988{yygotominor.yy46 = yymsp[0].major;}
1989#line 1992 "parse.c"
1990 break;
1991 case 17:
1992 case 18:
1993#line 121 "parse.y"
1994{sqlite3CommitTransaction(pParse);}
1995#line 1998 "parse.c"
1996 break;
1997 case 19:
1998#line 123 "parse.y"
1999{sqlite3RollbackTransaction(pParse);}
2000#line 2003 "parse.c"
2001 break;
2002 case 21:
2003#line 128 "parse.y"
2004{
2005 sqlite3StartTable(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410,yymsp[-4].minor.yy46,0,0,yymsp[-2].minor.yy46);
2006}
2007#line 2010 "parse.c"
2008 break;
2009 case 22:
2010 case 25:
2011 case 63:
2012 case 77:
2013 case 79:
2014 case 90:
2015 case 101:
2016 case 112:
2017 case 113:
2018 case 212:
2019 case 215:
2020#line 132 "parse.y"
2021{yygotominor.yy46 = 0;}
2022#line 2025 "parse.c"
2023 break;
2024 case 23:
2025 case 24:
2026 case 64:
2027 case 78:
2028 case 100:
2029 case 111:
2030 case 213:
2031 case 216:
2032#line 133 "parse.y"
2033{yygotominor.yy46 = 1;}
2034#line 2037 "parse.c"
2035 break;
2036 case 26:
2037#line 139 "parse.y"
2038{
2039 sqlite3EndTable(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy0,0);
2040}
2041#line 2044 "parse.c"
2042 break;
2043 case 27:
2044#line 142 "parse.y"
2045{
2046 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy219);
2047 sqlite3SelectDelete(yymsp[0].minor.yy219);
2048}
2049#line 2052 "parse.c"
2050 break;
2051 case 30:
2052#line 154 "parse.y"
2053{
2054 yygotominor.yy410.z = yymsp[-2].minor.yy410.z;
2055 yygotominor.yy410.n = (pParse->sLastToken.z-yymsp[-2].minor.yy410.z) + pParse->sLastToken.n;
2056}
2057#line 2060 "parse.c"
2058 break;
2059 case 31:
2060#line 158 "parse.y"
2061{
2062 sqlite3AddColumn(pParse,&yymsp[0].minor.yy410);
2063 yygotominor.yy410 = yymsp[0].minor.yy410;
2064}
2065#line 2068 "parse.c"
2066 break;
2067 case 32:
2068 case 33:
2069 case 34:
2070 case 35:
2071 case 36:
2072 case 255:
2073#line 168 "parse.y"
2074{yygotominor.yy410 = yymsp[0].minor.yy0;}
2075#line 2078 "parse.c"
2076 break;
2077 case 38:
2078#line 229 "parse.y"
2079{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy410);}
2080#line 2083 "parse.c"
2081 break;
2082 case 39:
2083 case 42:
2084 case 119:
2085 case 120:
2086 case 131:
2087 case 240:
2088 case 242:
2089 case 251:
2090 case 252:
2091 case 253:
2092 case 254:
2093#line 230 "parse.y"
2094{yygotominor.yy410 = yymsp[0].minor.yy410;}
2095#line 2098 "parse.c"
2096 break;
2097 case 40:
2098#line 231 "parse.y"
2099{
2100 yygotominor.yy410.z = yymsp[-3].minor.yy410.z;
2101 yygotominor.yy410.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy410.z;
2102}
2103#line 2106 "parse.c"
2104 break;
2105 case 41:
2106#line 235 "parse.y"
2107{
2108 yygotominor.yy410.z = yymsp[-5].minor.yy410.z;
2109 yygotominor.yy410.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy410.z;
2110}
2111#line 2114 "parse.c"
2112 break;
2113 case 43:
2114#line 241 "parse.y"
2115{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);}
2116#line 2119 "parse.c"
2117 break;
2118 case 50:
2119 case 52:
2120#line 252 "parse.y"
2121{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy172);}
2122#line 2125 "parse.c"
2123 break;
2124 case 51:
2125#line 253 "parse.y"
2126{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy172);}
2127#line 2130 "parse.c"
2128 break;
2129 case 53:
2130#line 255 "parse.y"
2131{
2132 Expr *p = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy172, 0, 0);
2133 sqlite3AddDefaultValue(pParse,p);
2134}
2135#line 2138 "parse.c"
2136 break;
2137 case 54:
2138#line 259 "parse.y"
2139{
2140 Expr *p = sqlite3Expr(TK_STRING, 0, 0, &yymsp[0].minor.yy410);
2141 sqlite3AddDefaultValue(pParse,p);
2142}
2143#line 2146 "parse.c"
2144 break;
2145 case 56:
2146#line 268 "parse.y"
2147{sqlite3AddNotNull(pParse, yymsp[0].minor.yy46);}
2148#line 2151 "parse.c"
2149 break;
2150 case 57:
2151#line 270 "parse.y"
2152{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy46,yymsp[0].minor.yy46,yymsp[-2].minor.yy46);}
2153#line 2156 "parse.c"
2154 break;
2155 case 58:
2156#line 271 "parse.y"
2157{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy46,0,0,0,0);}
2158#line 2161 "parse.c"
2159 break;
2160 case 59:
2161#line 272 "parse.y"
2162{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy172);}
2163#line 2166 "parse.c"
2164 break;
2165 case 60:
2166#line 274 "parse.y"
2167{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy410,yymsp[-1].minor.yy174,yymsp[0].minor.yy46);}
2168#line 2171 "parse.c"
2169 break;
2170 case 61:
2171#line 275 "parse.y"
2172{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy46);}
2173#line 2176 "parse.c"
2174 break;
2175 case 62:
2176#line 276 "parse.y"
2177{sqlite3AddCollateType(pParse, (char*)yymsp[0].minor.yy410.z, yymsp[0].minor.yy410.n);}
2178#line 2181 "parse.c"
2179 break;
2180 case 65:
2181#line 289 "parse.y"
2182{ yygotominor.yy46 = OE_Restrict * 0x010101; }
2183#line 2186 "parse.c"
2184 break;
2185 case 66:
2186#line 290 "parse.y"
2187{ yygotominor.yy46 = (yymsp[-1].minor.yy46 & yymsp[0].minor.yy405.mask) | yymsp[0].minor.yy405.value; }
2188#line 2191 "parse.c"
2189 break;
2190 case 67:
2191#line 292 "parse.y"
2192{ yygotominor.yy405.value = 0; yygotominor.yy405.mask = 0x000000; }
2193#line 2196 "parse.c"
2194 break;
2195 case 68:
2196#line 293 "parse.y"
2197{ yygotominor.yy405.value = yymsp[0].minor.yy46; yygotominor.yy405.mask = 0x0000ff; }
2198#line 2201 "parse.c"
2199 break;
2200 case 69:
2201#line 294 "parse.y"
2202{ yygotominor.yy405.value = yymsp[0].minor.yy46<<8; yygotominor.yy405.mask = 0x00ff00; }
2203#line 2206 "parse.c"
2204 break;
2205 case 70:
2206#line 295 "parse.y"
2207{ yygotominor.yy405.value = yymsp[0].minor.yy46<<16; yygotominor.yy405.mask = 0xff0000; }
2208#line 2211 "parse.c"
2209 break;
2210 case 71:
2211#line 297 "parse.y"
2212{ yygotominor.yy46 = OE_SetNull; }
2213#line 2216 "parse.c"
2214 break;
2215 case 72:
2216#line 298 "parse.y"
2217{ yygotominor.yy46 = OE_SetDflt; }
2218#line 2221 "parse.c"
2219 break;
2220 case 73:
2221#line 299 "parse.y"
2222{ yygotominor.yy46 = OE_Cascade; }
2223#line 2226 "parse.c"
2224 break;
2225 case 74:
2226#line 300 "parse.y"
2227{ yygotominor.yy46 = OE_Restrict; }
2228#line 2231 "parse.c"
2229 break;
2230 case 75:
2231 case 76:
2232 case 91:
2233 case 93:
2234 case 95:
2235 case 96:
2236 case 166:
2237#line 302 "parse.y"
2238{yygotominor.yy46 = yymsp[0].minor.yy46;}
2239#line 2242 "parse.c"
2240 break;
2241 case 80:
2242#line 312 "parse.y"
2243{yygotominor.yy410.n = 0; yygotominor.yy410.z = 0;}
2244#line 2247 "parse.c"
2245 break;
2246 case 81:
2247#line 313 "parse.y"
2248{yygotominor.yy410 = yymsp[-1].minor.yy0;}
2249#line 2252 "parse.c"
2250 break;
2251 case 86:
2252#line 319 "parse.y"
2253{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy174,yymsp[0].minor.yy46,yymsp[-2].minor.yy46,0);}
2254#line 2257 "parse.c"
2255 break;
2256 case 87:
2257#line 321 "parse.y"
2258{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy174,yymsp[0].minor.yy46,0,0,0,0);}
2259#line 2262 "parse.c"
2260 break;
2261 case 88:
2262#line 322 "parse.y"
2263{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy172);}
2264#line 2267 "parse.c"
2265 break;
2266 case 89:
2267#line 324 "parse.y"
2268{
2269 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy174, &yymsp[-3].minor.yy410, yymsp[-2].minor.yy174, yymsp[-1].minor.yy46);
2270 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy46);
2271}
2272#line 2275 "parse.c"
2273 break;
2274 case 92:
2275 case 94:
2276#line 338 "parse.y"
2277{yygotominor.yy46 = OE_Default;}
2278#line 2281 "parse.c"
2279 break;
2280 case 97:
2281#line 343 "parse.y"
2282{yygotominor.yy46 = OE_Ignore;}
2283#line 2286 "parse.c"
2284 break;
2285 case 98:
2286 case 167:
2287#line 344 "parse.y"
2288{yygotominor.yy46 = OE_Replace;}
2289#line 2292 "parse.c"
2290 break;
2291 case 99:
2292#line 348 "parse.y"
2293{
2294 sqlite3DropTable(pParse, yymsp[0].minor.yy373, 0, yymsp[-1].minor.yy46);
2295}
2296#line 2299 "parse.c"
2297 break;
2298 case 102:
2299#line 358 "parse.y"
2300{
2301 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}
2303#line 2306 "parse.c"
2304 break;
2305 case 103:
2306#line 361 "parse.y"
2307{
2308 sqlite3DropTable(pParse, yymsp[0].minor.yy373, 1, yymsp[-1].minor.yy46);
2309}
2310#line 2313 "parse.c"
2311 break;
2312 case 104:
2313#line 368 "parse.y"
2314{
2315 sqlite3Select(pParse, yymsp[0].minor.yy219, SRT_Callback, 0, 0, 0, 0, 0);
2316 sqlite3SelectDelete(yymsp[0].minor.yy219);
2317}
2318#line 2321 "parse.c"
2319 break;
2320 case 105:
2321 case 128:
2322#line 378 "parse.y"
2323{yygotominor.yy219 = yymsp[0].minor.yy219;}
2324#line 2327 "parse.c"
2325 break;
2326 case 106:
2327#line 380 "parse.y"
2328{
2329 if( yymsp[0].minor.yy219 ){
2330 yymsp[0].minor.yy219->op = yymsp[-1].minor.yy46;
2331 yymsp[0].minor.yy219->pPrior = yymsp[-2].minor.yy219;
2332 }else{
2333 sqlite3SelectDelete(yymsp[-2].minor.yy219);
2334 }
2335 yygotominor.yy219 = yymsp[0].minor.yy219;
2336}
2337#line 2340 "parse.c"
2338 break;
2339 case 108:
2340#line 391 "parse.y"
2341{yygotominor.yy46 = TK_ALL;}
2342#line 2345 "parse.c"
2343 break;
2344 case 110:
2345#line 395 "parse.y"
2346{
2347 yygotominor.yy219 = sqlite3SelectNew(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}
2349#line 2352 "parse.c"
2350 break;
2351 case 114:
2352 case 237:
2353#line 416 "parse.y"
2354{yygotominor.yy174 = yymsp[-1].minor.yy174;}
2355#line 2358 "parse.c"
2356 break;
2357 case 115:
2358 case 141:
2359 case 149:
2360 case 236:
2361#line 417 "parse.y"
2362{yygotominor.yy174 = 0;}
2363#line 2366 "parse.c"
2364 break;
2365 case 116:
2366#line 418 "parse.y"
2367{
2368 yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-2].minor.yy174,yymsp[-1].minor.yy172,yymsp[0].minor.yy410.n?&yymsp[0].minor.yy410:0);
2369}
2370#line 2373 "parse.c"
2371 break;
2372 case 117:
2373#line 421 "parse.y"
2374{
2375 yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-1].minor.yy174, sqlite3Expr(TK_ALL, 0, 0, 0), 0);
2376}
2377#line 2380 "parse.c"
2378 break;
2379 case 118:
2380#line 424 "parse.y"
2381{
2382 Expr *pRight = sqlite3Expr(TK_ALL, 0, 0, 0);
2383 Expr *pLeft = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy410);
2384 yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-3].minor.yy174, sqlite3Expr(TK_DOT, pLeft, pRight, 0), 0);
2385}
2386#line 2389 "parse.c"
2387 break;
2388 case 121:
2389#line 436 "parse.y"
2390{yygotominor.yy410.n = 0;}
2391#line 2394 "parse.c"
2392 break;
2393 case 122:
2394#line 448 "parse.y"
2395{yygotominor.yy373 = sqliteMalloc(sizeof(*yygotominor.yy373));}
2396#line 2399 "parse.c"
2397 break;
2398 case 123:
2399#line 449 "parse.y"
2400{
2401 yygotominor.yy373 = yymsp[0].minor.yy373;
2402 sqlite3SrcListShiftJoinType(yygotominor.yy373);
2403}
2404#line 2407 "parse.c"
2405 break;
2406 case 124:
2407#line 457 "parse.y"
2408{
2409 yygotominor.yy373 = yymsp[-1].minor.yy373;
2410 if( yygotominor.yy373 && yygotominor.yy373->nSrc>0 ) yygotominor.yy373->a[yygotominor.yy373->nSrc-1].jointype = yymsp[0].minor.yy46;
2411}
2412#line 2415 "parse.c"
2413 break;
2414 case 125:
2415#line 461 "parse.y"
2416{yygotominor.yy373 = 0;}
2417#line 2420 "parse.c"
2418 break;
2419 case 126:
2420#line 462 "parse.y"
2421{
2422 yygotominor.yy373 = sqlite3SrcListAppendFromTerm(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);
2423}
2424#line 2427 "parse.c"
2425 break;
2426 case 127:
2427#line 467 "parse.y"
2428{
2429 yygotominor.yy373 = sqlite3SrcListAppendFromTerm(yymsp[-6].minor.yy373,0,0,&yymsp[-2].minor.yy410,yymsp[-4].minor.yy219,yymsp[-1].minor.yy172,yymsp[0].minor.yy432);
2430 }
2431#line 2434 "parse.c"
2432 break;
2433 case 129:
2434#line 478 "parse.y"
2435{
2436 sqlite3SrcListShiftJoinType(yymsp[0].minor.yy373);
2437 yygotominor.yy219 = sqlite3SelectNew(0,yymsp[0].minor.yy373,0,0,0,0,0,0,0);
2438 }
2439#line 2442 "parse.c"
2440 break;
2441 case 130:
2442#line 485 "parse.y"
2443{yygotominor.yy410.z=0; yygotominor.yy410.n=0;}
2444#line 2447 "parse.c"
2445 break;
2446 case 132:
2447#line 490 "parse.y"
2448{yygotominor.yy373 = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410);}
2449#line 2452 "parse.c"
2450 break;
2451 case 133:
2452#line 494 "parse.y"
2453{ yygotominor.yy46 = JT_INNER; }
2454#line 2457 "parse.c"
2455 break;
2456 case 134:
2457#line 495 "parse.y"
2458{ yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
2459#line 2462 "parse.c"
2460 break;
2461 case 135:
2462#line 496 "parse.y"
2463{ yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy410,0); }
2464#line 2467 "parse.c"
2465 break;
2466 case 136:
2467#line 498 "parse.y"
2468{ yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy410,&yymsp[-1].minor.yy410); }
2469#line 2472 "parse.c"
2470 break;
2471 case 137:
2472 case 145:
2473 case 152:
2474 case 159:
2475 case 174:
2476 case 202:
2477 case 225:
2478 case 227:
2479 case 231:
2480#line 502 "parse.y"
2481{yygotominor.yy172 = yymsp[0].minor.yy172;}
2482#line 2485 "parse.c"
2483 break;
2484 case 138:
2485 case 151:
2486 case 158:
2487 case 203:
2488 case 226:
2489 case 228:
2490 case 232:
2491#line 503 "parse.y"
2492{yygotominor.yy172 = 0;}
2493#line 2496 "parse.c"
2494 break;
2495 case 139:
2496 case 171:
2497#line 507 "parse.y"
2498{yygotominor.yy432 = yymsp[-1].minor.yy432;}
2499#line 2502 "parse.c"
2500 break;
2501 case 140:
2502 case 170:
2503#line 508 "parse.y"
2504{yygotominor.yy432 = 0;}
2505#line 2508 "parse.c"
2506 break;
2507 case 142:
2508 case 150:
2509#line 519 "parse.y"
2510{yygotominor.yy174 = yymsp[0].minor.yy174;}
2511#line 2514 "parse.c"
2512 break;
2513 case 143:
2514#line 520 "parse.y"
2515{
2516 yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-3].minor.yy174,yymsp[-1].minor.yy172,0);
2517 if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
2518}
2519#line 2522 "parse.c"
2520 break;
2521 case 144:
2522#line 524 "parse.y"
2523{
2524 yygotominor.yy174 = sqlite3ExprListAppend(0,yymsp[-1].minor.yy172,0);
2525 if( yygotominor.yy174 && yygotominor.yy174->a ) yygotominor.yy174->a[0].sortOrder = yymsp[0].minor.yy46;
2526}
2527#line 2530 "parse.c"
2528 break;
2529 case 146:
2530 case 148:
2531#line 532 "parse.y"
2532{yygotominor.yy46 = SQLITE_SO_ASC;}
2533#line 2536 "parse.c"
2534 break;
2535 case 147:
2536#line 533 "parse.y"
2537{yygotominor.yy46 = SQLITE_SO_DESC;}
2538#line 2541 "parse.c"
2539 break;
2540 case 153:
2541#line 559 "parse.y"
2542{yygotominor.yy234.pLimit = 0; yygotominor.yy234.pOffset = 0;}
2543#line 2546 "parse.c"
2544 break;
2545 case 154:
2546#line 560 "parse.y"
2547{yygotominor.yy234.pLimit = yymsp[0].minor.yy172; yygotominor.yy234.pOffset = 0;}
2548#line 2551 "parse.c"
2549 break;
2550 case 155:
2551#line 562 "parse.y"
2552{yygotominor.yy234.pLimit = yymsp[-2].minor.yy172; yygotominor.yy234.pOffset = yymsp[0].minor.yy172;}
2553#line 2556 "parse.c"
2554 break;
2555 case 156:
2556#line 564 "parse.y"
2557{yygotominor.yy234.pOffset = yymsp[-2].minor.yy172; yygotominor.yy234.pLimit = yymsp[0].minor.yy172;}
2558#line 2561 "parse.c"
2559 break;
2560 case 157:
2561#line 568 "parse.y"
2562{sqlite3DeleteFrom(pParse,yymsp[-1].minor.yy373,yymsp[0].minor.yy172);}
2563#line 2566 "parse.c"
2564 break;
2565 case 160:
2566#line 578 "parse.y"
2567{
2568 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy174,SQLITE_MAX_COLUMN,"set list");
2569 sqlite3Update(pParse,yymsp[-3].minor.yy373,yymsp[-1].minor.yy174,yymsp[0].minor.yy172,yymsp[-4].minor.yy46);
2570}
2571#line 2574 "parse.c"
2572 break;
2573 case 161:
2574#line 587 "parse.y"
2575{yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-4].minor.yy174,yymsp[0].minor.yy172,&yymsp[-2].minor.yy410);}
2576#line 2579 "parse.c"
2577 break;
2578 case 162:
2579#line 588 "parse.y"
2580{yygotominor.yy174 = sqlite3ExprListAppend(0,yymsp[0].minor.yy172,&yymsp[-2].minor.yy410);}
2581#line 2584 "parse.c"
2582 break;
2583 case 163:
2584#line 594 "parse.y"
2585{sqlite3Insert(pParse, yymsp[-5].minor.yy373, yymsp[-1].minor.yy174, 0, yymsp[-4].minor.yy432, yymsp[-7].minor.yy46);}
2586#line 2589 "parse.c"
2587 break;
2588 case 164:
2589#line 596 "parse.y"
2590{sqlite3Insert(pParse, yymsp[-2].minor.yy373, 0, yymsp[0].minor.yy219, yymsp[-1].minor.yy432, yymsp[-4].minor.yy46);}
2591#line 2594 "parse.c"
2592 break;
2593 case 165:
2594#line 598 "parse.y"
2595{sqlite3Insert(pParse, yymsp[-3].minor.yy373, 0, 0, yymsp[-2].minor.yy432, yymsp[-5].minor.yy46);}
2596#line 2599 "parse.c"
2597 break;
2598 case 168:
2599 case 229:
2600#line 608 "parse.y"
2601{yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-2].minor.yy174,yymsp[0].minor.yy172,0);}
2602#line 2605 "parse.c"
2603 break;
2604 case 169:
2605 case 230:
2606#line 609 "parse.y"
2607{yygotominor.yy174 = sqlite3ExprListAppend(0,yymsp[0].minor.yy172,0);}
2608#line 2611 "parse.c"
2609 break;
2610 case 172:
2611#line 618 "parse.y"
2612{yygotominor.yy432 = sqlite3IdListAppend(yymsp[-2].minor.yy432,&yymsp[0].minor.yy410);}
2613#line 2616 "parse.c"
2614 break;
2615 case 173:
2616#line 619 "parse.y"
2617{yygotominor.yy432 = sqlite3IdListAppend(0,&yymsp[0].minor.yy410);}
2618#line 2621 "parse.c"
2619 break;
2620 case 175:
2621#line 630 "parse.y"
2622{yygotominor.yy172 = yymsp[-1].minor.yy172; sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); }
2623#line 2626 "parse.c"
2624 break;
2625 case 176:
2626 case 181:
2627 case 182:
2628#line 631 "parse.y"
2629{yygotominor.yy172 = sqlite3Expr(yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);}
2630#line 2633 "parse.c"
2631 break;
2632 case 177:
2633 case 178:
2634#line 632 "parse.y"
2635{yygotominor.yy172 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy0);}
2636#line 2639 "parse.c"
2637 break;
2638 case 179:
2639#line 634 "parse.y"
2640{
2641 Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy410);
2642 Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy410);
2643 yygotominor.yy172 = sqlite3Expr(TK_DOT, temp1, temp2, 0);
2644}
2645#line 2648 "parse.c"
2646 break;
2647 case 180:
2648#line 639 "parse.y"
2649{
2650 Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-4].minor.yy410);
2651 Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy410);
2652 Expr *temp3 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy410);
2653 Expr *temp4 = sqlite3Expr(TK_DOT, temp2, temp3, 0);
2654 yygotominor.yy172 = sqlite3Expr(TK_DOT, temp1, temp4, 0);
2655}
2656#line 2659 "parse.c"
2657 break;
2658 case 183:
2659#line 648 "parse.y"
2660{yygotominor.yy172 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);}
2661#line 2664 "parse.c"
2662 break;
2663 case 184:
2664#line 649 "parse.y"
2665{
2666 Token *pToken = &yymsp[0].minor.yy0;
2667 Expr *pExpr = yygotominor.yy172 = sqlite3Expr(TK_VARIABLE, 0, 0, pToken);
2668 sqlite3ExprAssignVarNumber(pParse, pExpr);
2669}
2670#line 2673 "parse.c"
2671 break;
2672 case 185:
2673#line 654 "parse.y"
2674{
2675 yygotominor.yy172 = sqlite3ExprSetColl(pParse, yymsp[-2].minor.yy172, &yymsp[0].minor.yy410);
2676}
2677#line 2680 "parse.c"
2678 break;
2679 case 186:
2680#line 658 "parse.y"
2681{
2682 yygotominor.yy172 = sqlite3Expr(TK_CAST, yymsp[-3].minor.yy172, 0, &yymsp[-1].minor.yy410);
2683 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
2684}
2685#line 2688 "parse.c"
2686 break;
2687 case 187:
2688#line 663 "parse.y"
2689{
2690 if( yymsp[-1].minor.yy174 && yymsp[-1].minor.yy174->nExpr>SQLITE_MAX_FUNCTION_ARG ){
2691 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
2692 }
2693 yygotominor.yy172 = sqlite3ExprFunction(yymsp[-1].minor.yy174, &yymsp[-4].minor.yy0);
2694 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
2695 if( yymsp[-2].minor.yy46 && yygotominor.yy172 ){
2696 yygotominor.yy172->flags |= EP_Distinct;
2697 }
2698}
2699#line 2702 "parse.c"
2700 break;
2701 case 188:
2702#line 673 "parse.y"
2703{
2704 yygotominor.yy172 = sqlite3ExprFunction(0, &yymsp[-3].minor.yy0);
2705 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
2706}
2707#line 2710 "parse.c"
2708 break;
2709 case 189:
2710#line 677 "parse.y"
2711{
2712 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
2713 ** treated as functions that return constants */
2714 yygotominor.yy172 = sqlite3ExprFunction(0,&yymsp[0].minor.yy0);
2715 if( yygotominor.yy172 ){
2716 yygotominor.yy172->op = TK_CONST_FUNC;
2717 yygotominor.yy172->span = yymsp[0].minor.yy0;
2718 }
2719}
2720#line 2723 "parse.c"
2721 break;
2722 case 190:
2723 case 191:
2724 case 192:
2725 case 193:
2726 case 194:
2727 case 195:
2728 case 196:
2729 case 197:
2730#line 686 "parse.y"
2731{yygotominor.yy172 = sqlite3Expr(yymsp[-1].major, yymsp[-2].minor.yy172, yymsp[0].minor.yy172, 0);}
2732#line 2735 "parse.c"
2733 break;
2734 case 198:
2735 case 200:
2736#line 696 "parse.y"
2737{yygotominor.yy72.eOperator = yymsp[0].minor.yy0; yygotominor.yy72.not = 0;}
2738#line 2741 "parse.c"
2739 break;
2740 case 199:
2741 case 201:
2742#line 697 "parse.y"
2743{yygotominor.yy72.eOperator = yymsp[0].minor.yy0; yygotominor.yy72.not = 1;}
2744#line 2747 "parse.c"
2745 break;
2746 case 204:
2747#line 704 "parse.y"
2748{
2749 ExprList *pList;
2750 pList = sqlite3ExprListAppend(0, yymsp[-1].minor.yy172, 0);
2751 pList = sqlite3ExprListAppend(pList, yymsp[-3].minor.yy172, 0);
2752 if( yymsp[0].minor.yy172 ){
2753 pList = sqlite3ExprListAppend(pList, yymsp[0].minor.yy172, 0);
2754 }
2755 yygotominor.yy172 = sqlite3ExprFunction(pList, &yymsp[-2].minor.yy72.eOperator);
2756 if( yymsp[-2].minor.yy72.not ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
2757 sqlite3ExprSpan(yygotominor.yy172, &yymsp[-3].minor.yy172->span, &yymsp[-1].minor.yy172->span);
2758 if( yygotominor.yy172 ) yygotominor.yy172->flags |= EP_InfixFunc;
2759}
2760#line 2763 "parse.c"
2761 break;
2762 case 205:
2763#line 717 "parse.y"
2764{
2765 yygotominor.yy172 = sqlite3Expr(yymsp[0].major, yymsp[-1].minor.yy172, 0, 0);
2766 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy172->span,&yymsp[0].minor.yy0);
2767}
2768#line 2771 "parse.c"
2769 break;
2770 case 206:
2771#line 721 "parse.y"
2772{
2773 yygotominor.yy172 = sqlite3Expr(TK_ISNULL, yymsp[-2].minor.yy172, 0, 0);
2774 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy172->span,&yymsp[0].minor.yy0);
2775}
2776#line 2779 "parse.c"
2777 break;
2778 case 207:
2779#line 725 "parse.y"
2780{
2781 yygotominor.yy172 = sqlite3Expr(TK_NOTNULL, yymsp[-2].minor.yy172, 0, 0);
2782 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy172->span,&yymsp[0].minor.yy0);
2783}
2784#line 2787 "parse.c"
2785 break;
2786 case 208:
2787#line 729 "parse.y"
2788{
2789 yygotominor.yy172 = sqlite3Expr(TK_NOTNULL, yymsp[-3].minor.yy172, 0, 0);
2790 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy172->span,&yymsp[0].minor.yy0);
2791}
2792#line 2795 "parse.c"
2793 break;
2794 case 209:
2795#line 733 "parse.y"
2796{
2797 yygotominor.yy172 = sqlite3Expr(yymsp[-1].major, yymsp[0].minor.yy172, 0, 0);
2798 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
2799}
2800#line 2803 "parse.c"
2801 break;
2802 case 210:
2803#line 737 "parse.y"
2804{
2805 yygotominor.yy172 = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy172, 0, 0);
2806 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
2807}
2808#line 2811 "parse.c"
2809 break;
2810 case 211:
2811#line 741 "parse.y"
2812{
2813 yygotominor.yy172 = sqlite3Expr(TK_UPLUS, yymsp[0].minor.yy172, 0, 0);
2814 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
2815}
2816#line 2819 "parse.c"
2817 break;
2818 case 214:
2819#line 748 "parse.y"
2820{
2821 ExprList *pList = sqlite3ExprListAppend(0, yymsp[-2].minor.yy172, 0);
2822 pList = sqlite3ExprListAppend(pList, yymsp[0].minor.yy172, 0);
2823 yygotominor.yy172 = sqlite3Expr(TK_BETWEEN, yymsp[-4].minor.yy172, 0, 0);
2824 if( yygotominor.yy172 ){
2825 yygotominor.yy172->pList = pList;
2826 }else{
2827 sqlite3ExprListDelete(pList);
2828 }
2829 if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
2830 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy172->span);
2831}
2832#line 2835 "parse.c"
2833 break;
2834 case 217:
2835#line 764 "parse.y"
2836{
2837 yygotominor.yy172 = sqlite3Expr(TK_IN, yymsp[-4].minor.yy172, 0, 0);
2838 if( yygotominor.yy172 ){
2839 yygotominor.yy172->pList = yymsp[-1].minor.yy174;
2840 sqlite3ExprSetHeight(yygotominor.yy172);
2841 }else{
2842 sqlite3ExprListDelete(yymsp[-1].minor.yy174);
2843 }
2844 if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
2845 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy0);
2846 }
2847#line 2850 "parse.c"
2848 break;
2849 case 218:
2850#line 775 "parse.y"
2851{
2852 yygotominor.yy172 = sqlite3Expr(TK_SELECT, 0, 0, 0);
2853 if( yygotominor.yy172 ){
2854 yygotominor.yy172->pSelect = yymsp[-1].minor.yy219;
2855 sqlite3ExprSetHeight(yygotominor.yy172);
2856 }else{
2857 sqlite3SelectDelete(yymsp[-1].minor.yy219);
2858 }
2859 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
2860 }
2861#line 2864 "parse.c"
2862 break;
2863 case 219:
2864#line 785 "parse.y"
2865{
2866 yygotominor.yy172 = sqlite3Expr(TK_IN, yymsp[-4].minor.yy172, 0, 0);
2867 if( yygotominor.yy172 ){
2868 yygotominor.yy172->pSelect = yymsp[-1].minor.yy219;
2869 sqlite3ExprSetHeight(yygotominor.yy172);
2870 }else{
2871 sqlite3SelectDelete(yymsp[-1].minor.yy219);
2872 }
2873 if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
2874 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy0);
2875 }
2876#line 2879 "parse.c"
2877 break;
2878 case 220:
2879#line 796 "parse.y"
2880{
2881 SrcList *pSrc = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410);
2882 yygotominor.yy172 = sqlite3Expr(TK_IN, yymsp[-3].minor.yy172, 0, 0);
2883 if( yygotominor.yy172 ){
2884 yygotominor.yy172->pSelect = sqlite3SelectNew(0,pSrc,0,0,0,0,0,0,0);
2885 sqlite3ExprSetHeight(yygotominor.yy172);
2886 }else{
2887 sqlite3SrcListDelete(pSrc);
2888 }
2889 if( yymsp[-2].minor.yy46 ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
2890 sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy172->span,yymsp[0].minor.yy410.z?&yymsp[0].minor.yy410:&yymsp[-1].minor.yy410);
2891 }
2892#line 2895 "parse.c"
2893 break;
2894 case 221:
2895#line 808 "parse.y"
2896{
2897 Expr *p = yygotominor.yy172 = sqlite3Expr(TK_EXISTS, 0, 0, 0);
2898 if( p ){
2899 p->pSelect = yymsp[-1].minor.yy219;
2900 sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
2901 sqlite3ExprSetHeight(yygotominor.yy172);
2902 }else{
2903 sqlite3SelectDelete(yymsp[-1].minor.yy219);
2904 }
2905 }
2906#line 2909 "parse.c"
2907 break;
2908 case 222:
2909#line 821 "parse.y"
2910{
2911 yygotominor.yy172 = sqlite3Expr(TK_CASE, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, 0);
2912 if( yygotominor.yy172 ){
2913 yygotominor.yy172->pList = yymsp[-2].minor.yy174;
2914 sqlite3ExprSetHeight(yygotominor.yy172);
2915 }else{
2916 sqlite3ExprListDelete(yymsp[-2].minor.yy174);
2917 }
2918 sqlite3ExprSpan(yygotominor.yy172, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
2919}
2920#line 2923 "parse.c"
2921 break;
2922 case 223:
2923#line 833 "parse.y"
2924{
2925 yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-4].minor.yy174, yymsp[-2].minor.yy172, 0);
2926 yygotominor.yy174 = sqlite3ExprListAppend(yygotominor.yy174, yymsp[0].minor.yy172, 0);
2927}
2928#line 2931 "parse.c"
2929 break;
2930 case 224:
2931#line 837 "parse.y"
2932{
2933 yygotominor.yy174 = sqlite3ExprListAppend(0, yymsp[-2].minor.yy172, 0);
2934 yygotominor.yy174 = sqlite3ExprListAppend(yygotominor.yy174, yymsp[0].minor.yy172, 0);
2935}
2936#line 2939 "parse.c"
2937 break;
2938 case 233:
2939#line 864 "parse.y"
2940{
2941 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy410, &yymsp[-5].minor.yy410, sqlite3SrcListAppend(0,&yymsp[-3].minor.yy410,0), yymsp[-1].minor.yy174, yymsp[-9].minor.yy46,
2942 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy46);
2943}
2944#line 2947 "parse.c"
2945 break;
2946 case 234:
2947 case 281:
2948#line 870 "parse.y"
2949{yygotominor.yy46 = OE_Abort;}
2950#line 2953 "parse.c"
2951 break;
2952 case 235:
2953#line 871 "parse.y"
2954{yygotominor.yy46 = OE_None;}
2955#line 2958 "parse.c"
2956 break;
2957 case 238:
2958#line 881 "parse.y"
2959{
2960 Expr *p = 0;
2961 if( yymsp[-1].minor.yy410.n>0 ){
2962 p = sqlite3Expr(TK_COLUMN, 0, 0, 0);
2963 if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)yymsp[-1].minor.yy410.z, yymsp[-1].minor.yy410.n);
2964 }
2965 yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-4].minor.yy174, p, &yymsp[-2].minor.yy410);
2966 sqlite3ExprListCheckLength(pParse, yygotominor.yy174, SQLITE_MAX_COLUMN, "index");
2967 if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
2968}
2969#line 2972 "parse.c"
2970 break;
2971 case 239:
2972#line 891 "parse.y"
2973{
2974 Expr *p = 0;
2975 if( yymsp[-1].minor.yy410.n>0 ){
2976 p = sqlite3Expr(TK_COLUMN, 0, 0, 0);
2977 if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)yymsp[-1].minor.yy410.z, yymsp[-1].minor.yy410.n);
2978 }
2979 yygotominor.yy174 = sqlite3ExprListAppend(0, p, &yymsp[-2].minor.yy410);
2980 sqlite3ExprListCheckLength(pParse, yygotominor.yy174, SQLITE_MAX_COLUMN, "index");
2981 if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
2982}
2983#line 2986 "parse.c"
2984 break;
2985 case 241:
2986#line 904 "parse.y"
2987{yygotominor.yy410.z = 0; yygotominor.yy410.n = 0;}
2988#line 2991 "parse.c"
2989 break;
2990 case 243:
2991#line 910 "parse.y"
2992{sqlite3DropIndex(pParse, yymsp[0].minor.yy373, yymsp[-1].minor.yy46);}
2993#line 2996 "parse.c"
2994 break;
2995 case 244:
2996 case 245:
2997#line 916 "parse.y"
2998{sqlite3Vacuum(pParse);}
2999#line 3002 "parse.c"
3000 break;
3001 case 246:
3002#line 924 "parse.y"
3003{sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy410,0);}
3004#line 3007 "parse.c"
3005 break;
3006 case 247:
3007#line 925 "parse.y"
3008{sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy0,0);}
3009#line 3012 "parse.c"
3010 break;
3011 case 248:
3012#line 926 "parse.y"
3013{
3014 sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy410,1);
3015}
3016#line 3019 "parse.c"
3017 break;
3018 case 249:
3019#line 929 "parse.y"
3020{sqlite3Pragma(pParse,&yymsp[-4].minor.yy410,&yymsp[-3].minor.yy410,&yymsp[-1].minor.yy410,0);}
3021#line 3024 "parse.c"
3022 break;
3023 case 250:
3024#line 930 "parse.y"
3025{sqlite3Pragma(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410,0,0);}
3026#line 3029 "parse.c"
3027 break;
3028 case 258:
3029#line 944 "parse.y"
3030{
3031 Token all;
3032 all.z = yymsp[-3].minor.yy410.z;
3033 all.n = (yymsp[0].minor.yy0.z - yymsp[-3].minor.yy410.z) + yymsp[0].minor.yy0.n;
3034 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy243, &all);
3035}
3036#line 3039 "parse.c"
3037 break;
3038 case 259:
3039#line 953 "parse.y"
3040{
3041 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);
3042 yygotominor.yy410 = (yymsp[-6].minor.yy410.n==0?yymsp[-7].minor.yy410:yymsp[-6].minor.yy410);
3043}
3044#line 3047 "parse.c"
3045 break;
3046 case 260:
3047 case 263:
3048#line 959 "parse.y"
3049{ yygotominor.yy46 = TK_BEFORE; }
3050#line 3053 "parse.c"
3051 break;
3052 case 261:
3053#line 960 "parse.y"
3054{ yygotominor.yy46 = TK_AFTER; }
3055#line 3058 "parse.c"
3056 break;
3057 case 262:
3058#line 961 "parse.y"
3059{ yygotominor.yy46 = TK_INSTEAD;}
3060#line 3063 "parse.c"
3061 break;
3062 case 264:
3063 case 265:
3064#line 966 "parse.y"
3065{yygotominor.yy370.a = yymsp[0].major; yygotominor.yy370.b = 0;}
3066#line 3069 "parse.c"
3067 break;
3068 case 266:
3069#line 968 "parse.y"
3070{yygotominor.yy370.a = TK_UPDATE; yygotominor.yy370.b = yymsp[0].minor.yy432;}
3071#line 3074 "parse.c"
3072 break;
3073 case 269:
3074#line 975 "parse.y"
3075{ yygotominor.yy172 = 0; }
3076#line 3079 "parse.c"
3077 break;
3078 case 270:
3079#line 976 "parse.y"
3080{ yygotominor.yy172 = yymsp[0].minor.yy172; }
3081#line 3084 "parse.c"
3082 break;
3083 case 271:
3084#line 980 "parse.y"
3085{
3086 if( yymsp[-2].minor.yy243 ){
3087 yymsp[-2].minor.yy243->pLast->pNext = yymsp[-1].minor.yy243;
3088 }else{
3089 yymsp[-2].minor.yy243 = yymsp[-1].minor.yy243;
3090 }
3091 yymsp[-2].minor.yy243->pLast = yymsp[-1].minor.yy243;
3092 yygotominor.yy243 = yymsp[-2].minor.yy243;
3093}
3094#line 3097 "parse.c"
3095 break;
3096 case 272:
3097#line 989 "parse.y"
3098{ yygotominor.yy243 = 0; }
3099#line 3102 "parse.c"
3100 break;
3101 case 273:
3102#line 995 "parse.y"
3103{ yygotominor.yy243 = sqlite3TriggerUpdateStep(&yymsp[-3].minor.yy410, yymsp[-1].minor.yy174, yymsp[0].minor.yy172, yymsp[-4].minor.yy46); }
3104#line 3107 "parse.c"
3105 break;
3106 case 274:
3107#line 1000 "parse.y"
3108{yygotominor.yy243 = sqlite3TriggerInsertStep(&yymsp[-5].minor.yy410, yymsp[-4].minor.yy432, yymsp[-1].minor.yy174, 0, yymsp[-7].minor.yy46);}
3109#line 3112 "parse.c"
3110 break;
3111 case 275:
3112#line 1003 "parse.y"
3113{yygotominor.yy243 = sqlite3TriggerInsertStep(&yymsp[-2].minor.yy410, yymsp[-1].minor.yy432, 0, yymsp[0].minor.yy219, yymsp[-4].minor.yy46);}
3114#line 3117 "parse.c"
3115 break;
3116 case 276:
3117#line 1007 "parse.y"
3118{yygotominor.yy243 = sqlite3TriggerDeleteStep(&yymsp[-1].minor.yy410, yymsp[0].minor.yy172);}
3119#line 3122 "parse.c"
3120 break;
3121 case 277:
3122#line 1010 "parse.y"
3123{yygotominor.yy243 = sqlite3TriggerSelectStep(yymsp[0].minor.yy219); }
3124#line 3127 "parse.c"
3125 break;
3126 case 278:
3127#line 1013 "parse.y"
3128{
3129 yygotominor.yy172 = sqlite3Expr(TK_RAISE, 0, 0, 0);
3130 if( yygotominor.yy172 ){
3131 yygotominor.yy172->iColumn = OE_Ignore;
3132 sqlite3ExprSpan(yygotominor.yy172, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
3133 }
3134}
3135#line 3138 "parse.c"
3136 break;
3137 case 279:
3138#line 1020 "parse.y"
3139{
3140 yygotominor.yy172 = sqlite3Expr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy410);
3141 if( yygotominor.yy172 ) {
3142 yygotominor.yy172->iColumn = yymsp[-3].minor.yy46;
3143 sqlite3ExprSpan(yygotominor.yy172, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
3144 }
3145}
3146#line 3149 "parse.c"
3147 break;
3148 case 280:
3149#line 1030 "parse.y"
3150{yygotominor.yy46 = OE_Rollback;}
3151#line 3154 "parse.c"
3152 break;
3153 case 282:
3154#line 1032 "parse.y"
3155{yygotominor.yy46 = OE_Fail;}
3156#line 3159 "parse.c"
3157 break;
3158 case 283:
3159#line 1037 "parse.y"
3160{
3161 sqlite3DropTrigger(pParse,yymsp[0].minor.yy373,yymsp[-1].minor.yy46);
3162}
3163#line 3166 "parse.c"
3164 break;
3165 case 284:
3166#line 1044 "parse.y"
3167{
3168 sqlite3Attach(pParse, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, yymsp[0].minor.yy386);
3169}
3170#line 3173 "parse.c"
3171 break;
3172 case 285:
3173#line 1047 "parse.y"
3174{
3175 sqlite3Detach(pParse, yymsp[0].minor.yy172);
3176}
3177#line 3180 "parse.c"
3178 break;
3179 case 286:
3180#line 1053 "parse.y"
3181{ yygotominor.yy386 = 0; }
3182#line 3185 "parse.c"
3183 break;
3184 case 287:
3185#line 1054 "parse.y"
3186{ yygotominor.yy386 = yymsp[0].minor.yy172; }
3187#line 3190 "parse.c"
3188 break;
3189 case 290:
3190#line 1062 "parse.y"
3191{sqlite3Reindex(pParse, 0, 0);}
3192#line 3195 "parse.c"
3193 break;
3194 case 291:
3195#line 1063 "parse.y"
3196{sqlite3Reindex(pParse, &yymsp[-1].minor.yy410, &yymsp[0].minor.yy410);}
3197#line 3200 "parse.c"
3198 break;
3199 case 292:
3200#line 1068 "parse.y"
3201{sqlite3Analyze(pParse, 0, 0);}
3202#line 3205 "parse.c"
3203 break;
3204 case 293:
3205#line 1069 "parse.y"
3206{sqlite3Analyze(pParse, &yymsp[-1].minor.yy410, &yymsp[0].minor.yy410);}
3207#line 3210 "parse.c"
3208 break;
3209 case 294:
3210#line 1074 "parse.y"
3211{
3212 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy373,&yymsp[0].minor.yy410);
3213}
3214#line 3217 "parse.c"
3215 break;
3216 case 295:
3217#line 1077 "parse.y"
3218{
3219 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy410);
3220}
3221#line 3224 "parse.c"
3222 break;
3223 case 296:
3224#line 1080 "parse.y"
3225{
3226 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy373);
3227}
3228#line 3231 "parse.c"
3229 break;
3230 case 299:
3231#line 1089 "parse.y"
3232{sqlite3VtabFinishParse(pParse,0);}
3233#line 3236 "parse.c"
3234 break;
3235 case 300:
3236#line 1090 "parse.y"
3237{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
3238#line 3241 "parse.c"
3239 break;
3240 case 301:
3241#line 1091 "parse.y"
3242{
3243 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy410, &yymsp[-2].minor.yy410, &yymsp[0].minor.yy410);
3244}
3245#line 3248 "parse.c"
3246 break;
3247 case 304:
3248#line 1096 "parse.y"
3249{sqlite3VtabArgInit(pParse);}
3250#line 3253 "parse.c"
3251 break;
3252 case 306:
3253 case 307:
3254 case 308:
3255 case 310:
3256#line 1098 "parse.y"
3257{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
3258#line 3261 "parse.c"
3259 break;
3260 };
3261 yygoto = yyRuleInfo[yyruleno].lhs;
3262 yysize = yyRuleInfo[yyruleno].nrhs;
3263 yypParser->yyidx -= yysize;
3264 yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto);
3265 if( yyact < YYNSTATE ){
3266#ifdef NDEBUG
3267 /* If we are not debugging and the reduce action popped at least
3268 ** one element off the stack, then we can push the new element back
3269 ** onto the stack here, and skip the stack overflow test in yy_shift().
3270 ** That gives a significant speed improvement. */
3271 if( yysize ){
3272 yypParser->yyidx++;
3273 yymsp -= yysize-1;
3274 yymsp->stateno = yyact;
3275 yymsp->major = yygoto;
3276 yymsp->minor = yygotominor;
3277 }else
3278#endif
3279 {
3280 yy_shift(yypParser,yyact,yygoto,&yygotominor);
3281 }
3282 }else if( yyact == YYNSTATE + YYNRULE + 1 ){
3283 yy_accept(yypParser);
3284 }
3285}
3286
3287/*
3288** The following code executes when the parse fails
3289*/
3290static void yy_parse_failed(
3291 yyParser *yypParser /* The parser */
3292){
3293 sqlite3ParserARG_FETCH;
3294#ifndef NDEBUG
3295 if( yyTraceFILE ){
3296 fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
3297 }
3298#endif
3299 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
3300 /* Here code is inserted which will be executed whenever the
3301 ** parser fails */
3302 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3303}
3304
3305/*
3306** The following code executes when a syntax error first occurs.
3307*/
3308static void yy_syntax_error(
3309 yyParser *yypParser, /* The parser */
3310 int yymajor, /* The major type of the error token */
3311 YYMINORTYPE yyminor /* The minor type of the error token */
3312){
3313 sqlite3ParserARG_FETCH;
3314#define TOKEN (yyminor.yy0)
3315#line 34 "parse.y"
3316
3317 if( !pParse->parseError ){
3318 if( TOKEN.z[0] ){
3319 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
3320 }else{
3321 sqlite3ErrorMsg(pParse, "incomplete SQL statement");
3322 }
3323 pParse->parseError = 1;
3324 }
3325#line 3329 "parse.c"
3326 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3327}
3328
3329/*
3330** The following is executed when the parser accepts
3331*/
3332static void yy_accept(
3333 yyParser *yypParser /* The parser */
3334){
3335 sqlite3ParserARG_FETCH;
3336#ifndef NDEBUG
3337 if( yyTraceFILE ){
3338 fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
3339 }
3340#endif
3341 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
3342 /* Here code is inserted which will be executed whenever the
3343 ** parser accepts */
3344 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
3345}
3346
3347/* The main parser program.
3348** The first argument is a pointer to a structure obtained from
3349** "sqlite3ParserAlloc" which describes the current state of the parser.
3350** The second argument is the major token number. The third is
3351** the minor token. The fourth optional argument is whatever the
3352** user wants (and specified in the grammar) and is available for
3353** use by the action routines.
3354**
3355** Inputs:
3356** <ul>
3357** <li> A pointer to the parser (an opaque structure.)
3358** <li> The major token number.
3359** <li> The minor token number.
3360** <li> An option argument of a grammar-specified type.
3361** </ul>
3362**
3363** Outputs:
3364** None.
3365*/
3366void sqlite3Parser(
3367 void *yyp, /* The parser */
3368 int yymajor, /* The major token code number */
3369 sqlite3ParserTOKENTYPE yyminor /* The value for the token */
3370 sqlite3ParserARG_PDECL /* Optional %extra_argument parameter */
3371){
3372 YYMINORTYPE yyminorunion;
3373 int yyact; /* The parser action. */
3374 int yyendofinput; /* True if we are at the end of input */
3375 int yyerrorhit = 0; /* True if yymajor has invoked an error */
3376 yyParser *yypParser; /* The parser */
3377
3378 /* (re)initialize the parser, if necessary */
3379 yypParser = (yyParser*)yyp;
3380 if( yypParser->yyidx<0 ){
3381#if YYSTACKDEPTH<=0
3382 if( yypParser->yystksz <=0 ){
3383 memset(&yyminorunion, 0, sizeof(yyminorunion));
3384 yyStackOverflow(yypParser, &yyminorunion);
3385 return;
3386 }
3387#endif
3388 yypParser->yyidx = 0;
3389 yypParser->yyerrcnt = -1;
3390 yypParser->yystack[0].stateno = 0;
3391 yypParser->yystack[0].major = 0;
3392 }
3393 yyminorunion.yy0 = yyminor;
3394 yyendofinput = (yymajor==0);
3395 sqlite3ParserARG_STORE;
3396
3397#ifndef NDEBUG
3398 if( yyTraceFILE ){
3399 fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
3400 }
3401#endif
3402
3403 do{
3404 yyact = yy_find_shift_action(yypParser,yymajor);
3405 if( yyact<YYNSTATE ){
3406 yy_shift(yypParser,yyact,yymajor,&yyminorunion);
3407 yypParser->yyerrcnt--;
3408 if( yyendofinput && yypParser->yyidx>=0 ){
3409 yymajor = 0;
3410 }else{
3411 yymajor = YYNOCODE;
3412 }
3413 }else if( yyact < YYNSTATE + YYNRULE ){
3414 yy_reduce(yypParser,yyact-YYNSTATE);
3415 }else if( yyact == YY_ERROR_ACTION ){
3416 int yymx;
3417#ifndef NDEBUG
3418 if( yyTraceFILE ){
3419 fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
3420 }
3421#endif
3422#ifdef YYERRORSYMBOL
3423 /* A syntax error has occurred.
3424 ** The response to an error depends upon whether or not the
3425 ** grammar defines an error token "ERROR".
3426 **
3427 ** This is what we do if the grammar does define ERROR:
3428 **
3429 ** * Call the %syntax_error function.
3430 **
3431 ** * Begin popping the stack until we enter a state where
3432 ** it is legal to shift the error symbol, then shift
3433 ** the error symbol.
3434 **
3435 ** * Set the error count to three.
3436 **
3437 ** * Begin accepting and shifting new tokens. No new error
3438 ** processing will occur until three tokens have been
3439 ** shifted successfully.
3440 **
3441 */
3442 if( yypParser->yyerrcnt<0 ){
3443 yy_syntax_error(yypParser,yymajor,yyminorunion);
3444 }
3445 yymx = yypParser->yystack[yypParser->yyidx].major;
3446 if( yymx==YYERRORSYMBOL || yyerrorhit ){
3447#ifndef NDEBUG
3448 if( yyTraceFILE ){
3449 fprintf(yyTraceFILE,"%sDiscard input token %s\n",
3450 yyTracePrompt,yyTokenName[yymajor]);
3451 }
3452#endif
3453 yy_destructor(yymajor,&yyminorunion);
3454 yymajor = YYNOCODE;
3455 }else{
3456 while(
3457 yypParser->yyidx >= 0 &&
3458 yymx != YYERRORSYMBOL &&
3459 (yyact = yy_find_reduce_action(
3460 yypParser->yystack[yypParser->yyidx].stateno,
3461 YYERRORSYMBOL)) >= YYNSTATE
3462 ){
3463 yy_pop_parser_stack(yypParser);
3464 }
3465 if( yypParser->yyidx < 0 || yymajor==0 ){
3466 yy_destructor(yymajor,&yyminorunion);
3467 yy_parse_failed(yypParser);
3468 yymajor = YYNOCODE;
3469 }else if( yymx!=YYERRORSYMBOL ){
3470 YYMINORTYPE u2;
3471 u2.YYERRSYMDT = 0;
3472 yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
3473 }
3474 }
3475 yypParser->yyerrcnt = 3;
3476 yyerrorhit = 1;
3477#else /* YYERRORSYMBOL is not defined */
3478 /* This is what we do if the grammar does not define ERROR:
3479 **
3480 ** * Report an error message, and throw away the input token.
3481 **
3482 ** * If the input token is $, then fail the parse.
3483 **
3484 ** As before, subsequent error messages are suppressed until
3485 ** three input tokens have been successfully shifted.
3486 */
3487 if( yypParser->yyerrcnt<=0 ){
3488 yy_syntax_error(yypParser,yymajor,yyminorunion);
3489 }
3490 yypParser->yyerrcnt = 3;
3491 yy_destructor(yymajor,&yyminorunion);
3492 if( yyendofinput ){
3493 yy_parse_failed(yypParser);
3494 }
3495 yymajor = YYNOCODE;
3496#endif
3497 }else{
3498 yy_accept(yypParser);
3499 yymajor = YYNOCODE;
3500 }
3501 }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
3502 return;
3503}

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status