📄 parse.c
字号:
/* Driver template for the LEMON parser generator.** The author disclaims copyright to this source code.*//* First off, code is included that follows the "include" declaration** in the input grammar file. */#include <stdio.h>#line 53 "parse.y"#include "sqliteInt.h"/*** An instance of this structure holds information about the** LIMIT clause of a SELECT statement.*/struct LimitVal { Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */ Expr *pOffset; /* The OFFSET expression. NULL if there is none */};/*** An instance of this structure is used to store the LIKE,** GLOB, NOT LIKE, and NOT GLOB operators.*/struct LikeOp { Token eOperator; /* "like" or "glob" or "regexp" */ int not; /* True if the NOT keyword is present */};/*** 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".*/struct TrigEvent { int a; IdList * b; };/*** An instance of this structure holds the ATTACH key and the key type.*/struct AttachKey { int type; Token key; };#line 46 "parse.c"/* Next is all token values, in a form suitable for use by makeheaders.** 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.*//* Make sure the INTERFACE macro is defined.*/#ifndef INTERFACE# define INTERFACE 1#endif/* The next thing included is series of defines which control** 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.*/#define YYCODETYPE unsigned char#define YYNOCODE 251#define YYACTIONTYPE unsigned short int#define YYWILDCARD 64#define sqlite3ParserTOKENTYPE Tokentypedef union { int yyinit; sqlite3ParserTOKENTYPE yy0; struct LimitVal yy64; Expr* yy122; Select* yy159; IdList* yy180; struct {int value; int mask;} yy207; struct LikeOp yy318; TriggerStep* yy327; SrcList* yy347; int yy392; struct TrigEvent yy410; ExprList* yy442;} YYMINORTYPE;#ifndef YYSTACKDEPTH#define YYSTACKDEPTH 100#endif#define sqlite3ParserARG_SDECL Parse *pParse;#define sqlite3ParserARG_PDECL ,Parse *pParse#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse#define sqlite3ParserARG_STORE yypParser->pParse = pParse#define YYNSTATE 610#define YYNRULE 319#define YYFALLBACK 1#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)/* The yyzerominor constant is used to initialize instances of** YYMINORTYPE objects to zero. */static const YYMINORTYPE yyzerominor = { 0 };/* Next are the tables used to determine what action to take based on the** 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.*/static const YYACTIONTYPE yy_action[] = { /* 0 */ 304, 930, 120, 609, 1, 178, 264, 436, 62, 62, /* 10 */ 62, 62, 214, 64, 64, 64, 64, 65, 65, 66, /* 20 */ 66, 66, 67, 216, 593, 467, 336, 174, 443, 449, /* 30 */ 69, 64, 64, 64, 64, 65, 65, 66, 66, 66, /* 40 */ 67, 216, 315, 592, 591, 355, 61, 60, 309, 453, /* 50 */ 454, 450, 450, 63, 63, 62, 62, 62, 62, 216, /* 60 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, /* 70 */ 216, 304, 431, 312, 436, 509, 430, 83, 64, 64, /* 80 */ 64, 64, 65, 65, 66, 66, 66, 67, 216, 406, /* 90 */ 403, 411, 65, 65, 66, 66, 66, 67, 216, 443, /* 100 */ 449, 551, 526, 59, 588, 217, 171, 57, 550, 411, /* 110 */ 68, 428, 70, 155, 610, 406, 403, 61, 60, 309, /* 120 */ 453, 454, 450, 450, 63, 63, 62, 62, 62, 62, /* 130 */ 595, 64, 64, 64, 64, 65, 65, 66, 66, 66, /* 140 */ 67, 216, 304, 228, 414, 415, 416, 312, 469, 170, /* 150 */ 114, 256, 357, 261, 358, 181, 330, 562, 412, 413, /* 160 */ 187, 561, 265, 359, 362, 363, 465, 218, 150, 151, /* 170 */ 443, 449, 95, 153, 364, 376, 412, 413, 510, 432, /* 180 */ 36, 492, 438, 411, 465, 218, 589, 590, 61, 60, /* 190 */ 309, 453, 454, 450, 450, 63, 63, 62, 62, 62, /* 200 */ 62, 649, 64, 64, 64, 64, 65, 65, 66, 66, /* 210 */ 66, 67, 216, 304, 440, 440, 440, 228, 109, 264, /* 220 */ 501, 330, 469, 511, 114, 256, 357, 261, 358, 181, /* 230 */ 330, 247, 68, 480, 70, 155, 265, 68, 552, 70, /* 240 */ 155, 443, 449, 187, 432, 35, 359, 362, 363, 569, /* 250 */ 412, 413, 510, 432, 42, 229, 438, 364, 207, 61, /* 260 */ 60, 309, 453, 454, 450, 450, 63, 63, 62, 62, /* 270 */ 62, 62, 264, 64, 64, 64, 64, 65, 65, 66, /* 280 */ 66, 66, 67, 216, 304, 570, 344, 427, 440, 440, /* 290 */ 440, 354, 433, 346, 221, 539, 325, 408, 411, 387, /* 300 */ 282, 281, 213, 66, 66, 66, 67, 216, 316, 206, /* 310 */ 214, 187, 443, 449, 359, 362, 363, 299, 545, 2, /* 320 */ 467, 543, 174, 411, 68, 364, 70, 155, 569, 384, /* 330 */ 61, 60, 309, 453, 454, 450, 450, 63, 63, 62, /* 340 */ 62, 62, 62, 433, 64, 64, 64, 64, 65, 65, /* 350 */ 66, 66, 66, 67, 216, 465, 304, 68, 544, 70, /* 360 */ 155, 426, 542, 593, 330, 412, 413, 394, 425, 20, /* 370 */ 539, 436, 178, 330, 436, 330, 514, 515, 387, 282, /* 380 */ 281, 198, 592, 241, 443, 449, 248, 432, 50, 214, /* 390 */ 412, 413, 152, 553, 402, 230, 432, 42, 432, 35, /* 400 */ 162, 78, 61, 60, 309, 453, 454, 450, 450, 63, /* 410 */ 63, 62, 62, 62, 62, 433, 64, 64, 64, 64, /* 420 */ 65, 65, 66, 66, 66, 67, 216, 330, 304, 198, /* 430 */ 474, 330, 505, 320, 433, 367, 154, 220, 436, 385, /* 440 */ 348, 436, 544, 397, 217, 475, 163, 161, 411, 240, /* 450 */ 432, 28, 554, 20, 432, 50, 443, 449, 307, 341, /* 460 */ 476, 381, 516, 433, 182, 485, 310, 460, 461, 19, /* 470 */ 433, 145, 517, 81, 61, 60, 309, 453, 454, 450, /* 480 */ 450, 63, 63, 62, 62, 62, 62, 385, 64, 64, /* 490 */ 64, 64, 65, 65, 66, 66, 66, 67, 216, 304, /* 500 */ 321, 504, 353, 508, 17, 457, 77, 330, 79, 388, /* 510 */ 335, 460, 461, 470, 512, 412, 413, 411, 123, 306, /* 520 */ 160, 444, 445, 429, 265, 432, 3, 443, 449, 217, /* 530 */ 432, 29, 377, 564, 349, 607, 921, 380, 921, 67, /* 540 */ 216, 488, 447, 448, 492, 61, 60, 309, 453, 454, /* 550 */ 450, 450, 63, 63, 62, 62, 62, 62, 148, 64, /* 560 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 216, /* 570 */ 304, 446, 389, 217, 525, 23, 492, 604, 124, 411, /* 580 */ 487, 396, 474, 222, 412, 413, 531, 607, 920, 333, /* 590 */ 920, 456, 456, 333, 411, 456, 456, 475, 443, 449, /* 600 */ 214, 333, 286, 456, 456, 249, 333, 532, 456, 456, /* 610 */ 489, 566, 476, 395, 340, 252, 61, 60, 309, 453, /* 620 */ 454, 450, 450, 63, 63, 62, 62, 62, 62, 604, /* 630 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, /* 640 */ 216, 304, 289, 330, 287, 268, 412, 413, 330, 159, /* 650 */ 853, 21, 330, 503, 330, 436, 330, 257, 330, 314, /* 660 */ 330, 412, 413, 182, 567, 515, 432, 24, 258, 443, /* 670 */ 449, 432, 33, 214, 487, 432, 54, 432, 53, 432, /* 680 */ 99, 432, 97, 432, 102, 270, 386, 61, 60, 309, /* 690 */ 453, 454, 450, 450, 63, 63, 62, 62, 62, 62, /* 700 */ 331, 64, 64, 64, 64, 65, 65, 66, 66, 66, /* 710 */ 67, 216, 304, 330, 560, 374, 560, 94, 306, 330, /* 720 */ 234, 330, 436, 288, 330, 274, 330, 272, 330, 333, /* 730 */ 330, 456, 456, 330, 603, 303, 432, 103, 405, 1, /* 740 */ 443, 449, 432, 108, 432, 110, 492, 432, 16, 432, /* 750 */ 100, 432, 34, 432, 98, 496, 432, 25, 61, 60, /* 760 */ 309, 453, 454, 450, 450, 63, 63, 62, 62, 62, /* 770 */ 62, 330, 64, 64, 64, 64, 65, 65, 66, 66, /* 780 */ 66, 67, 216, 304, 330, 254, 330, 183, 184, 185,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -