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