Drizzled Public API Documentation

parser.cc
1 /* A Bison parser, made by GNU Bison 2.5. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "2.5"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 1
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
63 
64 /* Substitute the variable and function names. */
65 #define yyparse execute_parse
66 #define yylex execute_lex
67 #define yyerror execute_error
68 #define yylval execute_lval
69 #define yychar execute_char
70 #define yydebug execute_debug
71 #define yynerrs execute_nerrs
72 
73 
74 /* Copy the first part of user declarations. */
75 
76 /* Line 268 of yacc.c */
77 #line 55 "drizzled/execute/parser.yy"
78 
79 
80 #include <config.h>
81 #include <iostream>
82 #include <stdint.h>
83 #include <drizzled/execute/symbol.h>
84 #include <drizzled/execute/scanner.h>
85 #include <drizzled/execute/context.h>
86 #include <vector>
87 
88 #ifndef __INTEL_COMPILER
89 #pragma GCC diagnostic ignored "-Wold-style-cast"
90 #endif
91 
92 #define YYENABLE_NLS 0
93 #define YYLTYPE_IS_TRIVIAL 0
94 
95 int execute_lex(YYSTYPE* lvalp, void* scanner);
96 std::string query;
97 #define parser_abort(A, B) do { parser::abort_func((A), (B)); YYABORT; } while (0)
98 
99 inline void execute_error(::drizzled::execute::Context *context, yyscan_t *scanner, const char *error)
100 {
101  if (not context->end())
102  {
103  /* TODO: FIX ME!!! */
104  /*
105  context->abort(context, error);*/
106  }
107 }
108 
109 
110 
111 /* Line 268 of yacc.c */
112 #line 113 "drizzled/execute/parser.cc"
113 
114 /* Enabling traces. */
115 #ifndef YYDEBUG
116 # define YYDEBUG 1
117 #endif
118 
119 /* Enabling verbose error messages. */
120 #ifdef YYERROR_VERBOSE
121 # undef YYERROR_VERBOSE
122 # define YYERROR_VERBOSE 1
123 #else
124 # define YYERROR_VERBOSE 1
125 #endif
126 
127 /* Enabling the token table. */
128 #ifndef YYTOKEN_TABLE
129 # define YYTOKEN_TABLE 0
130 #endif
131 
132 
133 /* Tokens. */
134 #ifndef YYTOKENTYPE
135 # define YYTOKENTYPE
136  /* Put the tokens into the symbol table, so that GDB and other debuggers
137  know about them. */
138  enum yytokentype {
139  STRING = 258,
140  QUOTED_STRING = 259,
141  UNKNOWN = 260
142  };
143 #endif
144 /* Tokens. */
145 #define STRING 258
146 #define QUOTED_STRING 259
147 #define UNKNOWN 260
148 
149 
150 
151 
152 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
153 
154 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
155 # define YYSTYPE_IS_DECLARED 1
156 #endif
157 
158 
159 /* Copy the second part of user declarations. */
160 
161 
162 /* Line 343 of yacc.c */
163 #line 164 "drizzled/execute/parser.cc"
164 
165 #ifdef short
166 # undef short
167 #endif
168 
169 #ifdef YYTYPE_UINT8
170 typedef YYTYPE_UINT8 yytype_uint8;
171 #else
172 typedef unsigned char yytype_uint8;
173 #endif
174 
175 #ifdef YYTYPE_INT8
176 typedef YYTYPE_INT8 yytype_int8;
177 #elif (defined __STDC__ || defined __C99__FUNC__ \
178  || defined __cplusplus || defined _MSC_VER)
179 typedef signed char yytype_int8;
180 #else
181 typedef short int yytype_int8;
182 #endif
183 
184 #ifdef YYTYPE_UINT16
185 typedef YYTYPE_UINT16 yytype_uint16;
186 #else
187 typedef unsigned short int yytype_uint16;
188 #endif
189 
190 #ifdef YYTYPE_INT16
191 typedef YYTYPE_INT16 yytype_int16;
192 #else
193 typedef short int yytype_int16;
194 #endif
195 
196 #ifndef YYSIZE_T
197 # ifdef __SIZE_TYPE__
198 # define YYSIZE_T __SIZE_TYPE__
199 # elif defined size_t
200 # define YYSIZE_T size_t
201 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
202  || defined __cplusplus || defined _MSC_VER)
203 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
204 # define YYSIZE_T size_t
205 # else
206 # define YYSIZE_T unsigned int
207 # endif
208 #endif
209 
210 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
211 
212 #ifndef YY_
213 # if defined YYENABLE_NLS && YYENABLE_NLS
214 # if ENABLE_NLS
215 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
216 # define YY_(msgid) dgettext ("bison-runtime", msgid)
217 # endif
218 # endif
219 # ifndef YY_
220 # define YY_(msgid) msgid
221 # endif
222 #endif
223 
224 /* Suppress unused-variable warnings by "using" E. */
225 #if ! defined lint || defined __GNUC__
226 # define YYUSE(e) ((void) (e))
227 #else
228 # define YYUSE(e) /* empty */
229 #endif
230 
231 /* Identity function, used to suppress warnings about constant conditions. */
232 #ifndef lint
233 # define YYID(n) (n)
234 #else
235 #if (defined __STDC__ || defined __C99__FUNC__ \
236  || defined __cplusplus || defined _MSC_VER)
237 static int
238 YYID (int yyi)
239 #else
240 static int
241 YYID (yyi)
242  int yyi;
243 #endif
244 {
245  return yyi;
246 }
247 #endif
248 
249 #if ! defined yyoverflow || YYERROR_VERBOSE
250 
251 /* The parser invokes alloca or malloc; define the necessary symbols. */
252 
253 # ifdef YYSTACK_USE_ALLOCA
254 # if YYSTACK_USE_ALLOCA
255 # ifdef __GNUC__
256 # define YYSTACK_ALLOC __builtin_alloca
257 # elif defined __BUILTIN_VA_ARG_INCR
258 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
259 # elif defined _AIX
260 # define YYSTACK_ALLOC __alloca
261 # elif defined _MSC_VER
262 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
263 # define alloca _alloca
264 # else
265 # define YYSTACK_ALLOC alloca
266 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
267  || defined __cplusplus || defined _MSC_VER)
268 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
269 # ifndef EXIT_SUCCESS
270 # define EXIT_SUCCESS 0
271 # endif
272 # endif
273 # endif
274 # endif
275 # endif
276 
277 # ifdef YYSTACK_ALLOC
278  /* Pacify GCC's `empty if-body' warning. */
279 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
280 # ifndef YYSTACK_ALLOC_MAXIMUM
281  /* The OS might guarantee only one guard page at the bottom of the stack,
282  and a page size can be as small as 4096 bytes. So we cannot safely
283  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
284  to allow for a few compiler-allocated temporary stack slots. */
285 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
286 # endif
287 # else
288 # define YYSTACK_ALLOC YYMALLOC
289 # define YYSTACK_FREE YYFREE
290 # ifndef YYSTACK_ALLOC_MAXIMUM
291 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
292 # endif
293 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
294  && ! ((defined YYMALLOC || defined malloc) \
295  && (defined YYFREE || defined free)))
296 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
297 # ifndef EXIT_SUCCESS
298 # define EXIT_SUCCESS 0
299 # endif
300 # endif
301 # ifndef YYMALLOC
302 # define YYMALLOC malloc
303 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
304  || defined __cplusplus || defined _MSC_VER)
305 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
306 # endif
307 # endif
308 # ifndef YYFREE
309 # define YYFREE free
310 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
311  || defined __cplusplus || defined _MSC_VER)
312 void free (void *); /* INFRINGES ON USER NAME SPACE */
313 # endif
314 # endif
315 # endif
316 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
317 
318 
319 #if (! defined yyoverflow \
320  && (! defined __cplusplus \
321  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
322 
323 /* A type that is properly aligned for any stack member. */
324 union yyalloc
325 {
326  yytype_int16 yyss_alloc;
327  YYSTYPE yyvs_alloc;
328 };
329 
330 /* The size of the maximum gap between one aligned stack and the next. */
331 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
332 
333 /* The size of an array large to enough to hold all stacks, each with
334  N elements. */
335 # define YYSTACK_BYTES(N) \
336  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
337  + YYSTACK_GAP_MAXIMUM)
338 
339 # define YYCOPY_NEEDED 1
340 
341 /* Relocate STACK from its old location to the new one. The
342  local variables YYSIZE and YYSTACKSIZE give the old and new number of
343  elements in the stack, and YYPTR gives the new location of the
344  stack. Advance YYPTR to a properly aligned location for the next
345  stack. */
346 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
347  do \
348  { \
349  YYSIZE_T yynewbytes; \
350  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
351  Stack = &yyptr->Stack_alloc; \
352  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
353  yyptr += yynewbytes / sizeof (*yyptr); \
354  } \
355  while (YYID (0))
356 
357 #endif
358 
359 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
360 /* Copy COUNT objects from FROM to TO. The source and destination do
361  not overlap. */
362 # ifndef YYCOPY
363 # if defined __GNUC__ && 1 < __GNUC__
364 # define YYCOPY(To, From, Count) \
365  __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
366 # else
367 # define YYCOPY(To, From, Count) \
368  do \
369  { \
370  YYSIZE_T yyi; \
371  for (yyi = 0; yyi < (Count); yyi++) \
372  (To)[yyi] = (From)[yyi]; \
373  } \
374  while (YYID (0))
375 # endif
376 # endif
377 #endif /* !YYCOPY_NEEDED */
378 
379 /* YYFINAL -- State number of the termination state. */
380 #define YYFINAL 3
381 /* YYLAST -- Last index in YYTABLE. */
382 #define YYLAST 3
383 
384 /* YYNTOKENS -- Number of terminals. */
385 #define YYNTOKENS 6
386 /* YYNNTS -- Number of nonterminals. */
387 #define YYNNTS 2
388 /* YYNRULES -- Number of rules. */
389 #define YYNRULES 3
390 /* YYNRULES -- Number of states. */
391 #define YYNSTATES 5
392 
393 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
394 #define YYUNDEFTOK 2
395 #define YYMAXUTOK 260
396 
397 #define YYTRANSLATE(YYX) \
398  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
399 
400 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
401 static const yytype_uint8 yytranslate[] =
402 {
403  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
405  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
429  5
430 };
431 
432 #if YYDEBUG
433 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
434  YYRHS. */
435 static const yytype_uint8 yyprhs[] =
436 {
437  0, 0, 3, 5
438 };
439 
440 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
441 static const yytype_int8 yyrhs[] =
442 {
443  7, 0, -1, 3, -1, 7, 3, -1
444 };
445 
446 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
447 static const yytype_uint8 yyrline[] =
448 {
449  0, 97, 97, 103
450 };
451 #endif
452 
453 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
454 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
455  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
456 static const char *const yytname[] =
457 {
458  "$end", "error", "$undefined", "STRING", "QUOTED_STRING", "UNKNOWN",
459  "$accept", "begin", 0
460 };
461 #endif
462 
463 # ifdef YYPRINT
464 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
465  token YYLEX-NUM. */
466 static const yytype_uint16 yytoknum[] =
467 {
468  0, 256, 257, 258, 259, 260
469 };
470 # endif
471 
472 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
473 static const yytype_uint8 yyr1[] =
474 {
475  0, 6, 7, 7
476 };
477 
478 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
479 static const yytype_uint8 yyr2[] =
480 {
481  0, 2, 1, 2
482 };
483 
484 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
485  Performed when YYTABLE doesn't specify something else to do. Zero
486  means the default is an error. */
487 static const yytype_uint8 yydefact[] =
488 {
489  0, 2, 0, 1, 3
490 };
491 
492 /* YYDEFGOTO[NTERM-NUM]. */
493 static const yytype_int8 yydefgoto[] =
494 {
495  -1, 2
496 };
497 
498 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
499  STATE-NUM. */
500 #define YYPACT_NINF -3
501 static const yytype_int8 yypact[] =
502 {
503  -2, -3, 0, -3, -3
504 };
505 
506 /* YYPGOTO[NTERM-NUM]. */
507 static const yytype_int8 yypgoto[] =
508 {
509  -3, -3
510 };
511 
512 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
513  positive, shift that token. If negative, reduce the rule which
514  number is the opposite. If YYTABLE_NINF, syntax error. */
515 #define YYTABLE_NINF -1
516 static const yytype_uint8 yytable[] =
517 {
518  3, 1, 0, 4
519 };
520 
521 #define yypact_value_is_default(yystate) \
522  ((yystate) == (-3))
523 
524 #define yytable_value_is_error(yytable_value) \
525  YYID (0)
526 
527 static const yytype_int8 yycheck[] =
528 {
529  0, 3, -1, 3
530 };
531 
532 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
533  symbol of state STATE-NUM. */
534 static const yytype_uint8 yystos[] =
535 {
536  0, 3, 7, 0, 3
537 };
538 
539 #define yyerrok (yyerrstatus = 0)
540 #define yyclearin (yychar = YYEMPTY)
541 #define YYEMPTY (-2)
542 #define YYEOF 0
543 
544 #define YYACCEPT goto yyacceptlab
545 #define YYABORT goto yyabortlab
546 #define YYERROR goto yyerrorlab
547 
548 
549 /* Like YYERROR except do call yyerror. This remains here temporarily
550  to ease the transition to the new meaning of YYERROR, for GCC.
551  Once GCC version 2 has supplanted version 1, this can go. However,
552  YYFAIL appears to be in use. Nevertheless, it is formally deprecated
553  in Bison 2.4.2's NEWS entry, where a plan to phase it out is
554  discussed. */
555 
556 #define YYFAIL goto yyerrlab
557 #if defined YYFAIL
558  /* This is here to suppress warnings from the GCC cpp's
559  -Wunused-macros. Normally we don't worry about that warning, but
560  some users do, and we want to make it easy for users to remove
561  YYFAIL uses, which will produce warnings from Bison 2.5. */
562 #endif
563 
564 #define YYRECOVERING() (!!yyerrstatus)
565 
566 #define YYBACKUP(Token, Value) \
567 do \
568  if (yychar == YYEMPTY && yylen == 1) \
569  { \
570  yychar = (Token); \
571  yylval = (Value); \
572  YYPOPSTACK (1); \
573  goto yybackup; \
574  } \
575  else \
576  { \
577  yyerror (context, scanner, YY_("syntax error: cannot back up")); \
578  YYERROR; \
579  } \
580 while (YYID (0))
581 
582 
583 #define YYTERROR 1
584 #define YYERRCODE 256
585 
586 
587 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
588  If N is 0, then set CURRENT to the empty location which ends
589  the previous symbol: RHS[0] (always defined). */
590 
591 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
592 #ifndef YYLLOC_DEFAULT
593 # define YYLLOC_DEFAULT(Current, Rhs, N) \
594  do \
595  if (YYID (N)) \
596  { \
597  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
598  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
599  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
600  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
601  } \
602  else \
603  { \
604  (Current).first_line = (Current).last_line = \
605  YYRHSLOC (Rhs, 0).last_line; \
606  (Current).first_column = (Current).last_column = \
607  YYRHSLOC (Rhs, 0).last_column; \
608  } \
609  while (YYID (0))
610 #endif
611 
612 
613 /* This macro is provided for backward compatibility. */
614 
615 #ifndef YY_LOCATION_PRINT
616 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
617 #endif
618 
619 
620 /* YYLEX -- calling `yylex' with the right arguments. */
621 
622 #ifdef YYLEX_PARAM
623 # define YYLEX yylex (&yylval, YYLEX_PARAM)
624 #else
625 # define YYLEX yylex (&yylval, scanner)
626 #endif
627 
628 /* Enable debugging if requested. */
629 #if YYDEBUG
630 
631 # ifndef YYFPRINTF
632 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
633 # define YYFPRINTF fprintf
634 # endif
635 
636 # define YYDPRINTF(Args) \
637 do { \
638  if (yydebug) \
639  YYFPRINTF Args; \
640 } while (YYID (0))
641 
642 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
643 do { \
644  if (yydebug) \
645  { \
646  YYFPRINTF (stderr, "%s ", Title); \
647  yy_symbol_print (stderr, \
648  Type, Value, context, scanner); \
649  YYFPRINTF (stderr, "\n"); \
650  } \
651 } while (YYID (0))
652 
653 
654 /*--------------------------------.
655 | Print this symbol on YYOUTPUT. |
656 `--------------------------------*/
657 
658 /*ARGSUSED*/
659 #if (defined __STDC__ || defined __C99__FUNC__ \
660  || defined __cplusplus || defined _MSC_VER)
661 static void
662 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ::drizzled::execute::Context *context, yyscan_t *scanner)
663 #else
664 static void
665 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context, scanner)
666  FILE *yyoutput;
667  int yytype;
668  YYSTYPE const * const yyvaluep;
669  ::drizzled::execute::Context *context;
670  yyscan_t *scanner;
671 #endif
672 {
673  if (!yyvaluep)
674  return;
675  YYUSE (context);
676  YYUSE (scanner);
677 # ifdef YYPRINT
678  if (yytype < YYNTOKENS)
679  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
680 # else
681  YYUSE (yyoutput);
682 # endif
683  switch (yytype)
684  {
685  default:
686  break;
687  }
688 }
689 
690 
691 /*--------------------------------.
692 | Print this symbol on YYOUTPUT. |
693 `--------------------------------*/
694 
695 #if (defined __STDC__ || defined __C99__FUNC__ \
696  || defined __cplusplus || defined _MSC_VER)
697 static void
698 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ::drizzled::execute::Context *context, yyscan_t *scanner)
699 #else
700 static void
701 yy_symbol_print (yyoutput, yytype, yyvaluep, context, scanner)
702  FILE *yyoutput;
703  int yytype;
704  YYSTYPE const * const yyvaluep;
705  ::drizzled::execute::Context *context;
706  yyscan_t *scanner;
707 #endif
708 {
709  if (yytype < YYNTOKENS)
710  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
711  else
712  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
713 
714  yy_symbol_value_print (yyoutput, yytype, yyvaluep, context, scanner);
715  YYFPRINTF (yyoutput, ")");
716 }
717 
718 /*------------------------------------------------------------------.
719 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
720 | TOP (included). |
721 `------------------------------------------------------------------*/
722 
723 #if (defined __STDC__ || defined __C99__FUNC__ \
724  || defined __cplusplus || defined _MSC_VER)
725 static void
726 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
727 #else
728 static void
729 yy_stack_print (yybottom, yytop)
730  yytype_int16 *yybottom;
731  yytype_int16 *yytop;
732 #endif
733 {
734  YYFPRINTF (stderr, "Stack now");
735  for (; yybottom <= yytop; yybottom++)
736  {
737  int yybot = *yybottom;
738  YYFPRINTF (stderr, " %d", yybot);
739  }
740  YYFPRINTF (stderr, "\n");
741 }
742 
743 # define YY_STACK_PRINT(Bottom, Top) \
744 do { \
745  if (yydebug) \
746  yy_stack_print ((Bottom), (Top)); \
747 } while (YYID (0))
748 
749 
750 /*------------------------------------------------.
751 | Report that the YYRULE is going to be reduced. |
752 `------------------------------------------------*/
753 
754 #if (defined __STDC__ || defined __C99__FUNC__ \
755  || defined __cplusplus || defined _MSC_VER)
756 static void
757 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, ::drizzled::execute::Context *context, yyscan_t *scanner)
758 #else
759 static void
760 yy_reduce_print (yyvsp, yyrule, context, scanner)
761  YYSTYPE *yyvsp;
762  int yyrule;
763  ::drizzled::execute::Context *context;
764  yyscan_t *scanner;
765 #endif
766 {
767  int yynrhs = yyr2[yyrule];
768  int yyi;
769  unsigned long int yylno = yyrline[yyrule];
770  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
771  yyrule - 1, yylno);
772  /* The symbols being reduced. */
773  for (yyi = 0; yyi < yynrhs; yyi++)
774  {
775  YYFPRINTF (stderr, " $%d = ", yyi + 1);
776  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
777  &(yyvsp[(yyi + 1) - (yynrhs)])
778  , context, scanner);
779  YYFPRINTF (stderr, "\n");
780  }
781 }
782 
783 # define YY_REDUCE_PRINT(Rule) \
784 do { \
785  if (yydebug) \
786  yy_reduce_print (yyvsp, Rule, context, scanner); \
787 } while (YYID (0))
788 
789 /* Nonzero means print parse trace. It is left uninitialized so that
790  multiple parsers can coexist. */
791 int yydebug;
792 #else /* !YYDEBUG */
793 # define YYDPRINTF(Args)
794 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
795 # define YY_STACK_PRINT(Bottom, Top)
796 # define YY_REDUCE_PRINT(Rule)
797 #endif /* !YYDEBUG */
798 
799 
800 /* YYINITDEPTH -- initial size of the parser's stacks. */
801 #ifndef YYINITDEPTH
802 # define YYINITDEPTH 200
803 #endif
804 
805 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
806  if the built-in stack extension method is used).
807 
808  Do not make this value too large; the results are undefined if
809  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
810  evaluated with infinite-precision integer arithmetic. */
811 
812 #ifndef YYMAXDEPTH
813 # define YYMAXDEPTH 10000
814 #endif
815 
816 
817 #if YYERROR_VERBOSE
818 
819 # ifndef yystrlen
820 # if defined __GLIBC__ && defined _STRING_H
821 # define yystrlen strlen
822 # else
823 /* Return the length of YYSTR. */
824 #if (defined __STDC__ || defined __C99__FUNC__ \
825  || defined __cplusplus || defined _MSC_VER)
826 static YYSIZE_T
827 yystrlen (const char *yystr)
828 #else
829 static YYSIZE_T
830 yystrlen (yystr)
831  const char *yystr;
832 #endif
833 {
834  YYSIZE_T yylen;
835  for (yylen = 0; yystr[yylen]; yylen++)
836  continue;
837  return yylen;
838 }
839 # endif
840 # endif
841 
842 # ifndef yystpcpy
843 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
844 # define yystpcpy stpcpy
845 # else
846 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
847  YYDEST. */
848 #if (defined __STDC__ || defined __C99__FUNC__ \
849  || defined __cplusplus || defined _MSC_VER)
850 static char *
851 yystpcpy (char *yydest, const char *yysrc)
852 #else
853 static char *
854 yystpcpy (yydest, yysrc)
855  char *yydest;
856  const char *yysrc;
857 #endif
858 {
859  char *yyd = yydest;
860  const char *yys = yysrc;
861 
862  while ((*yyd++ = *yys++) != '\0')
863  continue;
864 
865  return yyd - 1;
866 }
867 # endif
868 # endif
869 
870 # ifndef yytnamerr
871 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
872  quotes and backslashes, so that it's suitable for yyerror. The
873  heuristic is that double-quoting is unnecessary unless the string
874  contains an apostrophe, a comma, or backslash (other than
875  backslash-backslash). YYSTR is taken from yytname. If YYRES is
876  null, do not copy; instead, return the length of what the result
877  would have been. */
878 static YYSIZE_T
879 yytnamerr (char *yyres, const char *yystr)
880 {
881  if (*yystr == '"')
882  {
883  YYSIZE_T yyn = 0;
884  char const *yyp = yystr;
885 
886  for (;;)
887  switch (*++yyp)
888  {
889  case '\'':
890  case ',':
891  goto do_not_strip_quotes;
892 
893  case '\\':
894  if (*++yyp != '\\')
895  goto do_not_strip_quotes;
896  /* Fall through. */
897  default:
898  if (yyres)
899  yyres[yyn] = *yyp;
900  yyn++;
901  break;
902 
903  case '"':
904  if (yyres)
905  yyres[yyn] = '\0';
906  return yyn;
907  }
908  do_not_strip_quotes: ;
909  }
910 
911  if (! yyres)
912  return yystrlen (yystr);
913 
914  return yystpcpy (yyres, yystr) - yyres;
915 }
916 # endif
917 
918 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
919  about the unexpected token YYTOKEN for the state stack whose top is
920  YYSSP.
921 
922  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
923  not large enough to hold the message. In that case, also set
924  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
925  required number of bytes is too large to store. */
926 static int
927 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
928  yytype_int16 *yyssp, int yytoken)
929 {
930  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
931  YYSIZE_T yysize = yysize0;
932  YYSIZE_T yysize1;
933  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
934  /* Internationalized format string. */
935  const char *yyformat = 0;
936  /* Arguments of yyformat. */
937  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
938  /* Number of reported tokens (one for the "unexpected", one per
939  "expected"). */
940  int yycount = 0;
941 
942  /* There are many possibilities here to consider:
943  - Assume YYFAIL is not used. It's too flawed to consider. See
944  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
945  for details. YYERROR is fine as it does not invoke this
946  function.
947  - If this state is a consistent state with a default action, then
948  the only way this function was invoked is if the default action
949  is an error action. In that case, don't check for expected
950  tokens because there are none.
951  - The only way there can be no lookahead present (in yychar) is if
952  this state is a consistent state with a default action. Thus,
953  detecting the absence of a lookahead is sufficient to determine
954  that there is no unexpected or expected token to report. In that
955  case, just report a simple "syntax error".
956  - Don't assume there isn't a lookahead just because this state is a
957  consistent state with a default action. There might have been a
958  previous inconsistent state, consistent state with a non-default
959  action, or user semantic action that manipulated yychar.
960  - Of course, the expected token list depends on states to have
961  correct lookahead information, and it depends on the parser not
962  to perform extra reductions after fetching a lookahead from the
963  scanner and before detecting a syntax error. Thus, state merging
964  (from LALR or IELR) and default reductions corrupt the expected
965  token list. However, the list is correct for canonical LR with
966  one exception: it will still contain any token that will not be
967  accepted due to an error action in a later state.
968  */
969  if (yytoken != YYEMPTY)
970  {
971  int yyn = yypact[*yyssp];
972  yyarg[yycount++] = yytname[yytoken];
973  if (!yypact_value_is_default (yyn))
974  {
975  /* Start YYX at -YYN if negative to avoid negative indexes in
976  YYCHECK. In other words, skip the first -YYN actions for
977  this state because they are default actions. */
978  int yyxbegin = yyn < 0 ? -yyn : 0;
979  /* Stay within bounds of both yycheck and yytname. */
980  int yychecklim = YYLAST - yyn + 1;
981  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
982  int yyx;
983 
984  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
985  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
986  && !yytable_value_is_error (yytable[yyx + yyn]))
987  {
988  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
989  {
990  yycount = 1;
991  yysize = yysize0;
992  break;
993  }
994  yyarg[yycount++] = yytname[yyx];
995  yysize1 = yysize + yytnamerr (0, yytname[yyx]);
996  if (! (yysize <= yysize1
997  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
998  return 2;
999  yysize = yysize1;
1000  }
1001  }
1002  }
1003 
1004  switch (yycount)
1005  {
1006 # define YYCASE_(N, S) \
1007  case N: \
1008  yyformat = S; \
1009  break
1010  YYCASE_(0, YY_("syntax error"));
1011  YYCASE_(1, YY_("syntax error, unexpected %s"));
1012  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1013  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1014  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1015  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1016 # undef YYCASE_
1017  }
1018 
1019  yysize1 = yysize + yystrlen (yyformat);
1020  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1021  return 2;
1022  yysize = yysize1;
1023 
1024  if (*yymsg_alloc < yysize)
1025  {
1026  *yymsg_alloc = 2 * yysize;
1027  if (! (yysize <= *yymsg_alloc
1028  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1029  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1030  return 1;
1031  }
1032 
1033  /* Avoid sprintf, as that infringes on the user's name space.
1034  Don't have undefined behavior even if the translation
1035  produced a string with the wrong number of "%s"s. */
1036  {
1037  char *yyp = *yymsg;
1038  int yyi = 0;
1039  while ((*yyp = *yyformat) != '\0')
1040  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1041  {
1042  yyp += yytnamerr (yyp, yyarg[yyi++]);
1043  yyformat += 2;
1044  }
1045  else
1046  {
1047  yyp++;
1048  yyformat++;
1049  }
1050  }
1051  return 0;
1052 }
1053 #endif /* YYERROR_VERBOSE */
1054 
1055 /*-----------------------------------------------.
1056 | Release the memory associated to this symbol. |
1057 `-----------------------------------------------*/
1058 
1059 /*ARGSUSED*/
1060 #if (defined __STDC__ || defined __C99__FUNC__ \
1061  || defined __cplusplus || defined _MSC_VER)
1062 static void
1063 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, ::drizzled::execute::Context *context, yyscan_t *scanner)
1064 #else
1065 static void
1066 yydestruct (yymsg, yytype, yyvaluep, context, scanner)
1067  const char *yymsg;
1068  int yytype;
1069  YYSTYPE *yyvaluep;
1070  ::drizzled::execute::Context *context;
1071  yyscan_t *scanner;
1072 #endif
1073 {
1074  YYUSE (yyvaluep);
1075  YYUSE (context);
1076  YYUSE (scanner);
1077 
1078  if (!yymsg)
1079  yymsg = "Deleting";
1080  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1081 
1082  switch (yytype)
1083  {
1084 
1085  default:
1086  break;
1087  }
1088 }
1089 
1090 
1091 /* Prevent warnings from -Wmissing-prototypes. */
1092 #ifdef YYPARSE_PARAM
1093 #if defined __STDC__ || defined __cplusplus
1094 int yyparse (void *YYPARSE_PARAM);
1095 #else
1096 int yyparse ();
1097 #endif
1098 #else /* ! YYPARSE_PARAM */
1099 #if defined __STDC__ || defined __cplusplus
1100 int yyparse (::drizzled::execute::Context *context, yyscan_t *scanner);
1101 #else
1102 int yyparse ();
1103 #endif
1104 #endif /* ! YYPARSE_PARAM */
1105 
1106 
1107 /*----------.
1108 | yyparse. |
1109 `----------*/
1110 
1111 #ifdef YYPARSE_PARAM
1112 #if (defined __STDC__ || defined __C99__FUNC__ \
1113  || defined __cplusplus || defined _MSC_VER)
1114 int
1115 yyparse (void *YYPARSE_PARAM)
1116 #else
1117 int
1118 yyparse (YYPARSE_PARAM)
1119  void *YYPARSE_PARAM;
1120 #endif
1121 #else /* ! YYPARSE_PARAM */
1122 #if (defined __STDC__ || defined __C99__FUNC__ \
1123  || defined __cplusplus || defined _MSC_VER)
1124 int
1125 yyparse (::drizzled::execute::Context *context, yyscan_t *scanner)
1126 #else
1127 int
1128 yyparse (context, scanner)
1129  ::drizzled::execute::Context *context;
1130  yyscan_t *scanner;
1131 #endif
1132 #endif
1133 {
1134 /* The lookahead symbol. */
1135 int yychar;
1136 
1137 /* The semantic value of the lookahead symbol. */
1138 YYSTYPE yylval;
1139 
1140  /* Number of syntax errors so far. */
1141  int yynerrs;
1142 
1143  int yystate;
1144  /* Number of tokens to shift before error messages enabled. */
1145  int yyerrstatus;
1146 
1147  /* The stacks and their tools:
1148  `yyss': related to states.
1149  `yyvs': related to semantic values.
1150 
1151  Refer to the stacks thru separate pointers, to allow yyoverflow
1152  to reallocate them elsewhere. */
1153 
1154  /* The state stack. */
1155  yytype_int16 yyssa[YYINITDEPTH];
1156  yytype_int16 *yyss;
1157  yytype_int16 *yyssp;
1158 
1159  /* The semantic value stack. */
1160  YYSTYPE yyvsa[YYINITDEPTH];
1161  YYSTYPE *yyvs;
1162  YYSTYPE *yyvsp;
1163 
1164  YYSIZE_T yystacksize;
1165 
1166  int yyn;
1167  int yyresult;
1168  /* Lookahead token as an internal (translated) token number. */
1169  int yytoken;
1170  /* The variables used to return semantic value and location from the
1171  action routines. */
1172  YYSTYPE yyval;
1173 
1174 #if YYERROR_VERBOSE
1175  /* Buffer for error messages, and its allocated size. */
1176  char yymsgbuf[128];
1177  char *yymsg = yymsgbuf;
1178  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1179 #endif
1180 
1181 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1182 
1183  /* The number of symbols on the RHS of the reduced rule.
1184  Keep to zero when no symbol should be popped. */
1185  int yylen = 0;
1186 
1187  yytoken = 0;
1188  yyss = yyssa;
1189  yyvs = yyvsa;
1190  yystacksize = YYINITDEPTH;
1191 
1192  YYDPRINTF ((stderr, "Starting parse\n"));
1193 
1194  yystate = 0;
1195  yyerrstatus = 0;
1196  yynerrs = 0;
1197  yychar = YYEMPTY; /* Cause a token to be read. */
1198 
1199  /* Initialize stack pointers.
1200  Waste one element of value and location stack
1201  so that they stay on the same level as the state stack.
1202  The wasted elements are never initialized. */
1203  yyssp = yyss;
1204  yyvsp = yyvs;
1205 
1206  goto yysetstate;
1207 
1208 /*------------------------------------------------------------.
1209 | yynewstate -- Push a new state, which is found in yystate. |
1210 `------------------------------------------------------------*/
1211  yynewstate:
1212  /* In all cases, when you get here, the value and location stacks
1213  have just been pushed. So pushing a state here evens the stacks. */
1214  yyssp++;
1215 
1216  yysetstate:
1217  *yyssp = yystate;
1218 
1219  if (yyss + yystacksize - 1 <= yyssp)
1220  {
1221  /* Get the current used size of the three stacks, in elements. */
1222  YYSIZE_T yysize = yyssp - yyss + 1;
1223 
1224 #ifdef yyoverflow
1225  {
1226  /* Give user a chance to reallocate the stack. Use copies of
1227  these so that the &'s don't force the real ones into
1228  memory. */
1229  YYSTYPE *yyvs1 = yyvs;
1230  yytype_int16 *yyss1 = yyss;
1231 
1232  /* Each stack pointer address is followed by the size of the
1233  data in use in that stack, in bytes. This used to be a
1234  conditional around just the two extra args, but that might
1235  be undefined if yyoverflow is a macro. */
1236  yyoverflow (YY_("memory exhausted"),
1237  &yyss1, yysize * sizeof (*yyssp),
1238  &yyvs1, yysize * sizeof (*yyvsp),
1239  &yystacksize);
1240 
1241  yyss = yyss1;
1242  yyvs = yyvs1;
1243  }
1244 #else /* no yyoverflow */
1245 # ifndef YYSTACK_RELOCATE
1246  goto yyexhaustedlab;
1247 # else
1248  /* Extend the stack our own way. */
1249  if (YYMAXDEPTH <= yystacksize)
1250  goto yyexhaustedlab;
1251  yystacksize *= 2;
1252  if (YYMAXDEPTH < yystacksize)
1253  yystacksize = YYMAXDEPTH;
1254 
1255  {
1256  yytype_int16 *yyss1 = yyss;
1257  union yyalloc *yyptr =
1258  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1259  if (! yyptr)
1260  goto yyexhaustedlab;
1261  YYSTACK_RELOCATE (yyss_alloc, yyss);
1262  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1263 # undef YYSTACK_RELOCATE
1264  if (yyss1 != yyssa)
1265  YYSTACK_FREE (yyss1);
1266  }
1267 # endif
1268 #endif /* no yyoverflow */
1269 
1270  yyssp = yyss + yysize - 1;
1271  yyvsp = yyvs + yysize - 1;
1272 
1273  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1274  (unsigned long int) yystacksize));
1275 
1276  if (yyss + yystacksize - 1 <= yyssp)
1277  YYABORT;
1278  }
1279 
1280  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1281 
1282  if (yystate == YYFINAL)
1283  YYACCEPT;
1284 
1285  goto yybackup;
1286 
1287 /*-----------.
1288 | yybackup. |
1289 `-----------*/
1290 yybackup:
1291 
1292  /* Do appropriate processing given the current state. Read a
1293  lookahead token if we need one and don't already have one. */
1294 
1295  /* First try to decide what to do without reference to lookahead token. */
1296  yyn = yypact[yystate];
1297  if (yypact_value_is_default (yyn))
1298  goto yydefault;
1299 
1300  /* Not known => get a lookahead token if don't already have one. */
1301 
1302  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1303  if (yychar == YYEMPTY)
1304  {
1305  YYDPRINTF ((stderr, "Reading a token: "));
1306  yychar = YYLEX;
1307  }
1308 
1309  if (yychar <= YYEOF)
1310  {
1311  yychar = yytoken = YYEOF;
1312  YYDPRINTF ((stderr, "Now at end of input.\n"));
1313  }
1314  else
1315  {
1316  yytoken = YYTRANSLATE (yychar);
1317  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1318  }
1319 
1320  /* If the proper action on seeing token YYTOKEN is to reduce or to
1321  detect an error, take that action. */
1322  yyn += yytoken;
1323  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1324  goto yydefault;
1325  yyn = yytable[yyn];
1326  if (yyn <= 0)
1327  {
1328  if (yytable_value_is_error (yyn))
1329  goto yyerrlab;
1330  yyn = -yyn;
1331  goto yyreduce;
1332  }
1333 
1334  /* Count tokens shifted since error; after three, turn off error
1335  status. */
1336  if (yyerrstatus)
1337  yyerrstatus--;
1338 
1339  /* Shift the lookahead token. */
1340  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1341 
1342  /* Discard the shifted token. */
1343  yychar = YYEMPTY;
1344 
1345  yystate = yyn;
1346  *++yyvsp = yylval;
1347 
1348  goto yynewstate;
1349 
1350 
1351 /*-----------------------------------------------------------.
1352 | yydefault -- do the default action for the current state. |
1353 `-----------------------------------------------------------*/
1354 yydefault:
1355  yyn = yydefact[yystate];
1356  if (yyn == 0)
1357  goto yyerrlab;
1358  goto yyreduce;
1359 
1360 
1361 /*-----------------------------.
1362 | yyreduce -- Do a reduction. |
1363 `-----------------------------*/
1364 yyreduce:
1365  /* yyn is the number of a rule to reduce with. */
1366  yylen = yyr2[yyn];
1367 
1368  /* If YYLEN is nonzero, implement the default value of the action:
1369  `$$ = $1'.
1370 
1371  Otherwise, the following line sets YYVAL to garbage.
1372  This behavior is undocumented and Bison
1373  users should not rely upon it. Assigning to YYVAL
1374  unconditionally makes the parser a bit smaller, and it avoids a
1375  GCC warning that YYVAL may be used uninitialized. */
1376  yyval = yyvsp[1-yylen];
1377 
1378 
1379  YY_REDUCE_PRINT (yyn);
1380  switch (yyn)
1381  {
1382  case 2:
1383 
1384 /* Line 1806 of yacc.c */
1385 #line 97 "drizzled/execute/parser.yy"
1386  {
1387  query.append((yyvsp[(1) - (1)].string).data(), (yyvsp[(1) - (1)].string).size());
1388  query.push_back(' ');
1389  }
1390  break;
1391 
1392  case 3:
1393 
1394 /* Line 1806 of yacc.c */
1395 #line 103 "drizzled/execute/parser.yy"
1396  {
1397  query.append((yyvsp[(2) - (2)].string).data(), (yyvsp[(2) - (2)].string).size());
1398  query.push_back(' ');
1399  }
1400  break;
1401 
1402 
1403 
1404 /* Line 1806 of yacc.c */
1405 #line 1406 "drizzled/execute/parser.cc"
1406  default: break;
1407  }
1408  /* User semantic actions sometimes alter yychar, and that requires
1409  that yytoken be updated with the new translation. We take the
1410  approach of translating immediately before every use of yytoken.
1411  One alternative is translating here after every semantic action,
1412  but that translation would be missed if the semantic action invokes
1413  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1414  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1415  incorrect destructor might then be invoked immediately. In the
1416  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1417  to an incorrect destructor call or verbose syntax error message
1418  before the lookahead is translated. */
1419  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1420 
1421  YYPOPSTACK (yylen);
1422  yylen = 0;
1423  YY_STACK_PRINT (yyss, yyssp);
1424 
1425  *++yyvsp = yyval;
1426 
1427  /* Now `shift' the result of the reduction. Determine what state
1428  that goes to, based on the state we popped back to and the rule
1429  number reduced by. */
1430 
1431  yyn = yyr1[yyn];
1432 
1433  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1434  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1435  yystate = yytable[yystate];
1436  else
1437  yystate = yydefgoto[yyn - YYNTOKENS];
1438 
1439  goto yynewstate;
1440 
1441 
1442 /*------------------------------------.
1443 | yyerrlab -- here on detecting error |
1444 `------------------------------------*/
1445 yyerrlab:
1446  /* Make sure we have latest lookahead translation. See comments at
1447  user semantic actions for why this is necessary. */
1448  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1449 
1450  /* If not already recovering from an error, report this error. */
1451  if (!yyerrstatus)
1452  {
1453  ++yynerrs;
1454 #if ! YYERROR_VERBOSE
1455  yyerror (context, scanner, YY_("syntax error"));
1456 #else
1457 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1458  yyssp, yytoken)
1459  {
1460  char const *yymsgp = YY_("syntax error");
1461  int yysyntax_error_status;
1462  yysyntax_error_status = YYSYNTAX_ERROR;
1463  if (yysyntax_error_status == 0)
1464  yymsgp = yymsg;
1465  else if (yysyntax_error_status == 1)
1466  {
1467  if (yymsg != yymsgbuf)
1468  YYSTACK_FREE (yymsg);
1469  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1470  if (!yymsg)
1471  {
1472  yymsg = yymsgbuf;
1473  yymsg_alloc = sizeof yymsgbuf;
1474  yysyntax_error_status = 2;
1475  }
1476  else
1477  {
1478  yysyntax_error_status = YYSYNTAX_ERROR;
1479  yymsgp = yymsg;
1480  }
1481  }
1482  yyerror (context, scanner, yymsgp);
1483  if (yysyntax_error_status == 2)
1484  goto yyexhaustedlab;
1485  }
1486 # undef YYSYNTAX_ERROR
1487 #endif
1488  }
1489 
1490 
1491 
1492  if (yyerrstatus == 3)
1493  {
1494  /* If just tried and failed to reuse lookahead token after an
1495  error, discard it. */
1496 
1497  if (yychar <= YYEOF)
1498  {
1499  /* Return failure if at end of input. */
1500  if (yychar == YYEOF)
1501  YYABORT;
1502  }
1503  else
1504  {
1505  yydestruct ("Error: discarding",
1506  yytoken, &yylval, context, scanner);
1507  yychar = YYEMPTY;
1508  }
1509  }
1510 
1511  /* Else will try to reuse lookahead token after shifting the error
1512  token. */
1513  goto yyerrlab1;
1514 
1515 
1516 /*---------------------------------------------------.
1517 | yyerrorlab -- error raised explicitly by YYERROR. |
1518 `---------------------------------------------------*/
1519 yyerrorlab:
1520 
1521  /* Pacify compilers like GCC when the user code never invokes
1522  YYERROR and the label yyerrorlab therefore never appears in user
1523  code. */
1524  if (/*CONSTCOND*/ 0)
1525  goto yyerrorlab;
1526 
1527  /* Do not reclaim the symbols of the rule which action triggered
1528  this YYERROR. */
1529  YYPOPSTACK (yylen);
1530  yylen = 0;
1531  YY_STACK_PRINT (yyss, yyssp);
1532  yystate = *yyssp;
1533  goto yyerrlab1;
1534 
1535 
1536 /*-------------------------------------------------------------.
1537 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1538 `-------------------------------------------------------------*/
1539 yyerrlab1:
1540  yyerrstatus = 3; /* Each real token shifted decrements this. */
1541 
1542  for (;;)
1543  {
1544  yyn = yypact[yystate];
1545  if (!yypact_value_is_default (yyn))
1546  {
1547  yyn += YYTERROR;
1548  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1549  {
1550  yyn = yytable[yyn];
1551  if (0 < yyn)
1552  break;
1553  }
1554  }
1555 
1556  /* Pop the current state because it cannot handle the error token. */
1557  if (yyssp == yyss)
1558  YYABORT;
1559 
1560 
1561  yydestruct ("Error: popping",
1562  yystos[yystate], yyvsp, context, scanner);
1563  YYPOPSTACK (1);
1564  yystate = *yyssp;
1565  YY_STACK_PRINT (yyss, yyssp);
1566  }
1567 
1568  *++yyvsp = yylval;
1569 
1570 
1571  /* Shift the error token. */
1572  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1573 
1574  yystate = yyn;
1575  goto yynewstate;
1576 
1577 
1578 /*-------------------------------------.
1579 | yyacceptlab -- YYACCEPT comes here. |
1580 `-------------------------------------*/
1581 yyacceptlab:
1582  yyresult = 0;
1583  goto yyreturn;
1584 
1585 /*-----------------------------------.
1586 | yyabortlab -- YYABORT comes here. |
1587 `-----------------------------------*/
1588 yyabortlab:
1589  yyresult = 1;
1590  goto yyreturn;
1591 
1592 #if !defined(yyoverflow) || YYERROR_VERBOSE
1593 /*-------------------------------------------------.
1594 | yyexhaustedlab -- memory exhaustion comes here. |
1595 `-------------------------------------------------*/
1596 yyexhaustedlab:
1597  yyerror (context, scanner, YY_("memory exhausted"));
1598  yyresult = 2;
1599  /* Fall through. */
1600 #endif
1601 
1602 yyreturn:
1603  if (yychar != YYEMPTY)
1604  {
1605  /* Make sure we have latest lookahead translation. See comments at
1606  user semantic actions for why this is necessary. */
1607  yytoken = YYTRANSLATE (yychar);
1608  yydestruct ("Cleanup: discarding lookahead",
1609  yytoken, &yylval, context, scanner);
1610  }
1611  /* Do not reclaim the symbols of the rule which action triggered
1612  this YYABORT or YYACCEPT. */
1613  YYPOPSTACK (yylen);
1614  YY_STACK_PRINT (yyss, yyssp);
1615  while (yyssp != yyss)
1616  {
1617  yydestruct ("Cleanup: popping",
1618  yystos[*yyssp], yyvsp, context, scanner);
1619  YYPOPSTACK (1);
1620  }
1621 #ifndef yyoverflow
1622  if (yyss != yyssa)
1623  YYSTACK_FREE (yyss);
1624 #endif
1625 #if YYERROR_VERBOSE
1626  if (yymsg != yymsgbuf)
1627  YYSTACK_FREE (yymsg);
1628 #endif
1629  /* Make sure YYID is used. */
1630  return YYID (yyresult);
1631 }
1632 
1633 
1634 
1635 /* Line 2067 of yacc.c */
1636 #line 110 "drizzled/execute/parser.yy"
1637 
1638 
1639 
1640 namespace drizzled {
1641 namespace execute {
1642 
1643 std::vector<std::string> Context::start()
1644 {
1645  execute_parse(this, (void **)scanner);
1646  std::vector<std::string> parsed_queries;
1647  size_t start_pos= 0;
1648  while ((pos= query.find(';', start_pos)) != std::string::npos)
1649  {
1650  if ((pos > 0) && (query[pos-1] == '\\'))
1651  {
1652  start_pos= pos + 1;
1653  continue;
1654  }
1655  parsed_queries.push_back(query.substr(0, pos));
1656  pos++;
1657  if (query[pos] == ' ')
1658  {
1659  pos++;
1660  }
1661  query.erase(0, pos);
1662  }
1663  parsed_queries.push_back(query);
1664  query.clear();
1665 
1666  return parsed_queries;
1667 }
1668 
1669 } // namespace execute
1670 } // namespace drizzled
1671