⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parse.c

📁 SQLite is a software library that implements a self-contained, serverless, zero-configuration, trans
💻 C
📖 第 1 页 / 共 5 页
字号:
/* 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 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 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;  struct {int value; int mask;} yy405;  Token yy410;  IdList* yy432;} 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 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;/* 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 */   292,  901,  124,  587,  409,  172,    2,  418,   61,   61, /*    10 */    61,   61,  519,   63,   63,   63,   63,   64,   64,   65, /*    20 */    65,   65,   66,  210,  447,  212,  425,  431,   68,   63, /*    30 */    63,   63,   63,   64,   64,   65,   65,   65,   66,  210, /*    40 */   391,  388,  396,  451,   60,   59,  297,  435,  436,  432, /*    50 */   432,   62,   62,   61,   61,   61,   61,  263,   63,   63, /*    60 */    63,   63,   64,   64,   65,   65,   65,   66,  210,  292, /*    70 */   493,  494,  418,  489,  208,   82,   67,  420,   69,  154, /*    80 */    63,   63,   63,   63,   64,   64,   65,   65,   65,   66, /*    90 */   210,   67,  462,   69,  154,  425,  431,  573,  264,   58, /*   100 */    64,   64,   65,   65,   65,   66,  210,  397,  398,  422, /*   110 */   422,  422,  292,   60,   59,  297,  435,  436,  432,  432, /*   120 */    62,   62,   61,   61,   61,   61,  317,   63,   63,   63, /*   130 */    63,   64,   64,   65,   65,   65,   66,  210,  425,  431, /*   140 */    94,   65,   65,   65,   66,  210,  396,  210,  414,   34, /*   150 */    56,  298,  442,  443,  410,  488,   60,   59,  297,  435, /*   160 */   436,  432,  432,   62,   62,   61,   61,   61,   61,  490, /*   170 */    63,   63,   63,   63,   64,   64,   65,   65,   65,   66, /*   180 */   210,  292,  257,  524,  295,  571,  113,  408,  522,  451, /*   190 */   331,  317,  407,   20,  418,  340,  519,  396,  532,  531, /*   200 */   505,  447,  212,  570,  569,  208,  530,  425,  431,  149, /*   210 */   150,  397,  398,  414,   41,  211,  151,  533,  372,  489, /*   220 */   261,  568,  259,  420,  292,   60,   59,  297,  435,  436, /*   230 */   432,  432,   62,   62,   61,   61,   61,   61,  317,   63, /*   240 */    63,   63,   63,   64,   64,   65,   65,   65,   66,  210, /*   250 */   425,  431,  447,  333,  215,  422,  422,  422,  363,  418, /*   260 */   414,   41,  397,  398,  366,  567,  211,  292,   60,   59, /*   270 */   297,  435,  436,  432,  432,   62,   62,   61,   61,   61, /*   280 */    61,  396,   63,   63,   63,   63,   64,   64,   65,   65, /*   290 */    65,   66,  210,  425,  431,  491,  300,  524,  474,   66, /*   300 */   210,  214,  474,  229,  411,  286,  534,   20,  449,  523, /*   310 */   168,   60,   59,  297,  435,  436,  432,  432,   62,   62, /*   320 */    61,   61,   61,   61,  474,   63,   63,   63,   63,   64, /*   330 */    64,   65,   65,   65,   66,  210,  209,  480,  317,   77, /*   340 */   292,  239,  300,   55,  484,  230,  397,  398,  181,  547, /*   350 */   494,  345,  348,  349,   67,  152,   69,  154,  339,  524, /*   360 */   414,   35,  350,  241,  221,  370,  425,  431,  578,   20, /*   370 */   164,  118,  243,  343,  248,  344,  176,  322,  442,  443, /*   380 */   414,    3,   80,  252,   60,   59,  297,  435,  436,  432, /*   390 */   432,   62,   62,   61,   61,   61,   61,  174,   63,   63, /*   400 */    63,   63,   64,   64,   65,   65,   65,   66,  210,  292, /*   410 */   221,  550,  236,  487,  510,  353,  317,  118,  243,  343, /*   420 */   248,  344,  176,  181,  317,  525,  345,  348,  349,  252, /*   430 */   223,  415,  155,  464,  511,  425,  431,  350,  414,   34, /*   440 */   465,  211,  177,  175,  160,  237,  414,   34,  338,  549, /*   450 */   449,  323,  168,   60,   59,  297,  435,  436,  432,  432, /*   460 */    62,   62,   61,   61,   61,   61,  415,   63,   63,   63, /*   470 */    63,   64,   64,   65,   65,   65,   66,  210,  292,  542, /*   480 */   335,  517,  504,  541,  456,  571,  302,   19,  331,  144, /*   490 */   317,  390,  317,  330,    2,  362,  457,  294,  483,  373, /*   500 */   269,  268,  252,  570,  425,  431,  588,  391,  388,  458, /*   510 */   208,  495,  414,   49,  414,   49,  303,  585,  892,  159, /*   520 */   892,  496,   60,   59,  297,  435,  436,  432,  432,   62, /*   530 */    62,   61,   61,   61,   61,  201,   63,   63,   63,   63, /*   540 */    64,   64,   65,   65,   65,   66,  210,  292,  317,  181, /*   550 */   439,  255,  345,  348,  349,  370,  153,  582,  308,  251, /*   560 */   309,  452,   76,  350,   78,  382,  211,  426,  427,  415, /*   570 */   414,   27,  319,  425,  431,  440,    1,   22,  585,  891, /*   580 */   396,  891,  544,  478,  320,  263,  438,  438,  429,  430, /*   590 */   415,   60,   59,  297,  435,  436,  432,  432,   62,   62, /*   600 */    61,   61,   61,   61,  328,   63,   63,   63,   63,   64, /*   610 */    64,   65,   65,   65,   66,  210,  292,  428,  582,  374, /*   620 */   224,   93,  517,    9,  336,  396,  557,  396,  456,   67, /*   630 */   396,   69,  154,  399,  400,  401,  320,  238,  438,  438, /*   640 */   457,  318,  425,  431,  299,  397,  398,  320,  433,  438, /*   650 */   438,  581,  291,  458,  225,  327,    5,  222,  546,  292, /*   660 */    60,   59,  297,  435,  436,  432,  432,   62,   62,   61, /*   670 */    61,   61,   61,  395,   63,   63,   63,   63,   64,   64, /*   680 */    65,   65,   65,   66,  210,  425,  431,  482,  313,  392, /*   690 */   397,  398,  397,  398,  207,  397,  398,  824,  273,  517, /*   700 */   251,  200,  292,   60,   59,  297,  435,  436,  432,  432, /*   710 */    62,   62,   61,   61,   61,   61,  470,   63,   63,   63, /*   720 */    63,   64,   64,   65,   65,   65,   66,  210,  425,  431, /*   730 */   171,  160,  263,  263,  304,  415,  276,  119,  274,  263, /*   740 */   517,  517,  263,  517,  192,  292,   60,   70,  297,  435, /*   750 */   436,  432,  432,   62,   62,   61,   61,   61,   61,  379, /*   760 */    63,   63,   63,   63,   64,   64,   65,   65,   65,   66, /*   770 */   210,  425,  431,  384,  559,  305,  306,  251,  415,  320, /*   780 */   560,  438,  438,  561,  540,  360,  540,  387,  292,  196, /*   790 */    59,  297,  435,  436,  432,  432,   62,   62,   61,   61, /*   800 */    61,   61,  371,   63,   63,   63,   63,   64,   64,   65, /*   810 */    65,   65,   66,  210,  425,  431,  396,  275,  251,  251, /*   820 */   172,  250,  418,  415,  386,  367,  178,  179,  180,  469, /*   830 */   311,  123,  156,  128,  297,  435,  436,  432,  432,   62, /*   840 */    62,   61,   61,   61,   61,  317,   63,   63,   63,   63,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -