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