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

📄 parse.c

📁 SQLite的VS2005封装
💻 C
📖 第 1 页 / 共 5 页
字号:
/* 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 247#define YYACTIONTYPE unsigned short int#define YYWILDCARD 59#define sqlite3ParserTOKENTYPE Tokentypedef union {  sqlite3ParserTOKENTYPE yy0;  struct TrigEvent yy30;  Expr* yy62;  SrcList* yy151;  struct LimitVal yy220;  struct LikeOp yy222;  IdList* yy240;  int yy280;  struct {int value; int mask;} yy359;  TriggerStep* yy360;  Select* yy375;  ExprList* yy418;} 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 590#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. */#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 */   292,  903,  120,  589,    2,  172,  419,  419,   62,   62, /*    10 */    62,   62,  209,   64,   64,   64,   64,   65,   65,   66, /*    20 */    66,   66,   67,  211,  392,  389,  426,  432,   69,   64, /*    30 */    64,   64,   64,   65,   65,   66,   66,   66,   67,  211, /*    40 */   448,  213,  397,  452,   61,   60,  297,  436,  437,  433, /*    50 */   433,   63,   63,   62,   62,   62,   62,  264,   64,   64, /*    60 */    64,   64,   65,   65,   66,   66,   66,   67,  211,  292, /*    70 */   317,  419,  419,  490,  211,   83,   68,  421,   70,  154, /*    80 */    64,   64,   64,   64,   65,   65,   66,   66,   66,   67, /*    90 */   211,  489,  415,   36,  181,  426,  432,  448,  265,   59, /*   100 */    65,   65,   66,   66,   66,   67,  211,  398,  399,  423, /*   110 */   423,  423,  292,   61,   60,  297,  436,  437,  433,  433, /*   120 */    63,   63,   62,   62,   62,   62,  317,   64,   64,   64, /*   130 */    64,   65,   65,   66,   66,   66,   67,  211,  426,  432, /*   140 */    95,  313,  394,  475,  237,  172,  208,  419,  415,   35, /*   150 */    57,   67,  211,  201,  411,  475,   61,   60,  297,  436, /*   160 */   437,  433,  433,   63,   63,   62,   62,   62,   62,  503, /*   170 */    64,   64,   64,   64,   65,   65,   66,   66,   66,   67, /*   180 */   211,  292,  481,  524,  542,  573,  109,  416,  541,  452, /*   190 */   331,  317,  408,   21,  240,  340,  409,  522,  317,   68, /*   200 */   362,   70,  154,  572,  571,  519,  492,  426,  432,  149, /*   210 */   150,  380,  419,  415,   42,  412,  151,  533,  202,  490, /*   220 */   415,   50,  532,  421,  292,   61,   60,  297,  436,  437, /*   230 */   433,  433,   63,   63,   62,   62,   62,   62,  388,   64, /*   240 */    64,   64,   64,   65,   65,   66,   66,   66,   67,  211, /*   250 */   426,  432,  416,  333,  216,  423,  423,  423,   66,   66, /*   260 */    66,   67,  211,  491,  568,  212,  308,  292,   61,   60, /*   270 */   297,  436,  437,  433,  433,   63,   63,   62,   62,   62, /*   280 */    62,  397,   64,   64,   64,   64,   65,   65,   66,   66, /*   290 */    66,   67,  211,  426,  432,  182,  300,  410,  345,  348, /*   300 */   349,  531,  506,  252,   68,  519,   70,  154,  530,  350, /*   310 */   231,   61,   60,  297,  436,  437,  433,  433,   63,   63, /*   320 */    62,   62,   62,   62,  575,   64,   64,   64,   64,   65, /*   330 */    65,   66,   66,   66,   67,  211,  525,  317,  303,   78, /*   340 */   292,  238,  300,  511,  485,  153,  398,  399,  182,  494, /*   350 */   495,  345,  348,  349,  320,  152,  439,  439,  339,  415, /*   360 */    28,  328,  350,  512,  222,  370,  426,  432,  547,  495, /*   370 */   164,  114,  244,  343,  249,  344,  176,  583,  291,  416, /*   380 */   415,    3,   81,  253,   61,   60,  297,  436,  437,  433, /*   390 */   433,   63,   63,   62,   62,   62,   62,  174,   64,   64, /*   400 */    64,   64,   65,   65,   66,   66,   66,   67,  211,  292, /*   410 */   222,  587,  894,  488,  894,  302,  573,  114,  244,  343, /*   420 */   249,  344,  176,  182,  317,  397,  345,  348,  349,  253, /*   430 */   224,  416,  155,  549,  572,  426,  432,  350,   68,  463, /*   440 */    70,  154,  397,  175,  160,  397,  415,   35,  338,  587, /*   450 */   893,  584,  893,   61,   60,  297,  436,  437,  433,  433, /*   460 */    63,   63,   62,   62,   62,   62,  416,   64,   64,   64, /*   470 */    64,   65,   65,   66,   66,   66,   67,  211,  292,  550, /*   480 */   448,  213,  505,  373,  270,  269,  171,  160,  331,  584, /*   490 */   398,  399,  317,  330,  209,  383,  212,  159,  427,  428, /*   500 */   569,  570,  483,  524,  426,  432,  336,  398,  399,  230, /*   510 */   398,  399,  534,   21,  415,   42,  239,  549,  479,  430, /*   520 */   431,  475,   61,   60,  297,  436,  437,  433,  433,   63, /*   530 */    63,   62,   62,   62,   62,  264,   64,   64,   64,   64, /*   540 */    65,   65,   66,   66,   66,   67,  211,  292,  429,  287, /*   550 */   457,  256,  450,  523,  168,  215,  197,  295,  317,  353, /*   560 */   242,  317,  458,  298,  443,  444,  468,  373,  270,  269, /*   570 */   322,  443,  444,  426,  432,  459,  558,  496,  209,  299, /*   580 */   415,   35,  544,  415,   50,    1,  177,  497,  479,  397, /*   590 */   416,   61,   60,  297,  436,  437,  433,  433,   63,   63, /*   600 */    62,   62,   62,   62,  484,   64,   64,   64,   64,   65, /*   610 */    65,   66,   66,   66,   67,  211,  292,  317,  524,  375, /*   620 */   457,   94,  335,  590,  392,  389,  212,  580,   21,  309, /*   630 */    10,  363,  458,  212,  397,  209,  366,  391,    2,  415, /*   640 */    29,  294,  426,  432,  195,  459,  253,  327,  372,  361, /*   650 */   440,  450,  323,  168,  398,  399,  252,  147,  546,  292, /*   660 */    61,   60,  297,  436,  437,  433,  433,   63,   63,   62, /*   670 */    62,   62,   62,  317,   64,   64,   64,   64,   65,   65, /*   680 */    66,   66,   66,   67,  211,  426,  432,  210,  318,  453, /*   690 */   320,  223,  439,  439,   56,  415,   24,  826,  252,  398, /*   700 */   399,  193,  292,   61,   60,  297,  436,  437,  433,  433, /*   710 */    63,   63,   62,   62,   62,   62,  226,   64,   64,   64, /*   720 */    64,   65,   65,   66,   66,   66,   67,  211,  426,  432, /*   730 */   311,  119,  264,  304,  396,  416,  320,   19,  439,  439, /*   740 */   400,  401,  402,   85,  274,  292,   61,   71,  297,  436, /*   750 */   437,  433,  433,   63,   63,   62,   62,   62,   62,  371, /*   760 */    64,   64,   64,   64,   65,   65,   66,   66,   66,   67, /*   770 */   211,  426,  432,  385,  115,  320,   18,  439,  439,  446, /*   780 */   446,  374,  277,    5,  275,  264,    8,  252,  292,  341, /*   790 */    60,  297,  436,  437,  433,  433,   63,   63,   62,   62, /*   800 */    62,   62,  397,   64,   64,   64,   64,   65,   65,   66, /*   810 */    66,   66,   67,  211,  426,  432,  414,  397,  422,  470, /*   820 */   413,   22,  305,  387,  252,  419,  560,  193,  414,  264,

⌨️ 快捷键说明

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