Drizzled Public API Documentation

parser.cc
00001 
00002 /* A Bison parser, made by GNU Bison 2.4.1.  */
00003 
00004 /* Skeleton implementation for Bison's Yacc-like parsers in C
00005    
00006       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
00007    Free Software Foundation, Inc.
00008    
00009    This program is free software: you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation, either version 3 of the License, or
00012    (at your option) any later version.
00013    
00014    This program is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.
00018    
00019    You should have received a copy of the GNU General Public License
00020    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00021 
00022 /* As a special exception, you may create a larger work that contains
00023    part or all of the Bison parser skeleton and distribute that work
00024    under terms of your choice, so long as that work isn't itself a
00025    parser generator using the skeleton or a modified version thereof
00026    as a parser skeleton.  Alternatively, if you modify or redistribute
00027    the parser skeleton itself, you may (at your option) remove this
00028    special exception, which will cause the skeleton and the resulting
00029    Bison output files to be licensed under the GNU General Public
00030    License without this special exception.
00031    
00032    This special exception was added by the Free Software Foundation in
00033    version 2.2 of Bison.  */
00034 
00035 /* C LALR(1) parser skeleton written by Richard Stallman, by
00036    simplifying the original so-called "semantic" parser.  */
00037 
00038 /* All symbols defined below should begin with yy or YY, to avoid
00039    infringing on user name space.  This should be done even for local
00040    variables, as they might otherwise be expanded by user macros.
00041    There are some unavoidable exceptions within include files to
00042    define necessary library symbols; they are noted "INFRINGES ON
00043    USER NAME SPACE" below.  */
00044 
00045 /* Identify Bison output.  */
00046 #define YYBISON 1
00047 
00048 /* Bison version.  */
00049 #define YYBISON_VERSION "2.4.1"
00050 
00051 /* Skeleton name.  */
00052 #define YYSKELETON_NAME "yacc.c"
00053 
00054 /* Pure parsers.  */
00055 #define YYPURE 1
00056 
00057 /* Push parsers.  */
00058 #define YYPUSH 0
00059 
00060 /* Pull parsers.  */
00061 #define YYPULL 1
00062 
00063 /* Using locations.  */
00064 #define YYLSP_NEEDED 0
00065 
00066 /* Substitute the variable and function names.  */
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 /* Copy the first part of user declarations.  */
00077 
00078 /* Line 189 of yacc.c  */
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     /* TODO: FIX ME!!! */
00106     /*
00107     context->abort(context, error);*/
00108   }
00109 }
00110 
00111 
00112 
00113 /* Line 189 of yacc.c  */
00114 #line 115 "drizzled/execute/parser.cc"
00115 
00116 /* Enabling traces.  */
00117 #ifndef YYDEBUG
00118 # define YYDEBUG 1
00119 #endif
00120 
00121 /* Enabling verbose error messages.  */
00122 #ifdef YYERROR_VERBOSE
00123 # undef YYERROR_VERBOSE
00124 # define YYERROR_VERBOSE 1
00125 #else
00126 # define YYERROR_VERBOSE 1
00127 #endif
00128 
00129 /* Enabling the token table.  */
00130 #ifndef YYTOKEN_TABLE
00131 # define YYTOKEN_TABLE 0
00132 #endif
00133 
00134 
00135 /* Tokens.  */
00136 #ifndef YYTOKENTYPE
00137 # define YYTOKENTYPE
00138    /* Put the tokens into the symbol table, so that GDB and other debuggers
00139       know about them.  */
00140    enum yytokentype {
00141      STRING = 258,
00142      QUOTED_STRING = 259,
00143      UNKNOWN = 260
00144    };
00145 #endif
00146 /* Tokens.  */
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 /* obsolescent; will be withdrawn */
00157 # define YYSTYPE_IS_DECLARED 1
00158 #endif
00159 
00160 
00161 /* Copy the second part of user declarations.  */
00162 
00163 
00164 /* Line 264 of yacc.c  */
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> /* INFRINGES ON USER NAME SPACE */
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> /* INFRINGES ON USER NAME SPACE */
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 /* Suppress unused-variable warnings by "using" E.  */
00227 #if ! defined lint || defined __GNUC__
00228 # define YYUSE(e) ((void) (e))
00229 #else
00230 # define YYUSE(e) /* empty */
00231 #endif
00232 
00233 /* Identity function, used to suppress warnings about constant conditions.  */
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 /* The parser invokes alloca or malloc; define the necessary symbols.  */
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> /* INFRINGES ON USER NAME SPACE */
00261 #   elif defined _AIX
00262 #    define YYSTACK_ALLOC __alloca
00263 #   elif defined _MSC_VER
00264 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
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> /* INFRINGES ON USER NAME SPACE */
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    /* Pacify GCC's `empty if-body' warning.  */
00281 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00282 #  ifndef YYSTACK_ALLOC_MAXIMUM
00283     /* The OS might guarantee only one guard page at the bottom of the stack,
00284        and a page size can be as small as 4096 bytes.  So we cannot safely
00285        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00286        to allow for a few compiler-allocated temporary stack slots.  */
00287 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
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> /* INFRINGES ON USER NAME SPACE */
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); /* INFRINGES ON USER NAME SPACE */
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 *); /* INFRINGES ON USER NAME SPACE */
00315 #   endif
00316 #  endif
00317 # endif
00318 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00319 
00320 
00321 #if (! defined yyoverflow \
00322      && (! defined __cplusplus \
00323    || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00324 
00325 /* A type that is properly aligned for any stack member.  */
00326 union yyalloc
00327 {
00328   yytype_int16 yyss_alloc;
00329   YYSTYPE yyvs_alloc;
00330 };
00331 
00332 /* The size of the maximum gap between one aligned stack and the next.  */
00333 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00334 
00335 /* The size of an array large to enough to hold all stacks, each with
00336    N elements.  */
00337 # define YYSTACK_BYTES(N) \
00338      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00339       + YYSTACK_GAP_MAXIMUM)
00340 
00341 /* Copy COUNT objects from FROM to TO.  The source and destination do
00342    not overlap.  */
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 /* Relocate STACK from its old location to the new one.  The
00360    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00361    elements in the stack, and YYPTR gives the new location of the
00362    stack.  Advance YYPTR to a properly aligned location for the next
00363    stack.  */
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 /* YYFINAL -- State number of the termination state.  */
00378 #define YYFINAL  3
00379 /* YYLAST -- Last index in YYTABLE.  */
00380 #define YYLAST   3
00381 
00382 /* YYNTOKENS -- Number of terminals.  */
00383 #define YYNTOKENS  6
00384 /* YYNNTS -- Number of nonterminals.  */
00385 #define YYNNTS  2
00386 /* YYNRULES -- Number of rules.  */
00387 #define YYNRULES  3
00388 /* YYNRULES -- Number of states.  */
00389 #define YYNSTATES  5
00390 
00391 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00392 #define YYUNDEFTOK  2
00393 #define YYMAXUTOK   260
00394 
00395 #define YYTRANSLATE(YYX)            \
00396   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00397 
00398 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
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 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00432    YYRHS.  */
00433 static const yytype_uint8 yyprhs[] =
00434 {
00435        0,     0,     3,     5
00436 };
00437 
00438 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00439 static const yytype_int8 yyrhs[] =
00440 {
00441        7,     0,    -1,     3,    -1,     7,     3,    -1
00442 };
00443 
00444 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00445 static const yytype_uint8 yyrline[] =
00446 {
00447        0,    97,    97,   103
00448 };
00449 #endif
00450 
00451 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00452 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00453    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
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 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00463    token YYLEX-NUM.  */
00464 static const yytype_uint16 yytoknum[] =
00465 {
00466        0,   256,   257,   258,   259,   260
00467 };
00468 # endif
00469 
00470 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00471 static const yytype_uint8 yyr1[] =
00472 {
00473        0,     6,     7,     7
00474 };
00475 
00476 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00477 static const yytype_uint8 yyr2[] =
00478 {
00479        0,     2,     1,     2
00480 };
00481 
00482 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00483    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00484    means the default is an error.  */
00485 static const yytype_uint8 yydefact[] =
00486 {
00487        0,     2,     0,     1,     3
00488 };
00489 
00490 /* YYDEFGOTO[NTERM-NUM].  */
00491 static const yytype_int8 yydefgoto[] =
00492 {
00493       -1,     2
00494 };
00495 
00496 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00497    STATE-NUM.  */
00498 #define YYPACT_NINF -3
00499 static const yytype_int8 yypact[] =
00500 {
00501       -2,    -3,     0,    -3,    -3
00502 };
00503 
00504 /* YYPGOTO[NTERM-NUM].  */
00505 static const yytype_int8 yypgoto[] =
00506 {
00507       -3,    -3
00508 };
00509 
00510 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00511    positive, shift that token.  If negative, reduce the rule which
00512    number is the opposite.  If zero, do what YYDEFACT says.
00513    If YYTABLE_NINF, syntax error.  */
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 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00526    symbol of state STATE-NUM.  */
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 /* Like YYERROR except do call yyerror.  This remains here temporarily
00543    to ease the transition to the new meaning of YYERROR, for GCC.
00544    Once GCC version 2 has supplanted version 1, this can go.  */
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 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00573    If N is 0, then set CURRENT to the empty location which ends
00574    the previous symbol: RHS[0] (always defined).  */
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 /* YY_LOCATION_PRINT -- Print the location on the stream.
00599    This macro was not mandated originally: define only if we know
00600    we won't break user code: when these are the locations we know.  */
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 /* YYLEX -- calling `yylex' with the right arguments.  */
00615 
00616 #ifdef YYLEX_PARAM
00617 # define YYLEX yylex (&yylval, YYLEX_PARAM)
00618 #else
00619 # define YYLEX yylex (&yylval, scanner)
00620 #endif
00621 
00622 /* Enable debugging if requested.  */
00623 #if YYDEBUG
00624 
00625 # ifndef YYFPRINTF
00626 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
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 | Print this symbol on YYOUTPUT.  |
00650 `--------------------------------*/
00651 
00652 /*ARGSUSED*/
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 | Print this symbol on YYOUTPUT.  |
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 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
00714 | TOP (included).                                                   |
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 | Report that the YYRULE is going to be reduced.  |
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   /* The symbols being reduced.  */
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 /* Nonzero means print parse trace.  It is left uninitialized so that
00784    multiple parsers can coexist.  */
00785 int yydebug;
00786 #else /* !YYDEBUG */
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 /* !YYDEBUG */
00792 
00793 
00794 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00795 #ifndef YYINITDEPTH
00796 # define YYINITDEPTH 200
00797 #endif
00798 
00799 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00800    if the built-in stack extension method is used).
00801 
00802    Do not make this value too large; the results are undefined if
00803    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
00804    evaluated with infinite-precision integer arithmetic.  */
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 /* Return the length of YYSTR.  */
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 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00842    YYDEST.  */
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 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
00867    quotes and backslashes, so that it's suitable for yyerror.  The
00868    heuristic is that double-quoting is unnecessary unless the string
00869    contains an apostrophe, a comma, or backslash (other than
00870    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
00871    null, do not copy; instead, return the length of what the result
00872    would have been.  */
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       /* Fall through.  */
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 /* Copy into YYRESULT an error message about the unexpected token
00914    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
00915    including the terminating null byte.  If YYRESULT is null, do not
00916    copy anything; just return the number of bytes that would be
00917    copied.  As a special case, return 0 if an ordinary "syntax error"
00918    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
00919    size calculation.  */
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       /* This is so xgettext sees the translatable formats that are
00940    constructed on the fly.  */
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       /* Start YYX at -YYN if negative to avoid negative indexes in
00959    YYCHECK.  */
00960       int yyxbegin = yyn < 0 ? -yyn : 0;
00961 
00962       /* Stay within bounds of both yycheck and yytname.  */
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     /* Avoid sprintf, as that infringes on the user's name space.
00999        Don't have undefined behavior even if the translation
01000        produced a string with the wrong number of "%s"s.  */
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 /* YYERROR_VERBOSE */
01021 
01022 
01023 /*-----------------------------------------------.
01024 | Release the memory associated to this symbol.  |
01025 `-----------------------------------------------*/
01026 
01027 /*ARGSUSED*/
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 /* Prevent warnings from -Wmissing-prototypes.  */
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 /* ! YYPARSE_PARAM */
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 /* ! YYPARSE_PARAM */
01072 
01073 
01074 
01075 
01076 
01077 /*-------------------------.
01078 | yyparse or yypush_parse.  |
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 /* ! YYPARSE_PARAM */
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 /* The lookahead symbol.  */
01105 int yychar;
01106 
01107 /* The semantic value of the lookahead symbol.  */
01108 YYSTYPE yylval;
01109 
01110     /* Number of syntax errors so far.  */
01111     int yynerrs;
01112 
01113     int yystate;
01114     /* Number of tokens to shift before error messages enabled.  */
01115     int yyerrstatus;
01116 
01117     /* The stacks and their tools:
01118        `yyss': related to states.
01119        `yyvs': related to semantic values.
01120 
01121        Refer to the stacks thru separate pointers, to allow yyoverflow
01122        to reallocate them elsewhere.  */
01123 
01124     /* The state stack.  */
01125     yytype_int16 yyssa[YYINITDEPTH];
01126     yytype_int16 *yyss;
01127     yytype_int16 *yyssp;
01128 
01129     /* The semantic value stack.  */
01130     YYSTYPE yyvsa[YYINITDEPTH];
01131     YYSTYPE *yyvs;
01132     YYSTYPE *yyvsp;
01133 
01134     YYSIZE_T yystacksize;
01135 
01136   int yyn;
01137   int yyresult;
01138   /* Lookahead token as an internal (translated) token number.  */
01139   int yytoken;
01140   /* The variables used to return semantic value and location from the
01141      action routines.  */
01142   YYSTYPE yyval;
01143 
01144 #if YYERROR_VERBOSE
01145   /* Buffer for error messages, and its allocated size.  */
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   /* The number of symbols on the RHS of the reduced rule.
01154      Keep to zero when no symbol should be popped.  */
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; /* Cause a token to be read.  */
01168 
01169   /* Initialize stack pointers.
01170      Waste one element of value and location stack
01171      so that they stay on the same level as the state stack.
01172      The wasted elements are never initialized.  */
01173   yyssp = yyss;
01174   yyvsp = yyvs;
01175 
01176   goto yysetstate;
01177 
01178 /*------------------------------------------------------------.
01179 | yynewstate -- Push a new state, which is found in yystate.  |
01180 `------------------------------------------------------------*/
01181  yynewstate:
01182   /* In all cases, when you get here, the value and location stacks
01183      have just been pushed.  So pushing a state here evens the stacks.  */
01184   yyssp++;
01185 
01186  yysetstate:
01187   *yyssp = yystate;
01188 
01189   if (yyss + yystacksize - 1 <= yyssp)
01190     {
01191       /* Get the current used size of the three stacks, in elements.  */
01192       YYSIZE_T yysize = yyssp - yyss + 1;
01193 
01194 #ifdef yyoverflow
01195       {
01196   /* Give user a chance to reallocate the stack.  Use copies of
01197      these so that the &'s don't force the real ones into
01198      memory.  */
01199   YYSTYPE *yyvs1 = yyvs;
01200   yytype_int16 *yyss1 = yyss;
01201 
01202   /* Each stack pointer address is followed by the size of the
01203      data in use in that stack, in bytes.  This used to be a
01204      conditional around just the two extra args, but that might
01205      be undefined if yyoverflow is a macro.  */
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 /* no yyoverflow */
01215 # ifndef YYSTACK_RELOCATE
01216       goto yyexhaustedlab;
01217 # else
01218       /* Extend the stack our own way.  */
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 /* no yyoverflow */
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 | yybackup.  |
01259 `-----------*/
01260 yybackup:
01261 
01262   /* Do appropriate processing given the current state.  Read a
01263      lookahead token if we need one and don't already have one.  */
01264 
01265   /* First try to decide what to do without reference to lookahead token.  */
01266   yyn = yypact[yystate];
01267   if (yyn == YYPACT_NINF)
01268     goto yydefault;
01269 
01270   /* Not known => get a lookahead token if don't already have one.  */
01271 
01272   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
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   /* If the proper action on seeing token YYTOKEN is to reduce or to
01291      detect an error, take that action.  */
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   /* Count tokens shifted since error; after three, turn off error
01305      status.  */
01306   if (yyerrstatus)
01307     yyerrstatus--;
01308 
01309   /* Shift the lookahead token.  */
01310   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01311 
01312   /* Discard the shifted token.  */
01313   yychar = YYEMPTY;
01314 
01315   yystate = yyn;
01316   *++yyvsp = yylval;
01317 
01318   goto yynewstate;
01319 
01320 
01321 /*-----------------------------------------------------------.
01322 | yydefault -- do the default action for the current state.  |
01323 `-----------------------------------------------------------*/
01324 yydefault:
01325   yyn = yydefact[yystate];
01326   if (yyn == 0)
01327     goto yyerrlab;
01328   goto yyreduce;
01329 
01330 
01331 /*-----------------------------.
01332 | yyreduce -- Do a reduction.  |
01333 `-----------------------------*/
01334 yyreduce:
01335   /* yyn is the number of a rule to reduce with.  */
01336   yylen = yyr2[yyn];
01337 
01338   /* If YYLEN is nonzero, implement the default value of the action:
01339      `$$ = $1'.
01340 
01341      Otherwise, the following line sets YYVAL to garbage.
01342      This behavior is undocumented and Bison
01343      users should not rely upon it.  Assigning to YYVAL
01344      unconditionally makes the parser a bit smaller, and it avoids a
01345      GCC warning that YYVAL may be used uninitialized.  */
01346   yyval = yyvsp[1-yylen];
01347 
01348 
01349   YY_REDUCE_PRINT (yyn);
01350   switch (yyn)
01351     {
01352         case 2:
01353 
01354 /* Line 1455 of yacc.c  */
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 /* Line 1455 of yacc.c  */
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 /* Line 1455 of yacc.c  */
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   /* Now `shift' the result of the reduction.  Determine what state
01387      that goes to, based on the state we popped back to and the rule
01388      number reduced by.  */
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 | yyerrlab -- here on detecting error |
01403 `------------------------------------*/
01404 yyerrlab:
01405   /* If not already recovering from an error, report this error.  */
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       /* If just tried and failed to reuse lookahead token after an
01451    error, discard it.  */
01452 
01453       if (yychar <= YYEOF)
01454   {
01455     /* Return failure if at end of input.  */
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   /* Else will try to reuse lookahead token after shifting the error
01468      token.  */
01469   goto yyerrlab1;
01470 
01471 
01472 /*---------------------------------------------------.
01473 | yyerrorlab -- error raised explicitly by YYERROR.  |
01474 `---------------------------------------------------*/
01475 yyerrorlab:
01476 
01477   /* Pacify compilers like GCC when the user code never invokes
01478      YYERROR and the label yyerrorlab therefore never appears in user
01479      code.  */
01480   if (/*CONSTCOND*/ 0)
01481      goto yyerrorlab;
01482 
01483   /* Do not reclaim the symbols of the rule which action triggered
01484      this YYERROR.  */
01485   YYPOPSTACK (yylen);
01486   yylen = 0;
01487   YY_STACK_PRINT (yyss, yyssp);
01488   yystate = *yyssp;
01489   goto yyerrlab1;
01490 
01491 
01492 /*-------------------------------------------------------------.
01493 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
01494 `-------------------------------------------------------------*/
01495 yyerrlab1:
01496   yyerrstatus = 3;  /* Each real token shifted decrements this.  */
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       /* Pop the current state because it cannot handle the error token.  */
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   /* Shift the error token.  */
01528   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01529 
01530   yystate = yyn;
01531   goto yynewstate;
01532 
01533 
01534 /*-------------------------------------.
01535 | yyacceptlab -- YYACCEPT comes here.  |
01536 `-------------------------------------*/
01537 yyacceptlab:
01538   yyresult = 0;
01539   goto yyreturn;
01540 
01541 /*-----------------------------------.
01542 | yyabortlab -- YYABORT comes here.  |
01543 `-----------------------------------*/
01544 yyabortlab:
01545   yyresult = 1;
01546   goto yyreturn;
01547 
01548 #if !defined(yyoverflow) || YYERROR_VERBOSE
01549 /*-------------------------------------------------.
01550 | yyexhaustedlab -- memory exhaustion comes here.  |
01551 `-------------------------------------------------*/
01552 yyexhaustedlab:
01553   yyerror (context, scanner, YY_("memory exhausted"));
01554   yyresult = 2;
01555   /* Fall through.  */
01556 #endif
01557 
01558 yyreturn:
01559   if (yychar != YYEMPTY)
01560      yydestruct ("Cleanup: discarding lookahead",
01561      yytoken, &yylval, context, scanner);
01562   /* Do not reclaim the symbols of the rule which action triggered
01563      this YYABORT or YYACCEPT.  */
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   /* Make sure YYID is used.  */
01581   return YYID (yyresult);
01582 }
01583 
01584 
01585 
01586 /* Line 1675 of yacc.c  */
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 } // namespace execute
01613 } // namespace drizzled
01614