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

📄 parse.c

📁 一个小型嵌入式数据库SQLite的源码,C语言
💻 C
📖 第 1 页 / 共 5 页
字号:
 /* 218 */ "expr ::= expr in_op LP exprlist RP", /* 219 */ "expr ::= LP select RP", /* 220 */ "expr ::= expr in_op LP select RP", /* 221 */ "expr ::= expr in_op nm dbnm", /* 222 */ "expr ::= EXISTS LP select RP", /* 223 */ "expr ::= CASE case_operand case_exprlist case_else END", /* 224 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", /* 225 */ "case_exprlist ::= WHEN expr THEN expr", /* 226 */ "case_else ::= ELSE expr", /* 227 */ "case_else ::=", /* 228 */ "case_operand ::= expr", /* 229 */ "case_operand ::=", /* 230 */ "exprlist ::= exprlist COMMA expritem", /* 231 */ "exprlist ::= expritem", /* 232 */ "expritem ::= expr", /* 233 */ "expritem ::=", /* 234 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP", /* 235 */ "uniqueflag ::= UNIQUE", /* 236 */ "uniqueflag ::=", /* 237 */ "idxlist_opt ::=", /* 238 */ "idxlist_opt ::= LP idxlist RP", /* 239 */ "idxlist ::= idxlist COMMA idxitem collate sortorder", /* 240 */ "idxlist ::= idxitem collate sortorder", /* 241 */ "idxitem ::= nm", /* 242 */ "cmd ::= DROP INDEX ifexists fullname", /* 243 */ "cmd ::= VACUUM", /* 244 */ "cmd ::= VACUUM nm", /* 245 */ "cmd ::= PRAGMA nm dbnm EQ nm", /* 246 */ "cmd ::= PRAGMA nm dbnm EQ ON", /* 247 */ "cmd ::= PRAGMA nm dbnm EQ plus_num", /* 248 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", /* 249 */ "cmd ::= PRAGMA nm dbnm LP nm RP", /* 250 */ "cmd ::= PRAGMA nm dbnm", /* 251 */ "plus_num ::= plus_opt number", /* 252 */ "minus_num ::= MINUS number", /* 253 */ "number ::= INTEGER|FLOAT", /* 254 */ "plus_opt ::= PLUS", /* 255 */ "plus_opt ::=", /* 256 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END", /* 257 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", /* 258 */ "trigger_time ::= BEFORE", /* 259 */ "trigger_time ::= AFTER", /* 260 */ "trigger_time ::= INSTEAD OF", /* 261 */ "trigger_time ::=", /* 262 */ "trigger_event ::= DELETE|INSERT", /* 263 */ "trigger_event ::= UPDATE", /* 264 */ "trigger_event ::= UPDATE OF inscollist", /* 265 */ "foreach_clause ::=", /* 266 */ "foreach_clause ::= FOR EACH ROW", /* 267 */ "foreach_clause ::= FOR EACH STATEMENT", /* 268 */ "when_clause ::=", /* 269 */ "when_clause ::= WHEN expr", /* 270 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", /* 271 */ "trigger_cmd_list ::=", /* 272 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt", /* 273 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP", /* 274 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select", /* 275 */ "trigger_cmd ::= DELETE FROM nm where_opt", /* 276 */ "trigger_cmd ::= select", /* 277 */ "expr ::= RAISE LP IGNORE RP", /* 278 */ "expr ::= RAISE LP raisetype COMMA nm RP", /* 279 */ "raisetype ::= ROLLBACK", /* 280 */ "raisetype ::= ABORT", /* 281 */ "raisetype ::= FAIL", /* 282 */ "cmd ::= DROP TRIGGER ifexists fullname", /* 283 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", /* 284 */ "key_opt ::=", /* 285 */ "key_opt ::= KEY expr", /* 286 */ "database_kw_opt ::= DATABASE", /* 287 */ "database_kw_opt ::=", /* 288 */ "cmd ::= DETACH database_kw_opt expr", /* 289 */ "cmd ::= REINDEX", /* 290 */ "cmd ::= REINDEX nm dbnm", /* 291 */ "cmd ::= ANALYZE", /* 292 */ "cmd ::= ANALYZE nm dbnm", /* 293 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", /* 294 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", /* 295 */ "add_column_fullname ::= fullname", /* 296 */ "kwcolumn_opt ::=", /* 297 */ "kwcolumn_opt ::= COLUMNKW", /* 298 */ "cmd ::= create_vtab", /* 299 */ "cmd ::= create_vtab LP vtabarglist RP", /* 300 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm", /* 301 */ "vtabarglist ::= vtabarg", /* 302 */ "vtabarglist ::= vtabarglist COMMA vtabarg", /* 303 */ "vtabarg ::=", /* 304 */ "vtabarg ::= vtabarg vtabargtoken", /* 305 */ "vtabargtoken ::= ANY", /* 306 */ "vtabargtoken ::= lp anylist RP", /* 307 */ "lp ::= LP", /* 308 */ "anylist ::=", /* 309 */ "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 1249 "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 633 "parse.y"{sqlite3ExprDelete((yypminor->yy172));}#line 1264 "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 870 "parse.y"{sqlite3ExprListDelete((yypminor->yy174));}#line 1279 "parse.c"      break;    case 189:    case 194:    case 202:    case 203:#line 502 "parse.y"{sqlite3SrcListDelete((yypminor->yy373));}#line 1287 "parse.c"      break;    case 199:#line 563 "parse.y"{  sqlite3ExprDelete((yypminor->yy234).pLimit);  sqlite3ExprDelete((yypminor->yy234).pOffset);}#line 1295 "parse.c"      break;    case 206:    case 209:    case 216:#line 519 "parse.y"{sqlite3IdListDelete((yypminor->yy432));}#line 1302 "parse.c"      break;    case 231:    case 236:#line 966 "parse.y"{sqlite3DeleteTriggerStep((yypminor->yy243));}#line 1308 "parse.c"      break;    case 233:#line 950 "parse.y"{sqlite3IdListDelete((yypminor->yy370).b);}#line 1313 "parse.c"      break;    case 238:#line 1034 "parse.y"{sqlite3ExprDelete((yypminor->yy386));}#line 1318 "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(  v

⌨️ 快捷键说明

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