using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using u8 = System.Byte;
using YYCODETYPE = System.Int32;
using YYACTIONTYPE = System.Int32;
namespace Community.CsharpSqlite
{
using sqlite3ParserTOKENTYPE = Sqlite3.Token;
public partial class Sqlite3
{
*************************************************************************
** Included in SQLite3 port to C#-SQLite; 2008 Noah B Hart
** C#-SQLite is an independent reimplementation of the SQLite software library
**
** SQLITE_SOURCE_ID: 2010-08-23 18:52:01 42537b60566f288167f1b5864a5435986838e3a3
**
*************************************************************************
*/
** The author disclaims copyright to this source code.
**
** This version of "lempar.c" is modified, slightly, for use by SQLite.
** The only modifications are the addition of a couple of NEVER()
** macros to disable tests that are needed in the case of a general
** LALR(1) grammar but which are always false in the
** specific grammar used by SQLite.
*/
** in the input grammar file. */
** Disable all error recovery processing in the parser push-down
** automaton.
*/
const int YYNOERRORRECOVERY = 1;
** Make yytestcase() the same as testcase()
*/
static void yytestcase<T>( T X )
{
testcase( X );
}
** An instance of this structure holds information about the
** LIMIT clause of a SELECT statement.
*/
public struct LimitVal
{
public Expr pLimit;
public Expr pOffset;
};
** An instance of this structure is used to store the LIKE,
** GLOB, NOT LIKE, and NOT GLOB operators.
*/
public struct LikeOp
{
public Token eOperator;
public bool not;
};
** An instance of the following structure describes the event of a
** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
** TK_DELETE, or TK_INSTEAD. If the event is of the form
**
** UPDATE ON (a,b,c)
**
** Then the "b" IdList records the list "a,b,c".
*/
public struct TrigEvent
{
public int a;
public IdList b;
};
** An instance of this structure holds the ATTACH key and the key type.
*/
public struct AttachKey
{
public int type;
public Token key;
};
** ExprSpan.zEnd values of pOut so that the span covers the complete
** range of text beginning with pStart and going to the end of pEnd.
*/
static void spanSet( ExprSpan pOut, Token pStart, Token pEnd )
{
pOut.zStart = pStart.z;
pOut.zEnd = pEnd.z.Substring( pEnd.n );
}
** new Expr to populate pOut. Set the span of pOut to be the identifier
** that created the expression.
*/
static void spanExpr( ExprSpan pOut, Parse pParse, int op, Token pValue )
{
pOut.pExpr = sqlite3PExpr( pParse, op, 0, 0, pValue );
pOut.zStart = pValue.z;
pOut.zEnd = pValue.z.Substring( pValue.n );
}
** objects and uses the result to populate a new ExprSpan object.
*/
static void spanBinaryExpr(
ExprSpan pOut,
Parse pParse,
int op,
ExprSpan pLeft,
ExprSpan pRight
)
{
pOut.pExpr = sqlite3PExpr( pParse, op, pLeft.pExpr, pRight.pExpr, 0 );
pOut.zStart = pLeft.zStart;
pOut.zEnd = pRight.zEnd;
}
*/
static void spanUnaryPostfix(
ExprSpan pOut,
Parse pParse,
int op,
ExprSpan pOperand,
Token pPostOp
)
{
pOut.pExpr = sqlite3PExpr( pParse, op, pOperand.pExpr, 0, 0 );
pOut.zStart = pOperand.zStart;
pOut.zEnd = pPostOp.z.Substring( pPostOp.n );
}
** unary TK_ISNULL or TK_NOTNULL expression. */
static void binaryToUnaryIfNull( Parse pParse, Expr pY, Expr pA, int op )
{
sqlite3 db = pParse.db;
if ( pY.op == TK_NULL )
{
pA.op = (u8)op;
sqlite3ExprDelete( db, ref pA.pRight );
pA.pRight = null;
}
}
*/
static void spanUnaryPrefix(
ExprSpan pOut,
Parse pParse,
int op,
ExprSpan pOperand,
Token pPreOp
)
{
pOut.pExpr = sqlite3PExpr( pParse, op, pOperand.pExpr, 0, 0 );
pOut.zStart = pPreOp.z;
pOut.zEnd = pOperand.zEnd;
}
** This section will be null unless lemon is run with the -m switch.
*/
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
** understands.
**
** Each symbol here is a terminal symbol in the grammar.
*/
*/
#if !INTERFACE
#endif
** various aspects of the generated parser.
** YYCODETYPE is the data type used for storing terminal
** and nonterminal numbers. "unsigned char" is
** used if there are fewer than 250 terminals
** and nonterminals. "int" is used otherwise.
** YYNOCODE is a number of type YYCODETYPE which corresponds
** to no legal terminal or nonterminal number. This
** number is used to fill in empty slots of the hash
** table.
** YYFALLBACK If defined, this indicates that one or more tokens
** have fall-back values which should be used if the
** original value of the token will not parse.
** YYACTIONTYPE is the data type used for storing terminal
** and nonterminal numbers. "unsigned char" is
** used if there are fewer than 250 rules and
** states combined. "int" is used otherwise.
** sqlite3ParserTOKENTYPE is the data type used for minor tokens given
** directly to the parser from the tokenizer.
** YYMINORTYPE is the data type used for all minor tokens.
** This is typically a union of many types, one of
** which is sqlite3ParserTOKENTYPE. The entry in the union
** for base tokens is called "yy0".
** YYSTACKDEPTH is the maximum depth of the parser's stack. If
** zero the stack is dynamically sized using realloc()
** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument
** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument
** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser
** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser
** YYNSTATE the combined number of states.
** YYNRULE the number of rules in the grammar
** YYERRORSYMBOL is the code number of the error symbol. If not
** defined, then do no error processing.
*/
const int YYNOCODE = 253;
const int YYWILDCARD = 67;
public class YYMINORTYPE
{
public int yyinit;
public sqlite3ParserTOKENTYPE yy0 = new sqlite3ParserTOKENTYPE();
public int yy4;
public TrigEvent yy90;
public ExprSpan yy118 = new ExprSpan();
public TriggerStep yy203;
public u8 yy210;
public struct _yy215
{
public int value;
public int mask;
}
public _yy215 yy215;
public SrcList yy259;
public LimitVal yy292;
public Expr yy314;
public ExprList yy322;
public LikeOp yy342;
public IdList yy384;
public Select yy387;
}
#if !YYSTACKDEPTH
const int YYSTACKDEPTH = 100;
#endif
const int YYNSTATE = 630;
const int YYNRULE = 329;
const int YYFALLBACK = 1;
const int YY_NO_ACTION = ( YYNSTATE + YYNRULE + 2 );
const int YY_ACCEPT_ACTION = ( YYNSTATE + YYNRULE + 1 );
const int YY_ERROR_ACTION = ( YYNSTATE + YYNRULE );
** YYMINORTYPE objects to zero. */
YYMINORTYPE yyzerominor = new YYMINORTYPE();
** otherwise.
**
** Applications can choose to define yytestcase() in the %include section
** to a macro that can assist in verifying code coverage. For production
** code the yytestcase() macro should be turned off. But it is useful
** for testing.
*/
** current state and lookahead token. These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.
**
** Suppose the action integer is N. Then the action is determined as
** follows
**
** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
** token onto the stack and goto state N.
**
** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
**
** N == YYNSTATE+YYNRULE A syntax error has occurred.
**
** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
**
** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
** slots in the yy_action[] table.
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as
**
** yy_action[ yy_shift_ofst[S] + X ]
**
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
** and that yy_default[S] should be used instead.
**
** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
** YY_SHIFT_USE_DFLT.
**
** The following are the tables generated in this section:
**
** yy_action[] A single table containing all actions.
** yy_lookahead[] A table containing the lookahead for each entry in
** yy_action. Used to detect hash collisions.
** yy_shift_ofst[] For each state, the offset into yy_action for
** shifting terminals.
** yy_reduce_ofst[] For each state, the offset into yy_action for
** shifting non-terminals after a reduce.
** yy_default[] Default action for each state.
*/
const int YY_ACTTAB_COUNT = 1557;
static YYACTIONTYPE[] yy_action = new YYACTIONTYPE[]{
313, 960, 186, 419, 2, 172, 627, 597, 55, 55,
55, 55, 48, 53, 53, 53, 53, 52, 52, 51,
51, 51, 50, 238, 302, 283, 623, 622, 516, 515,
590, 584, 55, 55, 55, 55, 282, 53, 53, 53,
53, 52, 52, 51, 51, 51, 50, 238, 6, 56,
57, 47, 582, 581, 583, 583, 54, 54, 55, 55,
55, 55, 608, 53, 53, 53, 53, 52, 52, 51,
51, 51, 50, 238, 313, 597, 409, 330, 579, 579,
32, 53, 53, 53, 53, 52, 52, 51, 51, 51,
50, 238, 330, 217, 620, 619, 166, 411, 624, 382,
379, 378, 7, 491, 590, 584, 200, 199, 198, 58,
377, 300, 414, 621, 481, 66, 623, 622, 621, 580,
254, 601, 94, 56, 57, 47, 582, 581, 583, 583,
54, 54, 55, 55, 55, 55, 671, 53, 53, 53,
53, 52, 52, 51, 51, 51, 50, 238, 313, 532,
226, 506, 507, 133, 177, 139, 284, 385, 279, 384,
169, 197, 342, 398, 251, 226, 253, 275, 388, 167,
139, 284, 385, 279, 384, 169, 570, 236, 590, 584,
672, 240, 275, 157, 620, 619, 554, 437, 51, 51,
51, 50, 238, 343, 439, 553, 438, 56, 57, 47,
582, 581, 583, 583, 54, 54, 55, 55, 55, 55,
465, 53, 53, 53, 53, 52, 52, 51, 51, 51,
50, 238, 313, 390, 52, 52, 51, 51, 51, 50,
238, 391, 166, 491, 566, 382, 379, 378, 409, 440,
579, 579, 252, 440, 607, 66, 377, 513, 621, 49,
46, 147, 590, 584, 621, 16, 466, 189, 621, 441,
442, 673, 526, 441, 340, 577, 595, 64, 194, 482,
434, 56, 57, 47, 582, 581, 583, 583, 54, 54,
55, 55, 55, 55, 30, 53, 53, 53, 53, 52,
52, 51, 51, 51, 50, 238, 313, 593, 593, 593,
387, 578, 606, 493, 259, 351, 258, 411, 1, 623,
622, 496, 623, 622, 65, 240, 623, 622, 597, 443,
237, 239, 414, 341, 237, 602, 590, 584, 18, 603,
166, 601, 87, 382, 379, 378, 67, 623, 622, 38,
623, 622, 176, 270, 377, 56, 57, 47, 582, 581,
583, 583, 54, 54, 55, 55, 55, 55, 175, 53,
53, 53, 53, 52, 52, 51, 51, 51, 50, 238,
313, 396, 233, 411, 531, 565, 317, 620, 619, 44,
620, 619, 240, 206, 620, 619, 597, 266, 414, 268,
409, 597, 579, 579, 352, 184, 505, 601, 73, 533,
590, 584, 466, 548, 190, 620, 619, 576, 620, 619,
547, 383, 551, 35, 332, 575, 574, 600, 504, 56,
57, 47, 582, 581, 583, 583, 54, 54, 55, 55,
55, 55, 567, 53, 53, 53, 53, 52, 52, 51,
51, 51, 50, 238, 313, 411, 561, 561, 528, 364,
259, 351, 258, 183, 361, 549, 524, 374, 411, 597,
414, 240, 560, 560, 409, 604, 579, 579, 328, 601,
93, 623, 622, 414, 590, 584, 237, 564, 559, 559,
520, 402, 601, 87, 409, 210, 579, 579, 168, 421,
950, 519, 950, 56, 57, 47, 582, 581, 583, 583,
54, 54, 55, 55, 55, 55, 192, 53, 53, 53,
53, 52, 52, 51, 51, 51, 50, 238, 313, 600,
293, 563, 511, 234, 357, 146, 475, 475, 367, 411,
562, 411, 358, 542, 425, 171, 411, 215, 144, 620,
619, 544, 318, 353, 414, 203, 414, 275, 590, 584,
549, 414, 174, 601, 94, 601, 79, 558, 471, 61,
601, 79, 421, 949, 350, 949, 34, 56, 57, 47,
582, 581, 583, 583, 54, 54, 55, 55, 55, 55,
535, 53, 53, 53, 53, 52, 52, 51, 51, 51,
50, 238, 313, 307, 424, 394, 272, 49, 46, 147,
349, 322, 4, 411, 491, 312, 321, 425, 568, 492,
216, 264, 407, 575, 574, 429, 66, 549, 414, 621,
540, 602, 590, 584, 13, 603, 621, 601, 72, 12,
618, 617, 616, 202, 210, 621, 546, 469, 422, 319,
148, 56, 57, 47, 582, 581, 583, 583, 54, 54,
55, 55, 55, 55, 338, 53, 53, 53, 53, 52,
52, 51, 51, 51, 50, 238, 313, 600, 600, 411,
39, 21, 37, 170, 237, 875, 411, 572, 572, 201,
144, 473, 538, 331, 414, 474, 143, 146, 630, 628,
334, 414, 353, 601, 68, 168, 590, 584, 132, 365,
601, 96, 307, 423, 530, 336, 49, 46, 147, 568,
406, 216, 549, 360, 529, 56, 57, 47, 582, 581,
583, 583, 54, 54, 55, 55, 55, 55, 411, 53,
53, 53, 53, 52, 52, 51, 51, 51, 50, 238,
313, 411, 605, 414, 484, 510, 172, 422, 597, 318,
496, 485, 601, 99, 411, 142, 414, 411, 231, 411,
540, 411, 359, 629, 2, 601, 97, 426, 308, 414,
590, 584, 414, 20, 414, 621, 414, 621, 601, 106,
503, 601, 105, 601, 108, 601, 109, 204, 28, 56,
57, 47, 582, 581, 583, 583, 54, 54, 55, 55,
55, 55, 411, 53, 53, 53, 53, 52, 52, 51,
51, 51, 50, 238, 313, 411, 597, 414, 411, 276,
214, 600, 411, 366, 213, 381, 601, 134, 274, 500,
414, 167, 130, 414, 621, 411, 354, 414, 376, 601,
135, 129, 601, 100, 590, 584, 601, 104, 522, 521,
414, 621, 224, 273, 600, 167, 327, 282, 600, 601,
103, 468, 521, 56, 57, 47, 582, 581, 583, 583,
54, 54, 55, 55, 55, 55, 411, 53, 53, 53,
53, 52, 52, 51, 51, 51, 50, 238, 313, 411,
27, 414, 411, 375, 276, 167, 359, 544, 50, 238,
601, 95, 128, 223, 414, 411, 165, 414, 411, 621,
411, 621, 612, 601, 102, 372, 601, 76, 590, 584,
414, 570, 236, 414, 470, 414, 167, 621, 188, 601,
98, 225, 601, 138, 601, 137, 232, 56, 45, 47,
582, 581, 583, 583, 54, 54, 55, 55, 55, 55,
411, 53, 53, 53, 53, 52, 52, 51, 51, 51,
50, 238, 313, 276, 276, 414, 411, 276, 544, 459,
359, 171, 209, 479, 601, 136, 628, 334, 621, 621,
125, 414, 621, 368, 411, 621, 257, 540, 589, 588,
601, 75, 590, 584, 458, 446, 23, 23, 124, 414,
326, 325, 621, 427, 324, 309, 600, 288, 601, 92,
586, 585, 57, 47, 582, 581, 583, 583, 54, 54,
55, 55, 55, 55, 411, 53, 53, 53, 53, 52,
52, 51, 51, 51, 50, 238, 313, 587, 411, 414,
411, 207, 611, 476, 171, 472, 160, 123, 601, 91,
323, 261, 15, 414, 464, 414, 411, 621, 411, 354,
222, 411, 601, 74, 601, 90, 590, 584, 159, 264,
158, 414, 461, 414, 621, 600, 414, 121, 120, 25,
601, 89, 601, 101, 621, 601, 88, 47, 582, 581,
583, 583, 54, 54, 55, 55, 55, 55, 544, 53,
53, 53, 53, 52, 52, 51, 51, 51, 50, 238,
43, 405, 263, 3, 610, 264, 140, 415, 622, 24,
410, 11, 456, 594, 118, 155, 219, 452, 408, 621,
621, 621, 156, 43, 405, 621, 3, 286, 621, 113,
415, 622, 111, 445, 411, 400, 557, 403, 545, 10,
411, 408, 264, 110, 205, 436, 541, 566, 453, 414,
621, 621, 63, 621, 435, 414, 411, 621, 601, 94,
403, 621, 411, 337, 601, 86, 150, 40, 41, 534,
566, 414, 242, 264, 42, 413, 412, 414, 600, 595,
601, 85, 191, 333, 107, 451, 601, 84, 621, 539,
40, 41, 420, 230, 411, 149, 316, 42, 413, 412,
398, 127, 595, 315, 621, 399, 278, 625, 181, 414,
593, 593, 593, 592, 591, 14, 450, 411, 601, 71,
240, 621, 43, 405, 264, 3, 615, 180, 264, 415,
622, 614, 414, 593, 593, 593, 592, 591, 14, 621,
408, 601, 70, 621, 417, 33, 405, 613, 3, 411,
264, 411, 415, 622, 418, 626, 178, 509, 8, 403,
241, 416, 126, 408, 414, 621, 414, 449, 208, 566,
240, 221, 621, 601, 83, 601, 82, 599, 297, 277,
296, 30, 403, 31, 395, 264, 295, 397, 489, 40,
41, 411, 566, 220, 621, 294, 42, 413, 412, 271,
621, 595, 600, 621, 59, 60, 414, 269, 267, 623,
622, 36, 40, 41, 621, 601, 81, 598, 235, 42,
413, 412, 621, 621, 595, 265, 344, 411, 248, 556,
173, 185, 593, 593, 593, 592, 591, 14, 218, 29,
621, 543, 414, 305, 304, 303, 179, 301, 411, 566,
454, 601, 80, 289, 335, 593, 593, 593, 592, 591,
14, 411, 287, 414, 151, 392, 246, 260, 411, 196,
195, 523, 601, 69, 411, 245, 414, 526, 537, 285,
389, 595, 621, 414, 536, 601, 17, 362, 153, 414,
466, 463, 601, 78, 154, 414, 462, 152, 601, 77,
355, 255, 621, 455, 601, 9, 621, 386, 444, 517,
247, 621, 593, 593, 593, 621, 621, 244, 621, 243,
430, 518, 292, 621, 329, 621, 145, 393, 280, 513,
291, 131, 621, 514, 621, 621, 311, 621, 259, 346,
249, 621, 621, 229, 314, 621, 228, 512, 227, 240,
494, 488, 310, 164, 487, 486, 373, 480, 163, 262,
369, 371, 162, 26, 212, 478, 477, 161, 141, 363,
467, 122, 339, 187, 119, 348, 347, 117, 116, 115,
114, 112, 182, 457, 320, 22, 433, 432, 448, 19,
609, 431, 428, 62, 193, 596, 573, 298, 555, 552,
571, 404, 290, 380, 498, 510, 495, 306, 281, 499,
250, 5, 497, 460, 345, 447, 569, 550, 238, 299,
527, 525, 508, 961, 502, 501, 961, 401, 961, 211,
490, 356, 256, 961, 483, 961, 961, 961, 961, 961,
961, 961, 961, 961, 961, 961, 370,
};
static YYCODETYPE[] yy_lookahead = new YYCODETYPE[]{
19, 142, 143, 144, 145, 24, 1, 26, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 15, 98, 26, 27, 7, 8,
49, 50, 77, 78, 79, 80, 109, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 22, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 23, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 19, 94, 112, 19, 114, 115,
25, 82, 83, 84, 85, 86, 87, 88, 89, 90,
91, 92, 19, 22, 94, 95, 96, 150, 150, 99,
100, 101, 76, 150, 49, 50, 105, 106, 107, 54,
110, 158, 165, 165, 161, 162, 26, 27, 165, 113,
16, 174, 175, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 118, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 19, 23,
92, 97, 98, 24, 96, 97, 98, 99, 100, 101,
102, 25, 97, 216, 60, 92, 62, 109, 221, 25,
97, 98, 99, 100, 101, 102, 86, 87, 49, 50,
118, 116, 109, 25, 94, 95, 32, 97, 88, 89,
90, 91, 92, 128, 104, 41, 106, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
11, 82, 83, 84, 85, 86, 87, 88, 89, 90,
91, 92, 19, 19, 86, 87, 88, 89, 90, 91,
92, 27, 96, 150, 66, 99, 100, 101, 112, 150,
114, 115, 138, 150, 161, 162, 110, 103, 165, 222,
223, 224, 49, 50, 165, 22, 57, 24, 165, 170,
171, 118, 94, 170, 171, 23, 98, 25, 185, 186,
243, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 126, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 19, 129, 130, 131,
88, 23, 172, 173, 105, 106, 107, 150, 22, 26,
27, 181, 26, 27, 22, 116, 26, 27, 26, 230,
231, 197, 165, 230, 231, 113, 49, 50, 204, 117,
96, 174, 175, 99, 100, 101, 22, 26, 27, 136,
26, 27, 118, 16, 110, 68, 69, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80, 118, 82,
83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
19, 214, 215, 150, 23, 23, 155, 94, 95, 22,
94, 95, 116, 160, 94, 95, 94, 60, 165, 62,
112, 26, 114, 115, 128, 23, 36, 174, 175, 88,
49, 50, 57, 120, 22, 94, 95, 23, 94, 95,
120, 51, 25, 136, 169, 170, 171, 194, 58, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 23, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 19, 150, 12, 12, 23, 228,
105, 106, 107, 23, 233, 25, 165, 19, 150, 94,
165, 116, 28, 28, 112, 174, 114, 115, 108, 174,
175, 26, 27, 165, 49, 50, 231, 11, 44, 44,
46, 46, 174, 175, 112, 160, 114, 115, 50, 22,
23, 57, 25, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 119, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 19, 194,
225, 23, 23, 215, 19, 95, 105, 106, 107, 150,
23, 150, 27, 23, 67, 25, 150, 206, 207, 94,
95, 166, 104, 218, 165, 22, 165, 109, 49, 50,
120, 165, 25, 174, 175, 174, 175, 23, 21, 234,
174, 175, 22, 23, 239, 25, 25, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
205, 82, 83, 84, 85, 86, 87, 88, 89, 90,
91, 92, 19, 22, 23, 216, 23, 222, 223, 224,
63, 220, 35, 150, 150, 163, 220, 67, 166, 167,
168, 150, 169, 170, 171, 161, 162, 25, 165, 165,
150, 113, 49, 50, 25, 117, 165, 174, 175, 35,
7, 8, 9, 160, 160, 165, 120, 100, 67, 247,
248, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 193, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 19, 194, 194, 150,
135, 24, 137, 35, 231, 138, 150, 129, 130, 206,
207, 30, 27, 213, 165, 34, 118, 95, 0, 1,
2, 165, 218, 174, 175, 50, 49, 50, 22, 48,
174, 175, 22, 23, 23, 244, 222, 223, 224, 166,
167, 168, 120, 239, 23, 68, 69, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80, 150, 82,
83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
19, 150, 173, 165, 181, 182, 24, 67, 26, 104,
181, 188, 174, 175, 150, 39, 165, 150, 52, 150,
150, 150, 150, 144, 145, 174, 175, 249, 250, 165,
49, 50, 165, 52, 165, 165, 165, 165, 174, 175,
29, 174, 175, 174, 175, 174, 175, 160, 22, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 150, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 19, 150, 94, 165, 150, 150,
160, 194, 150, 213, 160, 52, 174, 175, 23, 23,
165, 25, 22, 165, 165, 150, 150, 165, 52, 174,
175, 22, 174, 175, 49, 50, 174, 175, 190, 191,
165, 165, 240, 23, 194, 25, 187, 109, 194, 174,
175, 190, 191, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 150, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 19, 150,
22, 165, 150, 23, 150, 25, 150, 166, 91, 92,
174, 175, 22, 217, 165, 150, 102, 165, 150, 165,
150, 165, 150, 174, 175, 19, 174, 175, 49, 50,
165, 86, 87, 165, 23, 165, 25, 165, 24, 174,
175, 187, 174, 175, 174, 175, 205, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
150, 82, 83, 84, 85, 86, 87, 88, 89, 90,
91, 92, 19, 150, 150, 165, 150, 150, 166, 23,
150, 25, 160, 20, 174, 175, 1, 2, 165, 165,
104, 165, 165, 43, 150, 165, 240, 150, 49, 50,
174, 175, 49, 50, 23, 23, 25, 25, 53, 165,
187, 187, 165, 23, 187, 25, 194, 205, 174, 175,
71, 72, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, 80, 150, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 19, 98, 150, 165,
150, 160, 150, 59, 25, 53, 104, 22, 174, 175,
213, 138, 5, 165, 1, 165, 150, 165, 150, 150,
240, 150, 174, 175, 174, 175, 49, 50, 118, 150,
35, 165, 27, 165, 165, 194, 165, 108, 127, 76,
174, 175, 174, 175, 165, 174, 175, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80, 166, 82,
83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
19, 20, 193, 22, 150, 150, 150, 26, 27, 76,
150, 22, 1, 150, 119, 121, 217, 20, 37, 165,
165, 165, 16, 19, 20, 165, 22, 205, 165, 119,
26, 27, 108, 128, 150, 150, 150, 56, 150, 22,
150, 37, 150, 127, 160, 23, 150, 66, 193, 165,
165, 165, 16, 165, 23, 165, 150, 165, 174, 175,
56, 165, 150, 65, 174, 175, 15, 86, 87, 88,
66, 165, 140, 150, 93, 94, 95, 165, 194, 98,
174, 175, 22, 3, 164, 193, 174, 175, 165, 150,
86, 87, 4, 180, 150, 248, 251, 93, 94, 95,
216, 180, 98, 251, 165, 221, 150, 149, 6, 165,
129, 130, 131, 132, 133, 134, 193, 150, 174, 175,
116, 165, 19, 20, 150, 22, 149, 151, 150, 26,
27, 149, 165, 129, 130, 131, 132, 133, 134, 165,
37, 174, 175, 165, 149, 19, 20, 13, 22, 150,
150, 150, 26, 27, 146, 147, 151, 150, 25, 56,
152, 159, 154, 37, 165, 165, 165, 193, 160, 66,
116, 193, 165, 174, 175, 174, 175, 194, 199, 150,
200, 126, 56, 124, 123, 150, 201, 122, 150, 86,
87, 150, 66, 193, 165, 202, 93, 94, 95, 150,
165, 98, 194, 165, 125, 22, 165, 150, 150, 26,
27, 135, 86, 87, 165, 174, 175, 203, 226, 93,
94, 95, 165, 165, 98, 150, 218, 150, 193, 157,
118, 157, 129, 130, 131, 132, 133, 134, 5, 104,
165, 211, 165, 10, 11, 12, 13, 14, 150, 66,
17, 174, 175, 210, 246, 129, 130, 131, 132, 133,
134, 150, 210, 165, 31, 121, 33, 150, 150, 86,
87, 176, 174, 175, 150, 42, 165, 94, 211, 210,
150, 98, 165, 165, 211, 174, 175, 150, 55, 165,
57, 150, 174, 175, 61, 165, 150, 64, 174, 175,
150, 150, 165, 150, 174, 175, 165, 104, 150, 184,
150, 165, 129, 130, 131, 165, 165, 150, 165, 150,
150, 176, 150, 165, 47, 165, 150, 150, 176, 103,
150, 22, 165, 178, 165, 165, 179, 165, 105, 106,
107, 165, 165, 229, 111, 165, 92, 176, 229, 116,
184, 176, 179, 156, 176, 176, 18, 157, 156, 237,
45, 157, 156, 135, 157, 157, 238, 156, 68, 157,
189, 189, 139, 219, 22, 157, 18, 192, 192, 192,
192, 189, 219, 199, 157, 242, 40, 157, 199, 242,
153, 157, 38, 245, 196, 166, 232, 198, 177, 177,
232, 227, 209, 178, 166, 182, 166, 148, 177, 177,
209, 196, 177, 199, 209, 199, 166, 208, 92, 195,
174, 174, 183, 252, 183, 183, 252, 191, 252, 235,
186, 241, 241, 252, 186, 252, 252, 252, 252, 252,
252, 252, 252, 252, 252, 252, 236,
};
const int YY_SHIFT_USE_DFLT = -74;
const int YY_SHIFT_COUNT = 418;
const int YY_SHIFT_MIN = -73;
const int YY_SHIFT_MAX = 1468;
static short[] yy_shift_ofst = new short[]{
975, 1114, 1343, 1114, 1213, 1213, 90, 90, 0, -19,
1213, 1213, 1213, 1213, 1213, 345, 445, 721, 1091, 1213,
1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213,
1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213,
1213, 1213, 1213, 1213, 1213, 1213, 1213, 1236, 1213, 1213,
1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213,
1213, 199, 445, 445, 835, 835, 365, 1164, 55, 647,
573, 499, 425, 351, 277, 203, 129, 795, 795, 795,
795, 795, 795, 795, 795, 795, 795, 795, 795, 795,
795, 795, 795, 795, 795, 869, 795, 943, 1017, 1017,
-69, -45, -45, -45, -45, -45, -1, 58, 138, 100,
445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
445, 445, 445, 445, 445, 445, 537, 438, 445, 445,
445, 445, 445, 365, 807, 1436, -74, -74, -74, 1293,
73, 434, 434, 311, 314, 290, 283, 286, 540, 467,
445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
445, 445, 445, 445, 445, 445, 445, 445, 445, 445,
445, 445, 65, 722, 722, 722, 688, 266, 1164, 1164,
1164, -74, -74, -74, 136, 168, 168, 234, 360, 360,
360, 430, 372, 435, 352, 278, 126, -36, -36, -36,
-36, 421, 651, -36, -36, 592, 292, 212, 623, 158,
204, 204, 505, 158, 505, 144, 365, 154, 365, 154,
645, 154, 204, 154, 154, 535, 548, 548, 365, 387,
508, 233, 1464, 1222, 1222, 1456, 1456, 1222, 1462, 1410,
1165, 1468, 1468, 1468, 1468, 1222, 1165, 1462, 1410, 1410,
1222, 1448, 1338, 1425, 1222, 1222, 1448, 1222, 1448, 1222,
1448, 1419, 1313, 1313, 1313, 1387, 1364, 1364, 1419, 1313,
1336, 1313, 1387, 1313, 1313, 1254, 1245, 1254, 1245, 1254,
1245, 1222, 1222, 1186, 1189, 1175, 1169, 1171, 1165, 1164,
1243, 1244, 1244, 1212, 1212, 1212, 1212, -74, -74, -74,
-74, -74, -74, 939, 104, 680, 571, 327, 1, 980,
26, 972, 971, 946, 901, 870, 830, 806, 54, 21,
-73, 510, 242, 1198, 1190, 1170, 1042, 1161, 1108, 1146,
1141, 1132, 1015, 1127, 1026, 1034, 1020, 1107, 1004, 1116,
1121, 1005, 1099, 951, 1043, 1003, 969, 1045, 1035, 950,
1053, 1047, 1025, 942, 913, 992, 1019, 945, 984, 940,
876, 904, 953, 896, 748, 804, 880, 786, 868, 819,
805, 810, 773, 751, 766, 706, 716, 691, 681, 568,
655, 638, 676, 516, 541, 594, 599, 567, 541, 534,
507, 527, 498, 523, 466, 382, 409, 384, 357, 6,
240, 224, 143, 62, 18, 71, 39, 9, 5,
};
const int YY_REDUCE_USE_DFLT = -142;
const int YY_REDUCE_COUNT = 312;
const int YY_REDUCE_MIN = -141;
const int YY_REDUCE_MAX = 1369;
static short[] yy_reduce_ofst = new short[]{
-141, 994, 1118, 223, 157, -53, 93, 89, 83, 375,
386, 381, 379, 308, 295, 325, -47, 27, 1240, 1234,
1228, 1221, 1208, 1187, 1151, 1111, 1109, 1077, 1054, 1022,
1016, 1000, 911, 908, 906, 890, 888, 874, 834, 816,
800, 760, 758, 755, 742, 739, 726, 685, 672, 668,
665, 652, 611, 609, 607, 604, 591, 578, 526, 519,
453, 474, 454, 461, 443, 245, 442, 473, 484, 484,
484, 484, 484, 484, 484, 484, 484, 484, 484, 484,
484, 484, 484, 484, 484, 484, 484, 484, 484, 484,
484, 484, 484, 484, 484, 484, 484, 484, 484, 484,
484, 484, 484, 484, 484, 484, 484, 130, 484, 484,
1145, 909, 1110, 1088, 1084, 1033, 1002, 965, 820, 837,
746, 686, 612, 817, 610, 919, 221, 563, 814, 813,
744, 669, 470, 543, 484, 484, 484, 484, 484, 291,
569, 671, 658, 970, 1290, 1287, 1286, 1282, 518, 518,
1280, 1279, 1277, 1270, 1268, 1263, 1261, 1260, 1256, 1251,
1247, 1227, 1185, 1168, 1167, 1159, 1148, 1139, 1117, 1066,
1049, 1006, 998, 996, 995, 973, 970, 966, 964, 892,
762, -52, 881, 932, 802, 731, 619, 812, 664, 660,
627, 392, 331, 124, 1358, 1357, 1356, 1354, 1352, 1351,
1349, 1319, 1334, 1346, 1334, 1334, 1334, 1334, 1334, 1334,
1334, 1320, 1304, 1334, 1334, 1319, 1360, 1325, 1369, 1326,
1315, 1311, 1301, 1324, 1300, 1335, 1350, 1345, 1348, 1342,
1333, 1341, 1303, 1332, 1331, 1284, 1278, 1274, 1339, 1309,
1308, 1347, 1258, 1344, 1340, 1257, 1253, 1337, 1273, 1302,
1299, 1298, 1297, 1296, 1295, 1328, 1294, 1264, 1292, 1291,
1322, 1321, 1238, 1232, 1318, 1317, 1316, 1314, 1312, 1310,
1307, 1283, 1289, 1288, 1285, 1276, 1229, 1224, 1267, 1281,
1265, 1262, 1235, 1255, 1205, 1183, 1179, 1177, 1162, 1140,
1153, 1184, 1182, 1102, 1124, 1103, 1095, 1090, 1089, 1093,
1112, 1115, 1086, 1105, 1092, 1087, 1068, 962, 955, 957,
1031, 1023, 1030,
};
static YYACTIONTYPE[] yy_default = new YYACTIONTYPE[] {
635, 870, 959, 959, 959, 870, 899, 899, 959, 759,
959, 959, 959, 959, 868, 959, 959, 933, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 899, 899, 674, 763, 794, 959,
959, 959, 959, 959, 959, 959, 959, 932, 934, 809,
808, 802, 801, 912, 774, 799, 792, 785, 796, 871,
864, 865, 863, 867, 872, 959, 795, 831, 848, 830,
842, 847, 854, 846, 843, 833, 832, 666, 834, 835,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 661, 728, 959, 959,
959, 959, 959, 959, 836, 837, 851, 850, 849, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 939, 937, 959, 883, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 641, 959, 759, 759, 759, 635, 959, 959, 959,
959, 951, 763, 753, 719, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 959, 804, 742, 922,
924, 959, 905, 740, 663, 761, 676, 751, 643, 798,
776, 776, 917, 798, 917, 700, 959, 788, 959, 788,
697, 788, 776, 788, 788, 866, 959, 959, 959, 760,
751, 959, 944, 767, 767, 936, 936, 767, 810, 732,
798, 739, 739, 739, 739, 767, 798, 810, 732, 732,
767, 658, 911, 909, 767, 767, 658, 767, 658, 767,
658, 876, 730, 730, 730, 715, 880, 880, 876, 730,
700, 730, 715, 730, 730, 780, 775, 780, 775, 780,
775, 767, 767, 959, 793, 781, 791, 789, 798, 959,
718, 651, 651, 640, 640, 640, 640, 956, 956, 951,
702, 702, 684, 959, 959, 959, 959, 959, 959, 959,
885, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 636, 946, 959, 959, 943, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 915,
959, 959, 959, 959, 959, 959, 908, 907, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 959,
959, 959, 959, 959, 790, 959, 782, 959, 869, 959,
959, 959, 959, 959, 959, 959, 959, 959, 959, 745,
819, 959, 818, 822, 817, 668, 959, 649, 959, 632,
637, 955, 958, 957, 954, 953, 952, 947, 945, 942,
941, 940, 938, 935, 931, 889, 887, 894, 893, 892,
891, 890, 888, 886, 884, 805, 803, 800, 797, 930,
882, 741, 738, 737, 657, 948, 914, 923, 921, 811,
920, 919, 918, 916, 913, 900, 807, 806, 733, 874,
873, 660, 904, 903, 902, 906, 910, 901, 769, 659,
656, 665, 722, 721, 729, 727, 726, 725, 724, 723,
720, 667, 675, 686, 714, 699, 698, 879, 881, 878,
877, 707, 706, 712, 711, 710, 709, 708, 705, 704,
703, 696, 695, 701, 694, 717, 716, 713, 693, 736,
735, 734, 731, 692, 691, 690, 822, 689, 688, 828,
827, 815, 858, 756, 755, 754, 766, 765, 778, 777,
813, 812, 779, 764, 758, 757, 773, 772, 771, 770,
762, 752, 784, 787, 786, 783, 860, 768, 857, 929,
928, 927, 926, 925, 862, 861, 829, 826, 679, 680,
898, 896, 897, 895, 682, 681, 678, 677, 859, 747,
746, 855, 852, 844, 840, 856, 853, 845, 841, 839,
838, 824, 823, 821, 820, 816, 825, 670, 748, 744,
743, 814, 750, 749, 687, 685, 683, 664, 662, 655,
653, 652, 654, 650, 648, 647, 646, 645, 644, 673,
672, 671, 669, 668, 642, 639, 638, 634, 633, 631,
};
** like the following:
**
** %fallback ID X Y Z.
**
** appears in the grammar, then ID becomes a fallback token for X, Y,
** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
** but it does not parse, the type of the token is changed to ID and
** the parse is retried before an error is thrown.
*/
#if YYFALLBACK || TRUE
static YYCODETYPE[] yyFallback = new YYCODETYPE[]{
0,
0,
26,
26,
26,
26,
0,
26,
26,
26,
0,
26,
26,
26,
26,
0,
0,
0,
26,
0,
0,
26,
0,
0,
0,
0,
0,
0,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
26,
};
#endif // * YYFALLBACK */
** parser's stack. Information stored includes:
**
** + The state number for the parser at this level of the stack.
**
** + The value of the token stored at this level of the stack.
** (In other words, the "major" token.)
**
** + The semantic value stored at this level of the stack. This is
** the information used by the action routines in the grammar.
** It is sometimes called the "minor" token.
*/
public class yyStackEntry
{
public YYACTIONTYPE stateno;
public YYCODETYPE major;
** number for the token at this stack level */
public YYMINORTYPE minor;
** is the value of the token */
};
** the following structure */
public class yyParser
{
public int yyidx;
#if YYTRACKMAXSTACKDEPTH
int yyidxMax;
#endif
public int yyerrcnt;
public Parse pParse;
#if YYSTACKDEPTH//<=0
public int yystksz;
public yyStackEntry *yystack;
#else
public yyStackEntry[] yystack = new yyStackEntry[YYSTACKDEPTH];
#endif
};
#if !NDEBUG
static TextWriter yyTraceFILE = null;
static string yyTracePrompt = "";
#endif // * NDEBUG */
#if !NDEBUG
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message. Tracing is turned off
** by making either argument NULL
**
** Inputs:
** <ul>
** <li> A FILE* to which trace output should be written.
** If NULL, then tracing is turned off.
** <li> A prefix string written at the beginning of every
** line of trace output. If NULL, then tracing is
** turned off.
** </ul>
**
** Outputs:
** None.
*/
static void sqlite3ParserTrace( TextWriter TraceFILE, string zTracePrompt )
{
yyTraceFILE = TraceFILE;
yyTracePrompt = zTracePrompt;
if ( yyTraceFILE == null )
yyTracePrompt = "";
else if ( yyTracePrompt == "" )
yyTraceFILE = null;
}
#endif // * NDEBUG */
#if !NDEBUG
** are required. The following table supplies these names */
static string[] yyTokenName = {
"$", "SEMI", "EXPLAIN", "QUERY",
"PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
"IMMEDIATE", "EXCLUSIVE", "COMMIT", "END",
"ROLLBACK", "SAVEPOINT", "RELEASE", "TO",
"TABLE", "CREATE", "IF", "NOT",
"EXISTS", "TEMP", "LP", "RP",
"AS", "COMMA", "ID", "INDEXED",
"ABORT", "ACTION", "AFTER", "ANALYZE",
"ASC", "ATTACH", "BEFORE", "BY",
"CASCADE", "CAST", "COLUMNKW", "CONFLICT",
"DATABASE", "DESC", "DETACH", "EACH",
"FAIL", "FOR", "IGNORE", "INITIALLY",
"INSTEAD", "LIKE_KW", "MATCH", "NO",
"KEY", "OF", "OFFSET", "PRAGMA",
"RAISE", "REPLACE", "RESTRICT", "ROW",
"TRIGGER", "VACUUM", "VIEW", "VIRTUAL",
"REINDEX", "RENAME", "CTIME_KW", "ANY",
"OR", "AND", "IS", "BETWEEN",
"IN", "ISNULL", "NOTNULL", "NE",
"EQ", "GT", "LE", "LT",
"GE", "ESCAPE", "BITAND", "BITOR",
"LSHIFT", "RSHIFT", "PLUS", "MINUS",
"STAR", "SLASH", "REM", "CONCAT",
"COLLATE", "BITNOT", "STRING", "JOIN_KW",
"CONSTRAINT", "DEFAULT", "NULL", "PRIMARY",
"UNIQUE", "CHECK", "REFERENCES", "AUTOINCR",
"ON", "INSERT", "DELETE", "UPDATE",
"SET", "DEFERRABLE", "FOREIGN", "DROP",
"UNION", "ALL", "EXCEPT", "INTERSECT",
"SELECT", "DISTINCT", "DOT", "FROM",
"JOIN", "USING", "ORDER", "GROUP",
"HAVING", "LIMIT", "WHERE", "INTO",
"VALUES", "INTEGER", "FLOAT", "BLOB",
"REGISTER", "VARIABLE", "CASE", "WHEN",
"THEN", "ELSE", "INDEX", "ALTER",
"ADD", "error", "input", "cmdlist",
"ecmd", "explain", "cmdx", "cmd",
"transtype", "trans_opt", "nm", "savepoint_opt",
"create_table", "create_table_args", "createkw", "temp",
"ifnotexists", "dbnm", "columnlist", "conslist_opt",
"select", "column", "columnid", "type",
"carglist", "id", "ids", "typetoken",
"typename", "signed", "plus_num", "minus_num",
"carg", "ccons", "term", "expr",
"onconf", "sortorder", "autoinc", "idxlist_opt",
"refargs", "defer_subclause", "refarg", "refact",
"init_deferred_pred_opt", "conslist", "tcons", "idxlist",
"defer_subclause_opt", "orconf", "resolvetype", "raisetype",
"ifexists", "fullname", "oneselect", "multiselect_op",
"distinct", "selcollist", "from", "where_opt",
"groupby_opt", "having_opt", "orderby_opt", "limit_opt",
"sclp", "as", "seltablist", "stl_prefix",
"joinop", "indexed_opt", "on_opt", "using_opt",
"joinop2", "inscollist", "sortlist", "sortitem",
"nexprlist", "setlist", "insert_cmd", "inscollist_opt",
"itemlist", "exprlist", "likeop", "between_op",
"in_op", "case_operand", "case_exprlist", "case_else",
"uniqueflag", "collate", "nmnum", "plus_opt",
"number", "trigger_decl", "trigger_cmd_list", "trigger_time",
"trigger_event", "foreach_clause", "when_clause", "trigger_cmd",
"trnm", "tridxby", "database_kw_opt", "key_opt",
"add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist",
"vtabarg", "vtabargtoken", "lp", "anylist",
};
#endif // * NDEBUG */
#if !NDEBUG
*/
static string[] yyRuleName = {
"input ::= cmdlist",
"cmdlist ::= cmdlist ecmd",
"cmdlist ::= ecmd",
"ecmd ::= SEMI",
"ecmd ::= explain cmdx SEMI",
"explain ::=",
"explain ::= EXPLAIN",
"explain ::= EXPLAIN QUERY PLAN",
"cmdx ::= cmd",
"cmd ::= BEGIN transtype trans_opt",
"trans_opt ::=",
"trans_opt ::= TRANSACTION",
"trans_opt ::= TRANSACTION nm",
"transtype ::=",
"transtype ::= DEFERRED",
"transtype ::= IMMEDIATE",
"transtype ::= EXCLUSIVE",
"cmd ::= COMMIT trans_opt",
"cmd ::= END trans_opt",
"cmd ::= ROLLBACK trans_opt",
"savepoint_opt ::= SAVEPOINT",
"savepoint_opt ::=",
"cmd ::= SAVEPOINT nm",
"cmd ::= RELEASE savepoint_opt nm",
"cmd ::= ROLLBACK trans_opt TO savepoint_opt nm",
"cmd ::= create_table create_table_args",
"create_table ::= createkw temp TABLE ifnotexists nm dbnm",
"createkw ::= CREATE",
"ifnotexists ::=",
"ifnotexists ::= IF NOT EXISTS",
"temp ::= TEMP",
"temp ::=",
"create_table_args ::= LP columnlist conslist_opt RP",
"create_table_args ::= AS select",
"columnlist ::= columnlist COMMA column",
"columnlist ::= column",
"column ::= columnid type carglist",
"columnid ::= nm",
"id ::= ID",
"id ::= INDEXED",
"ids ::= ID|STRING",
"nm ::= id",
"nm ::= STRING",
"nm ::= JOIN_KW",
"type ::=",
"type ::= typetoken",
"typetoken ::= typename",
"typetoken ::= typename LP signed RP",
"typetoken ::= typename LP signed COMMA signed RP",
"typename ::= ids",
"typename ::= typename ids",
"signed ::= plus_num",
"signed ::= minus_num",
"carglist ::= carglist carg",
"carglist ::=",
"carg ::= CONSTRAINT nm ccons",
"carg ::= ccons",
"ccons ::= DEFAULT term",
"ccons ::= DEFAULT LP expr RP",
"ccons ::= DEFAULT PLUS term",
"ccons ::= DEFAULT MINUS term",
"ccons ::= DEFAULT id",
"ccons ::= NULL onconf",
"ccons ::= NOT NULL onconf",
"ccons ::= PRIMARY KEY sortorder onconf autoinc",
"ccons ::= UNIQUE onconf",
"ccons ::= CHECK LP expr RP",
"ccons ::= REFERENCES nm idxlist_opt refargs",
"ccons ::= defer_subclause",
"ccons ::= COLLATE ids",
"autoinc ::=",
"autoinc ::= AUTOINCR",
"refargs ::=",
"refargs ::= refargs refarg",
"refarg ::= MATCH nm",
"refarg ::= ON INSERT refact",
"refarg ::= ON DELETE refact",
"refarg ::= ON UPDATE refact",
"refact ::= SET NULL",
"refact ::= SET DEFAULT",
"refact ::= CASCADE",
"refact ::= RESTRICT",
"refact ::= NO ACTION",
"defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
"defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
"init_deferred_pred_opt ::=",
"init_deferred_pred_opt ::= INITIALLY DEFERRED",
"init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
"conslist_opt ::=",
"conslist_opt ::= COMMA conslist",
"conslist ::= conslist COMMA tcons",
"conslist ::= conslist tcons",
"conslist ::= tcons",
"tcons ::= CONSTRAINT nm",
"tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
"tcons ::= UNIQUE LP idxlist RP onconf",
"tcons ::= CHECK LP expr RP onconf",
"tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
"defer_subclause_opt ::=",
"defer_subclause_opt ::= defer_subclause",
"onconf ::=",
"onconf ::= ON CONFLICT resolvetype",
"orconf ::=",
"orconf ::= OR resolvetype",
"resolvetype ::= raisetype",
"resolvetype ::= IGNORE",
"resolvetype ::= REPLACE",
"cmd ::= DROP TABLE ifexists fullname",
"ifexists ::= IF EXISTS",
"ifexists ::=",
"cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select",
"cmd ::= DROP VIEW ifexists fullname",
"cmd ::= select",
"select ::= oneselect",
"select ::= select multiselect_op oneselect",
"multiselect_op ::= UNION",
"multiselect_op ::= UNION ALL",
"multiselect_op ::= EXCEPT|INTERSECT",
"oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
"distinct ::= DISTINCT",
"distinct ::= ALL",
"distinct ::=",
"sclp ::= selcollist COMMA",
"sclp ::=",
"selcollist ::= sclp expr as",
"selcollist ::= sclp STAR",
"selcollist ::= sclp nm DOT STAR",
"as ::= AS nm",
"as ::= ids",
"as ::=",
"from ::=",
"from ::= FROM seltablist",
"stl_prefix ::= seltablist joinop",
"stl_prefix ::=",
"seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
"seltablist ::= stl_prefix LP select RP as on_opt using_opt",
"seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
"dbnm ::=",
"dbnm ::= DOT nm",
"fullname ::= nm dbnm",
"joinop ::= COMMA|JOIN",
"joinop ::= JOIN_KW JOIN",
"joinop ::= JOIN_KW nm JOIN",
"joinop ::= JOIN_KW nm nm JOIN",
"on_opt ::= ON expr",
"on_opt ::=",
"indexed_opt ::=",
"indexed_opt ::= INDEXED BY nm",
"indexed_opt ::= NOT INDEXED",
"using_opt ::= USING LP inscollist RP",
"using_opt ::=",
"orderby_opt ::=",
"orderby_opt ::= ORDER BY sortlist",
"sortlist ::= sortlist COMMA sortitem sortorder",
"sortlist ::= sortitem sortorder",
"sortitem ::= expr",
"sortorder ::= ASC",
"sortorder ::= DESC",
"sortorder ::=",
"groupby_opt ::=",
"groupby_opt ::= GROUP BY nexprlist",
"having_opt ::=",
"having_opt ::= HAVING expr",
"limit_opt ::=",
"limit_opt ::= LIMIT expr",
"limit_opt ::= LIMIT expr OFFSET expr",
"limit_opt ::= LIMIT expr COMMA expr",
"cmd ::= DELETE FROM fullname indexed_opt where_opt",
"where_opt ::=",
"where_opt ::= WHERE expr",
"cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt",
"setlist ::= setlist COMMA nm EQ expr",
"setlist ::= nm EQ expr",
"cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP",
"cmd ::= insert_cmd INTO fullname inscollist_opt select",
"cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
"insert_cmd ::= INSERT orconf",
"insert_cmd ::= REPLACE",
"itemlist ::= itemlist COMMA expr",
"itemlist ::= expr",
"inscollist_opt ::=",
"inscollist_opt ::= LP inscollist RP",
"inscollist ::= inscollist COMMA nm",
"inscollist ::= nm",
"expr ::= term",
"expr ::= LP expr RP",
"term ::= NULL",
"expr ::= id",
"expr ::= JOIN_KW",
"expr ::= nm DOT nm",
"expr ::= nm DOT nm DOT nm",
"term ::= INTEGER|FLOAT|BLOB",
"term ::= STRING",
"expr ::= REGISTER",
"expr ::= VARIABLE",
"expr ::= expr COLLATE ids",
"expr ::= CAST LP expr AS typetoken RP",
"expr ::= ID LP distinct exprlist RP",
"expr ::= ID LP STAR RP",
"term ::= CTIME_KW",
"expr ::= expr AND expr",
"expr ::= expr OR expr",
"expr ::= expr LT|GT|GE|LE expr",
"expr ::= expr EQ|NE expr",
"expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
"expr ::= expr PLUS|MINUS expr",
"expr ::= expr STAR|SLASH|REM expr",
"expr ::= expr CONCAT expr",
"likeop ::= LIKE_KW",
"likeop ::= NOT LIKE_KW",
"likeop ::= MATCH",
"likeop ::= NOT MATCH",
"expr ::= expr likeop expr",
"expr ::= expr likeop expr ESCAPE expr",
"expr ::= expr ISNULL|NOTNULL",
"expr ::= expr NOT NULL",
"expr ::= expr IS expr",
"expr ::= expr IS NOT expr",
"expr ::= NOT expr",
"expr ::= BITNOT expr",
"expr ::= MINUS expr",
"expr ::= PLUS expr",
"between_op ::= BETWEEN",
"between_op ::= NOT BETWEEN",
"expr ::= expr between_op expr AND expr",
"in_op ::= IN",
"in_op ::= NOT IN",
"expr ::= expr in_op LP exprlist RP",
"expr ::= LP select RP",
"expr ::= expr in_op LP select RP",
"expr ::= expr in_op nm dbnm",
"expr ::= EXISTS LP select RP",
"expr ::= CASE case_operand case_exprlist case_else END",
"case_exprlist ::= case_exprlist WHEN expr THEN expr",
"case_exprlist ::= WHEN expr THEN expr",
"case_else ::= ELSE expr",
"case_else ::=",
"case_operand ::= expr",
"case_operand ::=",
"exprlist ::= nexprlist",
"exprlist ::=",
"nexprlist ::= nexprlist COMMA expr",
"nexprlist ::= expr",
"cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
"uniqueflag ::= UNIQUE",
"uniqueflag ::=",
"idxlist_opt ::=",
"idxlist_opt ::= LP idxlist RP",
"idxlist ::= idxlist COMMA nm collate sortorder",
"idxlist ::= nm collate sortorder",
"collate ::=",
"collate ::= COLLATE ids",
"cmd ::= DROP INDEX ifexists fullname",
"cmd ::= VACUUM",
"cmd ::= VACUUM nm",
"cmd ::= PRAGMA nm dbnm",
"cmd ::= PRAGMA nm dbnm EQ nmnum",
"cmd ::= PRAGMA nm dbnm LP nmnum RP",
"cmd ::= PRAGMA nm dbnm EQ minus_num",
"cmd ::= PRAGMA nm dbnm LP minus_num RP",
"nmnum ::= plus_num",
"nmnum ::= nm",
"nmnum ::= ON",
"nmnum ::= DELETE",
"nmnum ::= DEFAULT",
"plus_num ::= plus_opt number",
"minus_num ::= MINUS number",
"number ::= INTEGER|FLOAT",
"plus_opt ::= PLUS",
"plus_opt ::=",
"cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
"trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
"trigger_time ::= BEFORE",
"trigger_time ::= AFTER",
"trigger_time ::= INSTEAD OF",
"trigger_time ::=",
"trigger_event ::= DELETE|INSERT",
"trigger_event ::= UPDATE",
"trigger_event ::= UPDATE OF inscollist",
"foreach_clause ::=",
"foreach_clause ::= FOR EACH ROW",
"when_clause ::=",
"when_clause ::= WHEN expr",
"trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
"trigger_cmd_list ::= trigger_cmd SEMI",
"trnm ::= nm",
"trnm ::= nm DOT nm",
"tridxby ::=",
"tridxby ::= INDEXED BY nm",
"tridxby ::= NOT INDEXED",
"trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
"trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP",
"trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select",
"trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
"trigger_cmd ::= select",
"expr ::= RAISE LP IGNORE RP",
"expr ::= RAISE LP raisetype COMMA nm RP",
"raisetype ::= ROLLBACK",
"raisetype ::= ABORT",
"raisetype ::= FAIL",
"cmd ::= DROP TRIGGER ifexists fullname",
"cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
"cmd ::= DETACH database_kw_opt expr",
"key_opt ::=",
"key_opt ::= KEY expr",
"database_kw_opt ::= DATABASE",
"database_kw_opt ::=",
"cmd ::= REINDEX",
"cmd ::= REINDEX nm dbnm",
"cmd ::= ANALYZE",
"cmd ::= ANALYZE nm dbnm",
"cmd ::= ALTER TABLE fullname RENAME TO nm",
"cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
"add_column_fullname ::= fullname",
"kwcolumn_opt ::=",
"kwcolumn_opt ::= COLUMNKW",
"cmd ::= create_vtab",
"cmd ::= create_vtab LP vtabarglist RP",
"create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm",
"vtabarglist ::= vtabarg",
"vtabarglist ::= vtabarglist COMMA vtabarg",
"vtabarg ::=",
"vtabarg ::= vtabarg vtabargtoken",
"vtabargtoken ::= ANY",
"vtabargtoken ::= lp anylist RP",
"lp ::= LP",
"anylist ::=",
"anylist ::= anylist LP anylist RP",
"anylist ::= anylist ANY",
};
#endif // * NDEBUG */
#if YYSTACKDEPTH//<=0
** Try to increase the size of the parser stack.
*/
static void yyGrowStack(yyParser p){
int newSize;
newSize = p.yystksz*2 + 100;
p.yystack = Array.Resize(p.yystack,newSize);
p.yystksz = newSize;
#if !NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
yyTracePrompt, p.yystksz);
}
#endif
}
#endif
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
**
** Inputs:
** A pointer to the function used to allocate memory.
**
** Outputs:
** A pointer to a parser. This pointer is used in subsequent calls
** to sqlite3Parser and sqlite3ParserFree.
*/
static yyParser sqlite3ParserAlloc()
{
yyParser pParser = new yyParser();
if ( pParser != null )
{
pParser.yyidx = -1;
#if YYTRACKMAXSTACKDEPTH
pParser.yyidxMax=0;
#endif
#if YYSTACKDEPTH//<=0
pParser.yystack = NULL;
pParser.yystksz = null;
yyGrowStack(pParser);
#endif
}
return pParser;
}
** symbol. The symbol can be either a terminal or nonterminal.
** "yymajor" is the symbol code, and "yypminor" is a pointer to
** the value.
*/
static void yy_destructor(
yyParser yypParser,
YYCODETYPE yymajor,
YYMINORTYPE yypminor
)
{
Parse pParse = yypParser.pParse;
switch ( yymajor )
{
** terminal or non-terminal is destroyed. This can happen
** when the symbol is popped from the stack during a
** reduce or during error processing or when a parser is
** being destroyed before it is finished parsing.
**
** Note: during a reduce, the only symbols destroyed are those
** which appear on the RHS of the rule, but which are not used
** inside the C code.
*/
case 160:
case 194:
{
sqlite3SelectDelete( pParse.db, ref ( yypminor.yy387 ) );
}
break;
case 174:
case 175:
{
sqlite3ExprDelete( pParse.db, ref ( yypminor.yy118 ).pExpr );
}
break;
case 179:
case 187:
case 197:
case 200:
case 202:
case 204:
case 214:
case 216:
case 217:
case 220:
case 221:
case 226:
{
sqlite3ExprListDelete( pParse.db, ref ( yypminor.yy322 ) );
}
break;
case 193:
case 198:
case 206:
case 207:
{
sqlite3SrcListDelete( pParse.db, ref ( yypminor.yy259 ) );
}
break;
case 199:
case 201:
case 210:
case 215:
case 225:
case 227:
case 238:
case 243:
{
sqlite3ExprDelete( pParse.db, ref ( yypminor.yy314 ) );
}
break;
case 211:
case 213:
case 219:
{
sqlite3IdListDelete( pParse.db, ref ( yypminor.yy384 ) );
}
break;
case 234:
case 239:
{
sqlite3DeleteTriggerStep( pParse.db, ref ( yypminor.yy203 ) );
}
break;
case 236:
{
sqlite3IdListDelete( pParse.db, ref ( yypminor.yy90 ).b );
}
break;
default:
break;
}
}
** Pop the parser's stack once.
**
** If there is a destructor routine associated with the token which
** is popped from the stack, then call it.
**
** Return the major token number for the symbol popped.
*/
static int yy_pop_parser_stack( yyParser pParser )
{
YYCODETYPE yymajor;
yyStackEntry yytos = pParser.yystack[pParser.yyidx];
** empty in SQLite. */
if ( NEVER( pParser.yyidx < 0 ) )
return 0;
#if !NDEBUG
if ( yyTraceFILE != null && pParser.yyidx >= 0 )
{
fprintf( yyTraceFILE, "%sPopping %s\n",
yyTracePrompt,
yyTokenName[yytos.major] );
}
#endif
yymajor = yytos.major;
yy_destructor( pParser, yymajor, yytos.minor );
pParser.yyidx--;
return yymajor;
}
** Deallocate and destroy a parser. Destructors are all called for
** all stack elements before shutting the parser down.
**
** Inputs:
** <ul>
** <li> A pointer to the parser. This should be a pointer
** obtained from sqlite3ParserAlloc.
** <li> A pointer to a function used to reclaim memory obtained
** from malloc.
** </ul>
*/
static void sqlite3ParserFree(
yyParser p,
dxDel freeProc//)(void*)
)
{
yyParser pParser = p;
** created in the first place. */
if ( NEVER( pParser == null ) )
return;
while ( pParser.yyidx >= 0 )
yy_pop_parser_stack( pParser );
#if YYSTACKDEPTH//<=0
pParser.yystack = null;
#endif
pParser = null;
}
** Return the peak depth of the stack for a parser.
*/
#if YYTRACKMAXSTACKDEPTH
int sqlite3ParserStackPeak(void p){
yyParser pParser = (yyParser*)p;
return pParser.yyidxMax;
}
#endif
** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead. If it is, return the action, otherwise
** return YY_NO_ACTION.
*/
static int yy_find_shift_action(
yyParser pParser,
YYCODETYPE iLookAhead
)
{
int i;
int stateno = pParser.yystack[pParser.yyidx].stateno;
if ( stateno > YY_SHIFT_COUNT
|| ( i = yy_shift_ofst[stateno] ) == YY_SHIFT_USE_DFLT )
{
return yy_default[stateno];
}
Debug.Assert( iLookAhead != YYNOCODE );
i += iLookAhead;
if ( i < 0 || i >= YY_ACTTAB_COUNT || yy_lookahead[i] != iLookAhead )
{
if ( iLookAhead > 0 )
{
YYCODETYPE iFallback;
if ( iLookAhead < yyFallback.Length
&& ( iFallback = yyFallback[iLookAhead] ) != 0 )
{
#if !NDEBUG
if ( yyTraceFILE != null )
{
fprintf( yyTraceFILE, "%sFALLBACK %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback] );
}
#endif
return yy_find_shift_action( pParser, iFallback );
}
{
int j = i - iLookAhead + YYWILDCARD;
if (
j >= 0 &&
j < YY_ACTTAB_COUNT &&
yy_lookahead[j] == YYWILDCARD
)
{
#if !NDEBUG
if ( yyTraceFILE != null )
{
Debugger.Break();
}
#endif // * NDEBUG */
return yy_action[j];
}
}
}
return yy_default[stateno];
}
else
{
return yy_action[i];
}
}
** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead. If it is, return the action, otherwise
** return YY_NO_ACTION.
*/
static int yy_find_reduce_action(
int stateno,
YYCODETYPE iLookAhead
)
{
int i;
#if YYERRORSYMBOL
if( stateno>YY_REDUCE_COUNT ){
return yy_default[stateno];
}
#else
Debug.Assert( stateno <= YY_REDUCE_COUNT );
#endif
i = yy_reduce_ofst[stateno];
Debug.Assert( i != YY_REDUCE_USE_DFLT );
Debug.Assert( iLookAhead != YYNOCODE );
i += iLookAhead;
#if YYERRORSYMBOL
if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
return yy_default[stateno];
}
#else
Debug.Assert( i >= 0 && i < YY_ACTTAB_COUNT );
Debug.Assert( yy_lookahead[i] == iLookAhead );
#endif
return yy_action[i];
}
** The following routine is called if the stack overflows.
*/
static void yyStackOverflow( yyParser yypParser, YYMINORTYPE yypMinor )
{
Parse pParse = yypParser.pParse;
yypParser.yyidx--;
#if !NDEBUG
if ( yyTraceFILE != null )
{
Debugger.Break();
}
#endif
while ( yypParser.yyidx >= 0 )
yy_pop_parser_stack( yypParser );
** stack every overflows */
UNUSED_PARAMETER( yypMinor );
sqlite3ErrorMsg( pParse, "parser stack overflow" );
pParse.parseError = 1;
yypParser.pParse = pParse;
}
** Perform a shift action.
*/
static void yy_shift(
yyParser yypParser,
int yyNewState,
int yyMajor,
YYMINORTYPE yypMinor
)
{
yyStackEntry yytos = new yyStackEntry();
yypParser.yyidx++;
#if YYTRACKMAXSTACKDEPTH
if( yypParser.yyidx>yypParser.yyidxMax ){
yypParser.yyidxMax = yypParser.yyidx;
}
#endif
#if !YYSTACKDEPTH//was YYSTACKDEPTH>0
if ( yypParser.yyidx >= YYSTACKDEPTH )
{
yyStackOverflow( yypParser, yypMinor );
return;
}
#else
if( yypParser.yyidx>=yypParser.yystksz ){
yyGrowStack(yypParser);
if( yypParser.yyidx>=yypParser.yystksz ){
yyStackOverflow(yypParser, yypMinor);
return;
}
}
#endif
yypParser.yystack[yypParser.yyidx] = yytos;
yytos.stateno = (YYACTIONTYPE)yyNewState;
yytos.major = (YYCODETYPE)yyMajor;
yytos.minor = yypMinor;
#if !NDEBUG
if ( yyTraceFILE != null && yypParser.yyidx > 0 )
{
int i;
fprintf( yyTraceFILE, "%sShift %d\n", yyTracePrompt, yyNewState );
fprintf( yyTraceFILE, "%sStack:", yyTracePrompt );
for ( i = 1; i <= yypParser.yyidx; i++ )
fprintf( yyTraceFILE, " %s", yyTokenName[yypParser.yystack[i].major] );
fprintf( yyTraceFILE, "\n" );
}
#endif
}
** is used during the reduce.
*/
public struct _yyRuleInfo
{
public YYCODETYPE lhs;
public byte nrhs;
public _yyRuleInfo( YYCODETYPE lhs, byte nrhs )
{
this.lhs = lhs;
this.nrhs = nrhs;
}
}
static _yyRuleInfo[] yyRuleInfo = new _yyRuleInfo[]{
new _yyRuleInfo( 142, 1 ),
new _yyRuleInfo( 143, 2 ),
new _yyRuleInfo( 143, 1 ),
new _yyRuleInfo( 144, 1 ),
new _yyRuleInfo( 144, 3 ),
new _yyRuleInfo( 145, 0 ),
new _yyRuleInfo( 145, 1 ),
new _yyRuleInfo( 145, 3 ),
new _yyRuleInfo( 146, 1 ),
new _yyRuleInfo( 147, 3 ),
new _yyRuleInfo( 149, 0 ),
new _yyRuleInfo( 149, 1 ),
new _yyRuleInfo( 149, 2 ),
new _yyRuleInfo( 148, 0 ),
new _yyRuleInfo( 148, 1 ),
new _yyRuleInfo( 148, 1 ),
new _yyRuleInfo( 148, 1 ),
new _yyRuleInfo( 147, 2 ),
new _yyRuleInfo( 147, 2 ),
new _yyRuleInfo( 147, 2 ),
new _yyRuleInfo( 151, 1 ),
new _yyRuleInfo( 151, 0 ),
new _yyRuleInfo( 147, 2 ),
new _yyRuleInfo( 147, 3 ),
new _yyRuleInfo( 147, 5 ),
new _yyRuleInfo( 147, 2 ),
new _yyRuleInfo( 152, 6 ),
new _yyRuleInfo( 154, 1 ),
new _yyRuleInfo( 156, 0 ),
new _yyRuleInfo( 156, 3 ),
new _yyRuleInfo( 155, 1 ),
new _yyRuleInfo( 155, 0 ),
new _yyRuleInfo( 153, 4 ),
new _yyRuleInfo( 153, 2 ),
new _yyRuleInfo( 158, 3 ),
new _yyRuleInfo( 158, 1 ),
new _yyRuleInfo( 161, 3 ),
new _yyRuleInfo( 162, 1 ),
new _yyRuleInfo( 165, 1 ),
new _yyRuleInfo( 165, 1 ),
new _yyRuleInfo( 166, 1 ),
new _yyRuleInfo( 150, 1 ),
new _yyRuleInfo( 150, 1 ),
new _yyRuleInfo( 150, 1 ),
new _yyRuleInfo( 163, 0 ),
new _yyRuleInfo( 163, 1 ),
new _yyRuleInfo( 167, 1 ),
new _yyRuleInfo( 167, 4 ),
new _yyRuleInfo( 167, 6 ),
new _yyRuleInfo( 168, 1 ),
new _yyRuleInfo( 168, 2 ),
new _yyRuleInfo( 169, 1 ),
new _yyRuleInfo( 169, 1 ),
new _yyRuleInfo( 164, 2 ),
new _yyRuleInfo( 164, 0 ),
new _yyRuleInfo( 172, 3 ),
new _yyRuleInfo( 172, 1 ),
new _yyRuleInfo( 173, 2 ),
new _yyRuleInfo( 173, 4 ),
new _yyRuleInfo( 173, 3 ),
new _yyRuleInfo( 173, 3 ),
new _yyRuleInfo( 173, 2 ),
new _yyRuleInfo( 173, 2 ),
new _yyRuleInfo( 173, 3 ),
new _yyRuleInfo( 173, 5 ),
new _yyRuleInfo( 173, 2 ),
new _yyRuleInfo( 173, 4 ),
new _yyRuleInfo( 173, 4 ),
new _yyRuleInfo( 173, 1 ),
new _yyRuleInfo( 173, 2 ),
new _yyRuleInfo( 178, 0 ),
new _yyRuleInfo( 178, 1 ),
new _yyRuleInfo( 180, 0 ),
new _yyRuleInfo( 180, 2 ),
new _yyRuleInfo( 182, 2 ),
new _yyRuleInfo( 182, 3 ),
new _yyRuleInfo( 182, 3 ),
new _yyRuleInfo( 182, 3 ),
new _yyRuleInfo( 183, 2 ),
new _yyRuleInfo( 183, 2 ),
new _yyRuleInfo( 183, 1 ),
new _yyRuleInfo( 183, 1 ),
new _yyRuleInfo( 183, 2 ),
new _yyRuleInfo( 181, 3 ),
new _yyRuleInfo( 181, 2 ),
new _yyRuleInfo( 184, 0 ),
new _yyRuleInfo( 184, 2 ),
new _yyRuleInfo( 184, 2 ),
new _yyRuleInfo( 159, 0 ),
new _yyRuleInfo( 159, 2 ),
new _yyRuleInfo( 185, 3 ),
new _yyRuleInfo( 185, 2 ),
new _yyRuleInfo( 185, 1 ),
new _yyRuleInfo( 186, 2 ),
new _yyRuleInfo( 186, 7 ),
new _yyRuleInfo( 186, 5 ),
new _yyRuleInfo( 186, 5 ),
new _yyRuleInfo( 186, 10 ),
new _yyRuleInfo( 188, 0 ),
new _yyRuleInfo( 188, 1 ),
new _yyRuleInfo( 176, 0 ),
new _yyRuleInfo( 176, 3 ),
new _yyRuleInfo( 189, 0 ),
new _yyRuleInfo( 189, 2 ),
new _yyRuleInfo( 190, 1 ),
new _yyRuleInfo( 190, 1 ),
new _yyRuleInfo( 190, 1 ),
new _yyRuleInfo( 147, 4 ),
new _yyRuleInfo( 192, 2 ),
new _yyRuleInfo( 192, 0 ),
new _yyRuleInfo( 147, 8 ),
new _yyRuleInfo( 147, 4 ),
new _yyRuleInfo( 147, 1 ),
new _yyRuleInfo( 160, 1 ),
new _yyRuleInfo( 160, 3 ),
new _yyRuleInfo( 195, 1 ),
new _yyRuleInfo( 195, 2 ),
new _yyRuleInfo( 195, 1 ),
new _yyRuleInfo( 194, 9 ),
new _yyRuleInfo( 196, 1 ),
new _yyRuleInfo( 196, 1 ),
new _yyRuleInfo( 196, 0 ),
new _yyRuleInfo( 204, 2 ),
new _yyRuleInfo( 204, 0 ),
new _yyRuleInfo( 197, 3 ),
new _yyRuleInfo( 197, 2 ),
new _yyRuleInfo( 197, 4 ),
new _yyRuleInfo( 205, 2 ),
new _yyRuleInfo( 205, 1 ),
new _yyRuleInfo( 205, 0 ),
new _yyRuleInfo( 198, 0 ),
new _yyRuleInfo( 198, 2 ),
new _yyRuleInfo( 207, 2 ),
new _yyRuleInfo( 207, 0 ),
new _yyRuleInfo( 206, 7 ),
new _yyRuleInfo( 206, 7 ),
new _yyRuleInfo( 206, 7 ),
new _yyRuleInfo( 157, 0 ),
new _yyRuleInfo( 157, 2 ),
new _yyRuleInfo( 193, 2 ),
new _yyRuleInfo( 208, 1 ),
new _yyRuleInfo( 208, 2 ),
new _yyRuleInfo( 208, 3 ),
new _yyRuleInfo( 208, 4 ),
new _yyRuleInfo( 210, 2 ),
new _yyRuleInfo( 210, 0 ),
new _yyRuleInfo( 209, 0 ),
new _yyRuleInfo( 209, 3 ),
new _yyRuleInfo( 209, 2 ),
new _yyRuleInfo( 211, 4 ),
new _yyRuleInfo( 211, 0 ),
new _yyRuleInfo( 202, 0 ),
new _yyRuleInfo( 202, 3 ),
new _yyRuleInfo( 214, 4 ),
new _yyRuleInfo( 214, 2 ),
new _yyRuleInfo( 215, 1 ),
new _yyRuleInfo( 177, 1 ),
new _yyRuleInfo( 177, 1 ),
new _yyRuleInfo( 177, 0 ),
new _yyRuleInfo( 200, 0 ),
new _yyRuleInfo( 200, 3 ),
new _yyRuleInfo( 201, 0 ),
new _yyRuleInfo( 201, 2 ),
new _yyRuleInfo( 203, 0 ),
new _yyRuleInfo( 203, 2 ),
new _yyRuleInfo( 203, 4 ),
new _yyRuleInfo( 203, 4 ),
new _yyRuleInfo( 147, 5 ),
new _yyRuleInfo( 199, 0 ),
new _yyRuleInfo( 199, 2 ),
new _yyRuleInfo( 147, 7 ),
new _yyRuleInfo( 217, 5 ),
new _yyRuleInfo( 217, 3 ),
new _yyRuleInfo( 147, 8 ),
new _yyRuleInfo( 147, 5 ),
new _yyRuleInfo( 147, 6 ),
new _yyRuleInfo( 218, 2 ),
new _yyRuleInfo( 218, 1 ),
new _yyRuleInfo( 220, 3 ),
new _yyRuleInfo( 220, 1 ),
new _yyRuleInfo( 219, 0 ),
new _yyRuleInfo( 219, 3 ),
new _yyRuleInfo( 213, 3 ),
new _yyRuleInfo( 213, 1 ),
new _yyRuleInfo( 175, 1 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 174, 1 ),
new _yyRuleInfo( 175, 1 ),
new _yyRuleInfo( 175, 1 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 5 ),
new _yyRuleInfo( 174, 1 ),
new _yyRuleInfo( 174, 1 ),
new _yyRuleInfo( 175, 1 ),
new _yyRuleInfo( 175, 1 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 6 ),
new _yyRuleInfo( 175, 5 ),
new _yyRuleInfo( 175, 4 ),
new _yyRuleInfo( 174, 1 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 222, 1 ),
new _yyRuleInfo( 222, 2 ),
new _yyRuleInfo( 222, 1 ),
new _yyRuleInfo( 222, 2 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 5 ),
new _yyRuleInfo( 175, 2 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 4 ),
new _yyRuleInfo( 175, 2 ),
new _yyRuleInfo( 175, 2 ),
new _yyRuleInfo( 175, 2 ),
new _yyRuleInfo( 175, 2 ),
new _yyRuleInfo( 223, 1 ),
new _yyRuleInfo( 223, 2 ),
new _yyRuleInfo( 175, 5 ),
new _yyRuleInfo( 224, 1 ),
new _yyRuleInfo( 224, 2 ),
new _yyRuleInfo( 175, 5 ),
new _yyRuleInfo( 175, 3 ),
new _yyRuleInfo( 175, 5 ),
new _yyRuleInfo( 175, 4 ),
new _yyRuleInfo( 175, 4 ),
new _yyRuleInfo( 175, 5 ),
new _yyRuleInfo( 226, 5 ),
new _yyRuleInfo( 226, 4 ),
new _yyRuleInfo( 227, 2 ),
new _yyRuleInfo( 227, 0 ),
new _yyRuleInfo( 225, 1 ),
new _yyRuleInfo( 225, 0 ),
new _yyRuleInfo( 221, 1 ),
new _yyRuleInfo( 221, 0 ),
new _yyRuleInfo( 216, 3 ),
new _yyRuleInfo( 216, 1 ),
new _yyRuleInfo( 147, 11 ),
new _yyRuleInfo( 228, 1 ),
new _yyRuleInfo( 228, 0 ),
new _yyRuleInfo( 179, 0 ),
new _yyRuleInfo( 179, 3 ),
new _yyRuleInfo( 187, 5 ),
new _yyRuleInfo( 187, 3 ),
new _yyRuleInfo( 229, 0 ),
new _yyRuleInfo( 229, 2 ),
new _yyRuleInfo( 147, 4 ),
new _yyRuleInfo( 147, 1 ),
new _yyRuleInfo( 147, 2 ),
new _yyRuleInfo( 147, 3 ),
new _yyRuleInfo( 147, 5 ),
new _yyRuleInfo( 147, 6 ),
new _yyRuleInfo( 147, 5 ),
new _yyRuleInfo( 147, 6 ),
new _yyRuleInfo( 230, 1 ),
new _yyRuleInfo( 230, 1 ),
new _yyRuleInfo( 230, 1 ),
new _yyRuleInfo( 230, 1 ),
new _yyRuleInfo( 230, 1 ),
new _yyRuleInfo( 170, 2 ),
new _yyRuleInfo( 171, 2 ),
new _yyRuleInfo( 232, 1 ),
new _yyRuleInfo( 231, 1 ),
new _yyRuleInfo( 231, 0 ),
new _yyRuleInfo( 147, 5 ),
new _yyRuleInfo( 233, 11 ),
new _yyRuleInfo( 235, 1 ),
new _yyRuleInfo( 235, 1 ),
new _yyRuleInfo( 235, 2 ),
new _yyRuleInfo( 235, 0 ),
new _yyRuleInfo( 236, 1 ),
new _yyRuleInfo( 236, 1 ),
new _yyRuleInfo( 236, 3 ),
new _yyRuleInfo( 237, 0 ),
new _yyRuleInfo( 237, 3 ),
new _yyRuleInfo( 238, 0 ),
new _yyRuleInfo( 238, 2 ),
new _yyRuleInfo( 234, 3 ),
new _yyRuleInfo( 234, 2 ),
new _yyRuleInfo( 240, 1 ),
new _yyRuleInfo( 240, 3 ),
new _yyRuleInfo( 241, 0 ),
new _yyRuleInfo( 241, 3 ),
new _yyRuleInfo( 241, 2 ),
new _yyRuleInfo( 239, 7 ),
new _yyRuleInfo( 239, 8 ),
new _yyRuleInfo( 239, 5 ),
new _yyRuleInfo( 239, 5 ),
new _yyRuleInfo( 239, 1 ),
new _yyRuleInfo( 175, 4 ),
new _yyRuleInfo( 175, 6 ),
new _yyRuleInfo( 191, 1 ),
new _yyRuleInfo( 191, 1 ),
new _yyRuleInfo( 191, 1 ),
new _yyRuleInfo( 147, 4 ),
new _yyRuleInfo( 147, 6 ),
new _yyRuleInfo( 147, 3 ),
new _yyRuleInfo( 243, 0 ),
new _yyRuleInfo( 243, 2 ),
new _yyRuleInfo( 242, 1 ),
new _yyRuleInfo( 242, 0 ),
new _yyRuleInfo( 147, 1 ),
new _yyRuleInfo( 147, 3 ),
new _yyRuleInfo( 147, 1 ),
new _yyRuleInfo( 147, 3 ),
new _yyRuleInfo( 147, 6 ),
new _yyRuleInfo( 147, 6 ),
new _yyRuleInfo( 244, 1 ),
new _yyRuleInfo( 245, 0 ),
new _yyRuleInfo( 245, 1 ),
new _yyRuleInfo( 147, 1 ),
new _yyRuleInfo( 147, 4 ),
new _yyRuleInfo( 246, 7 ),
new _yyRuleInfo( 247, 1 ),
new _yyRuleInfo( 247, 3 ),
new _yyRuleInfo( 248, 0 ),
new _yyRuleInfo( 248, 2 ),
new _yyRuleInfo( 249, 1 ),
new _yyRuleInfo( 249, 3 ),
new _yyRuleInfo( 250, 1 ),
new _yyRuleInfo( 251, 0 ),
new _yyRuleInfo( 251, 4 ),
new _yyRuleInfo( 251, 2 ),
};
** Perform a reduce action and the shift that must immediately
** follow the reduce.
*/
static void yy_reduce(
yyParser yypParser,
int yyruleno
)
{
int yygoto;
int yyact;
YYMINORTYPE yygotominor;
yymsp yymsp;
int yysize;
Parse pParse = yypParser.pParse;
yymsp = new yymsp( ref yypParser, yypParser.yyidx );
#if !NDEBUG
if ( yyTraceFILE != null && yyruleno >= 0
&& yyruleno < yyRuleName.Length )
{
fprintf( yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
yyRuleName[yyruleno] );
}
#endif // * NDEBUG */
** in some cases when it is copied into the stack after the following
** switch. yygotominor is uninitialized when a rule reduces that does
** not set the value of its left-hand side nonterminal. Leaving the
** value of the nonterminal uninitialized is utterly harmless as long
** as the value is never used. So really the only thing this code
** accomplishes is to quieten purify.
**
** 2007-01-16: The wireshark project (www.wireshark.org) reports that
** without this code, their parser segfaults. I'm not sure what there
** parser is doing to make this happen. This is the second bug report
** from wireshark this week. Clearly they are stressing Lemon in ways
** that it has not been previously stressed... (SQLite ticket #2172)
*/
yygotominor = new YYMINORTYPE();
switch ( yyruleno )
{
** follows:
** case 0:
** //#line <lineno> <grammarfile>
** { ... } // User supplied code
** //#line <lineno> <thisfile>
** break;
*/
case 5:
{
sqlite3BeginParse( pParse, 0 );
}
break;
case 6:
{
sqlite3BeginParse( pParse, 1 );
}
break;
case 7:
{
sqlite3BeginParse( pParse, 2 );
}
break;
case 8:
{
sqlite3FinishCoding( pParse );
}
break;
case 9:
{
sqlite3BeginTransaction( pParse, yymsp[-1].minor.yy4 );
}
break;
case 13:
{
yygotominor.yy4 = TK_DEFERRED;
}
break;
case 14:
case 15:
case 16:
case 115:
case 117:
{
yygotominor.yy4 = yymsp[0].major;
}
break;
case 17:
case 18:
{
sqlite3CommitTransaction( pParse );
}
break;
case 19:
{
sqlite3RollbackTransaction( pParse );
}
break;
case 22:
{
sqlite3Savepoint( pParse, SAVEPOINT_BEGIN, yymsp[0].minor.yy0 );
}
break;
case 23:
{
sqlite3Savepoint( pParse, SAVEPOINT_RELEASE, yymsp[0].minor.yy0 );
}
break;
case 24:
{
sqlite3Savepoint( pParse, SAVEPOINT_ROLLBACK, yymsp[0].minor.yy0 );
}
break;
case 26:
{
sqlite3StartTable( pParse, yymsp[-1].minor.yy0, yymsp[0].minor.yy0, yymsp[-4].minor.yy4, 0, 0, yymsp[-2].minor.yy4 );
}
break;
case 27:
{
pParse.db.lookaside.bEnabled = 0;
yygotominor.yy0 = yymsp[0].minor.yy0;
}
break;
case 28:
case 31:
case 70:
case 83:
case 85:
case 87:
case 98:
case 109:
case 120:
case 121:
case 222:
case 225:
{
yygotominor.yy4 = 0;
}
break;
case 29:
case 30:
case 71:
case 86:
case 108:
case 119:
case 223:
case 226:
{
yygotominor.yy4 = 1;
}
break;
case 32:
{
sqlite3EndTable( pParse, yymsp[-1].minor.yy0, yymsp[0].minor.yy0, 0 );
}
break;
case 33:
{
sqlite3EndTable( pParse, 0, 0, yymsp[0].minor.yy387 );
sqlite3SelectDelete( pParse.db, ref yymsp[0].minor.yy387 );
}
break;
case 36:
{
yygotominor.yy0.n = (int)( yymsp[-2].minor.yy0.z.Length - pParse.sLastToken.z.Length ) + pParse.sLastToken.n;
yygotominor.yy0.z = yymsp[-2].minor.yy0.z.Substring( 0, yygotominor.yy0.n );
}
break;
case 37:
{
sqlite3AddColumn( pParse, yymsp[0].minor.yy0 );
yygotominor.yy0 = yymsp[0].minor.yy0;
}
break;
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 46:
case 49:
case 127:
case 128:
case 138:
case 147:
case 251:
case 260:
case 261:
case 262:
case 263:
case 264:
case 265:
case 266:
case 267:
case 285:
{
yygotominor.yy0 = yymsp[0].minor.yy0;
}
break;
case 45:
{
sqlite3AddColumnType( pParse, yymsp[0].minor.yy0 );
}
break;
case 47:
{
yygotominor.yy0.n = yymsp[-3].minor.yy0.z.Length - yymsp[0].minor.yy0.z.Length + yymsp[0].minor.yy0.n;
yygotominor.yy0.z = yymsp[-3].minor.yy0.z.Substring( 0, yygotominor.yy0.n );
}
break;
case 48:
{
yygotominor.yy0.n = yymsp[-5].minor.yy0.z.Length - yymsp[0].minor.yy0.z.Length + 1;
yygotominor.yy0.z = yymsp[-5].minor.yy0.z.Substring( 0, yygotominor.yy0.n );
}
break;
case 50:
{
yygotominor.yy0.z = yymsp[-1].minor.yy0.z;
yygotominor.yy0.n = yymsp[0].minor.yy0.n + (int)( yymsp[-1].minor.yy0.z.Length - yymsp[0].minor.yy0.z.Length );
}
break;
case 57:
case 59:
{
sqlite3AddDefaultValue( pParse, yymsp[0].minor.yy118 );
}
break;
case 58:
{
sqlite3AddDefaultValue( pParse, yymsp[-1].minor.yy118 );
}
break;
case 60:
{
ExprSpan v = new ExprSpan();
v.pExpr = sqlite3PExpr( pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0 );
v.zStart = yymsp[-1].minor.yy0.z;
v.zEnd = yymsp[0].minor.yy118.zEnd;
sqlite3AddDefaultValue( pParse, v );
}
break;
case 61:
{
ExprSpan v = new ExprSpan();
spanExpr( v, pParse, TK_STRING, yymsp[0].minor.yy0 );
sqlite3AddDefaultValue( pParse, v );
}
break;
case 63:
{
sqlite3AddNotNull( pParse, yymsp[0].minor.yy4 );
}
break;
case 64:
{
sqlite3AddPrimaryKey( pParse, 0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4, yymsp[-2].minor.yy4 );
}
break;
case 65:
{
sqlite3CreateIndex( pParse, 0, 0, 0, 0, yymsp[0].minor.yy4, 0, 0, 0, 0 );
}
break;
case 66:
{
sqlite3AddCheckConstraint( pParse, yymsp[-1].minor.yy118.pExpr );
}
break;
case 67:
{
sqlite3CreateForeignKey( pParse, 0, yymsp[-2].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy4 );
}
break;
case 68:
{
sqlite3DeferForeignKey( pParse, yymsp[0].minor.yy4 );
}
break;
case 69:
{
sqlite3AddCollateType( pParse, yymsp[0].minor.yy0 );
}
break;
case 72:
{
yygotominor.yy4 = OE_None * 0x0101;
}
break;
case 73:
{
yygotominor.yy4 = ( yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask ) | yymsp[0].minor.yy215.value;
}
break;
case 74:
case 75:
{
yygotominor.yy215.value = 0;
yygotominor.yy215.mask = 0x000000;
}
break;
case 76:
{
yygotominor.yy215.value = yymsp[0].minor.yy4;
yygotominor.yy215.mask = 0x0000ff;
}
break;
case 77:
{
yygotominor.yy215.value = yymsp[0].minor.yy4 << 8;
yygotominor.yy215.mask = 0x00ff00;
}
break;
case 78:
{
yygotominor.yy4 = OE_SetNull;
}
break;
case 79:
{
yygotominor.yy4 = OE_SetDflt;
}
break;
case 80:
{
yygotominor.yy4 = OE_Cascade;
}
break;
case 81:
{
yygotominor.yy4 = OE_Restrict;
}
break;
case 82:
{
yygotominor.yy4 = OE_None;
}
break;
case 84:
case 99:
case 101:
case 104:
{
yygotominor.yy4 = yymsp[0].minor.yy4;
}
break;
case 88:
{
yygotominor.yy0.n = 0;
yygotominor.yy0.z = null;
}
break;
case 89:
{
yygotominor.yy0 = yymsp[-1].minor.yy0;
}
break;
case 94:
{
sqlite3AddPrimaryKey( pParse, yymsp[-3].minor.yy322, yymsp[0].minor.yy4, yymsp[-2].minor.yy4, 0 );
}
break;
case 95:
{
sqlite3CreateIndex( pParse, 0, 0, 0, yymsp[-2].minor.yy322, yymsp[0].minor.yy4, 0, 0, 0, 0 );
}
break;
case 96:
{
sqlite3AddCheckConstraint( pParse, yymsp[-2].minor.yy118.pExpr );
}
break;
case 97:
{
sqlite3CreateForeignKey( pParse, yymsp[-6].minor.yy322, yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4 );
sqlite3DeferForeignKey( pParse, yymsp[0].minor.yy4 );
}
break;
case 100:
{
yygotominor.yy4 = OE_Default;
}
break;
case 102:
{
yygotominor.yy210 = OE_Default;
}
break;
case 103:
{
yygotominor.yy210 = (u8)yymsp[0].minor.yy4;
}
break;
case 105:
{
yygotominor.yy4 = OE_Ignore;
}
break;
case 106:
{
yygotominor.yy4 = OE_Replace;
}
break;
case 107:
{
sqlite3DropTable( pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4 );
}
break;
case 110:
{
sqlite3CreateView( pParse, yymsp[-7].minor.yy0, yymsp[-3].minor.yy0, yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4 );
}
break;
case 111:
{
sqlite3DropTable( pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4 );
}
break;
case 112:
{
SelectDest dest = new SelectDest( SRT_Output, '\0', 0, 0, 0 );
sqlite3Select( pParse, yymsp[0].minor.yy387, ref dest );
sqlite3SelectDelete( pParse.db, ref yymsp[0].minor.yy387 );
}
break;
case 113:
{
yygotominor.yy387 = yymsp[0].minor.yy387;
}
break;
case 114:
{
if ( yymsp[0].minor.yy387 != null )
{
yymsp[0].minor.yy387.op = (u8)yymsp[-1].minor.yy4;
yymsp[0].minor.yy387.pPrior = yymsp[-2].minor.yy387;
}
else
{
sqlite3SelectDelete( pParse.db, ref yymsp[-2].minor.yy387 );
}
yygotominor.yy387 = yymsp[0].minor.yy387;
}
break;
case 116:
{
yygotominor.yy4 = TK_ALL;
}
break;
case 118:
{
yygotominor.yy387 = sqlite3SelectNew( pParse, yymsp[-6].minor.yy322, yymsp[-5].minor.yy259, yymsp[-4].minor.yy314, yymsp[-3].minor.yy322, yymsp[-2].minor.yy314, yymsp[-1].minor.yy322, yymsp[-7].minor.yy4, yymsp[0].minor.yy292.pLimit, yymsp[0].minor.yy292.pOffset );
}
break;
case 122:
case 247:
{
yygotominor.yy322 = yymsp[-1].minor.yy322;
}
break;
case 123:
case 151:
case 159:
case 240:
case 246:
{
yygotominor.yy322 = null;
}
break;
case 124:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr );
if ( yymsp[0].minor.yy0.n > 0 )
sqlite3ExprListSetName( pParse, yygotominor.yy322, yymsp[0].minor.yy0, 1 );
sqlite3ExprListSetSpan( pParse, yygotominor.yy322, yymsp[-1].minor.yy118 );
}
break;
case 125:
{
Expr p = sqlite3Expr( pParse.db, TK_ALL, null );
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yymsp[-1].minor.yy322, p );
}
break;
case 126:
{
Expr pRight = sqlite3PExpr( pParse, TK_ALL, 0, 0, yymsp[0].minor.yy0 );
Expr pLeft = sqlite3PExpr( pParse, TK_ID, 0, 0, yymsp[-2].minor.yy0 );
Expr pDot = sqlite3PExpr( pParse, TK_DOT, pLeft, pRight, 0 );
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yymsp[-3].minor.yy322, pDot );
}
break;
case 129:
{
yygotominor.yy0.n = 0;
}
break;
case 130:
{
yygotominor.yy259 = new SrcList();
}
break;
case 131:
{
yygotominor.yy259 = yymsp[0].minor.yy259;
sqlite3SrcListShiftJoinType( yygotominor.yy259 );
}
break;
case 132:
{
yygotominor.yy259 = yymsp[-1].minor.yy259;
if ( ALWAYS( yygotominor.yy259 != null && yygotominor.yy259.nSrc > 0 ) )
yygotominor.yy259.a[yygotominor.yy259.nSrc - 1].jointype = (u8)yymsp[0].minor.yy4;
}
break;
case 133:
{
yygotominor.yy259 = null;
}
break;
case 134:
{
yygotominor.yy259 = sqlite3SrcListAppendFromTerm( pParse, yymsp[-6].minor.yy259, yymsp[-5].minor.yy0, yymsp[-4].minor.yy0, yymsp[-3].minor.yy0, 0, yymsp[-1].minor.yy314, yymsp[0].minor.yy384 );
sqlite3SrcListIndexedBy( pParse, yygotominor.yy259, yymsp[-2].minor.yy0 );
}
break;
case 135:
{
yygotominor.yy259 = sqlite3SrcListAppendFromTerm( pParse, yymsp[-6].minor.yy259, 0, 0, yymsp[-2].minor.yy0, yymsp[-4].minor.yy387, yymsp[-1].minor.yy314, yymsp[0].minor.yy384 );
}
break;
case 136:
{
if ( yymsp[-6].minor.yy259 == null && yymsp[-2].minor.yy0.n == 0 && yymsp[-1].minor.yy314 == null && yymsp[0].minor.yy384 == null )
{
yygotominor.yy259 = yymsp[-4].minor.yy259;
}
else
{
Select pSubquery;
sqlite3SrcListShiftJoinType( yymsp[-4].minor.yy259 );
pSubquery = sqlite3SelectNew( pParse, 0, yymsp[-4].minor.yy259, 0, 0, 0, 0, 0, 0, 0 );
yygotominor.yy259 = sqlite3SrcListAppendFromTerm( pParse, yymsp[-6].minor.yy259, 0, 0, yymsp[-2].minor.yy0, pSubquery, yymsp[-1].minor.yy314, yymsp[0].minor.yy384 );
}
}
break;
case 137:
case 146:
{
yygotominor.yy0.z = null;
yygotominor.yy0.n = 0;
}
break;
case 139:
{
yygotominor.yy259 = sqlite3SrcListAppend( pParse.db, 0, yymsp[-1].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 140:
{
yygotominor.yy4 = JT_INNER;
}
break;
case 141:
{
yygotominor.yy4 = sqlite3JoinType( pParse, yymsp[-1].minor.yy0, 0, 0 );
}
break;
case 142:
{
yygotominor.yy4 = sqlite3JoinType( pParse, yymsp[-2].minor.yy0, yymsp[-1].minor.yy0, 0 );
}
break;
case 143:
{
yygotominor.yy4 = sqlite3JoinType( pParse, yymsp[-3].minor.yy0, yymsp[-2].minor.yy0, yymsp[-1].minor.yy0 );
}
break;
case 144:
case 155:
case 162:
case 169:
case 235:
case 237:
{
yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;
}
break;
case 145:
case 161:
case 168:
case 236:
case 238:
{
yygotominor.yy314 = null;
}
break;
case 148:
{
yygotominor.yy0.z = null;
yygotominor.yy0.n = 1;
}
break;
case 149:
case 181:
{
yygotominor.yy384 = yymsp[-1].minor.yy384;
}
break;
case 150:
case 180:
{
yygotominor.yy384 = null;
}
break;
case 152:
case 160:
case 239:
{
yygotominor.yy322 = yymsp[0].minor.yy322;
}
break;
case 153:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yymsp[-3].minor.yy322, yymsp[-1].minor.yy314 );
if ( yygotominor.yy322 != null )
yygotominor.yy322.a[yygotominor.yy322.nExpr - 1].sortOrder = (u8)yymsp[0].minor.yy4;
}
break;
case 154:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, 0, yymsp[-1].minor.yy314 );
if ( yygotominor.yy322 != null && ALWAYS( yygotominor.yy322.a != null ) )
yygotominor.yy322.a[0].sortOrder = (u8)yymsp[0].minor.yy4;
}
break;
case 156:
case 158:
{
yygotominor.yy4 = SQLITE_SO_ASC;
}
break;
case 157:
{
yygotominor.yy4 = SQLITE_SO_DESC;
}
break;
case 163:
{
yygotominor.yy292.pLimit = null;
yygotominor.yy292.pOffset = null;
}
break;
case 164:
{
yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;
yygotominor.yy292.pOffset = null;
}
break;
case 165:
{
yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr;
yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;
}
break;
case 166:
{
yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr;
yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;
}
break;
case 167:
{
sqlite3SrcListIndexedBy( pParse, yymsp[-2].minor.yy259, yymsp[-1].minor.yy0 );
sqlite3DeleteFrom( pParse, yymsp[-2].minor.yy259, yymsp[0].minor.yy314 );
}
break;
case 170:
{
sqlite3SrcListIndexedBy( pParse, yymsp[-4].minor.yy259, yymsp[-3].minor.yy0 );
sqlite3ExprListCheckLength( pParse, yymsp[-1].minor.yy322, "set list" );
sqlite3Update( pParse, yymsp[-4].minor.yy259, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210 );
}
break;
case 171:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr );
sqlite3ExprListSetName( pParse, yygotominor.yy322, yymsp[-2].minor.yy0, 1 );
}
break;
case 172:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, 0, yymsp[0].minor.yy118.pExpr );
sqlite3ExprListSetName( pParse, yygotominor.yy322, yymsp[-2].minor.yy0, 1 );
}
break;
case 173:
{
sqlite3Insert( pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210 );
}
break;
case 174:
{
sqlite3Insert( pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210 );
}
break;
case 175:
{
sqlite3Insert( pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210 );
}
break;
case 176:
{
yygotominor.yy210 = yymsp[0].minor.yy210;
}
break;
case 177:
{
yygotominor.yy210 = OE_Replace;
}
break;
case 178:
case 241:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yymsp[-2].minor.yy322, yymsp[0].minor.yy118.pExpr );
}
break;
case 179:
case 242:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, 0, yymsp[0].minor.yy118.pExpr );
}
break;
case 182:
{
yygotominor.yy384 = sqlite3IdListAppend( pParse.db, yymsp[-2].minor.yy384, yymsp[0].minor.yy0 );
}
break;
case 183:
{
yygotominor.yy384 = sqlite3IdListAppend( pParse.db, 0, yymsp[0].minor.yy0 );
}
break;
case 184:
{
yygotominor.yy118 = yymsp[0].minor.yy118;
}
break;
case 185:
{
yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr;
spanSet( yygotominor.yy118, yymsp[-2].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 186:
case 191:
case 192:
{
spanExpr( yygotominor.yy118, pParse, yymsp[0].major, yymsp[0].minor.yy0 );
}
break;
case 187:
case 188:
{
spanExpr( yygotominor.yy118, pParse, TK_ID, yymsp[0].minor.yy0 );
}
break;
case 189:
{
Expr temp1 = sqlite3PExpr( pParse, TK_ID, 0, 0, yymsp[-2].minor.yy0 );
Expr temp2 = sqlite3PExpr( pParse, TK_ID, 0, 0, yymsp[0].minor.yy0 );
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_DOT, temp1, temp2, 0 );
spanSet( yygotominor.yy118, yymsp[-2].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 190:
{
Expr temp1 = sqlite3PExpr( pParse, TK_ID, 0, 0, yymsp[-4].minor.yy0 );
Expr temp2 = sqlite3PExpr( pParse, TK_ID, 0, 0, yymsp[-2].minor.yy0 );
Expr temp3 = sqlite3PExpr( pParse, TK_ID, 0, 0, yymsp[0].minor.yy0 );
Expr temp4 = sqlite3PExpr( pParse, TK_DOT, temp2, temp3, 0 );
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_DOT, temp1, temp4, 0 );
spanSet( yygotominor.yy118, yymsp[-4].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 193:
{
** that look like this: #1 #2 ... These terms refer to registers
** in the virtual machine. #N is the N-th register. */
if ( pParse.nested == 0 )
{
sqlite3ErrorMsg( pParse, "near \"%T\": syntax error", yymsp[0].minor.yy0 );
yygotominor.yy118.pExpr = null;
}
else
{
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_REGISTER, 0, 0, yymsp[0].minor.yy0 );
if ( yygotominor.yy118.pExpr != null )
sqlite3GetInt32( yymsp[0].minor.yy0.z, 1, ref yygotominor.yy118.pExpr.iTable );
}
spanSet( yygotominor.yy118, yymsp[0].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 194:
{
spanExpr( yygotominor.yy118, pParse, TK_VARIABLE, yymsp[0].minor.yy0 );
sqlite3ExprAssignVarNumber( pParse, yygotominor.yy118.pExpr );
spanSet( yygotominor.yy118, yymsp[0].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 195:
{
yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken( pParse, yymsp[-2].minor.yy118.pExpr, yymsp[0].minor.yy0 );
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n );
}
break;
case 196:
{
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, yymsp[-1].minor.yy0 );
spanSet( yygotominor.yy118, yymsp[-5].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 197:
{
if ( yymsp[-1].minor.yy322 != null && yymsp[-1].minor.yy322.nExpr > pParse.db.aLimit[SQLITE_LIMIT_FUNCTION_ARG] )
{
sqlite3ErrorMsg( pParse, "too many arguments on function %T", yymsp[-4].minor.yy0 );
}
yygotominor.yy118.pExpr = sqlite3ExprFunction( pParse, yymsp[-1].minor.yy322, yymsp[-4].minor.yy0 );
spanSet( yygotominor.yy118, yymsp[-4].minor.yy0, yymsp[0].minor.yy0 );
if ( yymsp[-2].minor.yy4 != 0 && yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.flags |= EP_Distinct;
}
}
break;
case 198:
{
yygotominor.yy118.pExpr = sqlite3ExprFunction( pParse, 0, yymsp[-3].minor.yy0 );
spanSet( yygotominor.yy118, yymsp[-3].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 199:
{
** treated as functions that return constants */
yygotominor.yy118.pExpr = sqlite3ExprFunction( pParse, 0, yymsp[0].minor.yy0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.op = TK_CONST_FUNC;
}
spanSet( yygotominor.yy118, yymsp[0].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 200:
case 201:
case 202:
case 203:
case 204:
case 205:
case 206:
case 207:
{
spanBinaryExpr( yygotominor.yy118, pParse, yymsp[-1].major, yymsp[-2].minor.yy118, yymsp[0].minor.yy118 );
}
break;
case 208:
case 210:
{
yygotominor.yy342.eOperator = yymsp[0].minor.yy0;
yygotominor.yy342.not = false;
}
break;
case 209:
case 211:
{
yygotominor.yy342.eOperator = yymsp[0].minor.yy0;
yygotominor.yy342.not = true;
}
break;
case 212:
{
ExprList pList;
pList = sqlite3ExprListAppend( pParse, 0, yymsp[0].minor.yy118.pExpr );
pList = sqlite3ExprListAppend( pParse, pList, yymsp[-2].minor.yy118.pExpr );
yygotominor.yy118.pExpr = sqlite3ExprFunction( pParse, pList, yymsp[-1].minor.yy342.eOperator );
if ( yymsp[-1].minor.yy342.not )
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0 );
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
if ( yygotominor.yy118.pExpr != null )
yygotominor.yy118.pExpr.flags |= EP_InfixFunc;
}
break;
case 213:
{
ExprList pList;
pList = sqlite3ExprListAppend( pParse, 0, yymsp[-2].minor.yy118.pExpr );
pList = sqlite3ExprListAppend( pParse, pList, yymsp[-4].minor.yy118.pExpr );
pList = sqlite3ExprListAppend( pParse, pList, yymsp[0].minor.yy118.pExpr );
yygotominor.yy118.pExpr = sqlite3ExprFunction( pParse, pList, yymsp[-3].minor.yy342.eOperator );
if ( yymsp[-3].minor.yy342.not )
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0 );
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
if ( yygotominor.yy118.pExpr != null )
yygotominor.yy118.pExpr.flags |= EP_InfixFunc;
}
break;
case 214:
{
spanUnaryPostfix( yygotominor.yy118, pParse, yymsp[0].major, yymsp[-1].minor.yy118, yymsp[0].minor.yy0 );
}
break;
case 215:
{
spanUnaryPostfix( yygotominor.yy118, pParse, TK_NOTNULL, yymsp[-2].minor.yy118, yymsp[0].minor.yy0 );
}
break;
case 216:
{
spanBinaryExpr( yygotominor.yy118, pParse, TK_IS, yymsp[-2].minor.yy118, yymsp[0].minor.yy118 );
binaryToUnaryIfNull( pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL );
}
break;
case 217:
{
spanBinaryExpr( yygotominor.yy118, pParse, TK_ISNOT, yymsp[-3].minor.yy118, yymsp[0].minor.yy118 );
binaryToUnaryIfNull( pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL );
}
break;
case 218:
case 219:
{
spanUnaryPrefix( yygotominor.yy118, pParse, yymsp[-1].major, yymsp[0].minor.yy118, yymsp[-1].minor.yy0 );
}
break;
case 220:
{
spanUnaryPrefix( yygotominor.yy118, pParse, TK_UMINUS, yymsp[0].minor.yy118, yymsp[-1].minor.yy0 );
}
break;
case 221:
{
spanUnaryPrefix( yygotominor.yy118, pParse, TK_UPLUS, yymsp[0].minor.yy118, yymsp[-1].minor.yy0 );
}
break;
case 224:
{
ExprList pList = sqlite3ExprListAppend( pParse, 0, yymsp[-2].minor.yy118.pExpr );
pList = sqlite3ExprListAppend( pParse, pList, yymsp[0].minor.yy118.pExpr );
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.x.pList = pList;
}
else
{
sqlite3ExprListDelete( pParse.db, ref pList );
}
if ( yymsp[-3].minor.yy4 != 0 )
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0 );
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
}
break;
case 227:
{
if ( yymsp[-1].minor.yy322 == null )
{
**
** expr1 IN ()
** expr1 NOT IN ()
**
** simplify to constants 0 (false) and 1 (true), respectively,
** regardless of the value of expr1.
*/
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_INTEGER, 0, 0, sqlite3IntTokens[yymsp[-3].minor.yy4] );
sqlite3ExprDelete( pParse.db, ref yymsp[-4].minor.yy118.pExpr );
}
else
{
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.x.pList = yymsp[-1].minor.yy322;
sqlite3ExprSetHeight( pParse, yygotominor.yy118.pExpr );
}
else
{
sqlite3ExprListDelete( pParse.db, ref yymsp[-1].minor.yy322 );
}
if ( yymsp[-3].minor.yy4 != 0 )
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0 );
}
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n );
}
break;
case 228:
{
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_SELECT, 0, 0, 0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.x.pSelect = yymsp[-1].minor.yy387;
ExprSetProperty( yygotominor.yy118.pExpr, EP_xIsSelect );
sqlite3ExprSetHeight( pParse, yygotominor.yy118.pExpr );
}
else
{
sqlite3SelectDelete( pParse.db, ref yymsp[-1].minor.yy387 );
}
yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n );
}
break;
case 229:
{
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.x.pSelect = yymsp[-1].minor.yy387;
ExprSetProperty( yygotominor.yy118.pExpr, EP_xIsSelect );
sqlite3ExprSetHeight( pParse, yygotominor.yy118.pExpr );
}
else
{
sqlite3SelectDelete( pParse.db, ref yymsp[-1].minor.yy387 );
}
if ( yymsp[-3].minor.yy4 != 0 )
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0 );
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n );
}
break;
case 230:
{
SrcList pSrc = sqlite3SrcListAppend( pParse.db, 0, yymsp[-1].minor.yy0, yymsp[0].minor.yy0 );
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.x.pSelect = sqlite3SelectNew( pParse, 0, pSrc, 0, 0, 0, 0, 0, 0, 0 );
ExprSetProperty( yygotominor.yy118.pExpr, EP_xIsSelect );
sqlite3ExprSetHeight( pParse, yygotominor.yy118.pExpr );
}
else
{
sqlite3SrcListDelete( pParse.db, ref pSrc );
}
if ( yymsp[-2].minor.yy4 != 0 )
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0 );
yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z != null ? yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n ) : yymsp[-1].minor.yy0.z.Substring( yymsp[-1].minor.yy0.n );
}
break;
case 231:
{
Expr p = yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_EXISTS, 0, 0, 0 );
if ( p != null )
{
p.x.pSelect = yymsp[-1].minor.yy387;
ExprSetProperty( p, EP_xIsSelect );
sqlite3ExprSetHeight( pParse, p );
}
else
{
sqlite3SelectDelete( pParse.db, ref yymsp[-1].minor.yy387 );
}
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n );
}
break;
case 232:
{
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.x.pList = yymsp[-2].minor.yy322;
sqlite3ExprSetHeight( pParse, yygotominor.yy118.pExpr );
}
else
{
sqlite3ExprListDelete( pParse.db, ref yymsp[-2].minor.yy322 );
}
yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n );
}
break;
case 233:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr );
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yygotominor.yy322, yymsp[0].minor.yy118.pExpr );
}
break;
case 234:
{
yygotominor.yy322 = sqlite3ExprListAppend( pParse, 0, yymsp[-2].minor.yy118.pExpr );
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yygotominor.yy322, yymsp[0].minor.yy118.pExpr );
}
break;
case 243:
{
sqlite3CreateIndex( pParse, yymsp[-6].minor.yy0, yymsp[-5].minor.yy0,
sqlite3SrcListAppend( pParse.db, 0, yymsp[-3].minor.yy0, 0 ), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
yymsp[-10].minor.yy0, yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4 );
}
break;
case 244:
case 298:
{
yygotominor.yy4 = OE_Abort;
}
break;
case 245:
{
yygotominor.yy4 = OE_None;
}
break;
case 248:
{
Expr p = null;
if ( yymsp[-1].minor.yy0.n > 0 )
{
p = sqlite3Expr( pParse.db, TK_COLUMN, null );
sqlite3ExprSetCollByToken( pParse, p, yymsp[-1].minor.yy0 );
}
yygotominor.yy322 = sqlite3ExprListAppend( pParse, yymsp[-4].minor.yy322, p );
sqlite3ExprListSetName( pParse, yygotominor.yy322, yymsp[-2].minor.yy0, 1 );
sqlite3ExprListCheckLength( pParse, yygotominor.yy322, "index" );
if ( yygotominor.yy322 != null )
yygotominor.yy322.a[yygotominor.yy322.nExpr - 1].sortOrder = (u8)yymsp[0].minor.yy4;
}
break;
case 249:
{
Expr p = null;
if ( yymsp[-1].minor.yy0.n > 0 )
{
p = sqlite3PExpr( pParse, TK_COLUMN, 0, 0, 0 );
sqlite3ExprSetCollByToken( pParse, p, yymsp[-1].minor.yy0 );
}
yygotominor.yy322 = sqlite3ExprListAppend( pParse, 0, p );
sqlite3ExprListSetName( pParse, yygotominor.yy322, yymsp[-2].minor.yy0, 1 );
sqlite3ExprListCheckLength( pParse, yygotominor.yy322, "index" );
if ( yygotominor.yy322 != null )
yygotominor.yy322.a[yygotominor.yy322.nExpr - 1].sortOrder = (u8)yymsp[0].minor.yy4;
}
break;
case 250:
{
yygotominor.yy0.z = null;
yygotominor.yy0.n = 0;
}
break;
case 252:
{
sqlite3DropIndex( pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4 );
}
break;
case 253:
case 254:
{
sqlite3Vacuum( pParse );
}
break;
case 255:
{
sqlite3Pragma( pParse, yymsp[-1].minor.yy0, yymsp[0].minor.yy0, 0, 0 );
}
break;
case 256:
{
sqlite3Pragma( pParse, yymsp[-3].minor.yy0, yymsp[-2].minor.yy0, yymsp[0].minor.yy0, 0 );
}
break;
case 257:
{
sqlite3Pragma( pParse, yymsp[-4].minor.yy0, yymsp[-3].minor.yy0, yymsp[-1].minor.yy0, 0 );
}
break;
case 258:
{
sqlite3Pragma( pParse, yymsp[-3].minor.yy0, yymsp[-2].minor.yy0, yymsp[0].minor.yy0, 1 );
}
break;
case 259:
{
sqlite3Pragma( pParse, yymsp[-4].minor.yy0, yymsp[-3].minor.yy0, yymsp[-1].minor.yy0, 1 );
}
break;
case 270:
{
Token all = new Token();
all.n = (int)( yymsp[-3].minor.yy0.z.Length - yymsp[0].minor.yy0.z.Length ) + yymsp[0].minor.yy0.n;
all.z = yymsp[-3].minor.yy0.z.Substring( 0, all.n );
sqlite3FinishTrigger( pParse, yymsp[-1].minor.yy203, all );
}
break;
case 271:
{
sqlite3BeginTrigger( pParse, yymsp[-7].minor.yy0, yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4 );
yygotominor.yy0 = ( yymsp[-6].minor.yy0.n == 0 ? yymsp[-7].minor.yy0 : yymsp[-6].minor.yy0 );
}
break;
case 272:
case 275:
{
yygotominor.yy4 = TK_BEFORE;
}
break;
case 273:
{
yygotominor.yy4 = TK_AFTER;
}
break;
case 274:
{
yygotominor.yy4 = TK_INSTEAD;
}
break;
case 276:
case 277:
{
yygotominor.yy90.a = yymsp[0].major;
yygotominor.yy90.b = null;
}
break;
case 278:
{
yygotominor.yy90.a = TK_UPDATE;
yygotominor.yy90.b = yymsp[0].minor.yy384;
}
break;
case 281:
case 303:
{
yygotominor.yy314 = null;
}
break;
case 282:
case 304:
{
yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;
}
break;
case 283:
{
Debug.Assert( yymsp[-2].minor.yy203 != null );
yymsp[-2].minor.yy203.pLast.pNext = yymsp[-1].minor.yy203;
yymsp[-2].minor.yy203.pLast = yymsp[-1].minor.yy203;
yygotominor.yy203 = yymsp[-2].minor.yy203;
}
break;
case 284:
{
Debug.Assert( yymsp[-1].minor.yy203 != null );
yymsp[-1].minor.yy203.pLast = yymsp[-1].minor.yy203;
yygotominor.yy203 = yymsp[-1].minor.yy203;
}
break;
case 286:
{
yygotominor.yy0 = yymsp[0].minor.yy0;
sqlite3ErrorMsg( pParse,
"qualified table names are not allowed on INSERT, UPDATE, and DELETE " +
"statements within triggers" );
}
break;
case 288:
{
sqlite3ErrorMsg( pParse,
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements " +
"within triggers" );
}
break;
case 289:
{
sqlite3ErrorMsg( pParse,
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " +
"within triggers" );
}
break;
case 290:
{
yygotominor.yy203 = sqlite3TriggerUpdateStep( pParse.db, yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210 );
}
break;
case 291:
{
yygotominor.yy203 = sqlite3TriggerInsertStep( pParse.db, yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210 );
}
break;
case 292:
{
yygotominor.yy203 = sqlite3TriggerInsertStep( pParse.db, yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210 );
}
break;
case 293:
{
yygotominor.yy203 = sqlite3TriggerDeleteStep( pParse.db, yymsp[-2].minor.yy0, yymsp[0].minor.yy314 );
}
break;
case 294:
{
yygotominor.yy203 = sqlite3TriggerSelectStep( pParse.db, yymsp[0].minor.yy387 );
}
break;
case 295:
{
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_RAISE, 0, 0, 0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.affinity = (char)OE_Ignore;
}
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n );
}
break;
case 296:
{
yygotominor.yy118.pExpr = sqlite3PExpr( pParse, TK_RAISE, 0, 0, yymsp[-1].minor.yy0 );
if ( yygotominor.yy118.pExpr != null )
{
yygotominor.yy118.pExpr.affinity = (char)yymsp[-3].minor.yy4;
}
yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z.Substring( yymsp[0].minor.yy0.n );
}
break;
case 297:
{
yygotominor.yy4 = OE_Rollback;
}
break;
case 299:
{
yygotominor.yy4 = OE_Fail;
}
break;
case 300:
{
sqlite3DropTrigger( pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4 );
}
break;
case 301:
{
sqlite3Attach( pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314 );
}
break;
case 302:
{
sqlite3Detach( pParse, yymsp[0].minor.yy118.pExpr );
}
break;
case 307:
{
sqlite3Reindex( pParse, 0, 0 );
}
break;
case 308:
{
sqlite3Reindex( pParse, yymsp[-1].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 309:
{
sqlite3Analyze( pParse, 0, 0 );
}
break;
case 310:
{
sqlite3Analyze( pParse, yymsp[-1].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 311:
{
sqlite3AlterRenameTable( pParse, yymsp[-3].minor.yy259, yymsp[0].minor.yy0 );
}
break;
case 312:
{
sqlite3AlterFinishAddColumn( pParse, yymsp[0].minor.yy0 );
}
break;
case 313:
{
pParse.db.lookaside.bEnabled = 0;
sqlite3AlterBeginAddColumn( pParse, yymsp[0].minor.yy259 );
}
break;
case 316:
{
sqlite3VtabFinishParse( pParse, (Token)null );
}
break;
case 317:
{
sqlite3VtabFinishParse( pParse, yymsp[0].minor.yy0 );
}
break;
case 318:
{
sqlite3VtabBeginParse( pParse, yymsp[-3].minor.yy0, yymsp[-2].minor.yy0, yymsp[0].minor.yy0 );
}
break;
case 321:
{
sqlite3VtabArgInit( pParse );
}
break;
case 323:
case 324:
case 325:
{
sqlite3VtabArgExtend( pParse, yymsp[0].minor.yy0 );
}
break;
default:
break;
};
yygoto = yyRuleInfo[yyruleno].lhs;
yysize = yyRuleInfo[yyruleno].nrhs;
yypParser.yyidx -= yysize;
yyact = yy_find_reduce_action( yymsp[-yysize].stateno, (YYCODETYPE)yygoto );
if ( yyact < YYNSTATE )
{
#if NDEBUG
** one element off the stack, then we can push the new element back
** onto the stack here, and skip the stack overflow test in yy_shift().
** That gives a significant speed improvement. */
if( yysize!=0 ){
yypParser.yyidx++;
yymsp._yyidx -= yysize - 1;
yymsp[0].stateno = (YYACTIONTYPE)yyact;
yymsp[0].major = (YYCODETYPE)yygoto;
yymsp[0].minor = yygotominor;
}else
#endif
{
yy_shift( yypParser, yyact, yygoto, yygotominor );
}
}
else
{
Debug.Assert( yyact == YYNSTATE + YYNRULE + 1 );
yy_accept( yypParser );
}
}
** The following code executes when the parse fails
*/
#if !YYNOERRORRECOVERY
static void yy_parse_failed(
yyParser yypParser
)
{
Parse pParse = yypParser.pParse;
#if !NDEBUG
if ( yyTraceFILE != null )
{
Debugger.Break();
}
#endif
while ( yypParser.yyidx >= 0 )
yy_pop_parser_stack( yypParser );
** parser fails */
yypParser.pParse = pParse;
}
#endif //* YYNOERRORRECOVERY */
** The following code executes when a syntax error first occurs.
*/
static void yy_syntax_error(
yyParser yypParser,
int yymajor,
YYMINORTYPE yyminor
)
{
Parse pParse = yypParser.pParse;
UNUSED_PARAMETER( yymajor );
Debug.Assert( yyminor.yy0.z.Length > 0 );
sqlite3ErrorMsg( pParse, "near \"%T\": syntax error", yyminor.yy0 );
pParse.parseError = 1;
yypParser.pParse = pParse;
}
** The following is executed when the parser accepts
*/
static void yy_accept(
yyParser yypParser
)
{
Parse pParse = yypParser.pParse;
#if !NDEBUG
if ( yyTraceFILE != null )
{
fprintf( yyTraceFILE, "%sAccept!\n", yyTracePrompt );
}
#endif
while ( yypParser.yyidx >= 0 )
yy_pop_parser_stack( yypParser );
** parser accepts */
yypParser.pParse = pParse;
}
** The first argument is a pointer to a structure obtained from
** "sqlite3ParserAlloc" which describes the current state of the parser.
** The second argument is the major token number. The third is
** the minor token. The fourth optional argument is whatever the
** user wants (and specified in the grammar) and is available for
** use by the action routines.
**
** Inputs:
** <ul>
** <li> A pointer to the parser (an opaque structure.)
** <li> The major token number.
** <li> The minor token number.
** <li> An option argument of a grammar-specified type.
** </ul>
**
** Outputs:
** None.
*/
static void sqlite3Parser(
yyParser yyp,
int yymajor,
sqlite3ParserTOKENTYPE yyminor
, Parse pParse //sqlite3ParserARG_PDECL
)
{
YYMINORTYPE yyminorunion = new YYMINORTYPE();
int yyact;
bool yyendofinput;
#if YYERRORSYMBOL
int yyerrorhit = null;
#endif
yyParser yypParser;
yypParser = yyp;
if ( yypParser.yyidx < 0 )
{
#if YYSTACKDEPTH//<=0
if( yypParser.yystksz <=0 ){
memset(yyminorunion, 0, yyminorunion).Length;
yyStackOverflow(yypParser, yyminorunion);
return;
}
#endif
yypParser.yyidx = 0;
yypParser.yyerrcnt = -1;
yypParser.yystack[0] = new yyStackEntry();
yypParser.yystack[0].stateno = 0;
yypParser.yystack[0].major = 0;
}
yyminorunion.yy0 = yyminor.Copy();
yyendofinput = ( yymajor == 0 );
yypParser.pParse = pParse;
#if !NDEBUG
if ( yyTraceFILE != null )
{
fprintf( yyTraceFILE, "%sInput %s\n", yyTracePrompt, yyTokenName[yymajor] );
}
#endif
do
{
yyact = yy_find_shift_action( yypParser, (YYCODETYPE)yymajor );
if ( yyact < YYNSTATE )
{
Debug.Assert( !yyendofinput );
yy_shift( yypParser, yyact, yymajor, yyminorunion );
yypParser.yyerrcnt--;
yymajor = YYNOCODE;
}
else if ( yyact < YYNSTATE + YYNRULE )
{
yy_reduce( yypParser, yyact - YYNSTATE );
}
else
{
Debug.Assert( yyact == YY_ERROR_ACTION );
#if YYERRORSYMBOL
int yymx;
#endif
#if !NDEBUG
if ( yyTraceFILE != null )
{
Debugger.Break();
}
#endif
#if YYERRORSYMBOL
** The response to an error depends upon whether or not the
** grammar defines an error token "ERROR".
**
** This is what we do if the grammar does define ERROR:
**
** * Call the %syntax_error function.
**
** * Begin popping the stack until we enter a state where
** it is legal to shift the error symbol, then shift
** the error symbol.
**
** * Set the error count to three.
**
** * Begin accepting and shifting new tokens. No new error
** processing will occur until three tokens have been
** shifted successfully.
**
*/
if( yypParser.yyerrcnt<0 ){
yy_syntax_error(yypParser,yymajor,yyminorunion);
}
yymx = yypParser.yystack[yypParser.yyidx].major;
if( yymx==YYERRORSYMBOL || yyerrorhit ){
#if !NDEBUG
if( yyTraceFILE ){
Debug.Assert(false);
yyTracePrompt,yyTokenName[yymajor]);
}
#endif
yy_destructor(yypParser,(YYCODETYPE)yymajor,yyminorunion);
yymajor = YYNOCODE;
}else{
while(
yypParser.yyidx >= 0 &&
yymx != YYERRORSYMBOL &&
(yyact = yy_find_reduce_action(
yypParser.yystack[yypParser.yyidx].stateno,
YYERRORSYMBOL)) >= YYNSTATE
){
yy_pop_parser_stack(yypParser);
}
if( yypParser.yyidx < 0 || yymajor==0 ){
yy_destructor(yypParser, (YYCODETYPE)yymajor,yyminorunion);
yy_parse_failed(yypParser);
yymajor = YYNOCODE;
}else if( yymx!=YYERRORSYMBOL ){
YYMINORTYPE u2;
u2.YYERRSYMDT = null;
yy_shift(yypParser,yyact,YYERRORSYMBOL,u2);
}
}
yypParser.yyerrcnt = 3;
yyerrorhit = 1;
#elif (YYNOERRORRECOVERY)
** do any kind of error recovery. Instead, simply invoke the syntax
** error routine and continue going as if nothing had happened.
**
** Applications can set this macro (for example inside %include) if
** they intend to abandon the parse upon the first syntax error seen.
*/
yy_syntax_error(yypParser,yymajor,yyminorunion);
yy_destructor(yypParser,(YYCODETYPE)yymajor,yyminorunion);
yymajor = YYNOCODE;
#else // * YYERRORSYMBOL is not defined */
**
** * Report an error message, and throw away the input token.
**
** * If the input token is $, then fail the parse.
**
** As before, subsequent error messages are suppressed until
** three input tokens have been successfully shifted.
*/
if ( yypParser.yyerrcnt <= 0 )
{
yy_syntax_error( yypParser, yymajor, yyminorunion );
}
yypParser.yyerrcnt = 3;
yy_destructor( yypParser, (YYCODETYPE)yymajor, yyminorunion );
if ( yyendofinput )
{
yy_parse_failed( yypParser );
}
yymajor = YYNOCODE;
#endif
}
} while ( yymajor != YYNOCODE && yypParser.yyidx >= 0 );
return;
}
public class yymsp
{
public yyParser _yyParser;
public int _yyidx;
public yymsp( ref yyParser pointer_to_yyParser, int yyidx )
{
this._yyParser = pointer_to_yyParser;
this._yyidx = yyidx;
}
public yyStackEntry this[int offset]
{
get
{
return _yyParser.yystack[_yyidx + offset];
}
}
}
}
}