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

📄 parse.c

📁 嵌入式数据库Sqlite,SQLlite小型数据库
💻 C
📖 第 1 页 / 共 5 页
字号:
 /* 257 */ "trigger_time ::= INSTEAD OF", /* 258 */ "trigger_time ::=", /* 259 */ "trigger_event ::= DELETE|INSERT", /* 260 */ "trigger_event ::= UPDATE", /* 261 */ "trigger_event ::= UPDATE OF inscollist", /* 262 */ "foreach_clause ::=", /* 263 */ "foreach_clause ::= FOR EACH ROW", /* 264 */ "foreach_clause ::= FOR EACH STATEMENT", /* 265 */ "when_clause ::=", /* 266 */ "when_clause ::= WHEN expr", /* 267 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", /* 268 */ "trigger_cmd_list ::=", /* 269 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt", /* 270 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP", /* 271 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select", /* 272 */ "trigger_cmd ::= DELETE FROM nm where_opt", /* 273 */ "trigger_cmd ::= select", /* 274 */ "expr ::= RAISE LP IGNORE RP", /* 275 */ "expr ::= RAISE LP raisetype COMMA nm RP", /* 276 */ "raisetype ::= ROLLBACK", /* 277 */ "raisetype ::= ABORT", /* 278 */ "raisetype ::= FAIL", /* 279 */ "cmd ::= DROP TRIGGER fullname", /* 280 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", /* 281 */ "key_opt ::=", /* 282 */ "key_opt ::= KEY expr", /* 283 */ "database_kw_opt ::= DATABASE", /* 284 */ "database_kw_opt ::=", /* 285 */ "cmd ::= DETACH database_kw_opt expr", /* 286 */ "cmd ::= REINDEX", /* 287 */ "cmd ::= REINDEX nm dbnm", /* 288 */ "cmd ::= ANALYZE", /* 289 */ "cmd ::= ANALYZE nm dbnm", /* 290 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", /* 291 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", /* 292 */ "add_column_fullname ::= fullname", /* 293 */ "kwcolumn_opt ::=", /* 294 */ "kwcolumn_opt ::= COLUMNKW",};#endif /* NDEBUG *//*** This function returns the symbolic name associated with a token** value.*/const char *sqlite3ParserTokenName(int tokenType){#ifndef NDEBUG  if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){    return yyTokenName[tokenType];  }else{    return "Unknown";  }#else  return "";#endif}/* ** This function allocates a new parser.** The only argument is a pointer to a function which works like** malloc.**** Inputs:** A pointer to the function used to allocate memory.**** Outputs:** A pointer to a parser.  This pointer is used in subsequent calls** to sqlite3Parser and sqlite3ParserFree.*/void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){  yyParser *pParser;  pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );  if( pParser ){    pParser->yyidx = -1;  }  return pParser;}/* The following function deletes the value associated with a** symbol.  The symbol can be either a terminal or nonterminal.** "yymajor" is the symbol code, and "yypminor" is a pointer to** the value.*/static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){  switch( yymajor ){    /* Here is inserted the actions which take place when a    ** terminal or non-terminal is destroyed.  This can happen    ** when the symbol is popped from the stack during a    ** reduce or during error processing or when a parser is     ** being destroyed before it is finished parsing.    **    ** Note: during a reduce, the only symbols destroyed are those    ** which appear on the RHS of the rule, but which are not used    ** inside the C code.    */    case 154:    case 188:    case 205:#line 371 "parse.y"{sqlite3SelectDelete((yypminor->yy239));}#line 1215 "parse.c"      break;    case 168:    case 169:    case 193:    case 195:    case 203:    case 209:    case 217:    case 220:    case 222:    case 223:    case 233:#line 628 "parse.y"{sqlite3ExprDelete((yypminor->yy178));}#line 1230 "parse.c"      break;    case 173:    case 181:    case 191:    case 194:    case 196:    case 198:    case 208:    case 211:    case 212:    case 215:    case 221:#line 859 "parse.y"{sqlite3ExprListDelete((yypminor->yy462));}#line 1245 "parse.c"      break;    case 187:    case 192:    case 200:    case 201:#line 499 "parse.y"{sqlite3SrcListDelete((yypminor->yy285));}#line 1253 "parse.c"      break;    case 197:#line 560 "parse.y"{  sqlite3ExprDelete((yypminor->yy270).pLimit);  sqlite3ExprDelete((yypminor->yy270).pOffset);}#line 1261 "parse.c"      break;    case 204:    case 207:    case 214:#line 516 "parse.y"{sqlite3IdListDelete((yypminor->yy160));}#line 1268 "parse.c"      break;    case 229:    case 234:#line 953 "parse.y"{sqlite3DeleteTriggerStep((yypminor->yy247));}#line 1274 "parse.c"      break;    case 231:#line 937 "parse.y"{sqlite3IdListDelete((yypminor->yy132).b);}#line 1279 "parse.c"      break;    case 236:#line 1021 "parse.y"{sqlite3ExprDelete((yypminor->yy292));}#line 1284 "parse.c"      break;    default:  break;   /* If no destructor action specified: do nothing */  }}/*** Pop the parser's stack once.**** If there is a destructor routine associated with the token which** is popped from the stack, then call it.**** Return the major token number for the symbol popped.*/static int yy_pop_parser_stack(yyParser *pParser){  YYCODETYPE yymajor;  yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];  if( pParser->yyidx<0 ) return 0;#ifndef NDEBUG  if( yyTraceFILE && pParser->yyidx>=0 ){    fprintf(yyTraceFILE,"%sPopping %s\n",      yyTracePrompt,      yyTokenName[yytos->major]);  }#endif  yymajor = yytos->major;  yy_destructor( yymajor, &yytos->minor);  pParser->yyidx--;  return yymajor;}/* ** Deallocate and destroy a parser.  Destructors are all called for** all stack elements before shutting the parser down.**** Inputs:** <ul>** <li>  A pointer to the parser.  This should be a pointer**       obtained from sqlite3ParserAlloc.** <li>  A pointer to a function used to reclaim memory obtained**       from malloc.** </ul>*/void sqlite3ParserFree(  void *p,                    /* The parser to be deleted */  void (*freeProc)(void*)     /* Function used to reclaim memory */){  yyParser *pParser = (yyParser*)p;  if( pParser==0 ) return;  while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);  (*freeProc)((void*)pParser);}/*** Find the appropriate action for a parser given the terminal** look-ahead token iLookAhead.**** If the look-ahead token is YYNOCODE, then check to see if the action is** independent of the look-ahead.  If it is, return the action, otherwise** return YY_NO_ACTION.*/static int yy_find_shift_action(  yyParser *pParser,        /* The parser */  int iLookAhead            /* The look-ahead token */){  int i;  int stateno = pParser->yystack[pParser->yyidx].stateno;   if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){    return yy_default[stateno];  }  if( iLookAhead==YYNOCODE ){    return YY_NO_ACTION;  }  i += iLookAhead;  if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){#ifdef YYFALLBACK    int iFallback;            /* Fallback token */    if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])           && (iFallback = yyFallback[iLookAhead])!=0 ){#ifndef NDEBUG      if( yyTraceFILE ){        fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",           yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);      }#endif      return yy_find_shift_action(pParser, iFallback);    }#endif    return yy_default[stateno];  }else{    return yy_action[i];  }}/*** Find the appropriate action for a parser given the non-terminal** look-ahead token iLookAhead.**** If the look-ahead token is YYNOCODE, then check to see if the action is** independent of the look-ahead.  If it is, return the action, otherwise** return YY_NO_ACTION.*/static int yy_find_reduce_action(  int stateno,              /* Current state number */  int iLookAhead            /* The look-ahea

⌨️ 快捷键说明

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