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

📄 parse.c

📁 sqlite数据库的源代码, 例子是在windows上使用,不过可以移值到各种平台上使用
💻 C
📖 第 1 页 / 共 5 页
字号:
 /* 218 */ "expr ::= LP select RP", /* 219 */ "expr ::= expr in_op LP select RP", /* 220 */ "expr ::= expr in_op nm dbnm", /* 221 */ "expr ::= EXISTS LP select RP", /* 222 */ "expr ::= CASE case_operand case_exprlist case_else END", /* 223 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", /* 224 */ "case_exprlist ::= WHEN expr THEN expr", /* 225 */ "case_else ::= ELSE expr", /* 226 */ "case_else ::=", /* 227 */ "case_operand ::= expr", /* 228 */ "case_operand ::=", /* 229 */ "exprlist ::= exprlist COMMA expritem", /* 230 */ "exprlist ::= expritem", /* 231 */ "expritem ::= expr", /* 232 */ "expritem ::=", /* 233 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP", /* 234 */ "uniqueflag ::= UNIQUE", /* 235 */ "uniqueflag ::=", /* 236 */ "idxlist_opt ::=", /* 237 */ "idxlist_opt ::= LP idxlist RP", /* 238 */ "idxlist ::= idxlist COMMA idxitem collate sortorder", /* 239 */ "idxlist ::= idxitem collate sortorder", /* 240 */ "idxitem ::= nm", /* 241 */ "cmd ::= DROP INDEX ifexists fullname", /* 242 */ "cmd ::= VACUUM", /* 243 */ "cmd ::= VACUUM nm", /* 244 */ "cmd ::= PRAGMA nm dbnm EQ nm", /* 245 */ "cmd ::= PRAGMA nm dbnm EQ ON", /* 246 */ "cmd ::= PRAGMA nm dbnm EQ plus_num", /* 247 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", /* 248 */ "cmd ::= PRAGMA nm dbnm LP nm RP", /* 249 */ "cmd ::= PRAGMA nm dbnm", /* 250 */ "plus_num ::= plus_opt number", /* 251 */ "minus_num ::= MINUS number", /* 252 */ "number ::= INTEGER|FLOAT", /* 253 */ "plus_opt ::= PLUS", /* 254 */ "plus_opt ::=", /* 255 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END", /* 256 */ "trigger_decl ::= temp TRIGGER nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", /* 257 */ "trigger_time ::= BEFORE", /* 258 */ "trigger_time ::= AFTER", /* 259 */ "trigger_time ::= INSTEAD OF", /* 260 */ "trigger_time ::=", /* 261 */ "trigger_event ::= DELETE|INSERT", /* 262 */ "trigger_event ::= UPDATE", /* 263 */ "trigger_event ::= UPDATE OF inscollist", /* 264 */ "foreach_clause ::=", /* 265 */ "foreach_clause ::= FOR EACH ROW", /* 266 */ "foreach_clause ::= FOR EACH STATEMENT", /* 267 */ "when_clause ::=", /* 268 */ "when_clause ::= WHEN expr", /* 269 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", /* 270 */ "trigger_cmd_list ::=", /* 271 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt", /* 272 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP", /* 273 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select", /* 274 */ "trigger_cmd ::= DELETE FROM nm where_opt", /* 275 */ "trigger_cmd ::= select", /* 276 */ "expr ::= RAISE LP IGNORE RP", /* 277 */ "expr ::= RAISE LP raisetype COMMA nm RP", /* 278 */ "raisetype ::= ROLLBACK", /* 279 */ "raisetype ::= ABORT", /* 280 */ "raisetype ::= FAIL", /* 281 */ "cmd ::= DROP TRIGGER fullname", /* 282 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", /* 283 */ "key_opt ::=", /* 284 */ "key_opt ::= KEY expr", /* 285 */ "database_kw_opt ::= DATABASE", /* 286 */ "database_kw_opt ::=", /* 287 */ "cmd ::= DETACH database_kw_opt expr", /* 288 */ "cmd ::= REINDEX", /* 289 */ "cmd ::= REINDEX nm dbnm", /* 290 */ "cmd ::= ANALYZE", /* 291 */ "cmd ::= ANALYZE nm dbnm", /* 292 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", /* 293 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", /* 294 */ "add_column_fullname ::= fullname", /* 295 */ "kwcolumn_opt ::=", /* 296 */ "kwcolumn_opt ::= COLUMNKW", /* 297 */ "cmd ::= create_vtab", /* 298 */ "cmd ::= create_vtab LP vtabarglist RP", /* 299 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm", /* 300 */ "vtabarglist ::= vtabarg", /* 301 */ "vtabarglist ::= vtabarglist COMMA vtabarg", /* 302 */ "vtabarg ::=", /* 303 */ "vtabarg ::= vtabarg vtabargtoken", /* 304 */ "vtabargtoken ::= ANY", /* 305 */ "vtabargtoken ::= lp anylist RP", /* 306 */ "lp ::= LP", /* 307 */ "anylist ::=", /* 308 */ "anylist ::= anylist ANY",};#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 156:    case 190:    case 207:#line 374 "parse.y"{sqlite3SelectDelete((yypminor->yy219));}#line 1248 "parse.c"      break;    case 170:    case 171:    case 195:    case 197:    case 205:    case 211:    case 219:    case 222:    case 224:    case 225:    case 235:#line 631 "parse.y"{sqlite3ExprDelete((yypminor->yy172));}#line 1263 "parse.c"      break;    case 175:    case 183:    case 193:    case 196:    case 198:    case 200:    case 210:    case 213:    case 214:    case 217:    case 223:#line 865 "parse.y"{sqlite3ExprListDelete((yypminor->yy174));}#line 1278 "parse.c"      break;    case 189:    case 194:    case 202:    case 203:#line 502 "parse.y"{sqlite3SrcListDelete((yypminor->yy373));}#line 1286 "parse.c"      break;    case 199:#line 563 "parse.y"{  sqlite3ExprDelete((yypminor->yy234).pLimit);  sqlite3ExprDelete((yypminor->yy234).pOffset);}#line 1294 "parse.c"      break;    case 206:    case 209:    case 216:#line 519 "parse.y"{sqlite3IdListDelete((yypminor->yy432));}#line 1301 "parse.c"      break;    case 231:    case 236:#line 959 "parse.y"{sqlite3DeleteTriggerStep((yypminor->yy243));}#line 1307 "parse.c"      break;    case 233:#line 943 "parse.y"{sqlite3IdListDelete((yypminor->yy370).b);}#line 1312 "parse.c"      break;    case 238:#line 1027 "parse.y"{sqlite3ExprDelete((yypminor->yy386));}#line 1317 "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

⌨️ 快捷键说明

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