📄 parse.c
字号:
/* Driver template for the LEMON parser generator.** The author disclaims copyright to this source code.*//* First off, code is include which follows the "include" declaration** in the input file. */#include <stdio.h>#line 56 "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 47 "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 248#define YYACTIONTYPE unsigned short int#define YYWILDCARD 59#define sqlite3ParserTOKENTYPE Tokentypedef union { sqlite3ParserTOKENTYPE yy0; int yy46; struct LikeOp yy72; Expr* yy172; ExprList* yy174; Select* yy219; struct LimitVal yy234; TriggerStep* yy243; struct TrigEvent yy370; SrcList* yy373; Expr * yy386; struct {int value; int mask;} yy405; Token yy410; IdList* yy432; int yy495;} 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 588#define YYNRULE 312#define YYERRORSYMBOL 138#define YYERRSYMDT yy495#define YYFALLBACK 1#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)/* Next are that 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 */ 299, 901, 124, 587, 416, 174, 2, 425, 61, 61, /* 10 */ 61, 61, 297, 63, 63, 63, 63, 64, 64, 65, /* 20 */ 65, 65, 66, 212, 454, 214, 432, 438, 68, 63, /* 30 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 212, /* 40 */ 398, 395, 403, 458, 60, 59, 304, 442, 443, 439, /* 50 */ 439, 62, 62, 61, 61, 61, 61, 265, 63, 63, /* 60 */ 63, 63, 64, 64, 65, 65, 65, 66, 212, 299, /* 70 */ 500, 501, 425, 496, 210, 82, 67, 427, 69, 156, /* 80 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66, /* 90 */ 212, 67, 469, 69, 156, 432, 438, 573, 266, 58, /* 100 */ 64, 64, 65, 65, 65, 66, 212, 404, 405, 429, /* 110 */ 429, 429, 299, 60, 59, 304, 442, 443, 439, 439, /* 120 */ 62, 62, 61, 61, 61, 61, 324, 63, 63, 63, /* 130 */ 63, 64, 64, 65, 65, 65, 66, 212, 432, 438, /* 140 */ 94, 65, 65, 65, 66, 212, 403, 212, 421, 34, /* 150 */ 56, 305, 449, 450, 417, 481, 60, 59, 304, 442, /* 160 */ 443, 439, 439, 62, 62, 61, 61, 61, 61, 495, /* 170 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66, /* 180 */ 212, 299, 259, 524, 203, 571, 113, 415, 522, 458, /* 190 */ 338, 324, 414, 20, 241, 347, 297, 403, 471, 531, /* 200 */ 292, 454, 214, 570, 569, 472, 530, 432, 438, 151, /* 210 */ 152, 404, 405, 421, 41, 213, 153, 533, 422, 496, /* 220 */ 263, 568, 261, 427, 299, 60, 59, 304, 442, 443, /* 230 */ 439, 439, 62, 62, 61, 61, 61, 61, 324, 63, /* 240 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 212, /* 250 */ 432, 438, 454, 340, 217, 429, 429, 429, 219, 550, /* 260 */ 421, 41, 404, 405, 490, 567, 213, 299, 60, 59, /* 270 */ 304, 442, 443, 439, 439, 62, 62, 61, 61, 61, /* 280 */ 61, 652, 63, 63, 63, 63, 64, 64, 65, 65, /* 290 */ 65, 66, 212, 432, 438, 103, 652, 549, 524, 519, /* 300 */ 652, 216, 652, 67, 231, 69, 156, 534, 20, 66, /* 310 */ 212, 60, 59, 304, 442, 443, 439, 439, 62, 62, /* 320 */ 61, 61, 61, 61, 265, 63, 63, 63, 63, 64, /* 330 */ 64, 65, 65, 65, 66, 212, 654, 324, 288, 77, /* 340 */ 299, 456, 523, 170, 491, 155, 232, 380, 271, 270, /* 350 */ 327, 654, 445, 445, 485, 654, 485, 654, 210, 421, /* 360 */ 27, 456, 330, 170, 652, 391, 432, 438, 497, 425, /* 370 */ 652, 652, 652, 652, 652, 652, 652, 252, 654, 422, /* 380 */ 581, 291, 80, 652, 60, 59, 304, 442, 443, 439, /* 390 */ 439, 62, 62, 61, 61, 61, 61, 210, 63, 63, /* 400 */ 63, 63, 64, 64, 65, 65, 65, 66, 212, 299, /* 410 */ 379, 585, 892, 494, 892, 306, 393, 368, 324, 654, /* 420 */ 21, 324, 307, 324, 425, 654, 654, 654, 654, 654, /* 430 */ 654, 654, 571, 654, 425, 432, 438, 532, 654, 654, /* 440 */ 421, 49, 485, 421, 35, 421, 49, 329, 449, 450, /* 450 */ 570, 582, 348, 60, 59, 304, 442, 443, 439, 439, /* 460 */ 62, 62, 61, 61, 61, 61, 655, 63, 63, 63, /* 470 */ 63, 64, 64, 65, 65, 65, 66, 212, 299, 420, /* 480 */ 198, 655, 509, 419, 324, 655, 315, 655, 653, 425, /* 490 */ 223, 316, 653, 525, 653, 238, 166, 118, 245, 350, /* 500 */ 250, 351, 178, 314, 432, 438, 421, 34, 655, 254, /* 510 */ 239, 213, 389, 213, 422, 653, 588, 398, 395, 406, /* 520 */ 407, 408, 60, 59, 304, 442, 443, 439, 439, 62, /* 530 */ 62, 61, 61, 61, 61, 335, 63, 63, 63, 63, /* 540 */ 64, 64, 65, 65, 65, 66, 212, 299, 342, 655, /* 550 */ 307, 257, 463, 547, 501, 655, 655, 655, 655, 655, /* 560 */ 655, 655, 653, 655, 464, 653, 653, 653, 655, 655, /* 570 */ 653, 161, 498, 432, 438, 653, 653, 465, 1, 502, /* 580 */ 544, 418, 403, 585, 891, 176, 891, 343, 174, 503, /* 590 */ 425, 60, 59, 304, 442, 443, 439, 439, 62, 62, /* 600 */ 61, 61, 61, 61, 240, 63, 63, 63, 63, 64, /* 610 */ 64, 65, 65, 65, 66, 212, 299, 381, 223, 422, /* 620 */ 9, 93, 377, 582, 403, 118, 245, 350, 250, 351, /* 630 */ 178, 177, 162, 325, 403, 183, 345, 254, 352, 355, /* 640 */ 356, 227, 432, 438, 446, 320, 399, 404, 405, 357, /* 650 */ 459, 209, 540, 367, 540, 425, 546, 302, 202, 299, /* 660 */ 60, 59, 304, 442, 443, 439, 439, 62, 62, 61, /* 670 */ 61, 61, 61, 402, 63, 63, 63, 63, 64, 64, /* 680 */ 65, 65, 65, 66, 212, 432, 438, 225, 524, 404, /* 690 */ 405, 489, 422, 397, 18, 824, 2, 578, 20, 404, /* 700 */ 405, 194, 299, 60, 59, 304, 442, 443, 439, 439, /* 710 */ 62, 62, 61, 61, 61, 61, 386, 63, 63, 63, /* 720 */ 63, 64, 64, 65, 65, 65, 66, 212, 432, 438, /* 730 */ 327, 370, 445, 445, 481, 422, 327, 373, 445, 445, /* 740 */ 275, 519, 519, 8, 394, 299, 60, 70, 304, 442, /* 750 */ 443, 439, 439, 62, 62, 61, 61, 61, 61, 378, /* 760 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66, /* 770 */ 212, 432, 438, 243, 211, 167, 310, 224, 278, 196,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -