Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1030)

Side by Side Diff: third_party/sqlite/preprocessed/parse.c

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

Powered by Google App Engine
This is Rietveld 408576698