📄 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 51 "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 48 "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 249#define YYACTIONTYPE unsigned short int#define YYWILDCARD 59#define sqlite3ParserTOKENTYPE Tokentypedef union { sqlite3ParserTOKENTYPE yy0; Select* yy43; TriggerStep* yy75; struct LimitVal yy84; struct LikeOp yy86; struct {int value; int mask;} yy207; ExprList* yy242; int yy316; IdList* yy352; struct TrigEvent yy354; SrcList* yy419; Expr* yy450;} 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 598#define YYNRULE 315#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. */#ifdef __cplusplusstatic YYMINORTYPE yyzerominor;#elsestatic const YYMINORTYPE yyzerominor;#endif/* 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 */ 296, 914, 120, 597, 2, 172, 425, 425, 62, 62, /* 10 */ 62, 62, 210, 64, 64, 64, 64, 65, 65, 66, /* 20 */ 66, 66, 67, 212, 398, 395, 432, 438, 69, 64, /* 30 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212, /* 40 */ 458, 456, 327, 168, 61, 60, 301, 442, 443, 439, /* 50 */ 439, 63, 63, 62, 62, 62, 62, 256, 64, 64, /* 60 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 296, /* 70 */ 498, 425, 425, 212, 427, 83, 68, 469, 70, 154, /* 80 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, /* 90 */ 212, 68, 307, 70, 154, 432, 438, 454, 214, 59, /* 100 */ 65, 65, 66, 66, 66, 67, 212, 429, 429, 429, /* 110 */ 497, 583, 296, 61, 60, 301, 442, 443, 439, 439, /* 120 */ 63, 63, 62, 62, 62, 62, 321, 64, 64, 64, /* 130 */ 64, 65, 65, 66, 66, 66, 67, 212, 432, 438, /* 140 */ 95, 66, 66, 66, 67, 212, 403, 256, 421, 35, /* 150 */ 57, 67, 212, 175, 417, 499, 61, 60, 301, 442, /* 160 */ 443, 439, 439, 63, 63, 62, 62, 62, 62, 19, /* 170 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, /* 180 */ 212, 296, 225, 532, 299, 581, 109, 422, 242, 458, /* 190 */ 416, 335, 414, 21, 502, 503, 346, 403, 527, 176, /* 200 */ 160, 454, 214, 580, 579, 344, 500, 432, 438, 149, /* 210 */ 150, 404, 405, 539, 514, 418, 151, 541, 8, 498, /* 220 */ 538, 577, 578, 427, 296, 61, 60, 301, 442, 443, /* 230 */ 439, 439, 63, 63, 62, 62, 62, 62, 196, 64, /* 240 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212, /* 250 */ 432, 438, 454, 598, 398, 395, 429, 429, 429, 369, /* 260 */ 558, 481, 404, 405, 372, 576, 213, 296, 61, 60, /* 270 */ 301, 442, 443, 439, 439, 63, 63, 62, 62, 62, /* 280 */ 62, 321, 64, 64, 64, 64, 65, 65, 66, 66, /* 290 */ 66, 67, 212, 432, 438, 555, 503, 304, 557, 532, /* 300 */ 218, 557, 552, 421, 36, 234, 397, 2, 542, 21, /* 310 */ 540, 61, 60, 301, 442, 443, 439, 439, 63, 63, /* 320 */ 62, 62, 62, 62, 388, 64, 64, 64, 64, 65, /* 330 */ 65, 66, 66, 66, 67, 212, 415, 530, 85, 381, /* 340 */ 78, 323, 296, 210, 304, 527, 493, 492, 379, 274, /* 350 */ 273, 379, 274, 273, 347, 463, 241, 387, 268, 210, /* 360 */ 533, 581, 210, 403, 20, 224, 144, 464, 432, 438, /* 370 */ 485, 164, 114, 248, 349, 253, 350, 177, 554, 580, /* 380 */ 465, 420, 331, 81, 257, 419, 61, 60, 301, 442, /* 390 */ 443, 439, 439, 63, 63, 62, 62, 62, 62, 391, /* 400 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67, /* 410 */ 212, 296, 224, 203, 249, 496, 403, 440, 837, 114, /* 420 */ 248, 349, 253, 350, 177, 250, 321, 152, 404, 405, /* 430 */ 321, 257, 303, 324, 155, 445, 445, 432, 438, 317, /* 440 */ 400, 389, 213, 68, 209, 70, 154, 422, 421, 35, /* 450 */ 393, 202, 421, 42, 481, 61, 60, 301, 442, 443, /* 460 */ 439, 439, 63, 63, 62, 62, 62, 62, 422, 64, /* 470 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212, /* 480 */ 296, 404, 405, 183, 513, 422, 351, 354, 355, 403, /* 490 */ 77, 335, 79, 489, 216, 183, 334, 356, 351, 354, /* 500 */ 355, 433, 434, 406, 407, 408, 432, 438, 235, 356, /* 510 */ 386, 68, 291, 70, 154, 456, 531, 168, 198, 302, /* 520 */ 449, 450, 436, 437, 61, 60, 301, 442, 443, 439, /* 530 */ 439, 63, 63, 62, 62, 62, 62, 394, 64, 64, /* 540 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 296, /* 550 */ 321, 435, 422, 260, 404, 405, 321, 183, 153, 321, /* 560 */ 351, 354, 355, 446, 332, 321, 595, 905, 321, 905, /* 570 */ 1, 356, 421, 28, 403, 432, 438, 376, 421, 42, /* 580 */ 477, 421, 35, 213, 548, 366, 548, 421, 50, 159, /* 590 */ 421, 50, 422, 61, 60, 301, 442, 443, 439, 439, /* 600 */ 63, 63, 62, 62, 62, 62, 592, 64, 64, 64, /* 610 */ 64, 65, 65, 66, 66, 66, 67, 212, 296, 337, /* 620 */ 217, 463, 256, 94, 339, 326, 449, 450, 172, 340, /* 630 */ 425, 345, 532, 464, 312, 595, 904, 313, 904, 404, /* 640 */ 405, 588, 21, 226, 432, 438, 465, 243, 504, 324, /* 650 */ 322, 445, 445, 421, 3, 459, 230, 308, 505, 194, /* 660 */ 278, 296, 61, 60, 301, 442, 443, 439, 439, 63, /* 670 */ 63, 62, 62, 62, 62, 592, 64, 64, 64, 64, /* 680 */ 65, 65, 66, 66, 66, 67, 212, 432, 438, 213, /* 690 */ 179, 180, 181, 422, 324, 425, 445, 445, 281, 262, /* 700 */ 279, 402, 194, 481, 296, 61, 60, 301, 442, 443, /* 710 */ 439, 439, 63, 63, 62, 62, 62, 62, 377, 64, /* 720 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212, /* 730 */ 432, 438, 591, 295, 115, 268, 422, 266, 211, 264, /* 740 */ 373, 324, 246, 445, 445, 56, 256, 296, 61, 71, /* 750 */ 301, 442, 443, 439, 439, 63, 63, 62, 62, 62, /* 760 */ 62, 377, 64, 64, 64, 64, 65, 65, 66, 66, /* 770 */ 66, 67, 212, 432, 438, 550, 269, 474, 18, 549, /* 780 */ 280, 309, 343, 380, 171, 160, 256, 268, 5, 268, /* 790 */ 296, 368, 60, 301, 442, 443, 439, 439, 63, 63,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -