Drizzled Public API Documentation

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