00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #define YYBISON 1
00047
00048
00049 #define YYBISON_VERSION "2.4.1"
00050
00051
00052 #define YYSKELETON_NAME "yacc.c"
00053
00054
00055 #define YYPURE 1
00056
00057
00058 #define YYPUSH 0
00059
00060
00061 #define YYPULL 1
00062
00063
00064 #define YYLSP_NEEDED 0
00065
00066
00067 #define yyparse execute_parse
00068 #define yylex execute_lex
00069 #define yyerror execute_error
00070 #define yylval execute_lval
00071 #define yychar execute_char
00072 #define yydebug execute_debug
00073 #define yynerrs execute_nerrs
00074
00075
00076
00077
00078
00079 #line 55 "drizzled/execute/parser.yy"
00080
00081
00082 #include <config.h>
00083 #include <iostream>
00084 #include <stdint.h>
00085 #include <drizzled/execute/symbol.h>
00086 #include <drizzled/execute/scanner.h>
00087 #include <drizzled/execute/context.h>
00088 #include <vector>
00089
00090 #ifndef __INTEL_COMPILER
00091 #pragma GCC diagnostic ignored "-Wold-style-cast"
00092 #endif
00093
00094 #define YYENABLE_NLS 0
00095 #define YYLTYPE_IS_TRIVIAL 0
00096
00097 int execute_lex(YYSTYPE* lvalp, void* scanner);
00098 std::string query;
00099 #define parser_abort(A, B) do { parser::abort_func((A), (B)); YYABORT; } while (0)
00100
00101 inline void execute_error(::drizzled::execute::Context *context, yyscan_t *scanner, const char *error)
00102 {
00103 if (not context->end())
00104 {
00105
00106
00107
00108 }
00109 }
00110
00111
00112
00113
00114 #line 115 "drizzled/execute/parser.cc"
00115
00116
00117 #ifndef YYDEBUG
00118 # define YYDEBUG 1
00119 #endif
00120
00121
00122 #ifdef YYERROR_VERBOSE
00123 # undef YYERROR_VERBOSE
00124 # define YYERROR_VERBOSE 1
00125 #else
00126 # define YYERROR_VERBOSE 1
00127 #endif
00128
00129
00130 #ifndef YYTOKEN_TABLE
00131 # define YYTOKEN_TABLE 0
00132 #endif
00133
00134
00135
00136 #ifndef YYTOKENTYPE
00137 # define YYTOKENTYPE
00138
00139
00140 enum yytokentype {
00141 STRING = 258,
00142 QUOTED_STRING = 259,
00143 UNKNOWN = 260
00144 };
00145 #endif
00146
00147 #define STRING 258
00148 #define QUOTED_STRING 259
00149 #define UNKNOWN 260
00150
00151
00152
00153
00154 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00155
00156 # define yystype YYSTYPE
00157 # define YYSTYPE_IS_DECLARED 1
00158 #endif
00159
00160
00161
00162
00163
00164
00165 #line 166 "drizzled/execute/parser.cc"
00166
00167 #ifdef short
00168 # undef short
00169 #endif
00170
00171 #ifdef YYTYPE_UINT8
00172 typedef YYTYPE_UINT8 yytype_uint8;
00173 #else
00174 typedef unsigned char yytype_uint8;
00175 #endif
00176
00177 #ifdef YYTYPE_INT8
00178 typedef YYTYPE_INT8 yytype_int8;
00179 #elif (defined __STDC__ || defined __C99__FUNC__ \
00180 || defined __cplusplus || defined _MSC_VER)
00181 typedef signed char yytype_int8;
00182 #else
00183 typedef short int yytype_int8;
00184 #endif
00185
00186 #ifdef YYTYPE_UINT16
00187 typedef YYTYPE_UINT16 yytype_uint16;
00188 #else
00189 typedef unsigned short int yytype_uint16;
00190 #endif
00191
00192 #ifdef YYTYPE_INT16
00193 typedef YYTYPE_INT16 yytype_int16;
00194 #else
00195 typedef short int yytype_int16;
00196 #endif
00197
00198 #ifndef YYSIZE_T
00199 # ifdef __SIZE_TYPE__
00200 # define YYSIZE_T __SIZE_TYPE__
00201 # elif defined size_t
00202 # define YYSIZE_T size_t
00203 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00204 || defined __cplusplus || defined _MSC_VER)
00205 # include <stddef.h>
00206 # define YYSIZE_T size_t
00207 # else
00208 # define YYSIZE_T unsigned int
00209 # endif
00210 #endif
00211
00212 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00213
00214 #ifndef YY_
00215 # if YYENABLE_NLS
00216 # if ENABLE_NLS
00217 # include <libintl.h>
00218 # define YY_(msgid) dgettext ("bison-runtime", msgid)
00219 # endif
00220 # endif
00221 # ifndef YY_
00222 # define YY_(msgid) msgid
00223 # endif
00224 #endif
00225
00226
00227 #if ! defined lint || defined __GNUC__
00228 # define YYUSE(e) ((void) (e))
00229 #else
00230 # define YYUSE(e)
00231 #endif
00232
00233
00234 #ifndef lint
00235 # define YYID(n) (n)
00236 #else
00237 #if (defined __STDC__ || defined __C99__FUNC__ \
00238 || defined __cplusplus || defined _MSC_VER)
00239 static int
00240 YYID (int yyi)
00241 #else
00242 static int
00243 YYID (yyi)
00244 int yyi;
00245 #endif
00246 {
00247 return yyi;
00248 }
00249 #endif
00250
00251 #if ! defined yyoverflow || YYERROR_VERBOSE
00252
00253
00254
00255 # ifdef YYSTACK_USE_ALLOCA
00256 # if YYSTACK_USE_ALLOCA
00257 # ifdef __GNUC__
00258 # define YYSTACK_ALLOC __builtin_alloca
00259 # elif defined __BUILTIN_VA_ARG_INCR
00260 # include <alloca.h>
00261 # elif defined _AIX
00262 # define YYSTACK_ALLOC __alloca
00263 # elif defined _MSC_VER
00264 # include <malloc.h>
00265 # define alloca _alloca
00266 # else
00267 # define YYSTACK_ALLOC alloca
00268 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00269 || defined __cplusplus || defined _MSC_VER)
00270 # include <stdlib.h>
00271 # ifndef _STDLIB_H
00272 # define _STDLIB_H 1
00273 # endif
00274 # endif
00275 # endif
00276 # endif
00277 # endif
00278
00279 # ifdef YYSTACK_ALLOC
00280
00281 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
00282 # ifndef YYSTACK_ALLOC_MAXIMUM
00283
00284
00285
00286
00287 # define YYSTACK_ALLOC_MAXIMUM 4032
00288 # endif
00289 # else
00290 # define YYSTACK_ALLOC YYMALLOC
00291 # define YYSTACK_FREE YYFREE
00292 # ifndef YYSTACK_ALLOC_MAXIMUM
00293 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00294 # endif
00295 # if (defined __cplusplus && ! defined _STDLIB_H \
00296 && ! ((defined YYMALLOC || defined malloc) \
00297 && (defined YYFREE || defined free)))
00298 # include <stdlib.h>
00299 # ifndef _STDLIB_H
00300 # define _STDLIB_H 1
00301 # endif
00302 # endif
00303 # ifndef YYMALLOC
00304 # define YYMALLOC malloc
00305 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00306 || defined __cplusplus || defined _MSC_VER)
00307 void *malloc (YYSIZE_T);
00308 # endif
00309 # endif
00310 # ifndef YYFREE
00311 # define YYFREE free
00312 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00313 || defined __cplusplus || defined _MSC_VER)
00314 void free (void *);
00315 # endif
00316 # endif
00317 # endif
00318 #endif
00319
00320
00321 #if (! defined yyoverflow \
00322 && (! defined __cplusplus \
00323 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00324
00325
00326 union yyalloc
00327 {
00328 yytype_int16 yyss_alloc;
00329 YYSTYPE yyvs_alloc;
00330 };
00331
00332
00333 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00334
00335
00336
00337 # define YYSTACK_BYTES(N) \
00338 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00339 + YYSTACK_GAP_MAXIMUM)
00340
00341
00342
00343 # ifndef YYCOPY
00344 # if defined __GNUC__ && 1 < __GNUC__
00345 # define YYCOPY(To, From, Count) \
00346 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00347 # else
00348 # define YYCOPY(To, From, Count) \
00349 do \
00350 { \
00351 YYSIZE_T yyi; \
00352 for (yyi = 0; yyi < (Count); yyi++) \
00353 (To)[yyi] = (From)[yyi]; \
00354 } \
00355 while (YYID (0))
00356 # endif
00357 # endif
00358
00359
00360
00361
00362
00363
00364 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
00365 do \
00366 { \
00367 YYSIZE_T yynewbytes; \
00368 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
00369 Stack = &yyptr->Stack_alloc; \
00370 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00371 yyptr += yynewbytes / sizeof (*yyptr); \
00372 } \
00373 while (YYID (0))
00374
00375 #endif
00376
00377
00378 #define YYFINAL 3
00379
00380 #define YYLAST 3
00381
00382
00383 #define YYNTOKENS 6
00384
00385 #define YYNNTS 2
00386
00387 #define YYNRULES 3
00388
00389 #define YYNSTATES 5
00390
00391
00392 #define YYUNDEFTOK 2
00393 #define YYMAXUTOK 260
00394
00395 #define YYTRANSLATE(YYX) \
00396 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00397
00398
00399 static const yytype_uint8 yytranslate[] =
00400 {
00401 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00426 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
00427 5
00428 };
00429
00430 #if YYDEBUG
00431
00432
00433 static const yytype_uint8 yyprhs[] =
00434 {
00435 0, 0, 3, 5
00436 };
00437
00438
00439 static const yytype_int8 yyrhs[] =
00440 {
00441 7, 0, -1, 3, -1, 7, 3, -1
00442 };
00443
00444
00445 static const yytype_uint8 yyrline[] =
00446 {
00447 0, 97, 97, 103
00448 };
00449 #endif
00450
00451 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00452
00453
00454 static const char *const yytname[] =
00455 {
00456 "$end", "error", "$undefined", "STRING", "QUOTED_STRING", "UNKNOWN",
00457 "$accept", "begin", 0
00458 };
00459 #endif
00460
00461 # ifdef YYPRINT
00462
00463
00464 static const yytype_uint16 yytoknum[] =
00465 {
00466 0, 256, 257, 258, 259, 260
00467 };
00468 # endif
00469
00470
00471 static const yytype_uint8 yyr1[] =
00472 {
00473 0, 6, 7, 7
00474 };
00475
00476
00477 static const yytype_uint8 yyr2[] =
00478 {
00479 0, 2, 1, 2
00480 };
00481
00482
00483
00484
00485 static const yytype_uint8 yydefact[] =
00486 {
00487 0, 2, 0, 1, 3
00488 };
00489
00490
00491 static const yytype_int8 yydefgoto[] =
00492 {
00493 -1, 2
00494 };
00495
00496
00497
00498 #define YYPACT_NINF -3
00499 static const yytype_int8 yypact[] =
00500 {
00501 -2, -3, 0, -3, -3
00502 };
00503
00504
00505 static const yytype_int8 yypgoto[] =
00506 {
00507 -3, -3
00508 };
00509
00510
00511
00512
00513
00514 #define YYTABLE_NINF -1
00515 static const yytype_uint8 yytable[] =
00516 {
00517 3, 1, 0, 4
00518 };
00519
00520 static const yytype_int8 yycheck[] =
00521 {
00522 0, 3, -1, 3
00523 };
00524
00525
00526
00527 static const yytype_uint8 yystos[] =
00528 {
00529 0, 3, 7, 0, 3
00530 };
00531
00532 #define yyerrok (yyerrstatus = 0)
00533 #define yyclearin (yychar = YYEMPTY)
00534 #define YYEMPTY (-2)
00535 #define YYEOF 0
00536
00537 #define YYACCEPT goto yyacceptlab
00538 #define YYABORT goto yyabortlab
00539 #define YYERROR goto yyerrorlab
00540
00541
00542
00543
00544
00545
00546 #define YYFAIL goto yyerrlab
00547
00548 #define YYRECOVERING() (!!yyerrstatus)
00549
00550 #define YYBACKUP(Token, Value) \
00551 do \
00552 if (yychar == YYEMPTY && yylen == 1) \
00553 { \
00554 yychar = (Token); \
00555 yylval = (Value); \
00556 yytoken = YYTRANSLATE (yychar); \
00557 YYPOPSTACK (1); \
00558 goto yybackup; \
00559 } \
00560 else \
00561 { \
00562 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
00563 YYERROR; \
00564 } \
00565 while (YYID (0))
00566
00567
00568 #define YYTERROR 1
00569 #define YYERRCODE 256
00570
00571
00572
00573
00574
00575
00576 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00577 #ifndef YYLLOC_DEFAULT
00578 # define YYLLOC_DEFAULT(Current, Rhs, N) \
00579 do \
00580 if (YYID (N)) \
00581 { \
00582 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
00583 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
00584 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
00585 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
00586 } \
00587 else \
00588 { \
00589 (Current).first_line = (Current).last_line = \
00590 YYRHSLOC (Rhs, 0).last_line; \
00591 (Current).first_column = (Current).last_column = \
00592 YYRHSLOC (Rhs, 0).last_column; \
00593 } \
00594 while (YYID (0))
00595 #endif
00596
00597
00598
00599
00600
00601
00602 #ifndef YY_LOCATION_PRINT
00603 # if YYLTYPE_IS_TRIVIAL
00604 # define YY_LOCATION_PRINT(File, Loc) \
00605 fprintf (File, "%d.%d-%d.%d", \
00606 (Loc).first_line, (Loc).first_column, \
00607 (Loc).last_line, (Loc).last_column)
00608 # else
00609 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
00610 # endif
00611 #endif
00612
00613
00614
00615
00616 #ifdef YYLEX_PARAM
00617 # define YYLEX yylex (&yylval, YYLEX_PARAM)
00618 #else
00619 # define YYLEX yylex (&yylval, scanner)
00620 #endif
00621
00622
00623 #if YYDEBUG
00624
00625 # ifndef YYFPRINTF
00626 # include <stdio.h>
00627 # define YYFPRINTF fprintf
00628 # endif
00629
00630 # define YYDPRINTF(Args) \
00631 do { \
00632 if (yydebug) \
00633 YYFPRINTF Args; \
00634 } while (YYID (0))
00635
00636 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
00637 do { \
00638 if (yydebug) \
00639 { \
00640 YYFPRINTF (stderr, "%s ", Title); \
00641 yy_symbol_print (stderr, \
00642 Type, Value, context, scanner); \
00643 YYFPRINTF (stderr, "\n"); \
00644 } \
00645 } while (YYID (0))
00646
00647
00648
00649
00650
00651
00652
00653 #if (defined __STDC__ || defined __C99__FUNC__ \
00654 || defined __cplusplus || defined _MSC_VER)
00655 static void
00656 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ::drizzled::execute::Context *context, yyscan_t *scanner)
00657 #else
00658 static void
00659 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context, scanner)
00660 FILE *yyoutput;
00661 int yytype;
00662 YYSTYPE const * const yyvaluep;
00663 ::drizzled::execute::Context *context;
00664 yyscan_t *scanner;
00665 #endif
00666 {
00667 if (!yyvaluep)
00668 return;
00669 YYUSE (context);
00670 YYUSE (scanner);
00671 # ifdef YYPRINT
00672 if (yytype < YYNTOKENS)
00673 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00674 # else
00675 YYUSE (yyoutput);
00676 # endif
00677 switch (yytype)
00678 {
00679 default:
00680 break;
00681 }
00682 }
00683
00684
00685
00686
00687
00688
00689 #if (defined __STDC__ || defined __C99__FUNC__ \
00690 || defined __cplusplus || defined _MSC_VER)
00691 static void
00692 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ::drizzled::execute::Context *context, yyscan_t *scanner)
00693 #else
00694 static void
00695 yy_symbol_print (yyoutput, yytype, yyvaluep, context, scanner)
00696 FILE *yyoutput;
00697 int yytype;
00698 YYSTYPE const * const yyvaluep;
00699 ::drizzled::execute::Context *context;
00700 yyscan_t *scanner;
00701 #endif
00702 {
00703 if (yytype < YYNTOKENS)
00704 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
00705 else
00706 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
00707
00708 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context, scanner);
00709 YYFPRINTF (yyoutput, ")");
00710 }
00711
00712
00713
00714
00715
00716
00717 #if (defined __STDC__ || defined __C99__FUNC__ \
00718 || defined __cplusplus || defined _MSC_VER)
00719 static void
00720 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
00721 #else
00722 static void
00723 yy_stack_print (yybottom, yytop)
00724 yytype_int16 *yybottom;
00725 yytype_int16 *yytop;
00726 #endif
00727 {
00728 YYFPRINTF (stderr, "Stack now");
00729 for (; yybottom <= yytop; yybottom++)
00730 {
00731 int yybot = *yybottom;
00732 YYFPRINTF (stderr, " %d", yybot);
00733 }
00734 YYFPRINTF (stderr, "\n");
00735 }
00736
00737 # define YY_STACK_PRINT(Bottom, Top) \
00738 do { \
00739 if (yydebug) \
00740 yy_stack_print ((Bottom), (Top)); \
00741 } while (YYID (0))
00742
00743
00744
00745
00746
00747
00748 #if (defined __STDC__ || defined __C99__FUNC__ \
00749 || defined __cplusplus || defined _MSC_VER)
00750 static void
00751 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, ::drizzled::execute::Context *context, yyscan_t *scanner)
00752 #else
00753 static void
00754 yy_reduce_print (yyvsp, yyrule, context, scanner)
00755 YYSTYPE *yyvsp;
00756 int yyrule;
00757 ::drizzled::execute::Context *context;
00758 yyscan_t *scanner;
00759 #endif
00760 {
00761 int yynrhs = yyr2[yyrule];
00762 int yyi;
00763 unsigned long int yylno = yyrline[yyrule];
00764 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
00765 yyrule - 1, yylno);
00766
00767 for (yyi = 0; yyi < yynrhs; yyi++)
00768 {
00769 YYFPRINTF (stderr, " $%d = ", yyi + 1);
00770 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
00771 &(yyvsp[(yyi + 1) - (yynrhs)])
00772 , context, scanner);
00773 YYFPRINTF (stderr, "\n");
00774 }
00775 }
00776
00777 # define YY_REDUCE_PRINT(Rule) \
00778 do { \
00779 if (yydebug) \
00780 yy_reduce_print (yyvsp, Rule, context, scanner); \
00781 } while (YYID (0))
00782
00783
00784
00785 int yydebug;
00786 #else
00787 # define YYDPRINTF(Args)
00788 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
00789 # define YY_STACK_PRINT(Bottom, Top)
00790 # define YY_REDUCE_PRINT(Rule)
00791 #endif
00792
00793
00794
00795 #ifndef YYINITDEPTH
00796 # define YYINITDEPTH 200
00797 #endif
00798
00799
00800
00801
00802
00803
00804
00805
00806 #ifndef YYMAXDEPTH
00807 # define YYMAXDEPTH 10000
00808 #endif
00809
00810
00811
00812 #if YYERROR_VERBOSE
00813
00814 # ifndef yystrlen
00815 # if defined __GLIBC__ && defined _STRING_H
00816 # define yystrlen strlen
00817 # else
00818
00819 #if (defined __STDC__ || defined __C99__FUNC__ \
00820 || defined __cplusplus || defined _MSC_VER)
00821 static YYSIZE_T
00822 yystrlen (const char *yystr)
00823 #else
00824 static YYSIZE_T
00825 yystrlen (yystr)
00826 const char *yystr;
00827 #endif
00828 {
00829 YYSIZE_T yylen;
00830 for (yylen = 0; yystr[yylen]; yylen++)
00831 continue;
00832 return yylen;
00833 }
00834 # endif
00835 # endif
00836
00837 # ifndef yystpcpy
00838 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
00839 # define yystpcpy stpcpy
00840 # else
00841
00842
00843 #if (defined __STDC__ || defined __C99__FUNC__ \
00844 || defined __cplusplus || defined _MSC_VER)
00845 static char *
00846 yystpcpy (char *yydest, const char *yysrc)
00847 #else
00848 static char *
00849 yystpcpy (yydest, yysrc)
00850 char *yydest;
00851 const char *yysrc;
00852 #endif
00853 {
00854 char *yyd = yydest;
00855 const char *yys = yysrc;
00856
00857 while ((*yyd++ = *yys++) != '\0')
00858 continue;
00859
00860 return yyd - 1;
00861 }
00862 # endif
00863 # endif
00864
00865 # ifndef yytnamerr
00866
00867
00868
00869
00870
00871
00872
00873 static YYSIZE_T
00874 yytnamerr (char *yyres, const char *yystr)
00875 {
00876 if (*yystr == '"')
00877 {
00878 YYSIZE_T yyn = 0;
00879 char const *yyp = yystr;
00880
00881 for (;;)
00882 switch (*++yyp)
00883 {
00884 case '\'':
00885 case ',':
00886 goto do_not_strip_quotes;
00887
00888 case '\\':
00889 if (*++yyp != '\\')
00890 goto do_not_strip_quotes;
00891
00892 default:
00893 if (yyres)
00894 yyres[yyn] = *yyp;
00895 yyn++;
00896 break;
00897
00898 case '"':
00899 if (yyres)
00900 yyres[yyn] = '\0';
00901 return yyn;
00902 }
00903 do_not_strip_quotes: ;
00904 }
00905
00906 if (! yyres)
00907 return yystrlen (yystr);
00908
00909 return yystpcpy (yyres, yystr) - yyres;
00910 }
00911 # endif
00912
00913
00914
00915
00916
00917
00918
00919
00920 static YYSIZE_T
00921 yysyntax_error (char *yyresult, int yystate, int yychar)
00922 {
00923 int yyn = yypact[yystate];
00924
00925 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
00926 return 0;
00927 else
00928 {
00929 int yytype = YYTRANSLATE (yychar);
00930 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
00931 YYSIZE_T yysize = yysize0;
00932 YYSIZE_T yysize1;
00933 int yysize_overflow = 0;
00934 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
00935 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
00936 int yyx;
00937
00938 # if 0
00939
00940
00941 YY_("syntax error, unexpected %s");
00942 YY_("syntax error, unexpected %s, expecting %s");
00943 YY_("syntax error, unexpected %s, expecting %s or %s");
00944 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
00945 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
00946 # endif
00947 char *yyfmt;
00948 char const *yyf;
00949 static char const yyunexpected[] = "syntax error, unexpected %s";
00950 static char const yyexpecting[] = ", expecting %s";
00951 static char const yyor[] = " or %s";
00952 char yyformat[sizeof yyunexpected
00953 + sizeof yyexpecting - 1
00954 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
00955 * (sizeof yyor - 1))];
00956 char const *yyprefix = yyexpecting;
00957
00958
00959
00960 int yyxbegin = yyn < 0 ? -yyn : 0;
00961
00962
00963 int yychecklim = YYLAST - yyn + 1;
00964 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
00965 int yycount = 1;
00966
00967 yyarg[0] = yytname[yytype];
00968 yyfmt = yystpcpy (yyformat, yyunexpected);
00969
00970 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
00971 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
00972 {
00973 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
00974 {
00975 yycount = 1;
00976 yysize = yysize0;
00977 yyformat[sizeof yyunexpected - 1] = '\0';
00978 break;
00979 }
00980 yyarg[yycount++] = yytname[yyx];
00981 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
00982 yysize_overflow |= (yysize1 < yysize);
00983 yysize = yysize1;
00984 yyfmt = yystpcpy (yyfmt, yyprefix);
00985 yyprefix = yyor;
00986 }
00987
00988 yyf = YY_(yyformat);
00989 yysize1 = yysize + yystrlen (yyf);
00990 yysize_overflow |= (yysize1 < yysize);
00991 yysize = yysize1;
00992
00993 if (yysize_overflow)
00994 return YYSIZE_MAXIMUM;
00995
00996 if (yyresult)
00997 {
00998
00999
01000
01001 char *yyp = yyresult;
01002 int yyi = 0;
01003 while ((*yyp = *yyf) != '\0')
01004 {
01005 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01006 {
01007 yyp += yytnamerr (yyp, yyarg[yyi++]);
01008 yyf += 2;
01009 }
01010 else
01011 {
01012 yyp++;
01013 yyf++;
01014 }
01015 }
01016 }
01017 return yysize;
01018 }
01019 }
01020 #endif
01021
01022
01023
01024
01025
01026
01027
01028 #if (defined __STDC__ || defined __C99__FUNC__ \
01029 || defined __cplusplus || defined _MSC_VER)
01030 static void
01031 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, ::drizzled::execute::Context *context, yyscan_t *scanner)
01032 #else
01033 static void
01034 yydestruct (yymsg, yytype, yyvaluep, context, scanner)
01035 const char *yymsg;
01036 int yytype;
01037 YYSTYPE *yyvaluep;
01038 ::drizzled::execute::Context *context;
01039 yyscan_t *scanner;
01040 #endif
01041 {
01042 YYUSE (yyvaluep);
01043 YYUSE (context);
01044 YYUSE (scanner);
01045
01046 if (!yymsg)
01047 yymsg = "Deleting";
01048 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01049
01050 switch (yytype)
01051 {
01052
01053 default:
01054 break;
01055 }
01056 }
01057
01058
01059 #ifdef YYPARSE_PARAM
01060 #if defined __STDC__ || defined __cplusplus
01061 int yyparse (void *YYPARSE_PARAM);
01062 #else
01063 int yyparse ();
01064 #endif
01065 #else
01066 #if defined __STDC__ || defined __cplusplus
01067 int yyparse (::drizzled::execute::Context *context, yyscan_t *scanner);
01068 #else
01069 int yyparse ();
01070 #endif
01071 #endif
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081 #ifdef YYPARSE_PARAM
01082 #if (defined __STDC__ || defined __C99__FUNC__ \
01083 || defined __cplusplus || defined _MSC_VER)
01084 int
01085 yyparse (void *YYPARSE_PARAM)
01086 #else
01087 int
01088 yyparse (YYPARSE_PARAM)
01089 void *YYPARSE_PARAM;
01090 #endif
01091 #else
01092 #if (defined __STDC__ || defined __C99__FUNC__ \
01093 || defined __cplusplus || defined _MSC_VER)
01094 int
01095 yyparse (::drizzled::execute::Context *context, yyscan_t *scanner)
01096 #else
01097 int
01098 yyparse (context, scanner)
01099 ::drizzled::execute::Context *context;
01100 yyscan_t *scanner;
01101 #endif
01102 #endif
01103 {
01104
01105 int yychar;
01106
01107
01108 YYSTYPE yylval;
01109
01110
01111 int yynerrs;
01112
01113 int yystate;
01114
01115 int yyerrstatus;
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125 yytype_int16 yyssa[YYINITDEPTH];
01126 yytype_int16 *yyss;
01127 yytype_int16 *yyssp;
01128
01129
01130 YYSTYPE yyvsa[YYINITDEPTH];
01131 YYSTYPE *yyvs;
01132 YYSTYPE *yyvsp;
01133
01134 YYSIZE_T yystacksize;
01135
01136 int yyn;
01137 int yyresult;
01138
01139 int yytoken;
01140
01141
01142 YYSTYPE yyval;
01143
01144 #if YYERROR_VERBOSE
01145
01146 char yymsgbuf[128];
01147 char *yymsg = yymsgbuf;
01148 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01149 #endif
01150
01151 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
01152
01153
01154
01155 int yylen = 0;
01156
01157 yytoken = 0;
01158 yyss = yyssa;
01159 yyvs = yyvsa;
01160 yystacksize = YYINITDEPTH;
01161
01162 YYDPRINTF ((stderr, "Starting parse\n"));
01163
01164 yystate = 0;
01165 yyerrstatus = 0;
01166 yynerrs = 0;
01167 yychar = YYEMPTY;
01168
01169
01170
01171
01172
01173 yyssp = yyss;
01174 yyvsp = yyvs;
01175
01176 goto yysetstate;
01177
01178
01179
01180
01181 yynewstate:
01182
01183
01184 yyssp++;
01185
01186 yysetstate:
01187 *yyssp = yystate;
01188
01189 if (yyss + yystacksize - 1 <= yyssp)
01190 {
01191
01192 YYSIZE_T yysize = yyssp - yyss + 1;
01193
01194 #ifdef yyoverflow
01195 {
01196
01197
01198
01199 YYSTYPE *yyvs1 = yyvs;
01200 yytype_int16 *yyss1 = yyss;
01201
01202
01203
01204
01205
01206 yyoverflow (YY_("memory exhausted"),
01207 &yyss1, yysize * sizeof (*yyssp),
01208 &yyvs1, yysize * sizeof (*yyvsp),
01209 &yystacksize);
01210
01211 yyss = yyss1;
01212 yyvs = yyvs1;
01213 }
01214 #else
01215 # ifndef YYSTACK_RELOCATE
01216 goto yyexhaustedlab;
01217 # else
01218
01219 if (YYMAXDEPTH <= yystacksize)
01220 goto yyexhaustedlab;
01221 yystacksize *= 2;
01222 if (YYMAXDEPTH < yystacksize)
01223 yystacksize = YYMAXDEPTH;
01224
01225 {
01226 yytype_int16 *yyss1 = yyss;
01227 union yyalloc *yyptr =
01228 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01229 if (! yyptr)
01230 goto yyexhaustedlab;
01231 YYSTACK_RELOCATE (yyss_alloc, yyss);
01232 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
01233 # undef YYSTACK_RELOCATE
01234 if (yyss1 != yyssa)
01235 YYSTACK_FREE (yyss1);
01236 }
01237 # endif
01238 #endif
01239
01240 yyssp = yyss + yysize - 1;
01241 yyvsp = yyvs + yysize - 1;
01242
01243 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01244 (unsigned long int) yystacksize));
01245
01246 if (yyss + yystacksize - 1 <= yyssp)
01247 YYABORT;
01248 }
01249
01250 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01251
01252 if (yystate == YYFINAL)
01253 YYACCEPT;
01254
01255 goto yybackup;
01256
01257
01258
01259
01260 yybackup:
01261
01262
01263
01264
01265
01266 yyn = yypact[yystate];
01267 if (yyn == YYPACT_NINF)
01268 goto yydefault;
01269
01270
01271
01272
01273 if (yychar == YYEMPTY)
01274 {
01275 YYDPRINTF ((stderr, "Reading a token: "));
01276 yychar = YYLEX;
01277 }
01278
01279 if (yychar <= YYEOF)
01280 {
01281 yychar = yytoken = YYEOF;
01282 YYDPRINTF ((stderr, "Now at end of input.\n"));
01283 }
01284 else
01285 {
01286 yytoken = YYTRANSLATE (yychar);
01287 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01288 }
01289
01290
01291
01292 yyn += yytoken;
01293 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01294 goto yydefault;
01295 yyn = yytable[yyn];
01296 if (yyn <= 0)
01297 {
01298 if (yyn == 0 || yyn == YYTABLE_NINF)
01299 goto yyerrlab;
01300 yyn = -yyn;
01301 goto yyreduce;
01302 }
01303
01304
01305
01306 if (yyerrstatus)
01307 yyerrstatus--;
01308
01309
01310 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01311
01312
01313 yychar = YYEMPTY;
01314
01315 yystate = yyn;
01316 *++yyvsp = yylval;
01317
01318 goto yynewstate;
01319
01320
01321
01322
01323
01324 yydefault:
01325 yyn = yydefact[yystate];
01326 if (yyn == 0)
01327 goto yyerrlab;
01328 goto yyreduce;
01329
01330
01331
01332
01333
01334 yyreduce:
01335
01336 yylen = yyr2[yyn];
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346 yyval = yyvsp[1-yylen];
01347
01348
01349 YY_REDUCE_PRINT (yyn);
01350 switch (yyn)
01351 {
01352 case 2:
01353
01354
01355 #line 97 "drizzled/execute/parser.yy"
01356 {
01357 query.append((yyvsp[(1) - (1)].string).data(), (yyvsp[(1) - (1)].string).size());
01358 query.push_back(' ');
01359 }
01360 break;
01361
01362 case 3:
01363
01364
01365 #line 103 "drizzled/execute/parser.yy"
01366 {
01367 query.append((yyvsp[(2) - (2)].string).data(), (yyvsp[(2) - (2)].string).size());
01368 query.push_back(' ');
01369 }
01370 break;
01371
01372
01373
01374
01375 #line 1376 "drizzled/execute/parser.cc"
01376 default: break;
01377 }
01378 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
01379
01380 YYPOPSTACK (yylen);
01381 yylen = 0;
01382 YY_STACK_PRINT (yyss, yyssp);
01383
01384 *++yyvsp = yyval;
01385
01386
01387
01388
01389
01390 yyn = yyr1[yyn];
01391
01392 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01393 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01394 yystate = yytable[yystate];
01395 else
01396 yystate = yydefgoto[yyn - YYNTOKENS];
01397
01398 goto yynewstate;
01399
01400
01401
01402
01403
01404 yyerrlab:
01405
01406 if (!yyerrstatus)
01407 {
01408 ++yynerrs;
01409 #if ! YYERROR_VERBOSE
01410 yyerror (context, scanner, YY_("syntax error"));
01411 #else
01412 {
01413 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
01414 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
01415 {
01416 YYSIZE_T yyalloc = 2 * yysize;
01417 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
01418 yyalloc = YYSTACK_ALLOC_MAXIMUM;
01419 if (yymsg != yymsgbuf)
01420 YYSTACK_FREE (yymsg);
01421 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
01422 if (yymsg)
01423 yymsg_alloc = yyalloc;
01424 else
01425 {
01426 yymsg = yymsgbuf;
01427 yymsg_alloc = sizeof yymsgbuf;
01428 }
01429 }
01430
01431 if (0 < yysize && yysize <= yymsg_alloc)
01432 {
01433 (void) yysyntax_error (yymsg, yystate, yychar);
01434 yyerror (context, scanner, yymsg);
01435 }
01436 else
01437 {
01438 yyerror (context, scanner, YY_("syntax error"));
01439 if (yysize != 0)
01440 goto yyexhaustedlab;
01441 }
01442 }
01443 #endif
01444 }
01445
01446
01447
01448 if (yyerrstatus == 3)
01449 {
01450
01451
01452
01453 if (yychar <= YYEOF)
01454 {
01455
01456 if (yychar == YYEOF)
01457 YYABORT;
01458 }
01459 else
01460 {
01461 yydestruct ("Error: discarding",
01462 yytoken, &yylval, context, scanner);
01463 yychar = YYEMPTY;
01464 }
01465 }
01466
01467
01468
01469 goto yyerrlab1;
01470
01471
01472
01473
01474
01475 yyerrorlab:
01476
01477
01478
01479
01480 if ( 0)
01481 goto yyerrorlab;
01482
01483
01484
01485 YYPOPSTACK (yylen);
01486 yylen = 0;
01487 YY_STACK_PRINT (yyss, yyssp);
01488 yystate = *yyssp;
01489 goto yyerrlab1;
01490
01491
01492
01493
01494
01495 yyerrlab1:
01496 yyerrstatus = 3;
01497
01498 for (;;)
01499 {
01500 yyn = yypact[yystate];
01501 if (yyn != YYPACT_NINF)
01502 {
01503 yyn += YYTERROR;
01504 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01505 {
01506 yyn = yytable[yyn];
01507 if (0 < yyn)
01508 break;
01509 }
01510 }
01511
01512
01513 if (yyssp == yyss)
01514 YYABORT;
01515
01516
01517 yydestruct ("Error: popping",
01518 yystos[yystate], yyvsp, context, scanner);
01519 YYPOPSTACK (1);
01520 yystate = *yyssp;
01521 YY_STACK_PRINT (yyss, yyssp);
01522 }
01523
01524 *++yyvsp = yylval;
01525
01526
01527
01528 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01529
01530 yystate = yyn;
01531 goto yynewstate;
01532
01533
01534
01535
01536
01537 yyacceptlab:
01538 yyresult = 0;
01539 goto yyreturn;
01540
01541
01542
01543
01544 yyabortlab:
01545 yyresult = 1;
01546 goto yyreturn;
01547
01548 #if !defined(yyoverflow) || YYERROR_VERBOSE
01549
01550
01551
01552 yyexhaustedlab:
01553 yyerror (context, scanner, YY_("memory exhausted"));
01554 yyresult = 2;
01555
01556 #endif
01557
01558 yyreturn:
01559 if (yychar != YYEMPTY)
01560 yydestruct ("Cleanup: discarding lookahead",
01561 yytoken, &yylval, context, scanner);
01562
01563
01564 YYPOPSTACK (yylen);
01565 YY_STACK_PRINT (yyss, yyssp);
01566 while (yyssp != yyss)
01567 {
01568 yydestruct ("Cleanup: popping",
01569 yystos[*yyssp], yyvsp, context, scanner);
01570 YYPOPSTACK (1);
01571 }
01572 #ifndef yyoverflow
01573 if (yyss != yyssa)
01574 YYSTACK_FREE (yyss);
01575 #endif
01576 #if YYERROR_VERBOSE
01577 if (yymsg != yymsgbuf)
01578 YYSTACK_FREE (yymsg);
01579 #endif
01580
01581 return YYID (yyresult);
01582 }
01583
01584
01585
01586
01587 #line 110 "drizzled/execute/parser.yy"
01588
01589
01590
01591 namespace drizzled {
01592 namespace execute {
01593
01594 std::vector<std::string> Context::start()
01595 {
01596 execute_parse(this, (void **)scanner);
01597 std::vector<std::string> parsed_queries;
01598 while ((pos= query.find(';')) != std::string::npos)
01599 {
01600 parsed_queries.push_back(query.substr(0, pos));
01601 pos++;
01602 if (query[pos] == ' ')
01603 pos++;
01604 query.erase(0, pos);
01605 }
01606 parsed_queries.push_back(query);
01607 query.clear();
01608
01609 return parsed_queries;
01610 }
01611
01612 }
01613 }
01614